[Tutor] Exercise suggestions

Elwin Estle chrysalis_reborn at yahoo.com
Sat Jan 22 22:52:21 CET 2011


Well, I'm a noob myself, so perhaps take what I say with a grain or three of salt.  On the other hand, I have sort of the opposite problem, lots of ideas, but not the time nor skill to make them happen.

Do you even necessarily have to complete a project?  Sometimes just making an attempt can teach you things.

How about an archiving assistant, that makes a list of files to be fed into an archiver such as zip, etc.  I seem to remember that Python (is it supposed to be capitalized?  Official logo is in lower case), has modules to access zip or bzip or somesuch.  Sure, there are tons of these sorts of apps already, but so what?  Maybe you can make one that is better.

Find some text files to parse.  I have found a use for this where I work.  The company used to have these old dedicated green screen "dumb terminals" used to access a database.  They upgraded to pc's with an emulator program for the old green screen.  In my job I have to do audits of various information that is still stored in that database, which meana a lot of manual data entry.  I found that the emulator we were using has a low level scripting engine built in.  I was able to use that to feed it a list of part numbers, and then capture the raw screens of data to a large text file...which I then had to parse.

I wrote a program in Tcl that would let the user select from several lists of part numbers, then it would write a custom script for the emulator and then call the emulator with that script.  The emulator would do it's thing and spit out text file and then call my parser, a separate program, that would then step through the screens and extract the information I was after.  It could do 600 part numbers in about 20 minutes, a task that would have taken me hours to do manually.

At one point I needed to extract some information from some raw vCard files.  Same thing, load a text file and step through it and extract what I needed.  Next step is to get this information into an SQLite database.

Such projects teach string handling, regular expressions, etc., plus it trains you to look for patterns in text that you can feed to your regex.

Simple games.  Do a text adventure.  Do an ascii art adventure game using the Tkinter text widget.  Do some other sort of adventure game and use the canvas widget, instead.

Do a tetris clone.  Do a "same game" clone.  Do an icebreaker clone.  Do a python based version of Santa Paravia, http://www.santaparavia.com/Home.aspx

Make a simple MUD using python's networking capabilities.

Here's another work related project I did (but never finished), again in Tcl, but I am in the process of re-writing it in python, hopefully using OOP:

I run a CMM (Coordinate Measuring Machine).   We have a rather kludgy process for submitting work orders for parts to be measured on the machine, using something called Maximo (an IBM product...interesting, isn't it...how they tend to make crappy products and have "BM" in their name...coincidence?  I think not.)  Maximo is ugly an ugly lookin' slow, cryptic web app.  I think java is involved in it somewhere...which seems to be the case with a lot of ugly, slow web-apps.

Anyway, I decided to create a dedicated application to do the same thing.  The machine operators would put in a part number, their ID number, a quantity, and a part serial number, if any.  My app would find the part name, validate the info, and generate a time stamped "work order".  That was as far as I got, but the idea was that I could then "sign off" on this work order and the application would track the amount of time between when the operator submitted the part for measurement on the CMM to the time I was done with it, with a sort of sub category that listed how long it took for the CMM to actually measure the part.  Then this information would be made available in a searchable format that my boss could then use to track usage of the CMM, how often parts were being submitted, etc.

Further work related stuff.   We had some documents in Excel format, these were used to print hard copies that the operators would write information on as they checked the various parts off the machining stations (gage readings and such).  I hate, hate, hate, having to deal with these "checksheets"; making new ones for the operators, filing them, etc.  I thought, what if I could make this process simpler?

Phase one:  All the Excel files are "printed" to pdf.  I wrote a program that would glob the filenames of these pdf files from a certain directory, sort them by the property number of the machining station associated with a given part, then generate an HTML web page with a list of the checksheets for that machine.   An operator (or me) can just pick their machine on the web page, then scroll through a list of part numbers, and choose the one they want.  The pdf opens in Internet Explorer, and they can print them off.  No more digging for the original master copy in a three ring binder.  No more auditing to make sure that the master in the binder is up to date, since the pdf is made directly from the original Excel master...which is my boss's responsibility ;-).

Phase two:  Still partially vaporware.  I export the original Excel file to .csv format.  I have a Tcl based parser  (hey, I am only just switching to python here, okay?) that loads one of these files, and parses it into XML format.  The idea is to take these XML files and use them in some sort of web app to make an HTML form based version that the operators can just fill out.  These will be searchable and otherwise data-massageable...right now, the operators fill 'em out and we file them until there is a problem.  The engineers would also be able access the info to see if there are any trends with features on parts that are going out of spec, part runs vs. tool wear, etc.

Here's another idea.  Imagine that you are the owner of some sort of restaurant.  Write yourself a Point of Sale app for your restaurant.  I've always thought it would be neat to walk into say, a pizza place and use some sort of kiosk with drag and drop virtual pizza ingredients.  You design your pizza, it sends the order to the kitchen, you pay, and then go sit down until someone brings your order.    This could work for a fast food place, or whatever.

Further restaurant idea, more complicated.  I had this one years ago, but the computer hardware back then wasn't up to it...at least the hardware I could afford, anyway.  This is a simulation game of sorts.   The user designs a restaurant from the ground up, chooses the physical layout of the dining room, kitchen, etc.  Designs a menu.  Designates where the food for creating that menu is stored.  Hires servers, a chef, prep cooks, etc., then fires up the virtual restaurant.  From here they get to see how the layout of their kitchen and dining room works.  Are people getting in each other's way in the kitchen or the dining room?  Is your kitchen able to keep up?  Do you have enough staff?  Are the dishes being washed fast enough?  Are you buying enough ingredients to make sure that you don't run out of food?  Or have too much stock on hand and you are losing some to spoilage?  Are you managing costs and making a profit?   What about
 unexpected events, like equipment breakdowns, or a sudden influx of customers on a night you expected things to be a bit slow?  What if you get a surprise visit from the health inspector?  What if a customer gets food poisoning and sues you?  What if an employee is injured at work?  (slips, falls, cuts, etc.)  What if a rival restaurant offers your chef more money?

(and just thinking about this, the whole idea above could also be applied to a factory, which is all a restaurant is, really, a factory that produces edible consumables, rather than durable goods).

What about a facebook app?  I think you can do those in python.

There are all sorts of scenarios in the above for one to analyze and create code to simulate, etc.

Enough of my blathering.   Basically....find something, a problem, an imaginary idea like a game, and then figure out how to apply programming solutions to that problem.

--- On Sat, 1/22/11, michael scott <jigenbakuda at yahoo.com> wrote:

From: michael scott <jigenbakuda at yahoo.com>
Subject: [Tutor] Exercise suggestions
To: tutor at python.org
Date: Saturday, January 22, 2011, 11:56 AM

I am new to programming, I intend to get an entry level job programming next year (or a little bit longer). I am switching fields and not going to college, but kinda "self teaching" myself through various methods. I currently understand concepts in programming in python up to classes (like I understand how to make objects, I understand inheritance, etc...), and I have experimented with building guis in Tkinter,  but I'm finding that I understand concepts, but have no real way to implement them.

So now my problem emerges... can anyone give me suggestions of exercises I should do to help improve  my knowledge of what I can "actually" do with the concepts I have.

My main goal is to get to the point where I can assist in fixing bugs in open source programs (I'll be learning
 C++ in a couple months as well), but when I look at bugs / source code of larger programs, I am just so blown away at how little I understand. So I need to find a way to bridge the gap between my current level and the level needed to contribute to open source programs. A lofty goal I understand, but it is my goal. And I am very dedicated to reaching it.

Anyways, given my situation, do you good people have any suggestions for me. I don't need a person walking me through it, a simple, "build a program that asks a user to give you a name and create permutations of it" is great. Of course that example is elementary, but that is the gist of the responses I'm looking for. I just have no idea of what kind of programs to build, my ignorance is holding me back in my opinion.

Any response is welcomed, but I do ask if you are critical of me, please offer a method for me to improve the deficiency / deficiencies  I have. Thank you so much for
 reading my inquiry :)
 What is it about you... that intrigues me so?










      
-----Inline Attachment Follows-----

_______________________________________________
Tutor maillist  -  Tutor at python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110122/75d22685/attachment-0001.html>


More information about the Tutor mailing list