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\Test10.py", 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.
CrazyMonkey22
 
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
stranac
 
Posts: 1212
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:
viewtopic.php?f=25&t=3952
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1511
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 2 guests