[Tutor] New to Python

Wayne srilyk at gmail.com
Wed Oct 21 12:36:17 CEST 2009

On Tue, Oct 20, 2009 at 4:55 PM, <lfseeney at comcast.net> wrote:

> Hello all,
> Just started looking at Python, I have not programmed in a good 8-10 years
> now, and find myself woefully behind.

Luckily it shouldn't take you too much time with python - it's a lot easier
to learn/relearn than a lot of other languages!

> I was wondering if there was a Preset Menu and file system module for
> Python so I would not have to look at setting it all up?

The short answer: yes

But that leaves out a lot of details :)

> Trying to start again, Car wreck took me out for the last 10 years, and my
> memoery is lacking so I forget how things worked and now relearning things.

Well if you get stuck, we're glad to help around here :) Especially if you
follow the "asking good questions" guidelines you get in response to your
first email.

> Was never a true programmer mostly a trouble shooter for HW and SW
> development so I can scan and read code fair enough but was not the one
> writing code.

Honestly you probably got a decent amount of experience that way - I think
it may be more difficult reading someone else's code than reading your own!

> So basically (pardon the pun), is there a good reference online for using
> the libariers to give me a simple Interface with pull downs and such, file
> system and so?

There are *lots* of good online python references - including some written
by the folks around here.

> Last time I did any real coding had to write that myself, of course that
> was before many on the list was born I would guess.
> So I need a site that can handhold be a bit til whats left in the little
> gray cells can start working.
> The Issue that brings this up is I want to put together a program to help
> Miniature Wargame Players run mid to long campaign games, with all the
> wargames out there one would think there would be more than a few of these
> about, but there are very few and the better one still works like a DOS
> program.
> I am trying to put together a simple, expandable system that will folks to
> track and write reports for each turn of the game.

At first I was a little confused by what you wanted to do, but after reading
this it seems like you want a GUI? If so, Tkinter is probably the right
choice - I find it a lot simpler than most GUI libraries, but powerful
enough to handle what you need/want it to. Tkinter (indeed most python
scripts/GUIs) has the added benefit of being cross platform. If you write
something that works in windows, it probably works under another platform
(mac, *nix), as long as python is installed.

My personal recommendation would be to check out some of the regular
programming tutorials available - several written by some of the top
contributers here (in terms of activity, experience, and intelligence).
After you're refreshed as to some general programming concepts and syntax,
then it's a bit easier to pick up some of the GUIs. In reality, most people
have their favourite GUI, whether it be Tkinter, PyGTK+ (mine, but mainly
because I've found it has a bit more advanced drawing methods - I always
wanted to write up a sketchbook type program. Then I found mypaint, written
in PyGTK+ with a little bit of C that turns out to be perfect for my
desires), Qt, or any one of a number of others.

Most of those who are pretty familiar with their GUI of choice could
probably toss up a few features of the kind of thing you seem to be
describing (menus, forms) with very little trouble.

Python has lots of built-in file system operations/modules. You can easily
read/write a file from within python with no imports, although with what you
seem to want to do you might look at the pickle library (enables writing
then reading objects directly from a file, as opposed to just attributes),
configparser (which does pretty much what it sounds like - parses config
formatted files), or what might be the best option if you're planning to
support lots of campaign info - sqlite. Of course there are probably a few
people with other ideas and suggestions.

Anyway, HTH,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091021/127716c2/attachment.htm>

More information about the Tutor mailing list