473,396 Members | 1,895 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,396 software developers and data experts.

How does python work

I'm asking myself how Python code get's executed ...
What happens first etc ...
First read the file and then ..
How python handle's variable internally ...
also could someone point me to the build in functions in the python source
code ?
Jul 18 '05 #1
3 6549
On Thu, 10 Jul 2003 13:05:07 +0200,
Geiregat Jonas <en***@sdf-eu.org> wrote:
I'm asking myself how Python code get's executed ...
What happens first etc ...
First read the file and then ..
The code is parsed and compiled into bytecode that can then be executed.
Consult a textbook on parsing or programming language implementation for
more details about how parsing is done.

I thought someone (MWH?) wrote an explanation of Python's internals once,
but can't find anything at the moment. The Python docs have some relevant
material (http://www.python.org/doc/current/ext/ext.html), but that document
doesn't concentrate on the implementation details, just on the bits you can
easily access from extensions.
also could someone point me to the build in functions in the python source
code ?


They're in Python/bltinmodule.c.

--amk
OTHELLO: Once more, well met at Cyprus!
-- _Othello_, II, i

Jul 18 '05 #2
"Geiregat Jonas" <en***@sdf-eu.org> wrote in message news:<pa****************************@sdf-eu.org>...
I'm asking myself how Python code get's executed ...
What happens first etc ...
First read the file and then ..
How python handle's variable internally ...
also could someone point me to the build in functions in the python source
code ?


The Python Library Reference has a section on "Built-in Functions,
Types, and Exceptions" at
<http://www.python.org/doc/current/lib/builtin.html>. There is also a
section documenting some rather low level internal modules at
<http://www.python.org/doc/current/lib/language.html>, such as parser,
which lets you access the parse tree, and dis, a disassembler for
python bytecode.

-Peter
Jul 18 '05 #3
"A.M. Kuchling" <am*@amk.ca> writes:
On Thu, 10 Jul 2003 13:05:07 +0200,
Geiregat Jonas <en***@sdf-eu.org> wrote:
I'm asking myself how Python code get's executed ...
What happens first etc ...
First read the file and then ..


The code is parsed and compiled into bytecode that can then be executed.
Consult a textbook on parsing or programming language implementation for
more details about how parsing is done.

I thought someone (MWH?) wrote an explanation of Python's internals once,
but can't find anything at the moment.


I've threatened to do it, but not actually done it.

If you can read C, these things aren't that hard to figure out (though
tags or cscope certainly help...).

Cheers,
M.

--
You owe the Oracle a star-spangled dunce cap.
-- Internet Oracularity Internet Oracularity #1299-08
Jul 18 '05 #4

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

Similar topics

2
by: Chris Hodapp | last post by:
I have seen messages posted about this before, and there is a clear reference to it in the manual, but I have been unable to find a solution. I'm on Slackware 9.1, kernel 2.6.0-test11, using...
12
by: Helmut Jarausch | last post by:
Hi, what does Python do if two objects aren't comparable (to my opinion) If I've understood "Python in a Nutschell" correctly it should raise an exception but it doesn't do for me. Here are...
8
by: Will | last post by:
I just discovered Python and looked briefly at one of the tutorials for beginners... It looks a lot like the old Command line Basic... I'm sure it does much more but... 1 - Can you create...
30
by: Christian Seberino | last post by:
How does Ruby compare to Python?? How good is DESIGN of Ruby compared to Python? Python's design is godly. I'm wondering if Ruby's is godly too. I've heard it has solid OOP design but then...
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
2
by: Martin Kulas | last post by:
Hallo! I have a problem with Py_BuildValue: I want to convert an unsigned int to a PyObject *. http://docs.python.org/api/arg-parsing.html says that I can use "I" as a format string. But it...
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
3
by: walterbyrd | last post by:
My guess is that it would, but I can find no mention of python in the intuit developers site. I can find some references to PHP and Perl, but no Python. I looks to me like Intuit develops have...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.