Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using interpreter to lookup module 'sys' in Python

Tags:

python

So I just installed the python interpreter and wanted to use the help(sys) feature to get more information about the sys module, but I got this error and had no idea what went wrong.

C:\Users\Jake>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> help(sys)
'more' is not recognized as an internal or external command,
operable program or batch file.

>>>

Is this a matter of not having the source code for the sys module on my computer or something else entirely? Any help would be greatly appreciated.

like image 626
jez Avatar asked Oct 28 '11 03:10

jez


People also ask

What is the sys module in Python?

The sys module in Python provides various functions and variables that are used to manipulate different parts of the Python runtime environment. It allows operating on the interpreter as it provides access to the variables and functions that interact strongly with the interpreter.

How do I find a Python module?

We can also use the inspect module in python to locate a module. We will use inspect. getfile() method of inspecting module to get the path. This method will take the module's name as an argument and will return its path.

Where is sys module in Python?

It's in Python/Python/sysmodule.


2 Answers

Python uses the more program to show the help text. It's saying it can't find the more program. It should be at C:\Windows\System32\more.com. You need to have C:\Windows\System32 in your PATH environment variable.

like image 173
rob mayoff Avatar answered Oct 12 '22 10:10

rob mayoff


more is a program used to display text in the terminal. I believe it generally comes with Windows installations. Python is trying to use it to display the help text, but it seems that your computer doesn't have it, or your python interpreter isn't able to use it.

Here's a list of common Windows shell commands, including more.

like image 23
Matt Fenwick Avatar answered Oct 12 '22 11:10

Matt Fenwick