[Tutor] a question regarding os.system()

Bruce Sass bsass@freenet.edmonton.ab.ca
Thu, 30 Aug 2001 00:34:01 -0600 (MDT)


On Thu, 30 Aug 2001, Haiyang wrote:
> I know that we can use os.system() to lauch applications.
> Say, I want to use notepad to open a file - data.txt
> I should do
> os.system('notepad data.txt')
>
> BUT what if  the string 'data.txt' is stored in a variable, how can use
> notepad to open it?
>
> file='c:\data\data.txt'
> os.system('notepad     and What?

os.system('notepad %s' % file)


- Bruce