More about simple question
xinghua shi
csshi99 at yahoo.com
Tue Nov 5 00:11:52 EST 2002
>
> import sys,os,string
>
> pid = os.getpid()
>
> filename = ".ld.mon." + str(pid)
>
> print filename
>
> ^^^^^^^^^^Name error: name "filename" is not defined.
>
Actually, I have a file named "ld.stat.py" which is:
def main():
import sys,os,string
pid = os.getpid()
filename = ".ld.mon." + str(pid)
print filename
And then I typed:
python ld.stat.py
And I use python2.2. Besides, if I want to run the file "ld.stat.py" by typing "ld.stat" directly, how to do with this? Thanks so much for your help. :)
---------------------------------
Do you Yahoo!?
HotJobs - Search new jobs daily now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20021104/7a046bde/attachment.html>
More information about the Python-list
mailing list