creating a file from python
Erik Max Francis
max at alcyone.com
Tue Jul 2 20:28:59 EDT 2002
gollem wrote:
> I want to create a file from inside a running python script.
> I can do that using commands and touch but it won't work if the
> intended
> name of the file is the value of a python variable. The file is
> created as
> the variable name instead of the variable value.
Why not
open(fileName, 'w').close()
?
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ See the son in your bad day / Smell the flowers in the valley
\__/ Chante Moore
Bosskey.net: Aliens vs. Predator 2 / http://www.bosskey.net/avp2/
A personal guide to Aliens vs. Predator 2.
More information about the Python-list
mailing list