What Is the Win32 Extension for Python?

What Is the Win32 Extension for Python? thumbnail
The source code for interpreted language is hardware independent.

The same program running on computers with two different hardware architectures may look the same from the user's perspective, but the code the two machines are reading to execute the same program is very different. However, the same Python source code with the ".py" extension will run on both 32- and 64-bit Windows systems.

  1. File Extension

    • Different programs use varying data formats to read data from files. When the file uses the data formatting scheme the program expects, it will be able to load its contents properly. If not, it will be unable to process the file's contents. Source code files for different programming languages use this system as well to identify the language in which the file is written. Python uses the extension ".py" to identify files meant for the Python interpreter.

    Interpreter

    • Python is an interpreted language. This means that instead of a compiler converting source code into machine code, a program called an interpreter reads and translates a source code file into machine code as the program is running. Interpreters are operating system and architecture specific. This allows a Python developer to write a single source code file, which the different interpreters translate into the machine code for its operating system and architecture. For this reason, ".py" is the extension for both 32-bit and 64-bit architectures on any operating system.

    Executing Files

    • Anyone who installs the Python interpreter for his computer's operating system and architecture can execute a Python program from its source code. The user only needs to open his operating system's command line, then type "python filename.py" where "filename" is the name of the Python source code file. A file extension is just text in a file's name and doesn't affect its actual contents. This means that the interpreter will read and execute a Python source code file even if it lacks the ".py" extension.

    Caution

    • Executing a Python source file is just like executing any other program: If the file contains malicious code meant to compromise your system's security and steal your personal information, running the file will execute that code. To ensure their computer's security, users shouldn't run Python files whose contents they don't understand or that don't come from sources they trust.

Related Searches:

References

  • Photo Credit Comstock/Comstock/Getty Images

Comments

Related Ads

Featured