First time here? Check out the FAQ!
1

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

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
tinjaw's avatar
72
tinjaw
asked 5 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 5 years ago

Comments

see more comments

3 Answers

1

You can also locate runpy with at any python prompt:

import runpy
print(runpy.__file__)

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
gadgetsteve's avatar
56
gadgetsteve
answered 5 years ago
link

Comments

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

Thanks.

tinjaw's avatar tinjaw (5 years ago)
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's avatar gadgetsteve (5 years ago)
see more comments
0

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 5 years ago
link

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's avatar tinjaw (5 years ago)
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's avatar Wingware Support (5 years ago)
see more comments
0

As of Wing 7.2, you do this with Environment under the Debug/Execute tab in File Properties, or you can set up a Named Entry Point from the Debug menu and select Named Module and enter the module name.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 5 years ago
link

Comments

see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)