Project organization and import

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Mar 6 13:16:15 EST 2007


Diez B. Roggisch a écrit :
>>I'd like to point out something though. More than one of the people
>>who responded have implied that I am bringing my prior-language
>>mindset to Python, even suggesting that my brain isn't built for
>>Python. ;) In fact I think it's the other way around. I am struggling
>>to take full advantage of the fact that Python is an interpreted
>>language, to use Python in the most "Pythonic" way. You guys are
>>telling me that's broken and I should go back to a workflow that is
>>identical in spirit, and not necessarily any faster than I would use
>>with a compiled language. While that might be the right answer in
>>practice, I don't feel like it's a particularly "good" answer, and it
>>confirms my initial impression that Python package management is
>>broken.
>>
>>I think you should be asking yourselves, "Did we all abandon reload()
>>because it is actually an inferior workflow, or just because it's
>>totally broken in Python?"
> 
> 
> Sorry, but I fail to see the point of your argumentation.
> 
> Reloading a module means that you obviously have some editor open you code
> your module in, and an interactive interpreter running where you somehow
> have to make the 
> 
> reload(module)
> 
> line (re-)appear, and then most probably (unless the pure reloading itself
> triggers some testing code) some other line that e.g. instantiates a class
> defined in "module"
> 
> Now how exactly does that differ from having a test.py file containing
> 
> import module
> <do-something>
> 
> and a commandline sitting there with a 
> 
> python test.py

Actually, make it
python -i test.py

Then you have test.py executed, and your interactive interpreter up and 
ready in the desired state.



More information about the Python-list mailing list