executing python scripts that are symlinked

2013-05-16 Thread Charles Smith
Hi. How can I say, from the cmd line, that python should take my CWD as my CWD, and not the directory where the script actually is? I have a python script that works fine when it sits in directory WC, but if I move it out of WC to H and put a symlink from H/script to WC, it doesn't find the pack

Re: executing python scripts that are symlinked

2013-05-16 Thread Charles Smith
On 16 Mai, 10:18, Dave Angel wrote: > On 05/16/2013 03:48 AM, Charles Smith wrote: > > > Hi. > > > How can I say, from the cmd line, that python should take my CWD as my > > CWD, and not the directory where the script actually is? > > > I have a python sc

Re: executing python scripts that are symlinked

2013-05-16 Thread Charles Smith
On 16 Mai, 11:04, Steven D'Aprano wrote: > Python does use your current working directory as your current working > directory. I think you are misdiagnosing the problem. That's usually how it ends up ... > > Here's a demonstration: > > steve@runes:~$ cat test.py > import os > print os.getcwd(

subclassing from unittest

2013-05-22 Thread Charles Smith
Hi, I'd like to subclass from unittest.TestCase. I observed something interesting and wonder if anyone can explain what's going on... some subclasses create null tests. I can create this subclass and the test works: class StdTestCase (unittest.TestCase): blahblah and I can create this

Re: subclassing from unittest

2013-05-22 Thread Charles Smith
On 22 Mai, 17:32, Charles Smith wrote: > Hi, > > I'd like to subclass from unittest.TestCase.  I observed something > interesting and wonder if anyone can explain what's going on... some > subclasses create  null tests. > > I can create this subclass and the test

Importing modules with arguments

2021-07-30 Thread Charles Smith
I have found myself wanting to import module and provide arguments to them. There's two main reason I could think of for this. First is to prevent a circular import, though most of circular imports can be prevented by changing the design. The second reason is to invert dependencies between two m

Re: Importing modules with arguments

2021-07-30 Thread Charles Smith
First off, thanks for the answer. I don't see the cached module as a problem here. If you provide arguments to a module, the goal is "most likely" to alter/parameterize the behavior of the first import. Now, I agree that behavior becomes unpredictable because passing different parameters on subs