I have a save function within my Python program which looks like this:
def Save(n):
print(\"S3\")
global BF
global WF
global PBList
globa
As DSM noted, you're using http://docs.python.org/library/os.html#os.open instead of built-in open() function.
In os.open() the second parameter (mode) should be integer instead of string. So, if you ought to use from os import *
then just substitute mode string with one of the following args: