![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Xiaoy9
懒惰使我进步
展开
-
寻找图片文件夹
#! python3# -*- coding:utf-8 -*-# find_image_folders.py - 扫描整个硬盘,寻找"照片文件夹",# 假设定义"照片文件夹"就是超过半数文件都是照片的任何文件夹,# 照片必须是png或jpg文件,照片的宽度和高度必须大于500像素.import osfrom PIL import Imagefor foldername, su...原创 2018-07-30 14:19:31 · 219 阅读 · 0 评论 -
给你的图片加上水印
#! python3# -*- coding:utf-8 -*-# resizeAndAddLogo.py - Resizes all images in current working directory to fit# in a 300*30 squareimport osfrom PIL import ImageSQUARE_FIT_SIZE = 300LOGO_FILE...原创 2018-07-30 13:20:45 · 197 阅读 · 0 评论 -
xlsx转csv
#! python3# -*- coding:utf-8 -*-# saveE2Csv.py - 将工作区的xlsx文件全部转换成csv格式的文件# Excel中的每张表都是单独的csv文件import csv, openpyxl, osfrom openpyxl.utils import get_column_letteros.makedirs('Excel2CSV', e...原创 2018-07-25 18:01:37 · 1121 阅读 · 0 评论 -
天气预报
#! python3# -*- coding:utf-8 -*-# 使用api获取json格式的天气数据import json, requests, sysif len(sys.argv) != 2: print('Usage CN_Weather.py location') sys.exit()location = sys.argv[1]url = 'https://ww...原创 2018-07-25 15:39:06 · 348 阅读 · 0 评论 -
更复杂的用户输入之scan函数ex48(lexicon.py)
# -*- coding:utf-8 -*-def scan(sentence): # 将已知的词汇放入列表中存储 directions = ['north', 'south', 'east', 'west', 'down', 'up', 'left', 'right', 'back'] verbs = ['go', 'stop', 'kill', 'eat'] stops = [...原创 2018-06-13 10:00:08 · 342 阅读 · 0 评论 -
来自Percal25号行星的哥顿人
# -*- coding: utf-8 -*-from sys import exitfrom random import randintclass Scene(object): def enter(self): print "This scene is not yet configured. Subclass it and implement enter()." exit(...翻译 2018-06-06 14:37:36 · 799 阅读 · 0 评论 -
红尘传
# -*- coding:utf-8 -*-from hometown import *from koipondroom import *from end import *from suburb import *from kunlun import *# 记录所有房间class Map(object): # 存储所有房间 rooms = { 'home_town': ...原创 2018-06-11 16:53:10 · 174 阅读 · 0 评论 -
游戏机器人
#! python3# -*- coding:utf-8 -*-# robotPlay.pyimport pyautogui, time, needBuy# 食材和案板的位置food = {'rice': (450, 460), 'nori': (392, 520), 'fishegg': (452, 517), 'desktop': (563, 514)}# 空盘子的位置p...原创 2018-07-31 17:52:14 · 448 阅读 · 0 评论