python3包
Ⅰ python3,包和模塊的關系,包到底是個啥,最好截個圖給我看看
那麼箭頭指向的http文件夾就是一個包。
但是注意。包裡面回必須包含一個__init__.py (這個模塊裡面可答以不寫內容)
如果沒有這個文件,那麼就不是包了。。包下面放的client.py就是模塊
Ⅱ 現在三方包支持最好的python3是哪個版本
3.4
基本都是支持3.3+的,對3.2很多不支持了。
對於3.5,由於在windows上採用了vs2015編譯,運行時庫變化太大,mingw無法編譯對應的二進制擴展。所以很多二進制包對3.5支持比較差。
還有一個原因,3.4是最後一個支持WinXP的官方python3版本。
python35 變化較大,引入的很多新特性很多IDE並不支持
因此,由於Python的跨平台特性,因此兼容性最好的還是python3.4。Debian Jessie默認的Python 3就是這個版本。
Ⅲ python3進行數據分析需要安裝哪些包
numpy
pandas
Ⅳ 在python3中怎麼安裝其他包
你所問的問題,其實是屬於:
1.先參考
【教程】Python中的內置的模塊 和第三方的模塊
搞懂PIL是屬於第三方Python模塊
2.再參考:
【待完善】【總結】Python安裝第三方的庫、package的方法
去安裝PIL模塊。
3.關於PIL的一些使用,可以參考:
【已解決】Python中通過Image的open之後,去show結果打不開bmp圖片,無法正常顯示圖片
再針對PIL來說就是:
1. 這里不給貼地址,所以只能靠你自己用google搜:
python pil
第一個就是:
Python Imaging Library (PIL)
點擊進去後,找到自己python版本的PIL,比如:
Python Imaging Library 1.1.7 for Python 2.7 (Windows only)
下載,雙擊,安裝,即可。
2. 如果下載到的是PIL源碼,
則打開cmd,切換到其目錄
然後執行
setup.py install
就可以通過源碼方式安裝了。
這些方法,上面帖子其實都有總結的。
(此處不給貼地址,請自己用google搜帖子標題,就可以找到帖子地址了)
Ⅳ python3.2 下的抓包庫。。無論是pypcap還是scapy。貌似都沒有py3的版本。。跪求一個可以python3用
有一個py3kcap是pycap的封裝版本,可以用於python3版本。
給你一個使用的示例代碼:
#!/usr/bin/env python3.2
import ctypes,sys
from ctypes.util import find_library
#pcap = ctypes.cdll.LoadLibrary("libpcap.so")
pcap = None
if(find_library("libpcap") == None):
print("We are here!")
pcap = ctypes.cdll.LoadLibrary("libpcap.so")
else:
pcap = ctypes.cdll.LoadLibrary(find_library("libpcap"))
# required so we can access bpf_program->bf_insns
"""
struct bpf_program {
u_int bf_len;
struct bpf_insn *bf_insns;}
"""
class bpf_program(ctypes.Structure):
_fields_ = [("bf_len", ctypes.c_int),("bf_insns", ctypes.c_void_p)]
class sockaddr(ctypes.Structure):
_fields_=[("sa_family",ctypes.c_uint16),("sa_data",ctypes.c_char*14)]
class pcap_pkthdr(ctypes.Structure):
_fields_ = [("tv_sec", ctypes.c_long), ("tv_usec", ctypes.c_long), ("caplen", ctypes.c_uint), ("len", ctypes.c_uint)]
pkthdr = pcap_pkthdr()
program = bpf_program()
# prepare args
snaplen = ctypes.c_int(1500)
#buf = ctypes.c_char_p(filter)
optimize = ctypes.c_int(1)
mask = ctypes.c_uint()
net = ctypes.c_uint()
to_ms = ctypes.c_int(100000)
promisc = ctypes.c_int(1)
filter = bytes(str("port 80"), 'ascii')
buf = ctypes.c_char_p(filter)
errbuf = ctypes.create_string_buffer(256)
pcap_close = pcap.pcap_close
pcap_lookupdev = pcap.pcap_lookupdev
pcap_lookupdev.restype = ctypes.c_char_p
#pcap_lookupnet(dev, &net, &mask, errbuf)
pcap_lookupnet = pcap.pcap_lookupnet
#pcap_t *pcap_open_live(const char *device, int snaplen,int promisc, int to_ms,
#char *errbuf
pcap_open_live = pcap.pcap_open_live
#int pcap_compile(pcap_t *p, struct bpf_program *fp,const char *str, int optimize,
#bpf_u_int32 netmask)
pcap_compile = pcap.pcap_compile
#int pcap_setfilter(pcap_t *p, struct bpf_program *fp);
pcap_setfilter = pcap.pcap_setfilter
#const u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h);
pcap_next = pcap.pcap_next
# int pcap_compile_nopcap(int snaplen, int linktype, struct bpf_program *program,
# const char *buf, int optimize, bpf_u_int32 mask);
pcap_geterr = pcap.pcap_geterr
pcap_geterr.restype = ctypes.c_char_p
#check for default lookup device
dev = pcap_lookupdev(errbuf)
#override it for now ..
dev = bytes(str("wlan0"), 'ascii')
if(dev):
print("{0} is the default interface".format(dev))
else:
print("Was not able to find default interface")
if(pcap_lookupnet(dev,ctypes.byref(net),ctypes.byref(mask),errbuf) == -1):
print("Error could not get netmask for device {0}".format(errbuf))
sys.exit(0)
else:
print("Got Required netmask")
handle = pcap_open_live(dev,snaplen,promisc,to_ms,errbuf)
if(handle is False):
print("Error unable to open session : {0}".format(errbuf.value))
sys.exit(0)
else:
print("Pcap open live worked!")
if(pcap_compile(handle,ctypes.byref(program),buf,optimize,mask) == -1):
# this requires we call pcap_geterr() to get the error
err = pcap_geterr(handle)
print("Error could not compile bpf filter because {0}".format(err))
else:
print("Filter Compiled!")
if(pcap_setfilter(handle,ctypes.byref(program)) == -1):
print("Error couldn't install filter {0}".format(errbuf.value))
sys.exit(0)
else:
print("Filter installed!")
if(pcap_next(handle,ctypes.byref(pkthdr)) == -1):
err = pcap_geterr(handle)
print("ERROR pcap_next: {0}".format(err))
print("Got {0} bytes of data".format(pkthdr.len))
pcap_close(handle)
Ⅵ 關於python3包的安裝問題
如圖,勾選這個選項,就是安裝在本地,而不是一個項目
Ⅶ 在java中用python3.7的jar包
用jython就可以實現
Ⅷ python3parser在什麼包
pdb 調試復
traceback 調試
pprint 漂亮的輸出
logging 日誌
threading和制multiprocessing 多線程
urllib/urllib2/httplib http庫,httplib底層一點,推薦第三方的庫requests
os/sys 系統,環境相關
Queue 隊列
pickle/cPickle 序列化工具
hashlib md5, sha等hash演算法
cvs
Ⅸ python3.3不自帶的模塊或工具包 下載以後要怎麼處理才能在開發環境中調用 (比如放到pyth
之前需要先安裝sip,解壓到site-packages即可
然後安裝pyqt4,用安裝包點next就OK
主要需要確定Python的版本,有3.4和2.6分別對應64和32位的不同版本。
如果下載的是源代碼包,安裝就復雜些,sip和pyqt4都需要按照
configure.py
make
make install
的步驟安裝,這個需要有C語言支持
Ⅹ python3.6.5人工智慧方面所需要的包
這個沒有上限的,python的擴展包上萬至少,只能說你現在需要哪些方面,需要實現那些功能的模塊