Somehow python will not let me open a file, and write an integer into this file.
My script goes something like this:
<---when printed, this line works just fine, it returns 20 (16 + 4), I then want to write 20 to a my_file, but python tells me that my first argument must be string and not int, I WANT TO WRITE ONLY AN INT TO THIS FILE, NOT STRING!
My script goes something like this:
Code:
self.l__c = 4 self.l__calculation = (self.status) #at this point, self.status is 16 if <condition>: self.l__calculation = int(self.l__calculation) + (self.l__c) l__write = open(self.my_file,'w').write(self.l__calculation) self.l__calculation = int(self.l__calculation) + (self.l__c)
Comment