Learning Python – Lesson 1: Getting Started!

Why Do This?

Python is a simple programming language capable of big things. It features wide support across network devices.

There are many reasons you should consider learning Python – here are just some of them:

  • It is fun!
  • You might not have learned a programming language in a long, long time.
  • Python is often used in Software Defined Networking (SDN) Environments.
  • Did I mention it is fun?
  • Python is now a requirement for many professional certifications from companies like Cisco, Juniper, AWS, and more

The First Application

I hope you enjoy my notes on my learning here at AJSNetworking.com. I am using various resources to help you, but the primary one I would love for you to follow along with is the CBT Nuggets course:

Python Programming

I am on a Mac – which provides the luxury of having Python built right in (just like Linux). For those of you on Windows – head over to python.org/download.

For composing my Python applications – I am using the BBEdit from BareBones.com. After thirty days of the full version, you can continue to use it free for your text editing work. Advanced functionality like Web authoring goes away, but no big deal for me.

I will use BBEdit to create my first Python application! How exciting. 🙂 Here it is.

print “Hello World!”

print “This is awesome!” 

print “I am a programmer!”

I will save this complex program 😉 as a file named ex1.py.

I will now run this application in the Terminal application in Mac OS. This is done with the command:

python ex1.py Python

Make sure you are in the directory where that file exists of course!

Interested in what version of Python you are running?

Try this command:

python –version

I just discovered I am running Python 2.X.

Final Thoughts

This is an excellent time to practice with some of your directory and file management skills from within Terminal. I found myself using the following commands in this first application and its execution:

  • mkdir – Make a directory
  • cd – Change directory
  • ls – List the contents of a directory

Thanks for reading and I hope your first Python application was a success as well.

Do you have questions? We are standing by – just use the comments area below.

7 thoughts on “Learning Python – Lesson 1: Getting Started!

  1. BETTER
    AM ACTUALLY ON PHP now is fun too but it seems python is very powerful in NETWORKING than PHP.

    1. you might also enjoy this talk: irongeek.com/i.php?page=videos/securewv-hack3rcon2016/202-python-scripting-adam-byers

  2. Hi Anthony, for network automation and SDN, what programming language you think will be most relevant to learn. I am doing lately vbs and T-sql but I need to decide on either C# or Phyton.

    thanks

Leave a Reply

Your email address will not be published. Required fields are marked *