Data dodania Pytanie
2017-11-11 05:11 Regex to insert content just before mediawiki category links »
I'm trying to use a regex to insert a template into a page, before all category or interwiki links, but after everything else. So if you have a page t...
(3) odpowiedzi
2017-11-10 23:11 python url request causes sslv3 handshake errors. howto transform the script? »
I'm trying to get the siemscript of Sophos Central running for my graylog server. Script is python and not maintained for a yr. running it with pytho...
(0) odpowiedzi
2017-11-08 11:11 Print list separated in a single row in python »
I've got data = list(a.fetchall()) print data It returns: [('Data1',), ('Data2',), ('Data3',), ('Data4',), ('Data5',), ('Data6',), ('Data7 ',), (...
(4) odpowiedzi
2017-11-08 06:11 What ordering does dict.keys() and dict.values() guarantee? »
This question arises from this answer where one user uses d.keys() and d.values() separately to initialise a dataframe. It's common knowledge...
(1) odpowiedzi
2017-11-07 20:11 "Regrouping" data from nested dictionaries »
I have a JSON document like this: { 'item1':{ 'value':[a,b], 'number':1 }, 'item2':{ 'value':[a], 'number':2 }, 'item3':{ 'val...
(1) odpowiedzi
2017-11-06 12:11 Scrapy:Rename downloaded file name to a string with unicode cause messy characters »
I'm trying to scrap some PDF from a website using, instead of letting Scrapy name these files I want to name these PDF with the titles I scraped from ...
(0) odpowiedzi
2017-11-03 09:11 Python string literal throwing errors with place holders »
I have a list as : token_found = ["abcdxyz", "1234567"] I have a multiline string as below: user_creds_string = """ UserA_A: - name: 'Abcd' ...
(2) odpowiedzi
2017-10-31 15:10 Check if value of one key in json has another key »
I'm trying to print my json content. I know how to print just keys and values but I want to have access to the objects within the keys too. This is my...
(2) odpowiedzi
2017-10-31 01:10 multiprocessing: Run through an array with multiple processes? »
How to run through an array with multiple processes (for example 2) in parallel? For example I have this code: from multiprocessing import Process, V...
(1) odpowiedzi
2017-10-30 19:10 How to Enable Interactive Prompt While Using Fileinput »
Using the builtin fileinput Python module, if I have a file in.txt with the following contents: hello oldline world This code will replace the line...
(0) odpowiedzi
2017-10-30 09:10 Python server script to handle put request for login »
I need a python script(Acting as server) which will run on port say 8686.If any put request for login is trigger using username x and password y,it sh...
(0) odpowiedzi
2017-10-30 00:10 How to pad a character with spaces when it falls between a unicode range? »
The goal is to pad a character with spaces when the issubset condition is met, e.g. [in]: subset = [chr(ordinal) for ordinal in range(ord(u'\u31c0'...
(2) odpowiedzi
2017-10-29 18:10 How to search word of format ((int)X(int)X(int)) in pandas series (anaconda 2.7) »
How to search word of format ((int)X(int)X(int)) in pandas series (anaconda 2.7)? For example: kdkksjkdjk 10x40x0jjjjj How to extract "10x40x0" ...
(0) odpowiedzi
2017-10-29 17:10 Faster than if-elif statement »
I am receiving Points in large number from a sensor in real-time. However, I just need 4 categories of points, i.e., top_left, top_right, bottom_left,...
(3) odpowiedzi
2017-10-29 14:10 Python 2.7 multiprocessing - cant pass socket object instance via Manager dictionary »
I have a simple program that searches for open ports in a local network and stores the connected sockets in a dictionary along with their local addres...
(2) odpowiedzi
2017-10-28 21:10 Remove a specific letter from a specific line in a file in python »
This is probably a duplicate, but I couldn't find my answer anywhere. I have a text file and I want to remove a specific character from a specific li...
(2) odpowiedzi
2017-10-27 21:10 For the better OCR quality of tesseract in python »
I am trying to run a tesseract code in python to read characters including numbers and periods(.) but because of the stuffs above the numbers, tesser...
(0) odpowiedzi
2017-10-27 02:10 I set True=False and I can't undo it »
I was in this code golf thread where I learned in Python 2 you can set True=False. Now that I would like to go back to the real world I want True to b...
(4) odpowiedzi
2017-10-27 00:10 How to use regex in python? »
I must be missing something simple - whatever I do, I can't get my regex to match any strings: [~] $ python2.7 Python 2.7.12 (default, Aug 13 2016, 1...
(3) odpowiedzi
2017-10-25 20:10 TypeError exception not being caught »
Why is this TypeError not being caught by exception ? >>> op=None >>> try: ... val = op['one'] ... except KeyError, TypeError: ...
(2) odpowiedzi
2017-10-25 11:10 Python - Split strings into words within a list of lists »
I have the following list of lists (): [[u' why not giving me service'], [u' option to'], [u' removing an'], [u' verify name and '], [u' my credit ca...
(3) odpowiedzi
2017-10-19 17:10 Custom authentication and parameter checking in Flask »
I am currently refactoring a Flask app I wrote about two years ago and I suspect having done a few things not as elegantly and clean as it would have ...
(1) odpowiedzi
2017-10-18 15:10 I am getting run time error in this code »
I am getting run time error in this code #print("Hello World!") t=int(input()) while(t>0): a,k,n=raw_input().split(" ") a=int(a) k=in...
(0) odpowiedzi
2017-10-15 11:10 Converting json like data to csv »
data file looks like the below. Note that the tags and values are not necesirly fixed (i.e. one file may have 10, next 30, 31 etc) { 1=648749...
(0) odpowiedzi
2017-10-13 15:10 Run python kivy application in "kiosk mode" »
I've created a simple python application running in raspbian using kivy. The application runs already nicely in full screen mode. however I would like...
(1) odpowiedzi
2017-10-11 22:10 How to convert \303\255 to "í" in Python? »
I'm using Google Speech API and since i'm using LongRunning functions for wav files, and they're all in pt-BR language, they're returning with content...
(0) odpowiedzi
2017-10-11 03:10 Creating two dimensional list not working as expected »
I am pretty new to Python, and I have tried something similar to what I am trying here before and got the correct output, but in this case my code is ...
(3) odpowiedzi
2017-10-08 12:10 How I can use CMake for linking Python 2 and Python 3 libraries for a same software »
I am developing an IDE with plugins to support Python 2 and Python 3. The build system is CMake. The problem is when CMake looks for Python 2, the Py...
(1) odpowiedzi
2017-10-07 04:10 Python SyntaxError: invalid syntax, are brackets allowed in function parameters in python3? »
The function works in python2: def setCellValue(self, (x, y), value): self.map[x][y] = value But when I'm trying in python3 it shows invalid sy...
(2) odpowiedzi
2017-10-07 02:10 python - why does multiplication of long and float produce decimal-like answer? »
In this example: long_ten = 10**21 print(' type(long_ten):', type(long_ten)) print(' long_ten: {:52,f}'.format(long_ten)) tenth = 0.1 print(' t...
(2) odpowiedzi
2017-10-07 00:10 How to import a csv-file into a data array? »
I have a line of code in a script that imports data from a text file with lots of spaces between values into an array for use later. textfile = open(...
(2) odpowiedzi
2017-10-05 09:10 Writing python2 codes in python3 »
Can I write python 2 syntaxes in python 3 file and compile with python 3 compiler? What I mean is this: I know that by using future__import one can u...
(1) odpowiedzi
2017-10-04 02:10 membership in Pandas »
fake = {'EmployeeID' : [0,1,2,3,4,5,6] 'ManagerID' : [3,3,5,6,5,4,5] 'Name' : ['A','B','C','D','E','F','G']} df = pd.DataFrame(fake...
(2) odpowiedzi
2017-10-03 06:10 Issue with python version 2.7.3 importing maxrepeat module »
I am trying to import maxrepeat module in python 2.7.3 and couldn’t get much information in google can some one please help. What is the module tha...
(1) odpowiedzi
2017-10-01 22:10 Stop OpenCV for seventeen seconds? python »
I have a motion detection program in OpenCV, and I want it to play a sound when it detects motion. I use winsound. However, OpenCV still seems to be g...
(1) odpowiedzi