On 11/12/2011 01:42 AM, Steven D'Aprano wrote:
> On Fri, 11 Nov 2011 23:11:38 +0100, Gelonida N wrote:
>
>> Pytz is only imported by one module, so I wondered if there were any
>> tricks to 'change sys.path' prior to importing pytz
>
> sys.path is just a list of paths. You can import the sys modu
On Fri, 11 Nov 2011 23:11:38 +0100, Gelonida N wrote:
> Pytz is only imported by one module, so I wondered if there were any
> tricks to 'change sys.path' prior to importing pytz
sys.path is just a list of paths. You can import the sys module and
manipulate it any way you like.
--
Steven
--
On 11/11/2011 10:51 PM, Eric Snow wrote:
> On Fri, Nov 11, 2011 at 2:34 PM, Eric Snow
> wrote:
>
> So if you run a module as a script, that empty string will be added to
> sys.path and all imports will first check the directory you were in
> when you ran Python...
>
Yes that's normal (and for
On 11/11/2011 10:31 PM, Emile van Sebille wrote:
> On 11/11/2011 12:27 PM Gelonida N said...
>> Is there any way to tell pytz to import it's own tests package and tell
>> the rest of the code to import the other?
>>
>> Python version is 2.6.5
>>
>>
>> Thanks in advance for any suggestion.
>
> Star
On Fri, Nov 11, 2011 at 2:34 PM, Eric Snow wrote:
> The problem is that the empty string is still added to the from of
> sys.path. I'm going to have to find out more about that one.
Okay, don't know how I missed it but the docs for sys.path[1] spell it out:
"As initialized upon program star
On Fri, Nov 11, 2011 at 1:27 PM, Gelonida N wrote:
>
>
> Hi,
>
> I got some code.
> - This code contains a package named tests
> - there are at least 100 references in different python files
> importing from above mentioned tests package.
> - the code also imports pytz at one place
>
> I ge
On 11/11/2011 12:27 PM Gelonida N said...
Hi,
I got some code.
- This code contains a package named tests
- there are at least 100 references in different python files
importing from above mentioned tests package.
- the code also imports pytz at one place
I get following warning messa
Hi,
I got some code.
- This code contains a package named tests
- there are at least 100 references in different python files
importing from above mentioned tests package.
- the code also imports pytz at one place
I get following warning message:
/usr/lib/python2.6/dist-packages/pytz/_