A
A
Alexander Myasnikov2015-03-02 21:46:08
Python
Alexander Myasnikov, 2015-03-02 21:46:08

How to run a python script in cmd so that it prints in cmd and not in a new "Python" window?

In cmd, I run the python script with the command.
> name.py
A new window "Python.exe" opens and it displays information on the screen.
How to make the output of the program printed immediately in cmd?
PS Probably I put it wrong.

The author is asking not for cmd to execute python, but for python to communicate via stdin/stdout

That is exactly what is needed.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
thepikal, 2015-03-03
@thepikal

Path to Python space path to the file.
Here is an example
D:\Python34\python.exe D:\script.py

L
landstalker, 2015-03-03
@landstalker

Maybe there is some library connected, which calls additional. window. But yes ...
C:\Users\~\Dropbox\Python> python passgen.py - So the output goes to cmd
Enter password lenght
10
GeuBgSF$$C
C:\Users\~\Dropbox\Python>passgen.py - And just open the file in the default editor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question