473,473 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

working directory for debugging in pythonwin

Hello all,

I started using the nice Pythonwin IDE together with Python 2.3 (I have
come to prefer its editor to IDLE).
My problem is, that when I want to run a script in the debugger, I can
give the script name and arguments, but I can't tell it in which
directory it should run.

I googled this group but didn't find anything helpful so far.

I could use some os.chdir in my code, but that's ugly and I neither want
to copy the script around to the places where I would like to test it.

Any suggestions?

Thanks in advance
Thomas
Jul 19 '05 #1
4 2518
Thomas Pfaff wrote:
Hello all,

I started using the nice Pythonwin IDE together with Python 2.3 (I have
come to prefer its editor to IDLE).
My problem is, that when I want to run a script in the debugger, I can
give the script name and arguments, but I can't tell it in which
directory it should run.

I googled this group but didn't find anything helpful so far.

I could use some os.chdir in my code, but that's ugly and I neither want
to copy the script around to the places where I would like to test it.

Any suggestions?

Thanks in advance
Thomas

Thomas,

When you have initiated PythonWin, try opening (^O) the file you wish to
debug. By selecting the file directory and file you have chosen the
current working directory for the file.

Alternatively, in the Windows Explorer, try right clicking on the py
file you wish to debug. One of the options given is likely to be PythonWin.

Colin W.
Jul 19 '05 #2
Colin J. Williams schrieb:
Thomas Pfaff wrote:
Hello all,

I started using the nice Pythonwin IDE together with Python 2.3 (I have
come to prefer its editor to IDLE).
My problem is, that when I want to run a script in the debugger, I can
give the script name and arguments, but I can't tell it in which
directory it should run.

I googled this group but didn't find anything helpful so far.

I could use some os.chdir in my code, but that's ugly and I neither want
to copy the script around to the places where I would like to test it.

Any suggestions?

Thanks in advance
Thomas


Thomas,

When you have initiated PythonWin, try opening (^O) the file you wish to
debug. By selecting the file directory and file you have chosen the
current working directory for the file.

Alternatively, in the Windows Explorer, try right clicking on the py
file you wish to debug. One of the options given is likely to be
PythonWin.

Colin W.


Well this is what I do not want to do.
I want to have the script in some folder /source/myscript.py but run it
on data in e.g. /path/to/data/ like I would do on the commandline with

$ cd /path/to/data
$ pypthon /source/myscript.py local-file.dat
Cheers,
Thomas
Jul 19 '05 #3
You could pass the directory in as an optional extra argument
to the script. Alternately, you might accept either a bare file name
or a full path.

Roger
--
This signature was intentionally left blank.
(except it's not, wtf ??????)

"Thomas Pfaff" <ya**@gmx.net> wrote in message
news:3e************@individual.net...
Colin J. Williams schrieb:
Thomas Pfaff wrote:
Hello all,

I started using the nice Pythonwin IDE together with Python 2.3 (I have
come to prefer its editor to IDLE).
My problem is, that when I want to run a script in the debugger, I can
give the script name and arguments, but I can't tell it in which
directory it should run.

I googled this group but didn't find anything helpful so far.

I could use some os.chdir in my code, but that's ugly and I neither want
to copy the script around to the places where I would like to test it.

Any suggestions?

Thanks in advance
Thomas


Thomas,

When you have initiated PythonWin, try opening (^O) the file you wish to
debug. By selecting the file directory and file you have chosen the
current working directory for the file.

Alternatively, in the Windows Explorer, try right clicking on the py
file you wish to debug. One of the options given is likely to be
PythonWin.

Colin W.


Well this is what I do not want to do.
I want to have the script in some folder /source/myscript.py but run it
on data in e.g. /path/to/data/ like I would do on the commandline with

$ cd /path/to/data
$ pypthon /source/myscript.py local-file.dat
Cheers,
Thomas


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 19 '05 #4
Roger Upole schrieb:
You could pass the directory in as an optional extra argument
to the script. Alternately, you might accept either a bare file name
or a full path.

Roger


Yes, that's true, and I suppose it's good programming style not to
depend on a special working directory. On the other hand I'd like to
reduce the amount of command line parameters passed into the script, and
I definitely dislike the thought of havin a 'standard' working_dir=
keyword in all my scripts just because my debugger needs it.

Basically I'm used to being able to set an arbitrary working directory
from MS Developer Studio, and I wanted to know before I would contact
Mark Hammond directly, if there is anything else than workarounds for
this problem.

Cheers,
Thomas
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rami A. Kishek | last post by:
Hi, I would really appreciate help on this from all ye Win-oriented people. I have been using python under Linux for quite a while, know little about windows. I just upgraded my Python on WinME...
4
by: Glenn Reed | last post by:
This is just a general comment after trying my hand at some serious python programming for the first time. Have played with it for some time but this is the first serious thing I've done with it. ...
5
by: Will McGugan | last post by:
Hi, On my dev machine (P4 1.7Ghz Win2K) debugging with Komodo is painfuly slow. There is a delay of several seconds when stepping over a single line of code. Debugging the same code with...
0
by: PaulG | last post by:
(I've not found a solution to this anywhere else, so..) With a simple one line file: print "Hello world" if you use pythonwin debugging to step through one line at a time, it crashes...
14
by: Jive | last post by:
I've un-installed Python 2.4, re-installed Python 2.3 and PythonWin for 2.3, but it's still broke. When I start PythonWin, sometimes it looks like it is going to be okay. But as soon as I open...
10
by: rbt | last post by:
I assume that there's a better way than this to count the files in a directory recursively. Is there??? def count_em(valid_path): x = 0 for root, dirs, files in os.walk(valid_path): for f in...
1
by: VM | last post by:
I'm trying to debug an application in the VC dot net compiler and when I begin, I get the error: Unable to start debugging Unable to start program 'c:\myApp\PROGRAM\myApp.exe' 'G:\Program...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
20
by: krypto.wizard | last post by:
Is there any editor or IDE in Python (either Windows or Linux) which has very good debugging facilites like MS VisualStudio has or something like that. I like SPE but couldn't easily use winPDP....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.