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'>
>>> 

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) Node-Red 程式 [{"id":"d8886...