展视网论坛

 找回密码
 立即注册
查看: 15278|回复: 0

PythonApi

[复制链接]

17

主题

16

帖子

280

积分

超级版主

展视网老师

Rank: 8Rank: 8

积分
280
发表于 2021-4-2 21:38:21 | 显示全部楼层 |阅读模式
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])

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|展视网

GMT+8, 2024-4-20 16:36 , Processed in 0.066138 second(s), 35 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表