2018年1月11日 星期四

Python: Find the location of Python module sources

Python: Find the location of Python module sources

Python Basic: Exercise-146 with Solution

Write a Python program to find the location of Python module sources.
Sample Solution :-
import sys
print("\nList of directories in sys module:")
print(sys.path)
print("\nList of directories in os module:")
import os
print(os.path)

============ RESTART: F:/Python_APSC/py-ex-basic-146.py ===========

List of directories in sys module:
['F:/Python_APSC', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\Lib\\idlelib', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\python35.zip', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\DLLs', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\lib', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32', 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\site-packages']

List of directories in os module:
<module 'ntpath' from 'C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python35-32\\lib\\ntpath.py'>
>>> 

沒有留言:

張貼留言

113 學年度第 1 學期 RFID應用課程 Arduino程式

113 學年度第 1 學期 RFID應用課程 Arduino程式 https://www.mediafire.com/file/zr0h0p3iosq12jw/MFRC522+(2).7z/file 內含修改過後的 MFRC522 程式庫 (原程式有錯誤) //定義MFRC522...