Friday, May 19, 2023 at 12:25, Barry Scott wrote: Re: Silly (maybe) question re impor (at least in part)
> > >> On 19 May 2023, at 07:44, Grizzy Adams via Python-list >> <python-list@python.org> wrote: >> >> Morning All >> >> I'm working through the tutorial and running / saving work that I wish to >> keep >> and build on, most times I can save and (re)import later with no difference >> to >> when typed in console or editor and run with F5 (which saves before it can >> run) >> >> But sometimes saved work (albeit small) when imported does not work any >> longer >> I assume I have missed something, any pointers to what/how/why please >reimport is not 100% reliable, in simple cases it will work, but as your >code gets more complex it can break. at the moment my code is very minimal, one saved piece is a nice one-liner that I kept because I wanted to remember syntax and how easy/elegant "some" things are in python, but if I import it it fails >I rarely use reimport. Usually just exit python and start again. I may have confused this I use import to get my saved work, the "re" was to shoe it had been saved by the editor >If you are working on scripts then just run them from the Terminal >will work well with any need to use reimport. -- https://mail.python.org/mailman/listinfo/python-list