problem opening a file on 2.2a1
tolot at solar-system.dynodns.net
Mon Aug 20 21:45:04 CEST 2001
Rajarshi Guha <rajarshi at seed.chem.psu.edu> wrote:
> Traceback (most recent call last):
> File "./p.py", line 12, in ?
> data = open('data.out','w')
> TypeError: an integer is required
> What am I doing wrong?
Wild guess: you do a "from os import *" in p.py. Don't do this, it is evil
<wink>. os.open expects different arguments than the builtin open.
The tutorial and the python docs should contain s.th. like
"DO NOT USE from module import *!!! IT IS DANGEROUS!!"
(yes I know, multiple ! r a sure sign of a deseased mind)
More information about the Python-list