[PLUG] Rudimentary python help needed

Martin A. Brown martin at linux-ip.net
Wed Jan 22 18:16:27 UTC 2014


Greetings Denis,

 : I import my module (a file of a few lines of simple stuff), edit 
 : the file, then attempt to reload and get an error.  I have to 
 : quit python, restart python to get the revised file.  Can I get 
 : some clues here?

You are describing what the 'reload' function offers:

  http://docs.python.org/2/library/functions.html?highlight=reload#reload

 : parents at R2D4:~/Documents/Denis/Python$ python
 : Python 2.7.3 (default, Sep 26 2013, 20:03:06)
 : [GCC 4.6.3] on linux2
 : Type "help", "copyright", "credits" or "license" for more information.
 : >>> from pins_init import*
 : >>> cols  #test to illustrate that the code was read
 : 5
 : >>> reload(pins_init)
 : Traceback (most recent call last):
 :   File "<stdin>", line 1, in <module>
 : NameError: name 'pins_init' is not defined
 : >>>

You have posted a few Python questions recently.  Another option for 
language-specific questions is a language-specific mailing list. I 
can recommend the Python Tutor mailing list, which is geared toward 
exactly the sorts of questions you have been asking.

  https://mail.python.org/mailman/listinfo/tutor

Good luck,

-Martin

-- 
Martin A. Brown
http://linux-ip.net/



More information about the PLUG mailing list