We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello sir i'm at ex15 of learn python 3 the hard way and want to convert content of file into integer but got no way to do that.
i tried converting variable to integer which is holding a file
int_txt = int(txt)
but it gives an error like typeerror
TypeError: int() argument must be a string, a bytes-like object or a number, not '_io.TextIOWrapper' my whole code is like
TypeError: int() argument must be a string, a bytes-like object or a number, not '_io.TextIOWrapper'
`from sys import argv
script, filename = argv
txt = open(filename , encoding = "utf-8")
print(f"Here's your file {filename}:") print(txt.read()) print(type(filename))`
i tried checking that the content of file is in string or what so i got it's in string
so need help @zedshaw
The text was updated successfully, but these errors were encountered:
No branches or pull requests
hello sir
i'm at ex15 of learn python 3 the hard way and want to convert content of file into integer but got no way to do that.
i tried converting variable to integer which is holding a file
int_txt = int(txt)
but it gives an error like typeerror
TypeError: int() argument must be a string, a bytes-like object or a number, not '_io.TextIOWrapper'
my whole code is like
`from sys import argv
script, filename = argv
txt = open(filename , encoding = "utf-8")
print(f"Here's your file {filename}:")
print(txt.read())
print(type(filename))`
i tried checking that the content of file is in string or what so i got it's in string
so need help @zedshaw
The text was updated successfully, but these errors were encountered: