随笔分类 - Python
摘要:在Python的世界中,万物皆为对象,包括常量(numbers、strings、tuples···),也包括自定义的(lists、dict、functions···),这些对象犹如群星存在于茫茫宇宙中,但仅当我们为其赋予一个代号时(比如s='star wars'),才能够利用这个对象 而这些对象又分为可更改(mutable)与不可更改(immutable)对象 不可更改对象包括:numb...
阅读全文
摘要:https://www.jianshu.com/p/814d65a9c404
阅读全文
摘要:import matplotlib.image as img import os from shutil import copyfile path = 'D:\_Data\GTC_t1' savePath = 'D:\_Data\GTC_t1_selected' img_list = os.list
阅读全文
摘要:import requests import webbrowser import matplotlib.pyplot as plot from urllib.request import urlopen with open('t1.txt','r')as f: x=f.read().split('\
阅读全文
摘要:from bs4 import BeautifulSoup from urllib.request import urlopen import re html = urlopen("https://morvanzhou.github.io/static/scraping/table.html").r
阅读全文
摘要:当使用 [ [ None ] *n ] *n 方法创建时,会使子列表都指向同一列表 >>> t = [[]] * 5 >>> t [[], [], [], [], []] >>> t[0].append(5) #改变一子列表导致其他均被改变 >>> t [[5], [5], [5], [5], [5
阅读全文
摘要:文件读写 with open('Game/Dota.txt','w')as file: file.write('Radiant Victory! ') 当Game文件夹未创建时,出现FileNotFoundError 必须手动创建文件夹,或者用 import os # 创建的目录 path = "G
阅读全文

浙公网安备 33010602011771号