.PY - File Extension for Python Script Files


What is PY? PY, short name for Python, is used as the file extension for Python Script files. .PY files are text files that can be opened by Notepad or any text editors. See the sample .PY file included below.

✍: FYIcenter.com


File Extension: .PY

MIME Type: application/x-pytho

File Content: Python Script

.PY files are Python Script files with Pathon programming statements. Here is a sample .PY Python Script file containing some simple Python script code logic:

prices = {'apple': 0.40, 'banana': 0.50}
my_purchase = {
    'apple': 1,
    'banana': 6}
grocery_bill = sum(prices[fruit] * my_purchase[fruit]
                   for fruit in my_purchase)
print 'I owe the grocer $%.2f' % grocery_bill

.PY Python Script file sample: Click sample.py to download.

Since .PY text files are in text format, you can use Notepad or any text editor to create or modify them. No special software is needed.

For for information on how to use .PY Python Script files, see links below:

2013-01-15, 7095👍, 0💬