> This only works for code that is in a package, when you want to import a
> module in the same package. It doesn't work for code that is not in a
> package. For example,
>
> F:\Tutor>cat site.py
> print 'imported site.py'
>
> F:\Tutor>cat siteimporter.py
> from __future__ import absolute_import
>
Danny Yoo wrote:
>>> This isn't the first time this kind of problem has hit people. This
>>> problem is well known and is the subject of a Python Enhancement Proposal
>>> (PEP 328). If you're using Python 2.5, you can use a new feature called
>>> 'absolute_import' to avoid the import problem. Se
>> It looks like people have identified the problem, that your site.py
>> module isn't being found because it conflicts with something from
>> Python's Standard Library.
>>
>> This isn't the first time this kind of problem has hit people. This
>> problem is well known and is the subject of a Pyt
Danny Yoo wrote:
> Hi Shawn,
>
> It looks like people have identified the problem, that your site.py module
> isn't being found because it conflicts with something from Python's
> Standard Library.
>
> This isn't the first time this kind of problem has hit people. This
> problem is well known
Hey thanks for the help, gents,i renamed site.py to site_obj.py and my import and statement.everything is working now. Thank you guys very very much.shawnOn 10/26/06,
Danny Yoo <[EMAIL PROTECTED]> wrote:
Hi Shawn,It looks like people have identified the problem, that your site.py moduleisn't being
Hi Shawn,
It looks like people have identified the problem, that your site.py module
isn't being found because it conflicts with something from Python's
Standard Library.
This isn't the first time this kind of problem has hit people. This
problem is well known and is the subject of a Python
shawn bright wrote:
> hey there
>
> i have written a module called site.py
Use a different name, there is a library module called site that is
automatically imported when Python starts up. So when you 'import site'
you are getting the already-imported library module.
Kent
> in the file i have
Shawn,Python already has a module called site. From http://docs.python.org/lib/module-site.html :This module is automatically imported during initialization.
The automatic import can be suppressed using the interpreter's
-S option.
Importing this module will append site-specific paths to the mo
On 10/26/06, shawn bright <[EMAIL PROTECTED]> wrote:
> import site
Try this for a clue:
print site.__file__
--
Cheers,
Simon B
[EMAIL PROTECTED]
http://www.brunningonline.net/simon/blog/
___
Tutor maillist - Tutor@python.org
http://mail.python.org/m
hey therei have written a module called site.pyin the file i have this:import DbConnectorimport sensorclass Site(object): "site object" def __init__(self, id):
self.id = id self.con = DbConnector.DbConnector() id = str(self.id) stats = self.con.getOne(
10 matches
Mail list logo