Good point, Dennis. I use Apache2, and any time I modify .py files, I need to restart the Apache2 daemon. I wish I didn't have to, but the environment needs to be flushed. Luckily, it doesn't kill the sessions or anything like, say ColdFusion when it restarts. I was wondering if there was something with your environment that was using an old copy of the file without the import, because your syntax sounded perfect. Anyway, I'm glad you got it figured out!
Furbee On Thu, Feb 16, 2012 at 6:33 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com>wrote: > On Thu, 16 Feb 2012 21:00:40 -0500, Scott Macri <scottma...@gmail.com> > wrote: > > > >Do I need to close IDLE every time I modify one of my object classes > >being accessed? I've just been recreating the object in IDLE and not > >closing the window. Any thoughts on this? Thanks. > > If the file needs to be imported -- doing edit file/save file/ > "import file", won't affect anything that has references to the previous > edition of the file. Heck, just "import file" on the second import won't > do anything -- Python will find that "file" has already been imported > and reference that module. You have to use a reload operation to get > changed modules to import a second time. But even this only replaces > stuff for NEW references; any other references won't see the new > version. > > This is especially true if you are testing in the interactive shell. > You need to spawn a totally new process to ensure a clean environment > (which is why some of us keep a command line open next to the > environment we use for editing [PythonWin, in my case -- I never could > get comfortable with IDLE]. We edit the file in the IDE, save it, and > switch to the command shell to run the program cleanly. > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.