problem opening a file on 2.2a1

Marc Christiansen tolot at
Mon Aug 20 21:45:04 CEST 2001

Rajarshi Guha <rajarshi at> wrote:
> Traceback (most recent call last):
>   File "./", 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 Don't do this, it is evil
<wink>. expects different arguments than the builtin open.
The tutorial and the python docs should contain 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 mailing list