Thread: [Boa Constr] running applications
Status: Beta
Brought to you by:
riaan
From: Yuppie <sc...@we...> - 2002-07-31 17:28:51
|
Hi! By default applications use the same sys.path settings as Boa itself. If I want to run my app using modules located in other paths - how would I do that? Thanks! Yuppie |
From: Riaan B. <riaan@e.co.za> - 2002-07-31 21:06:05
|
Hi Yuppie, Yuppie wrote: > > Hi! > > By default applications use the same sys.path settings as Boa itself. If > I want to run my app using modules located in other paths - how would I > do that? When you run a module in Boa, it is not executed in Boa's process, so it knows nothing about Boa's sys.path. Also it is executed with the current directory being the directory where the script (or the application module) is saved. If your application needs to access any special paths, you have to add that logic to your code, just like you would have to without Boa. > > Thanks! > > Yuppie HTH, Riaan. |
From: Yuppie <sc...@we...> - 2002-08-01 20:49:52
|
Hi Riaan! Thanks for the quick response. Riaan Booysen wrote: > HTH, Well, not really. I'm not sure if my question is boa related or a general newbie question. But WingIDE has some of the features I was looking for in Boa and couldn't find. So I'll try to re-formulate my question: Riaan Booysen wrote: > If your application needs to access any special paths, you have to add > that logic to your code, just like you would have to without Boa. Without Boa I can also set paths (environment variables like PYTHONPATH) in a start script. Using WingIDE I have a lot of options (properties) to set the environment for debugging (not running) files. Most of them I couldn't find in Boa. A short comparison: WingIDE -- Boa Constructor Run Arguments -- File > Set command-line parameters Python Executable -- Preferences > General > pythonInterpreterPath Python Path -- ? Run Directory -- ? Environment -- ? I hope you can give me an answer like one of these: ( ) Boa has the same features. Just look ...(?) ( ) Boa doesn't have these features by design. If you want to set your environment for debugging/running files, just do ...(?) ( ) What do you expect? This is still alpha. The features you are talking about may be added in a future release. But there's a workaround: ... (?) ( ) This is a general python question. Please ask on a python list. TIA! Yuppie |
From: Riaan B. <riaan@e.co.za> - 2002-08-01 22:33:03
|
Hello Yuppie, Yuppie wrote: > WingIDE -- Boa Constructor > > Run Arguments -- File > Set command-line parameters > Python Executable -- Preferences > General > pythonInterpreterPath > Python Path -- ? > Run Directory -- ? The run directory of the script/application that you run or debug. > Environment -- ? > > I hope you can give me an answer like one of these: > ( ) Boa doesn't have these features by design. If you want to set your > environment for debugging/running files, just do ...(?) It's not there because I have never needed this. Possibly Shane did not need it either. Is it really that useful? Does it just temporarily change the Python Path and Environment of the debugged process? Why would you need to have a different python path when you are debugging than the one you use when running normally? Cheers, Riaan. |
From: Yuppie <sc...@we...> - 2002-08-03 17:15:11
|
Hi Riaan! Riaan Booysen wrote: > Does it just temporarily change the Python Path and Environment of > the debugged process? You may select different settings for each project/file. Debugging a file, WingIDE uses temporarily these settings. > Why would you need to have a different python path when you are > debugging than the one you use when running normally? I don't need that either. That's just the way WingIDE does it. I'd like to use the same settings for debugging and running. > It's not there because I have never needed this. > Possibly Shane did not need it either. > > Is it really that useful? Here's my use case: I want to use the IDE for Zope product development. Running tests against different Zope versions, I need to change a lot of environment settings: - pythonInterpreter - Zope path - environment variables like INSTANCE_HOME To change these settings, I have to change - pythonInterpreterPath in Preferences - sys.path in my python script - os.environ in my python script But these settings don't belong in the code. They are different for different workstations and testing scenarios. I'm dreaming of a feature that allows me working this way: 1. setting pythonInterpreter, paths, environment variables 2. run tests / debug using these settings 3. saving settings in a file like zope251.env 4. modifying my settings, run tests / debug again 5. saving settings in a file like zope260.env 6. working on my code 7. loading zope251.env 8. ... But I don't have much experience in python product development. So perhaps I should do it in a totally different way? Thanks again. And thanks to Ris for his reply. Yuppie |