上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 1 import socket # module 2 import threading 3 import time 4 5 """ 6 FUNCTIONS 7 create_connection(address, timeout=, source_address=None) 8 Connect to *address* and retu... 阅读全文
posted @ 2018-01-18 15:48 魂~ 阅读(3071) 评论(0) 推荐(0) 编辑
摘要: 1 import csv # Comma Separated Value 2 3 # class Dialect 4 # delimiter = None # 分隔符 5 # doublequote = None # 元素是引用符,双倍的引用符。默认是true,如果改为false就需要设置分隔符,否则报错。 6 # ... 阅读全文
posted @ 2018-01-17 16:36 魂~ 阅读(768) 评论(0) 推荐(0) 编辑
摘要: 1 import pickle 2 3 # 在python中如果我们有一些对象需要持久性存储,并且不丢失我们这个对象的类型与数据, 4 # 我们则需要将这些对象进行序列化,序列化后,需要使用的时候,我们在回复为原来的数据, 5 # 序列化的这种过程,我们将其称为pickle(腌制) 6 7 8 # 1、dumps(object) python对象 --> ... 阅读全文
posted @ 2018-01-17 14:38 魂~ 阅读(393) 评论(0) 推荐(1) 编辑
摘要: 1 import struct # a module 2 3 4 # Functions to convert between Python values and C structs. 5 # Python bytes objects are used to hold the data representing the C struct 6 # and also as form... 阅读全文
posted @ 2018-01-17 12:42 魂~ 阅读(505) 评论(0) 推荐(0) 编辑
摘要: 1 # http://www.runoob.com/python3/python3-multithreading.html 2 # https://docs.python.org/3/library/threading.html 3 # http://yoyzhou.github.io/blog/2013/02/28/python-threads-synchronization-lo... 阅读全文
posted @ 2018-01-17 11:16 魂~ 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 import queue 2 # queue - A multi-producer, multi-consumer queue. 3 # ['Empty', Exception raised by Queue.get(block=0)/get_nowait() 4 # 'Full', Exception raised by Queue.put(block=0)/put_nowait... 阅读全文
posted @ 2018-01-16 14:56 魂~ 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 1 import requests 2 import json 3 4 5 # 1、HTTP方法 6 requests.get('https://github.com/timeline.json') #GET请求 7 requests.post('http://httpbin.org/post') #POST请求 8 request... 阅读全文
posted @ 2018-01-16 11:52 魂~ 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 1 import json 2 3 # json.dumps 用于将 Python 对象编码成 JSON 字符串。 4 print(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])) 5 print(type(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]))) 6 7 # json.... 阅读全文
posted @ 2018-01-16 10:51 魂~ 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 void PrintNum1(int n); 4 void PrintNum2(int n); 5 void ShowNum(int n, void (* ptr)(int)); 6 7 void PrintMessage1(); 8 void PrintMessage2(); 9 void PrintMessage3... 阅读全文
posted @ 2018-01-15 17:09 魂~ 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 1 class LeiFeng(object): 2 3 def Sweep(self): 4 print("扫地") 5 6 def Wash(self): 7 print("洗衣") 8 9 def BuyRice(self): 10 print("买米") 11 12 13 class IF... 阅读全文
posted @ 2018-01-15 17:02 魂~ 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页