一、歷史背景
1991年,荷蘭計算機程序員Guido van Rossum為了方便編寫腳本代碼和實現面向對象編程,創建了一種程序語言——Python。隨著Python在計算機領域的不斷普及和廣泛應用,Python的使用者不斷增多,因此需要一個開放源代碼的許可證來規範Python在商業和個人項目中的使用方式,於是Python開發團隊在1999年發布了Python License。
Python License是一個自由軟體許可證,它為Python語言提供了一種適合商業和非商業用途的寬鬆版權授權。
二、Python License簡介
Python License的主要特點是授權非常靈活,允許修改源代碼、在商業和非商業領域中使用、分發和銷售Python軟體包。
此外,Python License還規定了用戶需提供開源代碼和版權信息,如果採用了Python軟體包,必須在發布說明中註明。
Python License的基本版權條款如下:
Python Software Foundation License Version 2 -------------------------------------------- 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and the Individual or Organization ("Licensee") accessing and otherwise using Python 2.7.16 software in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 2.7.16 alone or in any derivative version, provided, however, that PSF's License Agreement and PSF's notice of copyright, i.e., "Copyright © 2001-2013 Python Software Foundation; All Rights Reserved" are retained in Python 2.7.16 alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 2.7.16 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 2.7.16. 4. PSF is making Python 2.7.16 available to Licensee on an "AS IS" basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.7.16 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 2.7.16 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.7.16, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using Python 2.7.16, Licensee agrees to be bound by the terms and conditions of this License Agreement.
三、Python License主要條款
1、授權
Python License授權給許可方一個非排他性、免費的、全球範圍內的使用權,包括使用、複製、分發、發行、展示、表演和派生。這意味著無論您是個人還是團體,不論您是開發商用還是個人項目,你都可以使用Python,包括修改它、創建依賴它的軟體。
2、版權信息
Python License規定,你必須保持版權的完整性,例如你不能刪除版權聲明、不得將其改變,不能在你的派生版本中使用與Python開發者發不同的版本號。
3、開源取證
Python License要求開發人員提供開源代碼並註明Python版權信息。如果你使用了Python包,你必須註明,即使你只是從源碼編譯,而沒有源碼中引用了代碼。這就是所謂的取證(notice),它告訴人們你已經使用了Python軟體包,告訴他們從哪裡可以下載到它以及它的使用條件。
4、豁免賠償
Python License開發者免責任說明了有關Python 2.7.16的責任豁免,包括任何使用和傳播的相關風險。
5、終止
如果你不遵守Python License的條款和條件,許可將自動終止,並由此導致的任何問題應由你自行承擔。
四、Python代碼示例
# Python 程序用於檢測用戶輸入的數字是否為質數 # 用戶輸入數字 num = int(input("請輸入一個數字: ")) # 質數大於 1 if num > 1: # 查看因子 for i in range(2,num): if (num % i) == 0: print(num,"不是質數") print(i,"乘於",num//i,"是",num) break else: print(num,"是質數") # 如果輸入的數字小於或等於 1,不是質數 else: print(num,"不是質數")
原創文章,作者:UOCCJ,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/373056.html