I have a python web2py app uploaded at PythonAnywhere. App is working fine. I want to read a csv file placed in a folder along with my app and import it into mysql table. When I try to read that CSV file, I get the error saying "[Errno 11] Resource temporarily unavailable".
I am new to python as well as PythonAnywhere and I couldn't understand this issue and can't figure it out how can I overcome this error and read a csv file successfully at server?
Note: I can run this code successfully on my local machine.
What I am doing is this:
path = '/home/user123/web2py/files/'
file_ = path+filename
print file_
with open(file_, "r") as f_obj:
reader = csv.reader(f_obj)
fields = reader.next()
print fields
self.create_new_table(tablename, fields)
Will appreciate any help in this regard.
Thanx in advance.
I opened server.log file in Web tab and found out that the print statement "print fields" was causing the error .... It tried to print all the column names and at the mid of those column names, it produced this error and stopped execution. I removed such print statements which were trying to print long statements and the error was gone! It seems to be limit in print or something else similar to this, dont know exactly!