Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I execute ipython scripts?

Tags:

python

ipython

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

like image 966
piotr Avatar asked Aug 02 '12 17:08

piotr


People also ask

How do I run an IPython code?

To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World!

Is IPython the same as Python?

IPython is an interactive command-line terminal for Python. It was created by Fernando Perez in 2001. IPython offers an enhanced read-eval-print loop (REPL) environment particularly well adapted to scientific computing. In other words, IPython is a powerful interface to the Python language.

Is IPython better than Python?

Compared to Python, IPython (created by Fernando Perez in 2001) can do every thing what python can do. Ipython provides even extra features like tab-completion, testing, debugging, system calls and many other features. You can think IPython as a powerful interface to the Python language.


1 Answers

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
like image 140
minrk Avatar answered Oct 13 '22 09:10

minrk