python-3.x

The included URLconf 'appName.urls' does not appear to have any patterns in it

隐身守侯 提交于 2021-02-11 13:41:13
问题 Checking the documentation doesn't show any potential cause for the error. I have a django project with a number of apps (dir layout: ) settings.py (cryptoboard): ... # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] AUTH_USER_MODEL = "cryptousers.CryptoUser" # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django

Play sound asynchronously in Python

随声附和 提交于 2021-02-11 13:36:54
问题 I have a while loop for my cameras(with opencv) to take a photos when something moves. I would like to call a function to play a sound as well. But when I call and play it, it will stop looping for that execution time. I tried ThreadPoolExecutor but had no idea how could I blend it with my code, because I'm not passing anything to the function. Just calling it from loop. Btw. I would like to be able to play it multiple times (multiple executions in time of execution) if multiple something in

I am trying to extract data as HTML elements in python using pdfminer

半世苍凉 提交于 2021-02-11 13:33:59
问题 I am trying extract data as HTML from pdf using pdfminer although I was successful to extract text from the same pdf now I am getting an error while extracting data as HTML I have to filter the data further to categorize it in CSV. This is the script. from io import StringIO from pdfminer.layout import LAParams from pdfminer.high_level import extract_text_to_fp output_string = StringIO with open('mini.pdf','rb') as fn: extract_text_to_fp(fn, output_string, laparams=LAParams(), output_type=

I am trying to extract data as HTML elements in python using pdfminer

99封情书 提交于 2021-02-11 13:31:33
问题 I am trying extract data as HTML from pdf using pdfminer although I was successful to extract text from the same pdf now I am getting an error while extracting data as HTML I have to filter the data further to categorize it in CSV. This is the script. from io import StringIO from pdfminer.layout import LAParams from pdfminer.high_level import extract_text_to_fp output_string = StringIO with open('mini.pdf','rb') as fn: extract_text_to_fp(fn, output_string, laparams=LAParams(), output_type=

Discord py more than one tasks.loop at the same time?

柔情痞子 提交于 2021-02-11 13:30:49
问题 How can I have more than one loop running ate the same time using the same function but using different parameters like: @tasks.loop(seconds = 10) async def loop(name): Print(name) loop.start("Jon") loop.start("Joseph") Is this how u pass parameters to loops? 回答1: You need to create a new Loop object for each loop. You can do this by using regular function calling repeatedly instead of the decorator: async def loop(name): print(name) names = ["Jon", "Joseph"] loops = {name: tasks.loop(seconds

Discord py more than one tasks.loop at the same time?

房东的猫 提交于 2021-02-11 13:30:39
问题 How can I have more than one loop running ate the same time using the same function but using different parameters like: @tasks.loop(seconds = 10) async def loop(name): Print(name) loop.start("Jon") loop.start("Joseph") Is this how u pass parameters to loops? 回答1: You need to create a new Loop object for each loop. You can do this by using regular function calling repeatedly instead of the decorator: async def loop(name): print(name) names = ["Jon", "Joseph"] loops = {name: tasks.loop(seconds

Finding consecutive text elements in list that match pattern

社会主义新天地 提交于 2021-02-11 13:30:03
问题 I am dealing with lists ls that look like the following: ls = ['y4','j8','Le1','Retx3','MNxe4','Xe4','Xf4','Xe5'] Given one such list, I am trying to find out if it contains 3 consecutive elements that match the following pattern: 3 consecutive elements starting with the letter X , and having the same length (here 3). And their ending digits may only correspond to either of the following cases: denote the ending digit of the first found element by n , then the allowed sequences of the 3

Finding consecutive text elements in list that match pattern

回眸只為那壹抹淺笑 提交于 2021-02-11 13:29:05
问题 I am dealing with lists ls that look like the following: ls = ['y4','j8','Le1','Retx3','MNxe4','Xe4','Xf4','Xe5'] Given one such list, I am trying to find out if it contains 3 consecutive elements that match the following pattern: 3 consecutive elements starting with the letter X , and having the same length (here 3). And their ending digits may only correspond to either of the following cases: denote the ending digit of the first found element by n , then the allowed sequences of the 3

How to organize list of list of lists to be compatible with scipy.optimize fmin init array

时间秒杀一切 提交于 2021-02-11 13:27:36
问题 I am very amateur when it comes to scipy. I am trying to use scipy's fmin function on a multidimensional variable system. For the sake of simplicity I am using list of list of list's. My data is 12 dimensional, when I enter np.shape(DATA) it returns (3,2,2) , I am not even sure if scipy can handle that many dimensions, if not no problem I can reduce them, the point is that the optimize.fmin() function doesn't accept list based arrays as x0 initial parameters, so I need help either rewriting

How to organize list of list of lists to be compatible with scipy.optimize fmin init array

有些话、适合烂在心里 提交于 2021-02-11 13:27:34
问题 I am very amateur when it comes to scipy. I am trying to use scipy's fmin function on a multidimensional variable system. For the sake of simplicity I am using list of list of list's. My data is 12 dimensional, when I enter np.shape(DATA) it returns (3,2,2) , I am not even sure if scipy can handle that many dimensions, if not no problem I can reduce them, the point is that the optimize.fmin() function doesn't accept list based arrays as x0 initial parameters, so I need help either rewriting