Results 1 to 5 of 5

Thread: Difference between .p and .py

  1. #1
    Registered User
    Join Date
    Oct 2014
    Location
    UK
    Posts
    571

    Difference between .p and .py

    Hi All

    Could someone tell me what the different between the .p and .py format is for a Python script.
    I am guessing that .p is a compiled version of .py, but I am probably wrong.

    If I am right, could someone point me in the right direction of how I compile a Python scrip into a .p format?

    Thanks

  2. #2
    Super Member spherical's Avatar
    Join Date
    Dec 2004
    Location
    San Juan Island
    Posts
    4,686
    .pyc files are pre-compiled. Python compiles .py files on the fly. This shortens the startup time, because the file is compiled into bytecode first, but does not change how fast the code runs.
    Blown Glass · Carbon Fiber + Imagination

    Spherical Magic | We Build Cool Stuff!

    "When a man loves cats, I am his friend and comrade, without further introduction." - Mark Twain

  3. #3
    .p files are compiled C plugins. Not python scripts.

    To compile your LW python script you need to do it through Layout or Modeler, depending on what environment your script is for.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  4. #4
    In almost all cases, compiled python scripts (.PYC) run exactly the same as uncompiled python scripts (.PY). The only major difference is that you can open uncompiled scripts in a text editor and edit the script.

    The only reason to ever compile your code is if you want to provide users with a plugin, but not reveal the source code you put together. Understand though that python scripts can be de-compiled using tools available online... so you would want to limit who can get their hands on the actual plugin file to reduce the chances of piracy.
    Professional-level 3d training: Ryan's Lightwave Learning
    Plugin Developer: RR Tools for Lightwave

  5. #5
    Registered User
    Join Date
    Oct 2014
    Location
    UK
    Posts
    571
    Thanks guys

Bookmarks

Posting Permissions

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