[Tutor] Advice needed on first project

Adam adam at monkeez.org
Thu Apr 15 05:08:26 EDT 2004


I've started coding some python as my first attempt at learning it - I 
kind of learn things by doing them.

I'd appreciate some feedback, if that's possible and guidance for an 
error that I've come up against (which is obviously created by my code, 
not python).

The background is that this is a small command line application which 
collects data about magazine articles which will be written to a text 
file. However, I'm not at that stage yet. I have a meny.py file which 
initiates the program, and then I'm trying to create a new article 
through create_new_article.py. Menu calls create_new_article, and I want 
to return a list (article_items) back to menu.py.

You can see the code at: http://www.monkeez.org/python/mag/menu.txt and 
http://www.monkeez.org/python/mag/create_new_article.txt

How do I return the article_items so that menu.py has access to it? Does 
"global article_items" only affect the create_new_article module, or 
will it apply even further. In my case, it only seems to apply to that 
function.

I'd also appreciate some feedback on the code design. Does the code 
reflect the best design, or would there be a better way of doing this?

Thanks in advance.

adam



More information about the Tutor mailing list