Ask Your Question
1

How do I set a Launch Configuration to use the -m convention?

asked 2019-11-25 13:06:54 -0600

tinjaw gravatar image

updated 2019-11-27 09:16:17 -0600

I want to launch with...

python.exe -u -m mypackage.mymodule

I understand I can add the -m, but how do I get it to use the proper package.module.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-11-26 09:26:07 -0600

The -m option is not currently supported. We plan to add support for it soon.

edit flag offensive delete link more

Comments

What is the suggested workaround? I ask because I have a large main project that I am using to evaluate Wing Pro against, and it requires the use of -m format.

====EDIT====

Let me rephrase that. I know of no other way to run it w/o the -m option. I am open to being schooled.

tinjaw gravatar imagetinjaw ( 2019-11-26 11:12:42 -0600 )edit
1

A workaround is to use runpy.py in the standard library as the main debug file and specify the module name as the first argument -- so to debug the equivalent of python -m pip, the arguments for runpy.py would be: pip

To easily find runpy.py, add import runpy to a file and then use goto definition on runpy.

Wingware Support gravatar imageWingware Support ( 2019-11-26 11:43:32 -0600 )edit
1

answered 2019-11-26 11:54:06 -0600

You can also locate runpy with at any python prompt:

import runpy
print(runpy.__file__)
edit flag offensive delete link more

Comments

@gadgersteve, I just want to check with you that this continues to be true for virtual environments.

Thanks.

tinjaw gravatar imagetinjaw ( 2019-11-27 09:46:34 -0600 )edit
1

Some quick testing shows that runpy is not copied as a part of the virtual environment for venv nor virtualenv on 2.7 but is on the python path in all of my tests so the above gives the same result both in the virtual environments that I have tested and in normal use.- note that os is copied and gives different results in the venv to normal use so it is working fine!

gadgetsteve gravatar imagegadgetsteve ( 2019-11-27 14:16:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-11-25 13:06:54 -0600

Seen: 52 times

Last updated: Nov 26