Couple quick questions from a Python Noob

Discussion in 'Python' started by digitalsubjunctive@gmail.com, Jul 21, 2005.

  1. Guest

    Hey, I just started on Python and have a few questions I couldn't find
    answers to on the Python site or it's tutorial.

    1. I notice a few "compiled python" files (indicated by reddish snake
    icons), I thought Python didn't need to be compiled? This is my first
    venture into programming, but if it doesn't need to be compiled why
    compile it?

    2. What is a .pwy file?

    3. I want to save my first few programs as .exe files so I can show
    them off to all my leet friends. Okay, so the only program I've made
    takes your birthday and tells you what you're astrological sign is, but
    I'm in rural Nebraska and we don't have all that much to do :)

    Thanks for any help you guys!
     
    , Jul 21, 2005
    #1
    1. Advertising

  2. wrote:

    > Hey, I just started on Python and have a few questions I couldn't find
    > answers to on the Python site or it's tutorial.
    >
    > 1. I notice a few "compiled python" files (indicated by reddish snake
    > icons), I thought Python didn't need to be compiled? This is my first
    > venture into programming, but if it doesn't need to be compiled why
    > compile it?


    Just like Java, the Python interpreter runs python byte-code. The Python
    compiler compile Python source code into Python byte-code. Now the
    difference with Java is that you don't have to manually call the
    compiler - the interpreter will do it for you if and when needed.

    If you don't know what 'byte-code' is, it's just like a machine language
    (op-codes and the like) for a processor that doesn't exists - in fact
    this 'processor' is the interpreter (or 'Virtual Machine') itself.

    The main purpose is to have something that execute faster than purely
    interpreted languages (since parsing is already done), and is still
    portable between platforms (which is not that much important with
    Python, since we usually distribute the source files...).

    > 2. What is a .pwy file?


    (isn't that .pyw ?)
    It's a Windows-only stuff that avoid the DOS shell window to be opened
    when executing the script.

    > 3. I want to save my first few programs as .exe files so I can show
    > them off to all my leet friends.


    '.exe' files are Windows-specific. Python doesn't handle this out of the
    box. But there are programs like py2exe (and others, don't remember
    their name) that 'freeze' your script, the interpreter and all needed
    librairies in a .exe.

    HTH
    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    bruno modulix, Jul 21, 2005
    #2
    1. Advertising

  3. stringy Guest

    stringy, Jul 21, 2005
    #3
  4. Guest

    Thanks you to.

    Oh, and it is .pyw, you're right.
     
    , Jul 22, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne  Wengert

    A Couple of Questions

    Wayne Wengert, Jan 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    328
    =?Utf-8?B?aSBkb250IGtub3cgbXVjaCBhYm91dCB2cy4uLmI=
    Jan 22, 2004
  2. Ali Syed
    Replies:
    3
    Views:
    572
    Mark McIntyre
    Oct 13, 2004
  3. Kyle T. Jones
    Replies:
    7
    Views:
    336
    Carl Banks
    Apr 30, 2009
  4. Matt Roth

    quick noob questino: GUIs

    Matt Roth, Sep 25, 2005, in forum: Ruby
    Replies:
    1
    Views:
    83
    wannes
    Sep 25, 2005
  5. Joshua Haberman

    couple quick questions about YARV

    Joshua Haberman, Feb 12, 2006, in forum: Ruby
    Replies:
    5
    Views:
    159
    gabriele renzi
    Feb 19, 2006
Loading...

Share This Page