-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
advanced_classification | 广阔天地,大有作为 #13
Comments
https://stackoverflow.com/questions/12832891/django-postman-extends-a-base-html-that-does-not-exist |
find . -type f -print0 | xargs -0 grep "META_SetIpComPortMap" |
通过资源管理器打开某个指定的文件夹 |
cocos creator处理UUID的代码 function xx(t) {
var n = JSON.parse("[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62,64,64,64,63,52,53,54,55,56,57,58,59,60,61,64,64,64,64,64,64,64,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,64,64,64,64,64,64,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]");
var r = JSON.parse("[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"]");
var o = JSON.parse("[\"a\",\"a\",\"0\",\"8\",\"f\",\"5\",\"d\",\"f\",\"-\",\"9\",\"0\",\"7\",\"d\",\"-\",\"4\",\"4\",\"a\",\"9\",\"-\",\"9\",\"5\",\"0\",\"2\",\"-\",\"c\",\"a\",\"0\",\"7\",\"1\",\"1\",\"2\",\"f\",\"c\",\"e\",\"a\",\"d\"]");
var a = JSON.parse("[0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35]");
if (22 !== t.length) return t;
o[0] = t[0],
o[1] = t[1];
for (var e = 2, i = 2; e < 22; e += 2) {
var s = n[t.charCodeAt(e)],
c = n[t.charCodeAt(e + 1)];
o[a[i++]] = r[s >> 2],
o[a[i++]] = r[(3 & s) << 2 | c >> 4],
o[a[i++]] = r[15 & c]
}
return o.join('')
} 根据json找到对应的资源 |
#文件读写 学习python应该是怎样的学习流程?
import struct#有点像sscanf,格式化字符串,这里是格式化字节
#struct.pack('>I', 10240099) 将10240099转换成大端 无符号字节
#struct.unpack('<ccIIIIIIHH', s) # s = b'\x42\x4d\x38\x8c\x0a\x00\x00\x00\x00\x00\x36\x00\x00\x00\x28\x00\x00\x00\x80\x02\x00\x00\x68\x01\x00\x00\x01\x00\x18\x00'
#将s执行的字节数组,转换为小端 字符、字符、无符号整型、无符号整型、 …… 双字节无符号整型
|
看到同事的电脑上,每半小时都会有提醒“可以输入半小时的工作内容了”,看得出他是一个比较注重时间管理的人,我们也来做一个玩玩。 import threading
global timer
def hello():
messagebox.showinfo("提醒","是时候填写半小时的内容了")
global timer
timer = threading.Timer(30*60,hello)#30分钟后执行
timer.start()
timer = threading.Timer(1,hello)#1s后执行
timer.start() 我们创建界面的代码: #coding=utf-8
import time
import os
import threading
from tkinter import *
from tkinter import messagebox
global timer
global B1
global MessageTime
def hello():
messagebox.showinfo("提醒","是时候填写半小时的内容了")
global MessageTime
MessageTime= time.time()
global timer
timer = threading.Timer(30*60,hello)
timer.start()
def submit():#按钮只是messbox弹窗后的3mins 内有效,如果距离上次弹窗超过1min,则无效
global MessageTime
if(time.time()-MessageTime>3*60):
messagebox.showwarning("提醒","距离可以记录的时间,已经超过了3分钟,不能记录")
#B1.configure(state=DISABLED)
return
#else:
# B1.configure(state=NORMAL)
if not content.get():
messagebox.showerror("错误","输入为空")
return
#print(time.strftime('%Y_%m_%d',time.localtime(time.time())))
if os.path.exists('D:\\diary'):
pass
else:
os.makedirs("D:\\diary")
file = open('D:\\diary'+'\\'+time.strftime('%Y_%m_%d',time.localtime(time.time()))+".txt",'a')
string = time.strftime("%I:%M",time.localtime(time.time()))+"——"+content.get()+"\n"## 12小时格式
file.write(string)
file.close()
E1.delete(0,END)
E1.focus()
timer = threading.Timer(1,hello)
timer.start()
root = Tk()
root.wm_attributes('-topmost',1)
root.title("半小时记录")
L1 = Label(root,text="请输入这半小时干了什么: ")
#L1.pack(side=LEFT)
L1.grid(row=0,column=0)
content = StringVar()
E1 = Entry(root,bd=5,width=56,textvariable=content)
#E1.pack(side = LEFT)
E1.grid(row=0,column=1)
E1.focus()
B1 = Button(root,text="提交",command = submit)
#B1.pack(side=RIGHT)
B1.grid(row=0,column=2)
#L2 = Label(root,text="任务列表: ")
#L2.grid(row=1,column=0,sticky='W')
root.mainloop() |
#coding=utf-8
import time
import os
import threading
from tkinter import *
from tkinter import messagebox
global timer
global MessageTime
global accumlateTime
import functools
global L1,E1,B1,L2,B2,B3,content,T1
'''
def just_one_instance(func):
@functools.wraps(func)
def f(*args,**kwargs):
import socket
try:
global s
s = socket.socket()
host = socket.gethostname()
s.bind((host,60133))
except:
messagebox.showwarning("提醒","已经有一个实例在运行")
return None
return func(*args,**kwargs)
return f
'''
import sys
import time
import logging
logger = logging
class SingleInstance:
def __init__(self):
py_file_path = os.path.abspath(__file__)
basepath = os.path.dirname(py_file_path)
self.lockfile = os.path.normpath(basepath + '/' + os.path.basename(__file__) + '.lock')
if sys.platform == 'win32':
try:
# file already exists, we try to remove (in case previous execution was interrupted)
if os.path.exists(self.lockfile):
os.unlink(self.lockfile)
self.fd = os.open(self.lockfile, os.O_CREAT | os.O_EXCL | os.O_RDWR)
except OSError as e:
if e.errno == 13:
logger.error("Another instance is already running, quit.")
sys.exit(-1)
raise e
else:
# non Windows
import fcntl
self.fp = open(self.lockfile, 'w')
try:
fcntl.lockf(self.fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
logger.error("Another instance is already running, quit.")
sys.exit(-1)
accumlateTime = 30
def hello():
global L1
global accumlateTime,B1
accumlateTime=accumlateTime+1 #一分钟更新一次计数
if accumlateTime >30: #超过30分钟,可以记录了
accumlateTime = 0
messagebox.showinfo("提醒","是时候填写半小时的内容了")
global MessageTime
MessageTime= time.time()
B1.configure(state=NORMAL)#每半小时,设置按钮为可用,提交后设置为不可用
L1.configure(text="倒计时"+str(30-accumlateTime)+"分钟")
global timer
timer = threading.Timer(60,hello)
timer.start()
def submit():#按钮只是messbox弹窗后的3mins 内有效,如果距离上次弹窗超过1min,则无效
global MessageTime,content,B1
#if(time.time()-MessageTime>3*60):
# messagebox.showwarning("提醒","距离可以记录的时间,已经超过了3分钟,不能记录")
#B1.configure(state=DISABLED)
# return
#else:
# B1.configure(state=NORMAL)
if not content.get():
messagebox.showerror("错误","输入为空")
return
#print(time.strftime('%Y_%m_%d',time.localtime(time.time())))
if os.path.exists('D:\\diary'):
pass
else:
os.makedirs("D:\\diary")
file = open('D:\\diary'+'\\'+time.strftime('%Y_%m_%d',time.localtime(time.time()))+".txt",'a')
string = time.strftime("%I:%M",time.localtime(time.time()))+"——"+content.get()+"\n"## 12小时格式
file.write(string)
file.close()
global E1
E1.delete(0,END)
E1.focus()
B1.configure(state=DISABLED) #提交后按钮变灰色,因为每半小时只允许提交一次
def submittask():#按钮只是messbox弹窗后的3mins 内有效,如果距离上次弹窗超过1min,则无效
global T1
file = open('D:\\diary'+'\\'+time.strftime('%Y_%m_%d',time.localtime(time.time()))+"_task.txt",'w')
string = T1.get(0.0,'end')## 12小时格式
file.write(string)
file.close()
def loadtask():#按钮只是messbox弹窗后的3mins 内有效,如果距离上次弹窗超过1min,则无效
global T1
try:#文件可能不存在
file = open('D:\\diary'+'\\'+time.strftime('%Y_%m_%d',time.localtime(time.time()))+"_task.txt",'r')
string = file.read()
file.close()
T1.delete('1.0','end')
T1.insert(INSERT, string)
except:
pass
def openfolder():
os.startfile("D:\\diary\\")
#@just_one_instance
def main():
global L1,E1,B1,L2,B2,B3,content,T1
timer = threading.Timer(1,hello)
timer.start()
root = Tk()
root.resizable(False,False)
root.wm_attributes('-topmost',1)
root.title("每半小时记录一次(番茄工作法)")
L1 = Label(root,bd=1,text="倒计时30分钟")
#L1.pack(side=LEFT)
L1.grid(row=0,column=0,sticky='W')
content = StringVar()
E1 = Entry(root,bd=1,width=20,textvariable=content)
#E1.pack(side = LEFT)
E1.grid(row=0,column=1)
E1.focus()
B1 = Button(root,bd=1,text="提交干了啥",command = submit)
#B1.pack(side=RIGHT)
B1.grid(row=0,column=2)
L2 = Label(root,bd=1,text="任务列表: ")
L2.grid(row=1,column=0,sticky='W')
T1 = Text(root,height=5,width=40,bd=1)
T1.grid(row=2,column=0,sticky='W',columnspan=3)
B2 = Button(root,padx=3,text="提交任务",bd=1,command = submittask)
#B1.pack(side=RIGHT)
B2.grid(row=3,column=0,sticky='SW')
B3 = Button(root,padx=3,text="加载任务",bd=1,command = loadtask)
#B1.pack(side=RIGHT)
B3.grid(row=3,column=2,sticky='SE')
B4 = Button(root, padx=3, text="打开工作目录", bd=1, command=openfolder)
B4.grid(row=3, column=1)
root.mainloop()
if __name__ == '__main__':
instance = SingleInstance()
main() |
http://www.coolketang.com/hdjc/hdjc/pscc_m1/?rs=pscc_m1_l1_3&sw=1024&pc=23&nt=Photoshop%u9009%u9879%u5361%u6807%u7B7E%u7684%u4F7F%u7528&ct=%u4E92%u52A8%u6559%u7A0B%u7B2C%u4E00%u8282%uFF1A%u64CD%u4F5C%u793A%u8303 |
https://laiqun.github.io/2018/02/26/advanced-classification/#more
The text was updated successfully, but these errors were encountered: