Python byte code
Results 1 to 5 of 5

Thread: Python byte code

Hybrid View

  1. #1
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296

    Python byte code

    So I was doing some lite reading before bed last night and a confusion arose:

    Internally, and almost completely hidden from you, when you execute a program, Python first compiles your source code into a format known as byte code. Compilation is simply a translation step, and byte code is a lower-level, platform independent representation of your source code ....
    By saying the byte code is 'platform-independent' is this saying that the code can now be run interpreter-free??

    Put another way: Is the interpreter's function to translate from source code to byte code (this is all about Python language, of course) and then its done until the next new batch of code is run, its all up to the PVM after that?
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

  2. #2
    Senior Member
    Join Date
    Jul 2002
    Posts
    744
    yes.
    Every now and then, one of you won't annoy me.

  3. #3
    Senior Member IcSilk's Avatar
    Join Date
    Aug 2001
    Posts
    296
    So just to confirm .. a .py file needs the interpreter and the .pyc file does not need the interpreter but is run through the PVM. The PVM is part of the python IDLE? or is integrated within the OS? or both?

    I think the answer is both, that it is installed within the OS along with the Python IDLE package. Yes?
    "In most gardens they make the beds too soft - so that the flowers are always asleep" - Tiger Lily

  4. #4
    Senior Member
    Join Date
    Jul 2002
    Posts
    744
    ^

    Again, I would say, "yes.". The Virtual Machine is going to be Python version specific, likewise Python package organization is going to be OS dependent.
    Every now and then, one of you won't annoy me.

  5. #5
    Banned
    Join Date
    Jul 2011
    Posts
    24
    the following command can be used to get the disassembly of myfunc():
    dis.dis(myfunc)
    2 0 LOAD_GLOBAL 0 (len)
    3 LOAD_FAST 0 (alist)
    6 CALL_FUNCTION 1
    9 RETURN_VALUE

Similar Threads

  1. Developing a Port Scanner in Python
    By HTRegz in forum The Security Tutorials Forum
    Replies: 12
    Last Post: January 28th, 2006, 08:02 PM
  2. Network Security made easy?
    By Tiger Shark in forum Microsoft Security Discussions
    Replies: 5
    Last Post: January 14th, 2005, 08:47 PM
  3. C++ portability guide
    By tampabay420 in forum Programming Security
    Replies: 2
    Last Post: February 14th, 2003, 02:36 PM
  4. Black Wolf's Guide to Memory Resident Viruses.
    By ahmedmamuda in forum AntiVirus Discussions
    Replies: 2
    Last Post: March 20th, 2002, 02:03 AM
  5. The Worlds Longest Thread!
    By Noble Hamlet in forum AntiOnline's General Chit Chat
    Replies: 1100
    Last Post: March 17th, 2002, 09:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •