473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problem with reload(sys) (doing reload on the sys module)

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

************************************************** **************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
************************************************** **************

IDLE 1.1.2
import sys
sys.modules.keys() ['tkFileDialog', 'random', 'struct', 'tempfile', 'idlelib.cPickle',
'imp', 'collections', 'zipimport', 'string', 'SocketServer', 'repr',
'idlelib.string', 'idlelib.bdb', 'itertools', 'idlelib.SocketServer',
'ConfigParser', 'signal', 'idlelib.IOBinding', 'threading',
'tkMessageBox', 'idlelib.warnings', 'idlelib.struct',
'idlelib.cStringIO', 'cStringIO', 'locale', 'idlelib.threading',
'idlelib.TreeWidget', 'idlelib.rpc', 'atexit', 'idlelib.re',
'encodings', 'idlelib.RemoteDebugger', 'idlelib.tempfile',
'idlelib.codecs', '_tkinter', 'bdb', 're',
'idlelib.RemoteObjectBrowser', 'ntpath', 'idlelib.imp',
'idlelib.locale', 'idlelib.thread', 'math', 'idlelib.Debugger',
'Tkinter', 'idlelib.traceback', 'idlelib.marshal', 'UserDict', 'Queue',
'idlelib.StackViewer', 'codecs', 'idlelib.copy_reg', '_locale',
'socket', 'thread', 'sre', 'idlelib.time', 'traceback',
'idlelib.socket', 'idlelib.CallTipWindow', 'os', 'marshal',
'idlelib.tkFileDialog', '_sre', '__builtin__', 'select', 'idlelib.os',
'idlelib.ZoomHeight', 'idlelib.ConfigParser', 'errno', '_socket',
'binascii', 'sre_constants', 'types', 'idlelib.__builtin__',
'idlelib.tkMessageBox', 'cPickle', '_codecs', 'encodings.cp1252',
'idlelib.repr', 'idlelib.Queue', 'idlelib.__main__', 'idlelib.sys',
'encodings.aliases', 'exceptions', 'sre_parse', 'FixTk', 'copy_reg',
'sre_compile', '_random', 'site', 'SimpleDialog', '__main__',
'idlelib.types', 'tkCommonDialog', 'strop', 'encodings.codecs',
'encodings.exceptions', 'nt', 'idlelib.linecache', 'stat', '_ssl',
'warnings', 'encodings.types', 'sys', 'idlelib.Tkinter',
'idlelib.CallTips', 'idlelib.configHandler', 'idlelib.WindowList',
'idlelib.SimpleDialog', 'os.path', 'idlelib.ScrolledList',
'idlelib.ObjectBrowser', 'idlelib', 'Tkconstants', 'linecache', 'time',
'idlelib.select', 'idlelib.run'] reload(sys)
sys.modules.keys()
dir()
print 'hello world'
print 'hi nerds'
print 'it just stops here nothing works again'
print 'is this a bug or a feature'
print 'can some one help'
2 + 4
print 'but when i restart'
print 'everything returns'
import string
string.lowercase
string.lowercase()
print 'let me see if an exception can be thrown'
import nigeria
import lagos
no exception SyntaxError: invalid syntax print 'still checks for syntax'
print 'it checks syntax after the second token has been entered'
abracadabra
not SyntaxError: invalid syntax print
is SyntaxError: invalid syntax print 'syntax check is still working for reserved words'
you
can
check
the
rest f for SyntaxError: invalid syntax your
self
print 'i think this IDLE session is self explanatory'

This is not part of the above IDLE session
please mail me if you have any idea what this means.

og*******@yahoo.com

May 3 '06 #1
2 2803
Looks like a bug (probably in IDLE): when I start IDLE from the command
line, it pops up its interaction window and here is what it says about
stdout:

IDLE 1.1.2
import sys
sys.stdout <idlelib.rpc.RPCProxy instance at 0xb76a490c>

Then I try the reload and I get no output in the interaction
window:
reload(sys)
sys.stdout


After the reload, stdout has been changed to the terminal from which
IDLE got started, so I see the messages there:

<module 'sys' (built-in)>
<open file '<stdout>', mode 'w' at 0xb7b67068>

As you can see, stdout has been redefined (back to the way it would be if
you started Python from the command line, with no IDLE involved).
--
nick (nicholas dot dokos at hp dot com)
May 4 '06 #2
hi nick,

have you found any solutions to this problem.
maybe sys module does not need to be reloaded.
may Tim peters and the rest can help us on this

May 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bugs | last post by:
Hi Everyone. This problem is driving me crazy. Im using Access2003. Basically what I wish to do is create a new record for each jpg bmp or gif file in the current directory. I need to...
21
by: tyler_durden | last post by:
hi there peeps... like I say in the topic, I need to do an e-mail program in C language, and has to be made until the 3th of january..the problem is I'm having some problems with it. I was...
2
by: | last post by:
We just learned that a variable declared Friend within a module can be shared across multiple user sessions. Is there any way to declare a Friend variable within a module, so that it is...
2
by: Olav Tollefsen | last post by:
I have a Web Form with a DataList. Inside the ItemTemplate, I have a DropDownList control. <asp:DataList ID="ProductDataList" Runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1"...
3
by: Franco Perilli | last post by:
I've compiled this code and no problems, but when I run the program, it prints only the last entry i've inserted. Looks like a problem in the sorted insertion algorithm. Can u help me plz? ...
0
by: tete | last post by:
Hi there, i have a website developed with .NET 2.0 that worked very fine until i did last windows update a week ago. The problem is that when i click in a button it does not postback and i...
0
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vS2005 and .net 2.0. for a Windows application. I'm implementing a Drag and Drop between 2 DataGridView controls. It's working fine with just one item being drag and drop. I want...
11
by: =?iso-8859-9?q?S=F6nmez_Kartal?= | last post by:
Hello, I've had an encoding issue and solved it by "sys.setdefaultencoding('utf-8')"... My first try wasn't successful since setdefaultencoding is not named when I imported sys module. After,...
2
by: Danny Shevitz | last post by:
Howdy, In my app I need to exec user text that defines a function. I want this function to unpickle an object. Pickle breaks because it is looking for the object definition that isn't in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.