Hello Python!

In the spirit of Hello World, lets do one! First, hello world is the de facto way of kicking off a new language, project, or other programming experiment! In 1972, Brian Kernighan wrote a woefully out of date article Programming in C – A Tutorial and starts by showing how to print “hello, world.” Since that day, every tutorial/guide starts with Hello World and why break with tradition?

If you want to follow along I’ll be using PyCharm by JetBrains. You could also use VS Code, Atom, or any IDE you’re comfortable with. Also you will need to install Python 3.x and reboot. Did I say reboot? Yea, about that, you have to reboot :(.

So I’ll get some coffee and see you when you’re done. For those still sticking around, why does this picture even exist?

coffeesmall

Ok you’re back! So start up PyCharm (or whatever IDE you’re using) and if you haven’t done so before, just next your way through all the screens, no need to make any changes… You picked Darcula didn’t you? Of course you did.

cool

So now that you’re in PyCharm its time to make our first project! Easy peasy! Just choose Create New Project and name it whatever you like, just make sure that under Project Interpreter you have Python 3.X selected.

Under your project, right click and select new Python File and name it whatever you want, I called mine Main. Once you’ve done that, all you have left is to add your code and run it! For this we will use the print command and have it print “Hello, World”. Python is not too particular about quotes so you can use either of the following and it will work:

print(‘Hello, World’)

print(“Hello, World”)

Now just select Run->Debug and you’re good to go! If its the first time debugging and you’re using PyCharm you’ll need to have a debug configuration. Luckily it will create one for you the first time, all you have to do is select main when it pops up and you’ll get a default debug configuration!

Screen Shot 2018-02-22 at 9.32.04 PM

If you see something like this its time to celebrate!

Screen Shot 2018-02-24 at 8.22.02 AM

 

Hopefully this was a gentle first post, and you’re ready to dive into Tensor Flow in the next one!

 

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

Blog at WordPress.com.

Up ↑

%d bloggers like this: