[Solved] I have a table with a status however I want it to change status every 10 minutes. I’m using Postgresql

I can see what you’re after although there is a big omission: What happens when the status has reached ‘Z’ and it is time to update? More on that later. Your request has 2 components, actually getting a process to run and a rolling update procedure (script) for the status. Well, Postgres has no native … Read more

[Solved] Function doesn’t work in another function with sleep [closed]

Your code should work. To check what is wrong, you could use this: def checksite(): #blahblah while True: print(‘starting’) checksite() print(‘site checked’) time.sleep(10) print(‘sleep function complete’) Then maybe you will get an idea of what is wrong. 3 solved Function doesn’t work in another function with sleep [closed]

[Solved] Print lists in list

Not sure what you mean with “store the data of ‘li1’ into an index”. I’m assuming you want a list of lists? You could append the list. k = “/BTC” result_list = [] for i in range(l): if k in dat1[“Data”][i][‘Label’]: value = dat1[“Data”][i][‘Label’] value1 = dat1[“Data”][i][‘TradePairId’] value2 = dat1[“Data”][i][‘AskPrice’] value3 = dat1[“Data”][i][‘BidPrice’] result_list.append([value, value1, … Read more

[Solved] How to add user class objects to a list of objects

x = SimpleClass() creates the instance of class (something like an object of this type). If you run it outside the loop, you have exactly one object and try to change it. simplelist.append(x) in this case will append this unique object to list (and will change it each time) so you will have a list … Read more

[Solved] Count certain values of file in python

Here, you can try this one: summation = 0 with open(“test.txt”, “r”) as infile: for line in infile: newLine = line.split(“, “) summation = summation + int(newLine[3]) print(summation) Output: 3784 The contents of test.txt file are structured like this: [52639 – 2017-12-08 11:56:58,680] INFO main.master 251 Finished pre-smap protein tag (‘4h02′, [], 35000, 665, ’67’) … Read more

[Solved] how to convert xlsx files to simple xls for a given folder

This is mass conversion to the older Excel 97-2003: import glob from win32com.client import Dispatch for file in glob.glob(‘/home/adam/*.xlsx’): xl = Dispatch(‘Excel.Application’) wb = xl.Workbooks.Add(file) wb.SaveAs(file[:-1], FileFormat=56) xl.Quit() 2 solved how to convert xlsx files to simple xls for a given folder

[Solved] python program not working beacuse of the “if” [closed]

this is a problem with indentation. try this: while True: print(“YOUTUBE SIMULATOR”) print(“1. search a video”) print(“2. edit video”) choice = int(input()) if choice == 1: print(“Searching video…”) print(“Can’t find your video!”) elif choice == 2: print(“Editing video…”) print(“Can’t edit your video?”) solved python program not working beacuse of the “if” [closed]