[Python] Atom editor tips for pythonistas

I started using a new text editor, Atom, for a month now and it has become my favorite. It has great Python packages: autocomplete-plus-python-jedi and hydrogen. I want to focus on hydrogen.

Hydrogen allows you to debug codes quickly and without hassle. The basic feature is typing cmd + alt + enter.

Screen Shot 2015-08-11 at 8.38.42 PM

However what if you want to work on python console with the data(python objects) in the script? emacs has this feature so I thought Atom should have it too. I issued this on Github page, and Will, the author of hydrogen, showed me an answer. Big thanks to Will and here’s a dummies’ guide.

Screen Shot 2015-08-11 at 8.31.45 PM

When you  open Atom, it looks like above. Then hit cmd+alt+i for the developer tool.

Screen Shot 2015-08-11 at 8.32.18 PM

It is just like Google chrome right? Then click the Console window; it’s default in my case. Run the codes in hydrogen mode: cmd + alt + enter.

Screen Shot 2015-08-11 at 8.33.09 PM

Then some information is printed out on the console. Look for the iPython kernel json file. In some case, it prints out the entire path of the json file but in my case it printed only the name. Then open the terminal and do

find . | grep 'kernel-1534.json'    # Change the json file name.

# Then start the iPython shell

ipython console --existing /path/to/json

Then you can access all the data simultaneously from Hydrogen to that iPython shell. Hooray~~~ 😀


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: