製作模組 安裝模組壓縮包

2021-09-28 10:46:23 字數 4515 閱讀 4436

cp 12_publish_module/dist/* .

leon@leon-vostro-430:/usr/local/software/python$ ll

總用量 24

drwxrwxr-x 3 leon leon 4096 10月 9 11:35 ./

drwxrwxrwx 9 root root 4096 9月 26 09:03 ../

drwxrwxr-x 6 leon leon 4096 10月 9 11:29 12_publish_module/

-rw-rw-r-- 1 leon leon 4959 10月 9 11:24 12_publish_module.zip

-rw-rw-r-- 1 leon leon 803 10月 9 11:35 learn_message-1.0.tar.gz

leon@leon-vostro-430:/usr/local/software/python$

leon@leon-vostro-430:/usr/local/software/python$ tar zxvf learn_message-1.0.tar.gz

learn_message-1.0/

learn_message-1.0/setup.py

learn_message-1.0/learn_message/

learn_message-1.0/learn_message/receive_message.py

learn_message-1.0/learn_message/__init__.py

learn_message-1.0/learn_message/send_message.py

learn_message-1.0/pkg-info

leon@leon-vostro-430:/usr/local/software/python$

leon@leon-vostro-430:/usr/local/software/python$ ls -l

總用量 20

drwxrwxr-x 6 leon leon 4096 10月 9 11:29 12_publish_module

-rw-rw-r-- 1 leon leon 4959 10月 9 11:24 12_publish_module.zip

drwxrwxr-x 3 leon leon 4096 10月 9 11:29 learn_message-1.0

-rw-rw-r-- 1 leon leon 803 10月 9 11:35 learn_message-1.0.tar.gz

leon@leon-vostro-430:/usr/local/software/python$ cd learn_message-1.0/

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$ ll

總用量 20

drwxrwxr-x 3 leon leon 4096 10月 9 11:29 ./

drwxrwxr-x 4 leon leon 4096 10月 9 11:37 ../

drwxrwxr-x 2 leon leon 4096 10月 9 11:29 learn_message/

-rw-rw-r-- 1 leon leon 252 10月 9 11:29 pkg-info

-rw-rw-r-- 1 leon leon 493 10月 9 11:30 setup.py

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$ cat pkg-info

metadata-version: 1.0

name: learn_message

version: 1.0

summary: learn's 傳送和接收訊息模組

home-page: www.learn.com

author: leon

author-email: [email protected]

license: unknown

description: 完整的傳送和接收訊息模組

platform: unknown

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$ sudo python3 setup.py install

[sudo] password for leon:

running install

running build

running build_py

creating build

creating build/lib

creating build/lib/learn_message

copying learn_message/__init__.py -> build/lib/learn_message

copying learn_message/send_message.py -> build/lib/learn_message

copying learn_message/receive_message.py -> build/lib/learn_message

running install_lib

creating /usr/local/lib/python3.4/dist-packages/learn_message

copying build/lib/learn_message/receive_message.py -> /usr/local/lib/python3.4/dist-packages/learn_message

copying build/lib/learn_message/__init__.py -> /usr/local/lib/python3.4/dist-packages/learn_message

copying build/lib/learn_message/send_message.py -> /usr/local/lib/python3.4/dist-packages/learn_message

byte-compiling /usr/local/lib/python3.4/dist-packages/learn_message/receive_message.py to receive_message.cpython-34.pyc

byte-compiling /usr/local/lib/python3.4/dist-packages/learn_message/__init__.py to __init__.cpython-34.pyc

byte-compiling /usr/local/lib/python3.4/dist-packages/learn_message/send_message.py to send_message.cpython-34.pyc

running install_egg_info

writing /usr/local/lib/python3.4/dist-packages/learn_message-1.0.egg-info

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$ ls /usr/local/lib/python3.4/dist-packages/

easy_install.py learn_message-1.0.egg-info paho_mqtt-1.4.0.dist-info pip-19.0.3.dist-info __pycache__ setuptools-41.0.1.dist-info wheel-0.33.1.dist-info

learn_message paho pip pkg_resources setuptools wheel

leon@leon-vostro-430:/usr/local/software/python/learn_message-1.0$ python3

python 3.4.3 (default, nov 12 2018, 22:20:49)

[gcc 4.8.4] on linux

>>> import learn_message

>>> learn_message.send_message.send("hello")

正在傳送 hello...

>>> learn_message.receive_message.receive()

'這是來自 100xx 的簡訊'

>>>

Day19 zip,tar壓縮包模組

壓縮模快 zipfile 字尾為zip import zipfile 格式 with zipfile.zipfile file mode,zipfile.zip deflated 功能 建立乙個zip檔案,表示乙個zip物件 引數 file 表示壓縮包路徑,或類物件檔案 引數mode表示模式 預設為...

C 製作Zip壓縮包

壓縮包製作也是很多專案中需要用到的功能。比如有大量的檔案 假設有10000個 需要上傳,1個1個的上傳似乎不太靠譜 靠,那得傳到什麼時候啊?這時我們可以製作乙個壓縮包zip,直接傳這個檔案到伺服器端,然後在伺服器目錄解壓,釋放裡面的檔案。這裡我們選用icsharpcode.sharpziplib這個...

mysql壓縮包安裝

1 環境配置 2 修改ini檔案 mysqld basedir c program files mysql mysql server 5.6 mysql所在目錄 datadir c program files mysql mysql server 5.6 data mysql所在目錄 data 3 ...