[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

translating Python to Assembler

over

1/22/2008 10:24:00 PM

My expertise, if any, is in assembler. I'm trying to understand Python
scripts and modules by examining them after they have been
disassembled in a Windows environment.

I'm wondering if a Python symbols file is available. In the Windows
environment, a symbol file normally has a PDB extension. It's a little
unfortunate that Python also uses PDB for its debugger. Google, for
whatever reason, wont accept queries with dots, hyphens, etc., in the
query line. For example a Google for "python.pdb" returns +python
+pdb, so I get a ridiculous number of returns referring to the python
debugger. I have mentioned this to Google several times, but I guess
logic isn't one of their strong points. :-)
54 Answers

John Machin

1/22/2008 10:52:00 PM

0

On Jan 23, 9:24 am, o...@thepond.com wrote:
> My expertise, if any, is in assembler. I'm trying to understand Python
> scripts and modules by examining them after they have been
> disassembled in a Windows environment.
>

DB "Wrong way. Go back. Read the tutorials."
RET

James Matthews

1/23/2008 12:32:00 AM

0

The reason you were finding a Python Debugger when looking for the PDB
files is because PDB is Python DeBugger! Also why would you be looking
for a PDB file if you can read the C source!

On Jan 22, 2008 11:55 PM, Wim Vander Schelden <wim@fixnum.org> wrote:
> Python modules and scripts are normally not even compiled, if they have
> been,
> its probably just the Python interpreter packaged with the scripts and
> resources.
>
> My advice is that if you want to learn Python, is that you just read a book
> about
> it or read only resources. Learning Python from assembler is kind of...
> strange.
>
> Not only are you skipping several generations of programming languages,
> spanned
> over a period of 40 years, but the approach to programming in Python is so
> fundamentally different from assembler programming that there is simply no
> reason
> to start looking at if from this perspective.
>
> I truly hope you enjoy the world of high end programming languages, but
> treat them
> as such. Looking at them in a low-level representation or for a low-level
> perspective
> doesn't bear much fruits.
>
> Kind regards,
>
> Wim
>
>
>
> On 1/22/08, over@thepond.com <over@thepond.com> wrote:
> > My expertise, if any, is in assembler. I'm trying to understand Python
> > scripts and modules by examining them after they have been
> > disassembled in a Windows environment.
> >
> > I'm wondering if a Python symbols file is available. In the Windows
> > environment, a symbol file normally has a PDB extension. It's a little
> > unfortunate that Python also uses PDB for its debugger. Google, for
> > whatever reason, wont accept queries with dots, hyphens, etc., in the
> > query line. For example a Google for "python.pdb" returns +python
> > +pdb, so I get a ridiculous number of returns referring to the python
> > debugger. I have mentioned this to Google several times, but I guess
> > logic isn't one of their strong points. :-)
> > --
> > http://mail.python.org/mailman/listinfo/p...
> >
>
>
> --
> http://mail.python.org/mailman/listinfo/p...
>



--
http://search.goldwatches.com/?Search=Mova...
http://www.jewelers...
http://www.goldw...

Luis Zarrabeitia

1/23/2008 1:29:00 AM

0


I second Wim's opinion. Learn python as a high level language, you won't regret it.

About google, I'll give you a little gtip:

> > For example a Google for "python.pdb" returns +python
> > +pdb, so I get a ridiculous number of returns referring to the python
> > debugger. I have mentioned this to Google several times, but I guess
> > logic isn't one of their strong points. :-)

Instead of searching 'python.pdb' try the query "filetype:pdb python", or even
"python pdb" (quoted). The first one whould give you files with pdb extension
and python in the name or contents, and the second one (quoted) should return
pages with both words together, except for commas, spaces, dots, slashs, etc.

However... one of the second query results is this thread in google groups...
not a good sign.

--
Luis Zarrabeitia
Facultad de Matemática y Computación, UH
http://profesores.matcom.uh...


Quoting Wim Vander Schelden <wim@fixnum.org>:

> Python modules and scripts are normally not even compiled, if they have
> been,
> its probably just the Python interpreter packaged with the scripts and
> resources.
>
> My advice is that if you want to learn Python, is that you just read a book
> about
> it or read only resources. Learning Python from assembler is kind of...
> strange.
>
> Not only are you skipping several generations of programming languages,
> spanned
> over a period of 40 years, but the approach to programming in Python is so
> fundamentally different from assembler programming that there is simply no
> reason
> to start looking at if from this perspective.
>
> I truly hope you enjoy the world of high end programming languages, but
> treat them
> as such. Looking at them in a low-level representation or for a low-level
> perspective
> doesn't bear much fruits.
>
> Kind regards,
>
> Wim
>
> On 1/22/08, over@thepond.com <over@thepond.com> wrote:
> >
> > My expertise, if any, is in assembler. I'm trying to understand Python
> > scripts and modules by examining them after they have been
> > disassembled in a Windows environment.
> >
> > I'm wondering if a Python symbols file is available. In the Windows
> > environment, a symbol file normally has a PDB extension. It's a little
> > unfortunate that Python also uses PDB for its debugger. Google, for
> > whatever reason, wont accept queries with dots, hyphens, etc., in the
> > query line. For example a Google for "python.pdb" returns +python
> > +pdb, so I get a ridiculous number of returns referring to the python
> > debugger. I have mentioned this to Google several times, but I guess
> > logic isn't one of their strong points. :-)
> > --
> > http://mail.python.org/mailman/listinfo/p...
> >
>

--
"Al mundo nuevo corresponde la Universidad nueva"
UNIVERSIDAD DE LA HABANA
280 aniversario

Grant Edwards

1/23/2008 4:58:00 AM

0

On 2008-01-22, over@thepond.com <over@thepond.com> wrote:

> My expertise, if any, is in assembler. I'm trying to
> understand Python scripts and modules by examining them after
> they have been disassembled in a Windows environment.

You can't dissassemble them, since they aren't ever converted
to assembler and assembled. Python is compiled into bytecode
for a virtual machine (either the Java VM or the Python VM or
the .NET VM).

> I'm wondering if a Python symbols file is available.

You're way off track.

> In the Windows environment, a symbol file normally has a PDB
> extension. It's a little unfortunate that Python also uses PDB
> for its debugger. Google, for whatever reason, wont accept
> queries with dots, hyphens, etc., in the query line. For
> example a Google for "python.pdb" returns +python +pdb, so I
> get a ridiculous number of returns referring to the python
> debugger. I have mentioned this to Google several times, but I
> guess logic isn't one of their strong points. :-)

Trying to find assembly language stuff to look at is futile.
Python doesn't get compiled into assembly language.

If you want to learn Python, then read a book on Python.

--
Grant Edwards grante Yow! I am NOT a nut....
at
visi.com

Steven D'Aprano

1/23/2008 5:51:00 AM

0

On Wed, 23 Jan 2008 04:58:02 +0000, Grant Edwards wrote:

> On 2008-01-22, over@thepond.com <over@thepond.com> wrote:
>
>> My expertise, if any, is in assembler. I'm trying to understand Python
>> scripts and modules by examining them after they have been disassembled
>> in a Windows environment.
>
> You can't dissassemble them, since they aren't ever converted to
> assembler and assembled. Python is compiled into bytecode for a virtual
> machine (either the Java VM or the Python VM or the .NET VM).


There is the Python disassembler, dis, which dissassembles the bytecode
into something which might as well be "assembler" *cough* for the virtual
machine.



--
Steven

Christian Heimes

1/23/2008 7:49:00 AM

0

Wim Vander Schelden wrote:
> Python modules and scripts are normally not even compiled, if they have
> been,
> its probably just the Python interpreter packaged with the scripts and
> resources.

No, that is not correct. Python code is compiled to Python byte code and
execute inside a virtual machine just like Java or C#. It's even
possible to write code with Python assembly and compile the Python
assembly into byte code.

You most certainly meant: Python code is not compiled into machine code.

Christian

Bjoern Schliessmann

1/23/2008 1:04:00 PM

0

Grant Edwards wrote:

> Trying to find assembly language stuff to look at is futile.
> Python doesn't get compiled into assembly language.

So, how do processors execute Python scripts? :)

> If you want to learn Python, then read a book on Python.

ACK.

Regards,


Björn

--
BOFH excuse #198:

Post-it Note Sludge leaked into the monitor.

Christian Heimes

1/23/2008 1:21:00 PM

0

Wim Vander Schelden wrote:
> I didn't know that python uses a VM, I thought it still used an
> interpretter! You
> learn something new everyday :)

still? I don't think Python ever used a different model. Most modern
languages are using an interpreted byte code approach:

http://en.wikipedia.org/wiki/Interpreted_language#Languages_usually_compiled_to_a_virtual_ma...

IMHO .NET/C# is missing from the list.

Christian

Tim Roberts

1/24/2008 8:02:00 AM

0

Bjoern Schliessmann <usenet-mail-0306.20.chr0n0ss@spamgourmet.com> wrote:

>Grant Edwards wrote:
>
>> Trying to find assembly language stuff to look at is futile.
>> Python doesn't get compiled into assembly language.
>
>So, how do processors execute Python scripts? :)

Is that a rhetorical question? Grant is quite correct; Python scripts (in
the canonical CPython) are NOT compiled into assembly language. Scripts
are compiled to an intermediate language. Processors execute Python
scripts when the interpreter, written in a high-level language and compiled
to assembly, interprets the intermediate language created by the Python
"compiler".
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Bjoern Schliessmann

1/24/2008 3:14:00 PM

0

Tim Roberts wrote:
> Bjoern Schliessmann <usenet-mail-0306.20.chr0n0ss@spamgourmet.com>

>> So, how do processors execute Python scripts? :)
>
> Is that a rhetorical question?

A little bit.

> Grant is quite correct; Python scripts (in the canonical CPython)
> are NOT compiled into assembly language. Scripts are compiled to
> an intermediate language. Processors execute Python scripts when
> the interpreter, written in a high-level language and compiled to
> assembly, interprets the intermediate language created by the
> Python "compiler".

So in the end, the program defined in the Python script _is_
compiled to the CPU's language. But never mind, it depends on how
you define "compile" in the end.

Regards,


Björn

--
BOFH excuse #225:

It's those computer people in X {city of world}. They keep stuffing
things up.