Ye, this does work. Many thanks!
filename = "{NNN}_{BRAND}_farm.any".format(BRAND=brand, NNN=nnn)
with open(filename, "w") as outstream:
outstream.write(data)
--
https://mail.python.org/mailman/listinfo/python-list
Mr Zaug wrote:
> That makes sense.
>
> So I still can't see how to write the string object to a file whist naming
> the file with whatever values I provided for the NNN and BRAND variables.
>
> Printing the contents of the string object is working with all the
> expected substitutions. Do I need
That makes sense.
So I still can't see how to write the string object to a file whist naming the
file with whatever values I provided for the NNN and BRAND variables.
Printing the contents of the string object is working with all the expected
substitutions. Do I need to convert the string obje
Mr Zaug wrote:
> Actually, I don't understand what you mean by "all other braces." What
> braces are you talking about? The placeholders in the template file (the
> file being read in) have braces around them but they are not escaped.
The example you provide was
$include "_dispatcher_publi
Actually, I don't understand what you mean by "all other braces." What braces
are you talking about? The placeholders in the template file (the file being
read in) have braces around them but they are not escaped.
Also, do I really need curly braces to tell Python what my placeholders are?
--
Oh, that's much easier to read. Thanks!
--
https://mail.python.org/mailman/listinfo/python-list
Mr Zaug wrote:
> On Monday, November 30, 2015 at 4:14:48 AM UTC-5, Peter Otten wrote:
>> Mr Zaug wrote:
>>
>> > On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote:
>> >> Mr Zaug wrote:
>> >>
>> >> > When I run this script on OS X El Capitan, I see,
>> >> >
>> >> > # permiss
On Monday, November 30, 2015 at 4:14:48 AM UTC-5, Peter Otten wrote:
> Mr Zaug wrote:
>
> > On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote:
> >> Mr Zaug wrote:
> >>
> >> > When I run this script on OS X El Capitan, I see,
> >> >
> >> > # permission sensitive cache
> >> >
Mr Zaug wrote:
> On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote:
>> Mr Zaug wrote:
>>
>> > When I run this script on OS X El Capitan, I see,
>> >
>> > # permission sensitive cache
>> > $include "_dispatcher_shared_auth-checker:
>> >
>> > Was I supposed to incorporate
On 2015-11-30 02:40, Rob Hills wrote:
A program I am writing at present does exactly this and I simply do
multiple calls to string.replace (see below)
On 30/11/15 10:31, Mr Zaug wrote:
I seem to be heading in this direction.
#!/usr/bin/env python
import re
from os.path import exists
script, t
A program I am writing at present does exactly this and I simply do
multiple calls to string.replace (see below)
On 30/11/15 10:31, Mr Zaug wrote:
> I seem to be heading in this direction.
>
> #!/usr/bin/env python
> import re
> from os.path import exists
>
> script, template_file = argv
> print "
On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote:
> Mr Zaug wrote:
>
> > When I run this script on OS X El Capitan, I see,
> >
> > # permission sensitive cache
> > $include "_dispatcher_shared_auth-checker:
> >
> > Was I supposed to incorporate it into the script I poste
On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote:
> Mr Zaug wrote:
>
> > When I run this script on OS X El Capitan, I see,
> >
> > # permission sensitive cache
> > $include "_dispatcher_shared_auth-checker:
> >
> > Was I supposed to incorporate it into the script I poste
Mr Zaug wrote:
> When I run this script on OS X El Capitan, I see,
>
> # permission sensitive cache
> $include "_dispatcher_shared_auth-checker:
>
> Was I supposed to incorporate it into the script I posted?
Are you referring to my post? I'm sorry, I can't make sense of your
question.
-
When I run this script on OS X El Capitan, I see,
# permission sensitive cache
$include "_dispatcher_shared_auth-checker:
Was I supposed to incorporate it into the script I posted?
--
https://mail.python.org/mailman/listinfo/python-list
Mr Zaug wrote:
> I need to generate a config file based on an existing "template" file. I
> need to replace a set of strings with other strings globally in the
> generated file.
>
> Here is a snippet of the template file, where CONTENT_PATH and DAMPATH are
> two "placeholders" or variables. There
I should mention the template file is small, just 98 lines long and the working
config file will be the same size.
--
https://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo