Here is my code:
#Check if the value has only allowed characters
def checkStr(value):
return (set(value) <= allowed)
#Enter parameter
def enterParam (msg)
value=input(msg)
if len(value) == 0:
print("Cannot be empty, try again")
enterParam(msg)
if not checkStr(value):
print("incorrect symbols detected, try again")
enterParam(msg)
return value
Now my question is: This works OK inside the body of the script, but as soon as i put inside a class like below the eclipse/pydev starts complaining about enterParam and checkStr not being defined. What am i doing wrong?
class ParamInput:
#Check if the value has only allowed characters
def checkStr(self, value):
return (set(value) <= allowed)
#Enter parameter
def enterParam (self, msg)
value=input(msg)
if len(value) == 0:
print("Cannot be empty, try again")
enterParam(msg) #<==== not defined
if not checkStr(value): #<====not defined
print("incorrect symbols detected, try again")
enterParam(msg) #<====not defined
return value