質問編集履歴

2

更新

2021/12/13 08:17

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -414,26 +414,18 @@
414
414
 
415
415
  while True:
416
416
 
417
- # プロセスrが動作していなくて、プロセスmの情報ができたらプロセスrを起動
418
-
419
417
  if not r_running and os.path.exists(count_image_path)== True:
420
418
 
421
- print("not & count")
422
-
423
419
  executor.submit(i.text_reading)
424
420
 
425
421
  r_running = True
426
422
 
427
423
  print(r_running)
428
424
 
429
- print("not & count",2)
430
-
431
425
 
432
426
 
433
427
  if not os.path.exists(count_image_path):
434
428
 
435
- print("falseになる")
436
-
437
429
  r_running = False
438
430
 
439
431
 

1

更新

2021/12/13 08:17

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -388,11 +388,59 @@
388
388
 
389
389
  print (description)
390
390
 
391
- os.remove(count_image_path)
391
+ os.remove(count_image_path)
392
+
392
-
393
+ def main():
394
+
393
-
395
+ if os.path.exists(count_image_path):
396
+
394
-
397
+ print("count_image_pathが存在するので削除します")
398
+
395
-
399
+ os.remove(count_image_path)
400
+
401
+
402
+
403
+ m = Main()
404
+
405
+ i = Image_captioning()
406
+
407
+ executor = concurrent.futures.ProcessPoolExecutor()
408
+
409
+ executor.submit(m.process)
410
+
411
+ r_running = False
412
+
413
+
414
+
415
+ while True:
416
+
417
+ # プロセスrが動作していなくて、プロセスmの情報ができたらプロセスrを起動
418
+
419
+ if not r_running and os.path.exists(count_image_path)== True:
420
+
421
+ print("not & count")
422
+
423
+ executor.submit(i.text_reading)
424
+
425
+ r_running = True
426
+
427
+ print(r_running)
428
+
429
+ print("not & count",2)
430
+
431
+
432
+
433
+ if not os.path.exists(count_image_path):
434
+
435
+ print("falseになる")
436
+
437
+ r_running = False
438
+
439
+
440
+
441
+ if __name__ == '__main__':
442
+
443
+ main()
396
444
 
397
445
 
398
446