11

Is there a way to execute ipython scripts? I don't mean python scripts, but with simplified syntax as it would be entered into the ipython shell

asked Aug 2, 2012 at 17:29
0

1 Answer 1

14

sure, just run them with IPython as you with Python for a plain Python script:

$> echo '%time print "hello, world"' > script.ipy
$> ipython script.ipy
hello, world
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
answered Aug 2, 2012 at 18:26
Sign up to request clarification or add additional context in comments.

2 Comments

The key is the .ipy extension, otherwise it will try to run it as a plain python file.
The $> confused me at first. Then I deduced it's the OS shell prompt.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.