Posts

Dymock

Image
Dymock    Paróquia civil    Igreja e memorial de guerra de Dymock Coordenadas 51° 58' 43.0" N 2° 26' 15.9" O Estado soberano Reino Unido Nação constituinte Inglaterra Região Sudoeste da Inglaterra Condado cerimonial Gloucestershire Distrito não-metropolitano Forest of Dean Área - Total 31,63 km² População (2011)  - Total 1 214     • Densidade 38,4 hab./km² ...

getting error ipykernel_launcher.py: error: the following arguments are required: -t//--template,...

Image
0 whenever I was trying to run the code i am getting error usage: ipykernel_launcher.py [-h] -t/ TEMPLATE -i/ IMAGES [-v VISUALIZE] ipykernel_launcher.py: error: the following arguments are required: -t//--template, -i//--images import numpy as np import argparse import imutils import glob import cv2 import os os.chdir(r"C:UsersDDesktop") construct the argument parser and parse the arguments try: ap = argparse.ArgumentParser() ap.add_argument("-t", "--template", required=True, help= "testing.jpeg" ) ap.add_argument("-i", "--images", required=True, help="intel.jpeg") ap.add_argument("-v", "--visualize", help="Flag indicating whether or not to visualize each iteration") args = vars(ap.parse_ar...

Running multithreading in python is suspended

Image
2 I test multithreading in python, but the code is suspended: class MongoInsertThread(threading.Thread): def __init__(self, queue, thread_id): super(MongoInsertThread, self).__init__() self.thread_id = thread_id self.queue = queue def run(self): print(self.thread_id,': ', self.queue.get()) def save_to_mongo_with_thread(): q = queue.Queue() size = int(math.ceil(16 / 3)) for e in range(size): for i in range(e * size, min((e + 1) * size, 16)): q.put([i], block=False) threads = for i in range(size): threads.append(MongoInsertThread(q, i)) for t in threads: t.start() for t in threads: t.join() print("+++++++++++++++++++++++") th...