The Artima Developer Community
Sponsored Link

Python Answers Forum
dir(__builtin__) and dir("__builtin__")

1 reply on 1 page. Most recent reply: Aug 17, 2004 9:41 AM by Andy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
cristi

Posts: 2
Nickname: cristip
Registered: Aug, 2004

dir(__builtin__) and dir("__builtin__") Posted: Aug 17, 2004 6:44 AM
Reply to this message Reply
Advertisement
Hello, I'm learning Python. And I quite don't understand the diference between calling a function with a String <b>dir("__builtin__")</b> and with the name of the module.
I'm not working in the command line but with the GUI and it seems that all function arguments must be strings ("..") otherwise i'll get an error.

Thank You for your thoughts.


Andy

Posts: 28
Nickname: adn
Registered: Jul, 2004

Re: dir(__builtin__) and dir("__builtin__") Posted: Aug 17, 2004 9:41 AM
Reply to this message Reply
The item you're looking for is __builtins__, not __builtin__

dir("__builtin__") just shows you the attributes of the string "__builtin__". So it'll always work.

Flat View: This topic has 1 reply on 1 page
Topic: while / if Previous Topic   Next Topic Topic: is exec() what I want?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use