def insert_table(): running = True sList = [] #select table sTable = raw_input('Enter an Table Name : ') str = io_file.read_file_header(sTable, 'rb') for i in range(0,len(str)): sColumn = raw_input('Enter an Insert Value Column '+str[i]+' : ') sList.append(sColumn) else: print 'End' io_file.write_file(sTable, sList, 'ab')
def create_table(): running = True sList = [] #create table sTable = raw_input('Enter an Table Name : ') while running: #create table sColumn = raw_input('Enter an Add Column Name (Exit 0): ') if sColumn == '0': print 'Exit' running = False io_file.write_file(sTable, sList, 'wb') else: sList.append(sColumn) print sList else: print sList
scanner_func.retract(char) scanner_func.reset_token() # single if single == 0: if scanner_func.single() < 0: # illegal characters if scanner_func.character == ":": error.append("***LINE:" + str(scanner_func.line()) + " expect '=' after ':' ") else: error.append("***LINE:" + str(scanner_func.line()) + " illegal character: " + scanner_func.character) # end of file if end == -1: scanner_func.dyd_return("25", "EOF") else: end = 0 if len(buf) != 0: io_file.write_file(p_dyd, scanner_func.dyd) io_file.write_file(p_sc, scanner_func.symbol_table) io_file.add_file(p_sc, scanner_func.constant_table) io_file.write_file(p_err, error) print("Scanner finished") else: print("File not found.")
import io_file #open a file : ab the file is in the append mode str = io_file.read_file() io_file.write_file() print str[0] #fo = open("user.txt","ab") #print "Name of the file: ", fo.name #fo.write("dddYuki main\n"); # Close opend file #fo.close() #print "Closed or not : ", fo.closed #print "Opening mode : ", fo.mode #name = raw_input('Floor ?') #print int(name)