你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

(Uniapp,Python)开发经验

2021/12/28 9:35:26

python开发

​ global

​ 在函数里面声明全局变量

浮点数保留小数点

round(num,2)

操作配置文件

import configparser
config = configparser.ConfigParser()
config.read(AddresUrl + "\\config.ini", encoding='GB18030')

操作文件

with open(AddresUrl+"\\erverday"+time2+".txt", 'a', encoding='utf-8') as f:
	f.write(times+" "+text+"\n")
	f.close()

调用post和get

     date={
        "finshdate":times,
        "thing":thingid,
        "flag":falg,
        "token":token if 1 else 0
    }
    head={
        "token":token
    }
 jsons = requests.post(host+"/generator/plog/save", json=date,headers=head).text
 
 

uniapp开发