python - An integer is required? open() -
I have a very simple dragon script, which should scan a text file, in which The form of lines is formatted as id = ' value ' and put them in a word Python module is called chval.py and the input file is in.txt. This code is:
When I try to run it I get:
traceback (most recent call final):
File "chval.py", line 9 , In? F = Open (sys.argv [1], 'r') TypeError: An integer is required
I am using Python 2.4 ... because I do not use Has challenged anything new, what about open () is something I do not know? Why does it want an integer?
After that line, nothing is unheard of. In short: Why is this giving me the error and how do I fix it?
Because you have been using osopen from os import * by
, Which in fact requires an integer flag instead of "R" or "WA" of any lesson. Exit that line and you will get that error.
Comments
Post a Comment