views:

22

answers:

2

I have a python script I am trying to debug in eclipse. I can execute it, breakpoint all that jazz, but this specific script requires a handful of command line parameters. Is it possible to setup my dev environment in eclipse to put these parameters in?

Right now my program is just generating the line to execute, like:

script.py -aword -banother -cword -dmore -eparams -flast -gone

so could I just copy and paste everything after script.py somewhere? or can I hard code them into eclipse? or will I have to hard code the variables within my script?

+2  A: 

Yes, if you go into the project settings you can setup command line arguments to pass to your program. See the section titled: Running A Python Script

Wayne Werner
+1  A: 

Use a launch configuration

To create: - Right mouse button on your script, => Run as / Python Run => this creates a Run configuration - Right mouser button again, Run as / Run Configurations => opens this specific configuration - Tab 'Arguments', enter your arguments

To use: - from the same step above OR - access it from the 'Debug' and 'Run' icons in the toolbar

This configuration will be shared between the 'Run' and 'Debug' mode.

You can even check it in to share with the other members of your team by filling up the 'Save as' in the 'Common' tab. This is very useful if you have a complicated settings that require arguments, VM arguments, environment variables, ...

Daniel Coupal