I'm trying to implement Binary Search tree in python using recursion. I got trapped in some infinite recursions happening in my program.I'm making recursive calls to the function RecursBST by passing address and the data until the top traverse down t
This question already has an answer here: Recursive function returning none in Python [duplicate] 2 answers python recursion return None type 2 answers Return in Recursive Function 3 answers Python recursion and return statements 2 answers Can't figu
I need advice about tesseract. I have try to use Tesseract but the result is not perfect. A lot of information is missing. I would like to scan a registration certificate for the french vehicle and I must to recuperate the data into database. You can
I need to get info of all the docker containers running on a remote server via SSH. There may be several hundred of docker containers running simultaneously. What's the most efficient way to get all the info? Rest API is not an option. What I need to
I'm running the following snippet in Python 2.7.12 under macOS Sierra but I get KeyErrors: import logging from PIL import Image class TaskAddingFilter(logging.Filter): def __init__(self): logging.Filter.__init__(self) def filter(self, record): record
Just trying to submit the form data to the MySQL DB using Ajax & Python- Flask, but the same error "method not allowed" appearing again and again.. kindly look at the codes and help me out... <div class="modal-content"> <d
I am trying to build a program which allows the user to browse to a folder which contains python modules. Once the folder has been selected it will list all python files within that folder as well as all the classes and methods for each module. My qu
suppose I have the module myscript.py; This module is production code, and is called often as %dir%>python myscript.py foo bar. I want to extend it to take keyword arguments. I know that I can take these arguments using the script below, but unfortun
I have to split a text file into a specific amount of words per list in list, probably be best to show in example. say the text file looks like this "i am having a good day today" i have to write a function which looks like this ngrams.makeNGram
I have a csv where I need to count the total number for each category: New_Cell[2] Category I need to count 1 [A01] 1 [A01] 0 [A01] 1 [A01] 0 [A02] 1 [A02] 1 [A02] 2 [A02] 1 [A02] I need it to count each occurrence of TRUE for the if-condition so tha
My yaml file is: clusters: test: tag_cl: tag0 mtest: tag_cl: tag1, tag12 ctest3: tag_cl: tag2, tag22 I want to get value of each tag_cl. I am expecting a below output: tag0 tag1, tag12 tag2, tage22 I tried doing: stream = open('clusters.yml', 'r') da
I am writing a program and I need the program to return a integer say changed to remind the controller that there are something changed.But when I want to return this value, I kept receiving this message: return 1 SyntaxError: 'return' outside functi
Python 2.7: Struggling a little with path.exists import os import platform OS = platform.system() CPU_ARCH = platform.machine() if os.path.exists( os.path.join("/dir/to/place/" , CPU_ARCH) ): print "WORKED" # Linux LD_LIBRARY_PATH = &q
I'm trying to extract numbers from a string like "12+13". When I extract only the numbers from it into a list it becomes [1,2,1,3] actually I want the list to take the numbers as [12,13] and 12,13 should be integers also. I have tried my level b
I'm new to programming, especially Python. If it helps I'm trying the Udacity free class located here: https://www.udacity.com/course/viewer#!/c-ud088/l-3621198668/m-3612388742 I'm at the 1:14 timestamp in that video. The differences are, that I have
Situation: Firstly I am very new to programming, let alone python. My friend and I are working on our first project together. She has a MAC I have windows. Originally, she was taking care of the backend and I was looking at the front end. However, to
As I understand, | tries different subpatterns in alternation and matches the first possible option. Whenever there are multiple groups, the later ones behave unexpectedly when one of the subpatterns is empty giving it priority. Example: re.search("(
I am trying to use Google Drive API (Python) to download some tabs of a spreadsheets file. Are the gids information in the file's metadata? What I am trying to do is (this may not be correct, please suggest :)) : file_metadata = self.service.files().
I want to write a script where a user can get a list of all of the files in a directory and then type in the full filename to view them. Right now, my script will let a user do this once and then it continues onto the next portion of the script. I wo
I am using Opencv 3.0 with Python 2.7, for an Optical Character Recognition I need to find points of each contours that are found by findContours method. When I do debugging, I can see there are 208 countours found but I am curious about how can I ac
I have a Redhat 6 box which originally had python 2.6 installed on it (invoked by /usr/bin/python). A few days ago I installed 2.7.10 (invoked by /usr/local/bin/python or simply python). Earlier today I installed pip using sudo easy_install pip. The
I am able to upload videos to Facebook via their Graph API, but unable to upload captions (cc) for those videos. According to their documentation on uploading video captions only the video id, locale, and srt filename must be provided. However, when
I have created a webcrawler in python 2.7 and i am using mysqldb to insert data into database. I have executed each function as a different script for different webpages, but after i put them into a single file as functions, the program shows error;
Could there possibly be hidden files that I would need to find. Or do I have to re-install Python 2.7 if I want to work with it? ThanksPython installations on OS X generally go in separately and don't uninstall each other. Also, the convention is sti
interest = int(float(raw_input("Interest Rate: "))) monintrate = int(float(( interest / 100.0 ) / 12)) annintrate = int(float(interest / 12)) print "Interest: ",interest print "Mon Int Rate: ",monintrate print "Ann Int R
The program txt.py prints that takes in a directory as a command line parameter and prints all the files of a particular extension def printAll(path): for txtFile in glob.glob(path): print txtFile printAll(sys.argv[1]) In the command line I type in p
I'm running a URL classifier algorithm. I have few URLs related to blogs and I want to find out whether entered URL is for any blogpost or URL for blog whle blog. example 1 - if we enter following URL http://gizmodo.com/ it will tell that above URL i
I'm trying to make a scatter plot of some PCA data. I do some pretty typical code: plt.plot(pca[:,0], pca[:,1], '.',ms=3, markerfacecolor = self.colors[k], markeredgecolor = 'none') I want it to show just the marker face color with no outline. The pr
I am new to python and I have been trying to change my php regex into python but I have run into some problems with this multiline thing. I have been up and down the internet for the past couple days and I can't seem to make sense of it, if someone c
I must submit two forms at once and I don't want javascript. So I think I can post the form to myself, do my work and then post it on to the third-party payment provider. This is to make the order appear in our datastore. The manual says how to submi