[Python-ideas] pdb to support running modules

2018-01-04 Thread Mario Corchero
Hello All, Since PEP 338 we can run python modules as a script via `python -m module_name` but there is no way to run pdb on those (AFAIK). The proposal is to add a new argument "-m" to the pdb module to allow users to run `python -m pdb -m my_module_nam

Re: [Python-ideas] pdb to support running modules

2018-01-04 Thread Devin Jeanpierre
On Thu, Jan 4, 2018 at 1:56 PM, Mario Corchero wrote: > Since PEP 338 we can run python modules as a script via `python -m > module_name` but there is no way to run pdb on those (AFAIK). > > The proposal is to add a new argument "-m" to the pdb module to allow users > to run `python -m pdb -m my_m

Re: [Python-ideas] pdb to support running modules

2018-01-04 Thread Lisa Roach
I also +1 this idea, I don't see a reason why we couldn't run pdb on the modules. On Thu, Jan 4, 2018 at 12:29 PM, Devin Jeanpierre wrote: > On Thu, Jan 4, 2018 at 1:56 PM, Mario Corchero > wrote: > > Since PEP 338 we can run python modules as a script via `python -m > > module_name` but there

Re: [Python-ideas] pdb to support running modules

2018-01-04 Thread Guido van Rossum
Sounds uncontroversial, this can just be done via bugs.python.org. On Thu, Jan 4, 2018 at 4:50 PM, Lisa Roach wrote: > I also +1 this idea, I don't see a reason why we couldn't run pdb on the > modules. > > On Thu, Jan 4, 2018 at 12:29 PM, Devin Jeanpierre > wrote: > >> On Thu, Jan 4, 2018 at 1

[Python-ideas] Syntax to import modules before running command from the command line

2018-01-04 Thread Steve Barnes
Currently invoking `python -c "some;separated;set of commands;"` will, if you need to use any library functions, require one or more import somelib; sections in the execution string. This results in rather complex "one liners". On the other hand `python -m somelib` will load somelib and attempt

Re: [Python-ideas] Syntax to import modules before running command from the command line

2018-01-04 Thread Wes Turner
Could it just check if -c and -m are both set? That way there'd be no need for -p or -M. (I have an -m switch in pyline which does exactly this. It makes copying and pasting less convenient; but does save having to type 'import module;’ for one liners) On Friday, January 5, 2018, Steve Barnes w

Re: [Python-ideas] Syntax to import modules before running command from the command line

2018-01-04 Thread Wes Turner
An implicit print() would be convenient, too. On Friday, January 5, 2018, Wes Turner wrote: > Could it just check if -c and -m are both set? > That way there'd be no need for -p or -M. > > (I have an -m switch in pyline which does exactly this. It makes > copying and pasting less convenient; bu