Skip to content

Conversation

@richardeigenmann
Copy link

Adding quotes around the help(turtle.color) as this fails if turtle hasn't been imported

Adding quotes around the help(turtle.color) as this fails if turtle hasn't been imported
@Ivoz
Copy link
Member

Ivoz commented Jun 16, 2013

Practically all of the tutorial will fail if the turtle module hasn't been imported, though, which you are asked to do at the start of that page. I feel this would add inconsistency to the process.

@richardeigenmann
Copy link
Author

I got caught out because I wanted to check out the API of turtle and the
help command sounded like exactly what I want so I opened a new session,
started Python and typed my help instruction. Eventually it worked when
I added quotes. Perhaps we could add a sentence such as "(be sure to
import turtle before calling help as help uses to imported context to
find the correct information)" ?

What was "unusual" to me as a newbie is that help depends on the import.
Man pages don't work that way and Javadoc pages don't either. Though it
makes perfect sense that Python help needs to have the imports so that
it it shows the proper page when there might be multiple versions of a
library available on the system.

Regards,
Richard

On Sun, 2013-06-16 at 00:31 -0700, Matt Iversen wrote:

Practically all of the tutorial will fail if the turtle module hasn't
been imported, though, which you are asked to do at the start of that
page. I feel this would add inconsistency to the process.


Reply to this email directly or view it on GitHub.

projectgus added a commit that referenced this pull request Jun 22, 2013
…tudents will be re-opening an interactive Python shell.) Alternative solution to #36
@projectgus
Copy link
Contributor

This is definitely a common pitfall for new students.

I've pushed a commit with my preferred solution, which is showing a Tip with the NameError and explaining it (the point where you experienced it is the most common point I think, because it's the first time the student re-opens a previously closed interactive prompt after running non-interactive programs for a while.) As both @Ivoz and Richard point out, Python needs imports for many things so I think it's worthwhile taking the time out to explain that, giving people the right idea about how to approach it.

What do you think, @richardeigenmann?

@richardeigenmann
Copy link
Author

This seems perfectly reasonable.

Thanks,
Richard

On Sat, 2013-06-22 at 01:59 -0700, Angus Gratton wrote:

This is definitely a common pitfall for new students.

I've pushed a commit with my preferred solution, which is showing a
Tip with the NameError and explaining it (the point where you
experienced it is the most common point I think, because it's the
first time the student re-opens a previously closed interactive prompt
after running non-interactive programs for a while.) As both @Ivoz and
Richard point out, Python needs imports for many things so I think
it's worthwhile taking the time out to explain that, giving people the
right idea about how to approach it.

What do you think, @richardeigenmann?


Reply to this email directly or view it on GitHub.

@projectgus
Copy link
Contributor

Awesome, thanks. :)

@projectgus projectgus closed this Jun 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants