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_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...