You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In pure OOP mode, make go, turn etc. show a helpful error message #82
hm. i implement it in turtleprocess, so it write helpful error message to system console. where i should move it to print in in-game console, how do you think?
You don't have to think at all about moving any messages from one place to another. You do print('message') in the function, and it gets printed at the graphical shell.
Add the help text as a docstring to the function you're calling. Then you simply run print(self.__doc__) (or similar) generically to print help.
It may be a good idea to educate users/students on using the help() and dir()built-in functions to display help about a specific function they want to learn more about. IOW, printing Type "help(go)" to learn more about the "go" function. may be the way to go.
Activity
darvin commentedon Oct 4, 2010
hm. i implement it in turtleprocess, so it write helpful error message to system console. where i should move it to print in in-game console, how do you think?
cool-RR commentedon Oct 4, 2010
You don't have to think at all about moving any messages from one place to another. You do
print('message')in the function, and it gets printed at the graphical shell.bittner commentedon Sep 23, 2018
Here are two ideas related to that:
print(self.__doc__)(or similar) generically to print help.help()anddir()built-in functions to display help about a specific function they want to learn more about. IOW, printingType "help(go)" to learn more about the "go" function.may be the way to go.Just my two cents.