Reload on python version 3.5

A forum for general discussion of the Python programming language.

Reload on python version 3.5

Postby CrazyMonkey22 » Fri Apr 11, 2014 11:28 am

Has the reload function been changed between version 2.7 and 3.5? I am very new to python so am still quite unsure about what to do, but I couldn't get the reload function to work on 3.5 but seems to work on 2.7.

When I run my code.

Code: Select all
import test
reload (test)
import test

in 3.5 it gives me this error.

Code: Select all
Traceback (most recent call last):
  File "C:\Users\Documents\python\", line 2, in <module>
    reload (test)
NameError: name 'reload' is not defined

If anyone can tell me whether this is because the reload command has been changed, or I'm doing something wrong that would be much appreciated.
Last edited by stranac on Fri Apr 11, 2014 11:39 am, edited 1 time in total.
Reason: Added code tags. Locked.
Posts: 1
Joined: Fri Apr 11, 2014 11:08 am

Re: Reload on python version 3.5

Postby stranac » Fri Apr 11, 2014 11:41 am

Read this to learn how to post code properly: viewtopic.php?t=145

reload has been moved to the imp module in python 3.
Note: reload is not very useful
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
Posts: 1790
Joined: Thu Feb 07, 2013 3:42 pm

Re: Reload on python version 3.5

Postby metulburr » Fri Apr 11, 2014 12:03 pm

scroll down to reload:
we will be moving to on October 1 2016
more details here
User avatar
Posts: 2244
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 6 guests