import and reload problem python
I learned the basics of Python with other resources and then decided to read Mark Lutz's book. At the second task I was asked to import file with simple code by example: » from imp import reload » reload(script1) *some code* » And yes, I know that there's importlib instead of imp (they didn't change it to 5th edition). I actually tried to write this in different combinations but still nothing. When I do as it probably should be it goes: »from importlib import reload »reload(script1) Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> reload(script1) NameError: name 'script1' is not defined I've read that it can have to do something with where the file is saved but I did it with different files even in a folder where Python IDLE and other stuff are downloaded. There's no problem with code itself. I most likely don't see the answer under my nose so I would like to ask you to help me