You created a circular import; your pythonaslab
module imports selectionmodule
which imports the pythonaslab
module. You end up with incomplete modules that way, don't do that.
Remove the import pythonaslab
line from selectionmodule
; you are not using pythonaslab
in that module.
Also, another module cannot read your globals; you need to pass those in as arguments:
# this function takes one argument, and locally it is known as b
def ascendingselection(b):
# rest of function ..
then call that with:
selectionmodule.ascendingselection(b)
Note that you are not limited to one-letter variable names. Using longer, descriptive names makes your code more readable.