Skip to main content

I learned to compile python code without an IDE (and with the Atom text editor)

For a long time now, I've been wanting to learn how to compile code in Java and Python (the 2 main languages I like to code in) without the use of NetBeans/Eclipse and the Idle IDEs. A software developer friend of mine told me that many devs use text editors in the workplace, and I thought figuring out how to compile and run my code that way would be a cool thing to learn.



Compiling code in Java will be for a later blog, but here is how I got python setup:

1) Installing the Atom Text Editor


Atom is a free, open source text editor developed by GitHub. I was first introduced to Atom at a high school hackathon I went to, where it was praised for being fully customizable and having a large array of packages to download from (although I learned today that Vim is a better text editor in terms of memory usage). Installing Atom is very simple, and the download link can be found here








2) Installing the Script Package 

Next, I found out that installing the script package is what could let me run python code easily. 
Once you have atom running, choose the "install a package" option on the welcome guide. From there, click open installer, and search "script". The package below is the one we're interested in: 



Click the install button, and you're good to go. 


3) Getting the Python Part Setup 

Theoretically, you should be able to run python programs once you write them and save them with a ".py" extension. However, many people including me, get an error that says "python is not an internal or external command". 

This error is very easy to fix. Assuming you have already installed python, do the following:

1) search add or remove programs in your search bar, and try to uninstall python

2) this screen should come up:





3) Click on modify, click next on features and this screen should appear:



4) Check the Add Python to environment variables option

After this, python programs should start working in atom itself. Press Ctrl+Shift+B to run the code on Windows.





Comments

Popular posts from this blog

Showcase and how to get started with a Speech Recognition Bot coded in Java

When I first got into coding, I dreamed about creating my own local version of Siri for my desktop; lying back on my chair and doing things with just my voice was what I always wanted. After coding with Java for over a year, I decided that it was time to learn more than just using JFrame and creating classes. "Zero" is a speech recognition bot I coded using the Sphinx4 voice recognition library in Java and the Selenium Webdriver for Chrome. Although no Siri by any means, the bot can open and close windows, create tabs, open sites etc. using just my voice. The demo for the bot and its commands as of now can be found below: 1) Setting up the voice recognition: Luckily, there is already documentation on how to get started with sphinx4. The Jar Files for this library can be downloaded  here . As you can see, each recognizer should have an Acoustic Model Path, a Dictionary Path and a Language Model Path set. After running the code, I figured out that the recogni...

My experience at Hack The North 2017

I attended Canada's largest Hackathon, Hack The North, on September 15, 2017. It was an amazing experience, and we had a lot of coffee, no sleep and a decently-functioning project by the end of it. After signing in and eating dinner the very first day, we head out to Hagey Hall for the opening ceremonies.We had many speakers come out and talk to us, such as Balaji Srinivasan, Michael Gibson, and a Canadian rather popular in the hearts of everyone there- Justin Trudeau. The Prime Minister had a great speech, and this was the place we first came up with the idea for our project, so the opening ceremonies was an overall success. Hacking started the same night at 12. Our first night was entirely dedicated to research. Is our idea viable? What APIs do we want to use? What do we want to make our backend in?  We eventually planned out and envisioned what our project would look like, after which I started designing the frontend of the login page that was to be implemented. The next 2 ...

I downloaded and learned how to use Vim (On a basic level)

Having used Atom as my main and only text editor, I never even bothered looking at any other ones. However, a friend of mine-who has way more experience than me in development-showed me a few tests that seemed to suggest that Vim or Sublime Text was the way to go in terms of a text editor. I cant seem to find the tests right now, but the main thing that convinced me to choose a different editor was the data that showed the large amount of memory Atom took up while doing a task. Vim is probably the coolest editor I've seen, hands down. After downloading and launching Vim, I was greeted with this retro, old school screen that I fell in love with immediately. The shortcuts are so weird too! The concept of Vim revolves around never having to touch your mouse to do anything, and that is what makes it stand out the most in my opinion. I've learned how to run code, save files and some other basic commands, but a more detailed blog about Vim will come after I get to play ar...