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

沒有留言:

張貼留言

RFID TI 培訓影片系列

RFID TI 培訓影片系列  https://www.ti.com/zh-tw/video/series/rfid.html 培訓影片系列 RFID 隨著創新技術日益發展,RFID 和 RF 術語越來越容易讓人混淆。本訓練系列詳細介紹了使用案例、權衡技術優缺點,讓您清楚知道該選...