954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Where's Nemo?

I read somewhere about somebody importing the sys.py module. I can't find the bugger on my system! I have python 2.5.1 installed on this Waxows XP machine. I did a search for sys.py in the c:\python25 folder and sys.py isn't there! Isn't it supposed to be installed by default? If not, how do I install it?

When I import sys from the command line, I get:

>>> import sys
>>>


Cheers

Zorbie
Newbie Poster
6 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 
>>> import sys
>>>

Hmm, it seems to work. What did you expect to happen? :)

mawe
Junior Poster
133 posts since Sep 2005
Reputation Points: 19
Solved Threads: 58
 

Hi,

Yes mawe you're right, I've tried it as well and it seems to be performing.

<ul><li><LI class=li1>>>> import sys</li>
<li>>>></li>
</ul>


"Sys.py" is definitely there without a doubt! What the mystery is, is why would someone want to import it?

I too found this same thing happening to me when I first started using Python and I was mystfied that something AMAZING:icon_eek: didn't happen when I first imported it, and wondered for a long time that maybe I was doing something wrong and that had I ruined Python:icon_cry:...but I know now for sure that his machine is working all right!:)

fredzik.

fredzik
Junior Poster in Training
55 posts since Feb 2007
Reputation Points: 10
Solved Threads: 5
 

Hi,

The "Message" box is going funny again. The code should have come out exactly as theirs did...so here it is again:

>>> import sys
>>>


Bye.:)

fredzik.

fredzik
Junior Poster in Training
55 posts since Feb 2007
Reputation Points: 10
Solved Threads: 5
 

Yes, I've come to realize that it's working, I was just looking for a module named sys.py. It must be part of some other module file, but I don't know which one; maybe os.py?

Zorbie
Newbie Poster
6 posts since May 2007
Reputation Points: 10
Solved Threads: 0
 

Not all modules are modulename.py files. Some of them are .pyc (Python bytecode) or .pyd (Python dll) )files. My best guess is that the module sys is written in C and is part of the Python24.dll/Python25.dll. If you run the Windows version of Python, this file is installed in the Windows\system32 folder.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

>>My best guess is that the module sys is written in C

It is written in C(according to phrase in Dive Into Python).

kath.

katharnakh
Posting Whiz in Training
237 posts since Jan 2006
Reputation Points: 19
Solved Threads: 34
 

sysmodule.h in C:\Python25\include

StrikerX11
Light Poster
27 posts since Jun 2007
Reputation Points: 10
Solved Threads: 7
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You