Nov-11-2022, 03:33 PM
(This post was last modified: Nov-11-2022, 04:49 PM by snippsat.
Edit Reason: Fix code tag
)
Can You please tell me how to do. The first function needs to read USERNAME column from csv file to output one value per request and the second function outputs this value to the console with 5 seconds pause. To cycle through the entire column in the file. Thanks!!
import csv
import time
filename = "D:/Study/file/.vscode/telescript/DarkCryptoMining.csv"
def func1():
global Field
with open(filename, 'r', encoding="utf-8", newline='') as f:
data = csv.DictReader(f, delimiter=";")
for str in data:
for row in data:
if row['USERNAME'] == "-":
time.sleep(0)
else:
Field = (f'{row["USERNAME"]}')
def func2():
time.sleep(5)
print(Field)
def main():
func1()
func2()
main()
