0

I often used python as a library and it could save me some time if I could use an alias to launch python and tell him to load the math module at the same time (ideally in the same way as from math import *) Is there a command line argument for that?

It doesn't look like much but that would save me from doing something really repetitive. Thank you.

0

1 Answer 1

1

One way of doing this on the command line is using the -c (execute command) and -i (run interactively after executing script/command) options.

$ python -i -c 'from math import *'
>>> sin(pi/2)
1.0
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.