Python Api #POST请求模板 import urllib2 import urllib import Post Log.Tip(Log.m_logs[0]) data = {'object':'bimvr'} f = Post.Post( url='https://vdp2s1.izsw.net/api_v2/general', data=urllib.urlencode(data) ) Log.Tip(Log.m_logs[1] + ": " + f.read()) #UI登录界面模板 import UnityEngine from UnityEngine import Vector3 def Login(): Log.Tip(Log.m_logs[0] + ": " + UsernameInput.text ) Log.Tip(Log.m_logs[1] + ": " + PasswordInput.text ) Login() #Word输出模板 Log.Tip(Log.m_logs[0]) path = "D:/WordOutput/temp.doc" WordOutput.SaveWord(path,"Test WordOutput") Log.Tip(Log.m_logs[1] + ": " + path) from threading import Timer import time #定时器模板 # 定义总共输出几次的计数器 count = 0 def print_time(): Log.Tip(Log.m_logs[1] + ": " +time.ctime()) global t, count count += 1 # 如果count小于10,开始下一次调度 if count < 10: t = Timer(1, print_time) t.start() Log.Tip(Log.m_logs[0]) # 指定1秒后执行print_time函数 t = Timer(1, print_time) t.start() #动画模板 Log.Tip(Log.m_logs[0]) #添加动画控制 from threading import Timer import time #多人协同模板 Log.Tip(Log.m_logs[0]) #多人协同操作 Log.Tip(Log.m_logs[1]) #数据库密码验证模板 import urllib2 import urllib import Login Log.Tip(Log.m_logs[0]) f = Login.Login( username='1386', password='1234' ) Log.Tip(Log.m_logs[1] + ": " + f.read()) #顺序拆装模板 import UnityEngine from UnityEngine import Vector3 if(Assemble.m_isBroken): #顺序安装 Assemble.GetTogether() Log.Tip(Log.m_logs[0]) else: #打散 Assemble.BreakUp() Log.Tip(Log.m_logs[1]) import UnityEngine from UnityEngine import Vector3 #引擎交互模板 Log.Tip(Log.m_logs[0]) pos = gameObject.transform.position gameObject.transform.position = pos + Vector3(1,1,1) Log.Tip(Log.m_logs[1]) #装配模板 import UnityEngine from UnityEngine import Vector3 if(Assemble.m_isBroken): #恢复 Assemble.GetTogether() Log.Tip(Log.m_logs[1]) else: #打散 Assemble.BreakUp() Log.Tip(Log.m_logs[0])
|