ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Computers & Software

I am learning to program with python (Part 1)

Updated on March 6, 2011

About Me

I am a long term programmer, who completed a degree in software engineering six or seven years ago, and worked in the industry for a few years doing programming in C, C++, Visual basic and a range of other programming languages and then burnt out and had various health complaints. I ended up working with other aspects of computing, and haven’t programmed for four years.

But I did love it, and now I have decided to relearn much of what I used to know.

That part of my life is rather painful, but like all bad things, the memories have started to fade, and I have decided to relearn everything from the ground up, in order to get a job as a games programmer in a few years.

Why Python?

No programming language is easy. Python is not easy, but it is easier as a beginner’s language than many others. Python provides readymade games programming code, so you can get a 2d or 3d game done relatively quickly without too much fuss.

Also, Python is a language I’ve never worked with before, and rebuilding my ability to think computer will, I think, be accomplished better without having half remembered information hampering me.

Ok, end of blather, here is some useful information:

First Steps

I’ve decided to download five books on python programming, all of which can be obtained legally for free:

Non programmers guide to python by Josh Cogliati

This is the book I’ve started with. I’ve run through most of the exercises, and they are very helpful in providing you with the very basics of programming. It doesn’t go into a great deal of detail, but sometimes you just want a tutorial that goes from

print “hello world”

To very basic file management.

I am not sure how good it would be for a real non-programmer, since it assumes a certain base knowledge of how to think computer.

Invent with python Al Sweigart

A really good book. Provides a lot of games to program. I intend to use the exercises it mentions as a foundation for a series or programming problems, which I will use to get me thinking computer. I’m not going to read the solutions... I am going to program them first hand!

Think Python – Allen Downey

I think this is a better book for the complete novice... it contains a lot of stuff I know, but I think a lot of the exercises are actually quite tough. I am sure I will be working through it.

Learn Python the hard way Zed A Shaw

Another really good book full of programming exercises, which is very good for an experienced programmer. Once you work your way through this and the next book, you will have most of the basic skills needed to program... you’ll just need books on specific aspects of programming like user interfaces, 3d programming or database programming.

Building skills with python Steven F. Lott

Contains quite a lot of advanced computer programming concepts. I will get there... but not yet!

Which version of python I am learning

I have chosen to learn python 2.7. There is a more recent version (3.2) which is not a stable release. At this stage, I am not deep enough into programming that the differences between the two really matters. Later on, I will move to 3.1 when it has a stable release, and is widely supported on Unix operating systems.

How to install python

There are instructions in several of the books mentioned, or you can go to http://www.python.org/download/ . It is free and easy to do.

 

First program

I don’t really want to go through a full article without writing a single program, so here it is:

 

And here are the results:

 

It’s pretty self explanatory, isn’t it? You use the print statement to print a line of text to the python shell. You could replace the text with almost anything between the brackets and it would print it out on the screen.

It’s not a great program, but I guess at least it is better than Hello world, which is the traditional first program to write in a new language. And yeah, I think you should keep the tradition alive, Hello World was the first program I wrote in Python. I’m not posting it here, because it is your first exercise!

What will I do next?

Next I think I will do a basic program to allow users to guess high numbers and low numbers. It will be my first game! Wow! Games programming already... even if it is the most rubbish game you can think of!

Comments

Submit a Comment

No comments yet.

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: "https://hubpages.com/privacy-policy#gdpr"

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)