[Tutor] a question regarding os.system()
Victor R. Cardona
vcardon@siue.edu
Thu, 30 Aug 2001 14:53:27 -0500
On Thu, Aug 30, 2001 at 03:26:23PM +0900, Haiyang wrote:
> Hi there,
>
> 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?
You could use
os.system("notepad %s" % file)
HTH,
Victor
--
Victor R. Cardona
2:52pm up 5 days, 21:23, 2 users, load average: 1.07, 1.03, 1.01
Powered by SuSE Linux 7.1 (i386) 2.4.5-64GB-SMP