Re: [Tutor] Linux variable to Python

2005-05-17 Thread Terry Carroll
On Fri, 13 May 2005, Alberto Troiano wrote: > To explain for those who doesn't know: > The first line creates a variable named "fec" with the value cam(a Linux > function returning year month day hour minute second).jpg > The second show the value of "fec" > The third moves hola.txt to the direct

Re: [Tutor] Linux variable to Python

2005-05-13 Thread Alberto Troiano
And again I'm gonna say BINGO! It's like you were doing the same app as I am Thanks Alberto >From: Danny Yoo <[EMAIL PROTECTED]> >To: Alberto Troiano <[EMAIL PROTECTED]> >CC: tutor@python.org >Subject: Re: [Tutor] Linux variable to Python >Date:

Re: [Tutor] Linux variable to Python

2005-05-13 Thread Danny Yoo
On Fri, 13 May 2005, Alberto Troiano wrote: > Here is an example of what I want to do: > > I run over Linux shell the following command: > > [EMAIL PROTECTED] root]# fec=cam`date +%Y%m%d%H%M%S`.jpg > [EMAIL PROTECTED] root]# echo $fec > cam2005051255702.jpg > [EMAIL PROTECTED] root]# mv hola.txt

Re: [Tutor] Linux variable to Python

2005-05-13 Thread Lee Harr
>import os os.system("fec=cam`date +%Y%m%d%H%M%S`.jpg") >0 os.system("echo $fec") >0 os.system("mv hola.txt grabacion/$fec") >0 Each system() call gets a fresh shell, and a fresh env ... >>>import os >>>os.environ['foo'] = 'bar' >>>os.system('echo $foo') bar 0 >>>os.system('foo=zzz')

Re: [Tutor] Linux variable to Python

2005-05-13 Thread Max Noel
On May 13, 2005, at 21:03, Alberto Troiano wrote: os.system("fec=cam`date +%Y%m%d%H%M%S`.jpg") > 0 > os.system("echo $fec") > 0 > os.system("mv hola.txt grabacion/$fec") > 0 > > Then I check for the file and turns out that it moved hola.txt to > grabacion > with th

[Tutor] Linux variable to Python

2005-05-13 Thread Alberto Troiano
Hey Another problem Here is an example of what I want to do: I run over Linux shell the following command: [EMAIL PROTECTED] root]# fec=cam`date +%Y%m%d%H%M%S`.jpg [EMAIL PROTECTED] root]# echo $fec cam2005051255702.jpg [EMAIL PROTECTED] root]# mv hola.txt grabacion/$fec To explain for those w