Cranky Frankie wrote:

Is there a way I can import clr.py and then run clr()?

The same way you import any other module and then call a function in that module. Don't be fooled by the function having the same name as the module.

import clr  # import the module
clr.clr()  # and call the fully-qualified name of the function


Or if you prefer:

from clr import clr  # import only the function
clr()


By the way, this may be a simpler way of clearing the screen:

def clr():
    print("\n"*50)


This is probably better, although it's not guaranteed to work for all terminal types:

def clr():
    print("\033[2J")


--
Steven

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to