473,386 Members | 1,715 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,386 software developers and data experts.

Accessing 'Package Data'


At http://docs.python.org/dist/node12.html it is described how to add
package data to a module. This was pretty easy to do, but now how do I
access this data from my module? Is there an API to load a 'package
resource' ala Java's classloader?

S.
Oct 9 '07 #1
1 1280
Stefan Arentz wrote:
>
At http://docs.python.org/dist/node12.html it is described how to add
package data to a module. This was pretty easy to do, but now how do I
access this data from my module? Is there an API to load a 'package
resource' ala Java's classloader?
You can always use os.path + the __file__-attribute of the containing
package.

And there is the 3rd-party pkg_resources, part of setuptools:

http://peak.telecommunity.com/DevCenter/PkgResources

Diez
Oct 9 '07 #2

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

Similar topics

2
by: DanB | last post by:
I am using VB DotNet Std Edition and am writing a web application that needs to read and write to an password protected database. The mdb files reside in a folder (fpdb) under the localhost...
1
by: readytoride39 | last post by:
First of all I apologize in advance if this topic does not exactly fit but if someone could still address it I would appreciate it. My boss tasked me to take out all references of this third...
0
by: Hemant Shah | last post by:
Folks, I have been getting SQLCODE -911 while reading data from a table. When I look at the db2diag.log file I see following: 2006-10-10-14.33.13.384726-240 I127058C470 LEVEL: Warning...
0
by: TechWitch | last post by:
I've seen a number of posts from frustrated folks about this topic, with not much offered as a solution. I actually managed to get this to work today, so I thought I'd post for the benefit of...
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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.