import datetime
import subprocess
popen = subprocess.Popen(["sleep", "0.00001"])
while popen.poll() is None:
print("작업중...")
print(datetime.datetime.now())
print("종료 상태", popen.poll())
"""
작업중...
2024-06-04 20:05:01.251376
작업중...
2024-06-04 20:05:01.251404
작업중...
2024-06-04 20:05:01.251409
작업중...
2024-06-04 20:05:01.251412
작업중...
2024-06-04 20:05:01.251417
작업중...
2024-06-04 20:05:01.251432
작업중...
2024-06-04 20:05:01.251443
작업중...
2024-06-04 20:05:01.251452
작업중...
2024-06-04 20:05:01.251456
작업중...
2024-06-04 20:05:01.251459
작업중...
2024-06-04 20:05:01.251461
작업중...
2024-06-04 20:05:01.251470
작업중...
2024-06-04 20:05:01.251475
작업중...
2024-06-04 20:05:01.251478
작업중...
2024-06-04 20:05:01.251481
작업중...
2024-06-04 20:05:01.251492
작업중...
2024-06-04 20:05:01.251501
작업중...
2024-06-04 20:05:01.251512
작업중...
2024-06-04 20:05:01.251531
작업중...
2024-06-04 20:05:01.251535
작업중...
2024-06-04 20:05:01.251539
작업중...
2024-06-04 20:05:01.251543
작업중...
2024-06-04 20:05:01.251546
작업중...
2024-06-04 20:05:01.251549
작업중...
2024-06-04 20:05:01.251557
작업중...
2024-06-04 20:05:01.251562
작업중...
2024-06-04 20:05:01.251565
작업중...
2024-06-04 20:05:01.251568
작업중...
2024-06-04 20:05:01.251577
작업중...
2024-06-04 20:05:01.251592
작업중...
2024-06-04 20:05:01.251596
작업중...
2024-06-04 20:05:01.251600
작업중...
2024-06-04 20:05:01.251603
작업중...
2024-06-04 20:05:01.251607
작업중...
2024-06-04 20:05:01.251615
작업중...
2024-06-04 20:05:01.251630
작업중...
2024-06-04 20:05:01.251634
작업중...
2024-06-04 20:05:01.251643
작업중...
2024-06-04 20:05:01.251653
종료 상태 0
"""