Tagged Questions
Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.
0
votes
0answers
4 views
python youtube api upload on user behalf
I have a situation where I would do the following
user uploads a video
I will re-encode the file to MP4
I need to share it to Youtube after re-encoding.
I was able to setup OAuth URL and get the ...
1
vote
0answers
5 views
0
votes
1answer
13 views
Count two values (total words & uniques) in multiple files (texts) and output a csv in Python
I work with various collections of text files, about which I want to know a variety of things, like word counts, etc. I have code that successfully does this, and now I want to introduce a script into ...
0
votes
0answers
4 views
Django Tutorial pub_date__year filter works and pub_date__second filter doesn't
I'm working my way through the Django tutorial, and I have a model as follows.
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date ...
0
votes
0answers
5 views
Interactive plotting in a loop with matplotlib
I simply want to plot using matplotlib, via ipython, as my data comes in. I am opening ipython using the -pylab option. In the code below, the time.sleep(1) just acts as a place holder for the time it ...
0
votes
1answer
23 views
How to check if the number of lines in the file equal the number of characters in each of the lines?
The file must contain between 3 and 10 lines of text. That is, 3 is the minimum acceptable number of lines, and 10 is the maximum number of lines.
All lines must contain exactly the same number of ...
0
votes
3answers
18 views
Python next substring search
I am transmitting a message with a pre/postamble multiple times. I want to be able to extract the message between two valid pre/postambles. My curent code is
print(msgfile[msgfile.find(preamble) + ...
0
votes
0answers
22 views
Killing a thread with a socket in it (python)
I am pretty new at this.I am trying to build a server(chat server)
Sorry for presenting such a messing code.
There are alot of things that i am going to change about this code.
but as of now i just ...
3
votes
1answer
34 views
How to cut off a varying length tail from a list elegantly?
I'm fairly new to Python, and this is a rather basic question.
I've got a list lst and have at some point computed an integer n with 0<=n<=len(lst) that tells me that (for the purpose at hand) ...
0
votes
0answers
4 views
OAuth signature issue
I'm trying to use python with the rauth library to connect to the QBO api on the intuit partner platform, and I've mostly gotten it to work correctly. However, I'm frequently getting errors when ...
0
votes
0answers
7 views
Python - imposm.parser: PicklingError: Can't pickle <function parse_it at 0x02805DF0>
I am trying to use imposm.parser python library to parse some OSM data.
I am running the tutorial example script:
from imposm.parser import OSMParser
# simple class that handles the parsed OSM ...
0
votes
1answer
20 views
Optimize search to find next matching value in a list
I have a program that goes through a list and for each objects finds the next instance that has a matching value. When it does it prints out the location of each objects. The program runs perfectly ...
0
votes
3answers
64 views
startswith() can't find '//' at the front of my string
I've got a pretty simple python script that reads in a file, and parses it line by line.
It doesn't seem to recognize the '//' at the start of my lines. If I change it to look for '#' at the start ...
1
vote
1answer
14 views
itertools or functools for find-replace list in python
I have a set of strings that are sometimes invalid that I'd like to replace with particular better strings. I've been playing with functools and itertools and would like to try applying these to the ...
1
vote
0answers
18 views
Emacs indentation does not identify variables in Python-mode
So I really like how Emacs automatically colors variables in Python. However, when there is indentation (e.g. within a for loop), it does not color the syntax anymore. Is there an easy solution (same ...