# Ipython 

The true GOAT if we're going to be real. Big shout-out to Gabe from Schrodinger for truly putting me onto iPython. 

### Magic! 
![[redditsave.com_we_always_have_that_senior_who_solve_everything-y2y8hevqny891.mp4]]

iPython uses [MAGIC](https://ipython.readthedocs.io/en/stable/interactive/magics.html#) ! :) 

To load a file: 
```
%load filename.py
```

To save a file: 
```
%%writefile filename.py
```

To return a list of magic commands: use  ```%magic```
More useful magic commands can be found [here](https://towardsdatascience.com/useful-ipython-magic-commands-245e6c024711) and [here](https://towardsdatascience.com/top-10-magic-commands-in-python-to-boost-your-productivity-1acac061c7a9)! 

---

**Some notes:** Make sure to read the [docs](https://ipython.readthedocs.io/en/stable/interactive/tips.html) though. 
Reading about iPython led to installing xonsh
Which ultimately led to [this](https://gitter.im/xonsh/xonsh) community for support. 

Personally I think xonsh is really cool and could potentiallY be better than iPython?? It might need a note of its own eventually. 

Setting up [xonsh](obsidian://open?vault=Coding%20Tips&file=Xonsh) virtual environments seem a lot more easier than the python conda method. 

Running ipython :
![[Pasted image 20220703231737.png]]

---


Fun facts: 
- did you know you can create clusters and [parallel compute ](https://ipyparallel.readthedocs.io/en/latest/)in ipython? 
- here are some additional [cookbooks](https://github.com/ipython/ipython/wiki/Cookbook:-Notebook-utilities) for iPython. 


---

This may be better off in the VSCode section but here is a[ useful tutorial](https://www.scheidt-mt.com/en/blog/vscode_ipython/) on using iPython within VSCode should you ever make the switch to something a bit more user-friendly.