Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Compiling the code.

LobomoonLobomoon Posts: 7Member
I'm new to Python and I heard you can complile a code you written. What exactly do I need to type to compile a file named test.py? What are the benefits of keeping your code in compiled state?

Comments

  • infidelinfidel Posts: 2,900Member
    : I'm new to Python and I heard you can complile a code you written. What exactly do I need to type to compile a file named test.py? What are the benefits of keeping your code in compiled state?

    It's kind of like compiling Java into bytecode. You can compile your Python scripts into Python's bytecode. The idea is that the interpreter has one less step to perform when importing such a module. You don't HAVE to do it, though, Python will leave .pyc files it creates around for next time while it's running a program. I am pretty sure this is performed using a special command line option, but I've never bothered to look for it.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.