攝影或3C

Python: import socket ; socket.socket() ; socket.connect() ; socket.send()

import socket
import time
#import numpy as np
HOST = ‘192.168.2.11’
ctrl_socket = 0
data_socket = 0
ctrl_port = 8000
data_port = 8001

ctrl_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
data_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# family: 串接的類型可分為 IPv4本機、IPv4網路、IPv6網路,type: 串接可分為TCP/UDP
# ctrl_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# data_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

ctrl_socket.connect((HOST, ctrl_port))
# 用於客戶端指定要串接的IP位址跟Port號
time.sleep(0.2)
data_socket.connect((HOST, data_port))
print(data_socket)
print(ctrl_socket)
data_socket.send(b’Config’)

 

Jupyter:

 

推薦hahow線上學習python: https://igrape.net/30afN

儲蓄保險王

儲蓄險是板主最喜愛的儲蓄工具,最喜愛的投資理財工具則是ETF,最喜愛的省錢工具則是信用卡