namespace in Python?

H

Heiko Wundram

Carl said:
What is the equivalent of a C++ (or C#) namespace in Python?

Your best bet will be modules:

---

a.py
====

def test():
print "I am test() from a.py"

b.py
====

import a

a.test()

---

They are no direct match to C++-namespaces though, as the namespace doesn't
show up in the source but rather relies on the naming of the source
files...

--- Heiko.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,051
Latest member
noblesalt

Latest Threads

Top