Re: Run python module from console

2017-09-06 Thread Thomas Jollans
On 05/09/17 17:14, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > The runpy module can help you do this. https://docs.python.o

Re: Run python module from console

2017-09-05 Thread Grant Edwards
On 2017-09-05, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > os.system("python.exe myscr.py") -- Grant Edwards

Re: Run python module from console

2017-09-05 Thread Rhodri James
On 05/09/17 17:11, Stefan Ram wrote: Ned Batchelder writes: exec( compile( open( 'myscr.py', 'rb' ).read(), 'myscr.py', 'exec' )) . This looks quite complicated, but there are rumors that Python 4 might have a »execfile« function, and one then will be able to write: execfile( 'myscr.py' ) It'

Re: Run python module from console

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 8:45:00 PM UTC+5:30, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > > >>> By and large no

Re: Run python module from console

2017-09-05 Thread Ned Batchelder
On 9/5/17 11:16 AM, Stefan Ram wrote: > Andrej Viktorovich writes: >> I suppose I can run python module by passing module as param for executable: >> python.exe myscr.py >> But how to run script when I'm inside of console and have python prompt: The Python console isn't meant for ad-hoc execution

Re: Run python module from console

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 8:45:00 PM UTC+5:30, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > > >>> >> import myscr

Run python module from console

2017-09-05 Thread Andrej Viktorovich
Hello, I suppose I can run python module by passing module as param for executable: python.exe myscr.py But how to run script when I'm inside of console and have python prompt: >>> -- https://mail.python.org/mailman/listinfo/python-list