-
auto
2019-08-31 09:40:20
python
1645°
20
一、简单实例:实现客户端向服务端发送的信息,服务器收到信息后加上当前时间再返回给客户端服务端实现:#!/usr/bin/python
import socket, traceback, time
host = ''
port = 8000
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SO
-
auto
2019-08-31 09:40:20
python
1908°
20
元祖1 元祖(tuple)定义初始化(1)python在元祖是用()来表示的 eg: t = ()type(t) 查看t的类型 (2)t = (1,2,3)&nb
-
auto
2019-08-31 09:40:20
python
1721°
20
importeasygui
easygui.msgbox("HELLOLMDTX!")#使用按钮得到输入
importeasygui
a=easygui.buttonbox("whatisyouneed:",choices=['a','b','
-
auto
2019-08-31 09:40:20
python
1696°
20
fromPILimportImageColor#pipinstallpillow#http://pillow-zh-cn.readthedocs.io/zh_CN/latest/installation.htmlImageColor.getcolor('red','RGB')(255,0,0)ImageColor.getcolor('red','RGBA')#A透明度,png图片(255,0,0,
-
auto
2019-08-31 09:40:20
python
1581°
20
我采用的是MySQLdb操作的MYSQL数据库。先来一个简单的例子吧:importMySQLdb
try:
conn=MySQLdb.connect(host='localhost',user='root',passwd='root',db='test',port=3306)
cur=con
-
auto
2019-08-31 09:40:20
python
1711°
20
python入门必备常识
-
auto
2019-08-30 09:29:51
python
2333°
20
kafka简介(摘自百度百科) 一、简介: 详见:...1、生产者: from kafka...
-
auto
2019-08-30 09:29:51
python
2263°
20
1. 点击打开链接 job伯乐在线 讲解的很好2. 菜鸟教程 3. 廖雪峰4. 量化课堂
-
auto
2019-08-30 09:29:51
python
2073°
20
# -*- coding: utf-8 -*- import urllib2 # http发送报文 def httpsend(url, bw): req = ...
-
auto
2019-08-30 09:29:51
python
1890°
20
导读:如果你想学Python,或者你刚开始学习Python,那么你可能会问:“我能用Python做什么?”这个问题不好...
-
auto
2019-08-30 09:29:51
python
2164°
20
Python struct模块 Python struct模块 用处struct模块中的函数格式化字符串 对齐方式格式符 code使用示例...
-
auto
2019-08-30 09:29:51
python
2210°
20
import time import decimal # text decimal_sum print("decimal:") start =time.time() sum = decimal....
-
auto
2019-08-30 09:29:51
python
2188°
20
对str类型数据进行split操作如下: >>> s = 'abc\ndef' >>> s.split('\n') ...
-
auto
2019-08-30 09:29:51
python
1992°
20
# _*_ encoding:utf-8 _*_ """ 最大堆 """ class MaxHeap(object): # def __init__(self): # self.data = ...
-
auto
2019-08-30 09:29:51
python
2114°
20
from websocket import create_connection ws = create_connection("ws://127.0.0.1:9002") ws.send(...
-
auto
2019-08-30 09:29:51
python
2151°
20
1.python的注释规范 python 分为 单行注释,多行注释以及特殊注释 ... 3、告诉LINUX/UNIX去找到python的翻译
-
auto
2019-08-30 08:40:35
python
1631°
20
可以用pip list 或者用help('modules')
-
auto
2019-08-30 08:40:35
python
2314°
20
以下程序 使用python实现 Voronoi图from PIL import Image import random import math def generate_...
-
auto
2019-08-30 08:40:35
python
1885°
20
针对数组的切片操作
-
auto
2019-08-30 08:40:35
python
1640°
20
>>> b = 3 - 5j >>> a (2+4j) >>> b (3-5j) >>> 对应的实部、虚部和共轭复数可以很容易的获取。就像下...