473,473 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

modules...n methods

lee
First of all thnx guys for ur cover on ma questions....Ok some more
then...whats the way to read the sourcecode of methods and built in
functions?

Jan 12 '07 #1
3 959
lee wrote:
whats the way to read the sourcecode of methods
Easy. Look up the .py file and open it in an editor of your choice.
Those files are, for example, in "/usr/lib/python".
and built in functions?
Get your python interpreter's source code and look up the functions
there.

Regards,
Björn

--
BOFH excuse #370:

Virus due to computers having unsafe sex.

Jan 12 '07 #2

On Jan 12, 2007, at 8:56 AM, Bjoern Schliessmann wrote:
lee wrote:
>whats the way to read the sourcecode of methods

Easy. Look up the .py file and open it in an editor of your choice.
Those files are, for example, in "/usr/lib/python".
>and built in functions?
This becomes a lot easier if you use IPython (which embellishes the
python shell in many useful ways). For instance, I did a "dir
(__builtins__)" to find out what some of the builtin functions were.
One was called "zip". Here's what I do in IPython to get help on that
function:

In [2]: zip??
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in function zip>
Namespace: Python builtin
Docstring [source file open failed]:
zip(seq1 [, seq2 [...]]) -[(seq1[0], seq2[0] ...), (...)]

Return a list of tuples, where each tuple contains the i-th element
from each of the argument sequences. The returned list is
truncated
in length to the length of the shortest argument sequence.

Note that IPython's prompt is (by default) different than pythons---
the "In[<some number>]:". Any identifier you have a question about
will produce summary info via "<identifier>?" and summary + source
via "<identifier>??".

HTH
--b
Jan 12 '07 #3
belinda thom wrote:
This becomes a lot easier if you use IPython (which embellishes
the python shell in many useful ways). For instance, I did a "dir
(__builtins__)" to find out what some of the builtin functions
were.
Sure.
HTH
I'm sorry, it doesn't help me.

And *please* don't send mail copies to me.

Regards,
Björn

--
BOFH excuse #14:

sounds like a Windows problem, try calling Microsoft support

Jan 13 '07 #4

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

Similar topics

7
by: Jorgen Grahn | last post by:
I have a set of tests in different modules: test_foo.py, test_bar.py and so on. All of these use the simplest possible internal layout: a number of classes containing test*() methods, and the good...
9
by: MLH | last post by:
I need a fundamental explanation of Class Modules - something suitable for newbies. Access 2.0 didn't seem to focus on them very much. Now that I'm using Access 97, it seems they're everywhere. thx...
4
by: deko | last post by:
This is a basic program flow question. I'm trying to refractor an AC2000 app and split sections of code into separate modules. But there are a number of collections I create in one big module -...
3
by: Chris B. | last post by:
I'm getting some strange results in an asp.net web application that has recently gone live. In the header of almost all the pages, the full name of the currently logged in user is displayed. On...
5
by: Erik Cruz | last post by:
Hello! I have read some threads discussing the fact that a module is in reality a shared class. If I try to create a Public Shared Class in vb.net I receive a compile error. Why? If I can't...
13
by: Robin Haswell | last post by:
Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break down in to lots of modules...
0
by: nandar | last post by:
Hi All, I am involved in migratinig one of the MS Access Project to ASP.Net and SQL Server 2000. My question here is that how Modules and Class Modules (MS Access) can be taken care in ASP.Net. To...
173
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are...
11
by: Tina I | last post by:
Hi list, Is there a preferred way to distribute programs that depends on third party modules like PyQt, Beautifulsoup etc? I have used setuptools and just having the setup script check for the...
3
Kelicula
by: Kelicula | last post by:
This is NOT a complete OO perl tutorial However I thought it could be beneficial to explain some of the basic concepts, and allow some users to simplify the software design process. I have...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.