473,379 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

namespace in Python?

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

Yours /Carl
Dec 12 '05 #1
2 1510
"Carl" <ph***********@chello.se> wrote:
What is the equivalent of a C++ (or C#) namespace in Python?


modules and packages:

http://docs.python.org/tut/node8.html

</F>

Dec 12 '05 #2
Carl wrote:
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.
Dec 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tonguç Yumruk | last post by:
I'm trying to build a completely plug-in based system. One of my problems is importing a package dynamically. I'm trying to emulate the import command. The __import__() function or imp module...
0
by: John Allison | last post by:
Hi everybody I'm very new to python so please forgive any idiotic mistakes: I'm writing a MUD-like text game in python and I want to support dynamic ingame scripting to deal with user commands. I...
7
by: Doug Rosser | last post by:
I'm writing a fairly complicated test framework and keeping configuration data inside ini files that are parsed at runtime by the ConfigParser module. For example, there would be a section...
8
by: Elaine Jackson | last post by:
I would like to be able to write a function f, which will live in a module M, and will call a function g, such that, when f is imported from M into the interpreter, and invoked there, its...
8
by: Bo Peng | last post by:
Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res =...
14
by: ToddLMorgan | last post by:
Summary: How should multiple (related) projects be arranged (structured) and configured so that the following is possible: o Sharing common code (one of the projects would be a "common" project...
5
by: Jeff Jarrell | last post by:
Correct me if I am wrong but doesn't C# handle the "root namespace" on the project properties differently than vb.net? In vb.net, I have setting the root namespace on the project properties....
16
by: cj | last post by:
I am under the impression they are obsolete methods included for backward compatibility. For instance is using filedatetime("c:\myfile.txt") still the accepted way of getting the date...
2
by: gbin,Zhou | last post by:
Hi,all. I see from "http://docs.python.org/tut/node11.html" that "Name spaces are created at different moments and have different lifetimes. The namespace containing the built-in names is created...
1
by: Christof Winter | last post by:
I am trying to use a webservice with SOAPpy: import SOAPpy intact_wsdl = "http://www.ebi.ac.uk/intact/binary-search-ws/binarysearch?wsdl" intact_serv = SOAPpy.WSDL.Proxy(intact_wsdl) The...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.