Oct-28-2016, 02:51 AM
Here is some code for my text editor (in progress)
bksp() takes no arguments (1 given)
What gives?
print 'WELCOME TO CHARPY V2'
import os
#os detection/import msvcrt
try:
import msvcrt
except ImportError:
print 'ERROR: FAILED TO IMPORT MSVCRT. ARE YOU USING MAC OS X OR UNIX/LINUX?'
print 'IF SO, PLEASE USE WINDOWS FOR CHARPY V2'
quit()
#defining class for documents
class doc(object):
def __init__(self):
#this is the actual text
self.text = list()
self.name = raw_input('NAME YOUR NEW DOCUMENT')
def bksp():
length = len(self.text)
length = length - 1
lob = self.text[length]
self.text.remove[lob]
def edit(self):
self.isedit = True
while self.isedit:
char = msvcrt.getch()
if char not in ('<','`'):
self.text.append(char)
elif char == '<':
self.bksp()
elif char == '`':
#stop editing
self.isedit = False
os.system('CLS')
print self.text
x = doc()
x.edit()For some strange reason, if I press '<', i get the errorbksp() takes no arguments (1 given)
What gives?

sorry.