1

I am looking for a way, to invoke simple python one-liners directly from Windows cmd without the need to store a .py file somewhere.

Something like

python print('Test').

Is this possible?

1

2 Answers 2

5

Just use -c command line switch:

python -c "print('Test')"
Sign up to request clarification or add additional context in comments.

Comments

-1

you could just type python3 on your cmd and you'll get a sort of python debugger in which you can type and test your code.

so let's just type, print('Test') and it will execute

1 Comment

I know that, but that's not actually the question I'm having.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.