40 lines
890 B
Python
40 lines
890 B
Python
import configparser
|
|
import time
|
|
|
|
|
|
def config_read():
|
|
# 读取
|
|
config = configparser.ConfigParser()
|
|
config.read('config.ini')
|
|
|
|
mesg = config['video_path']['rtmp']
|
|
data = mesg.split(',')
|
|
def test1_1():
|
|
# 读取
|
|
config = configparser.ConfigParser()
|
|
config.read('config.ini')
|
|
|
|
num1 = config['que']['num']
|
|
name = config['que']['name']
|
|
# test_n = int(num)
|
|
print(type(int(num1)))
|
|
num2 = int(num1)
|
|
if num2 == 0:
|
|
print("ok")
|
|
config.set('que', 'num1', "1")
|
|
config.write(open("config.ini", "w"))
|
|
time.sleep(10)
|
|
|
|
config = configparser.ConfigParser()
|
|
config.read('config.ini')
|
|
num = config['que']['num']
|
|
name = config['que']['name']
|
|
print(num)
|
|
data = name.split(',')
|
|
print(len(data))
|
|
|
|
if __name__ == "__main__":
|
|
# config_read()
|
|
while 1:
|
|
test1_1()
|
|
time.sleep(1000) |