Re: [Tutor] question on string

2005-08-01 Thread Gilbert Tsang
Thank you all for the enthusiastic responses. It must have been other part of the script since the command string construction now works. I also realized that "file" is a poor choice of variable name. Thanks Danny for telling me about the subprocess module. Best regards, Gilbert. ZIYAD A. M.

Re: [Tutor] question on string

2005-08-01 Thread Bob Gailer
At 10:42 AM 8/1/2005, Gilbert Tsang wrote: Hi there, I would like to construct some string objects using the cprintf-style format: command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) Of course it is illegal in python How did you conclude that? "diff -u %s %s > %s.patch" % ( src, dst

Re: [Tutor] question on string

2005-08-01 Thread Alan G
> I would like to construct some string objects using the > cprintf-style format: > > command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) Should work - assuming the 3 variables are defined! Although file is a bad name for a variable since its also the name of the function for opening

Re: [Tutor] question on string

2005-08-01 Thread Danny Yoo
On Mon, 1 Aug 2005, Kent Johnson wrote: > > I would like to construct some string objects using the cprintf-style > > format: > > > > command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) > > > > Of course it is illegal in python but I couldn't figure out a way to > > construct string

Re: [Tutor] question on string

2005-08-01 Thread ZIYAD A. M. AL-BATLY
On Mon, 2005-08-01 at 10:42 -0700, Gilbert Tsang wrote: > Hi there, > > I would like to construct some string objects using the cprintf-style > format: > > command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) > > Of course it is illegal in python but I couldn't figure out a way to

Re: [Tutor] question on string

2005-08-01 Thread Kent Johnson
Gilbert Tsang wrote: > Hi there, > > I would like to construct some string objects using the cprintf-style > format: > > command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) > > Of course it is illegal in python but I couldn't figure out a way to > construct strings with that kind

[Tutor] question on string

2005-08-01 Thread Gilbert Tsang
Hi there, I would like to construct some string objects using the cprintf-style format: command_string = "diff -u %s %s > %s.patch" % ( src, dst, file ) Of course it is illegal in python but I couldn't figure out a way to construct strings with that kind of formatting and substitution. I have