2 answers

Programmatically deleting a worksheet in an ODS file (preferably in Python)

How do I programmatically delete a worksheet in an open document spreadsheet, preferably in Python? I have looked at https://pypi.python.org/pypi/pyexcel-ods/0.0.3 but I don't see any documentation ...

2 answers | 50 secs ago by zadrozny on Stack Overflow stackoverflow.com
7 answers

How to fade color

I would like to fade the color of a pixel out toward white, but obviously maintain the same color. If I have a pixel (200,120,40), will adding 10 to each value to make (210,130,50) make it the same ...

0 answers

Grapheme support in python regex

I'm using the awesome regex module, trying its \X grapheme support. First, I try with the plain old . >>> print regex.match('.', 'Ä').group(0) >>> print regex.match('..', ...

0 answers

flask-sqlalchemy error message: __init__ takes exactly 1 argument (2 given)

I am following a flask tutorial at http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database When I run the db_create.py script I get an error: File ...

0 answers

Taking a queue of integers and making copies of that element

"Write a function named stutter that accepts a queue of integers as a parameter and replaces every element of the queue with two copies of that element in the original queue." Example: q1 = Queue() ...

1 answer

Best place to learn Pygame?

I've been programming for about 3 months now and I chose Python as my first language. I recently finished making my first real project. It's a Blackjack game that I can run in my Mac's terminal but I ...

1 answers | 19 mins ago by Aldo_Sevada on Stack Overflow stackoverflow.com
1 answer

How to get DPI value of an image in Python/Django

I am trying to extract the Dpi value of an image Using python in one of my django powered web application.I am using following function to achieve my desired output that is the Dpi value of an image ...

1 answers | 26 mins ago by Rego on Stack Overflow stackoverflow.com
1 answer

Generating tremolo sine wave

I'm trying to create a tremolo by oscillating between two 430Hz and 450Hz, storing the 16-bit sample in the list wav. However, the audible frequency seems to increase range of oscillation across the ...

1 answers | 27 mins ago by twinlakes on Stack Overflow stackoverflow.com
1 answer

Python regex with unicode strings

Could not match unicode string in python 2.7. expected result 749130 >>> print match("\d+", u'\ufeff749130'.encode('utf-8')) None >>> print match("\d+", u'\ufeff749130') None ...

1 answers | 30 mins ago by Pavel Voropaev on Stack Overflow stackoverflow.com
1 answer

ImportError: No module named parse

I am trying to run web application using mongodb and pymongo to serve data from database. The error I am getting is ImportError: No module named parse. Please see below error.log from apache2 web ...

1 answer

Extract Contributors from repo in python by interacting with GITHUB API V3

I am using pygithub3 wrapper to interact with GITHUB API. I am trying to get the list of contributors from a git repo, following is my code: from pygithub3 import Github gh = Github() s = ...

1 answers | 39 mins ago by D_0909 on Stack Overflow stackoverflow.com
2 answers

Fixing SSL certificate error in exe compiled with py2exe (or PyInstaller)

I've just finished testing a Python programme which involves logging into a site and requires a CSRF cookie to be set. I've tried packaging it as an exe using py2exe and got a socket error. I have the ...

4 answers

[Answered]Python2 string input if-statement script

Below is the script I'm trying to write. I've made other working scripts, including simple if-statement scripts, but I wanted to experiment a bit and try making a script that relies on string inputs ...

0 answers

Downloading Rss Feed in python

I have a scenario where I need to download the xml of the provided url of rss feed. I am using following code for the same: urls = ['http://static.espncricinfo.com/rss/livescores.xml', ...

1 answer

What is the logic of this process

I was working on a problem in Project Euler; and I found a question in SO. The question and accepted answer says; n = 600851475143 i = 2 while i * i < n: while n%i == 0: n = n / i ...

0 answers

error: invalid command 'build_sphinx'

how can I install the documentation for rdflib in mac osx 10.10.1 python 2.7.9? I have followed the instructions as outlined in 1 and I get error: invalid command 'build_sphinx' the documentation does ...

1 answer

Twilio RequestValidator for Python always returns false

I'm trying to use Twilio with Google App Engine. I'm currently trying to validate requests coming in from Twilio with SMS messages. I have a custom handler that has the 2 methods below on it. from ...

1 answer

return pandas DF column with the number of days elapsed between index and today's date

I have a dF that has dates as its index, and I would like to add a new column 'delta' that shows the number of days between the date in the index and todays date. I have: dF['today'] = '2015-01-30' ...

1 answers | 53 mins ago by headdetective on Stack Overflow stackoverflow.com
1 answer

Sorting foreign key items in the template

The following code works in an application: user.tweets.order_by(Tweet.message) The following code works in a jinja2 template: {% for tweet in user.tweets %} But the following code fails in a ...

1 answers | 57 mins ago by stenci on Stack Overflow stackoverflow.com
1 answer

PDFMiner - export pages as List of Strings

I'm looking to export text from pdf as a list of strings where the list is the whole document and strings are the pages of the PDF. I'm using PDFMiner for this task but it is very complicated and I'm ...

1 answers | 1 hour ago by Haroon on Stack Overflow stackoverflow.com
2 answers

Dictionaries overwriting in Python

This program is to take the grammar rules found in Binary.text and store them into a dictionary, where the rules are: N = N D N = D D = 0 D = 1 but the current code returns D: D = 1, N:N = D, ...

1 answer

python multithread logic hole

I can't think of a solution to this logic problem in python multithreading Each thread created does this: wait on condition variable C1 Do the required work decrement a counter NT using a lock Lnt ...

1 answers | 1 hour ago by Bing Bang on Stack Overflow stackoverflow.com
0 answers

How to recognize table start/end in CSV file exported from excel?

I have strange excel file and when I export to CSV I have all tables from excel separated by ,,,,,,,,,,,,,, which I assume is protocol way to represent separation between tables. I have to write ...

3 answers

i keep getting the error 'module' object has no attribute 'init'

Especially when i run it from an external python file and just run it using IDLE or Pycharm..Please Help...but at times it works with in the interactive shell and then something happens and it starts ...

3 answers

How to retry urllib2.request when fails?

When urllib2.request reaches timeout, a urllib2.URLError exception is raised. What is the pythonic way to retry establishing a connection?

3 answers | 1 hour ago by iTayb on Stack Overflow stackoverflow.com
1 answer

Django query exception __init__() got an unexpected keyword argument 'hints'

I'm pretty new to Django/Python and having a bit of trouble sorting this out. Ubuntu 14.04 Apache Django 1.7.4 python 2.7 Postgresql __init__() got an unexpected keyword argument 'hints' Request ...

1 answers | 1 hour ago by James on Stack Overflow stackoverflow.com
2 answers

Why does scrapy throw an error for me when trying to spider and parse a site?

The following code class SiteSpider(BaseSpider): name = "some_site.com" allowed_domains = ["some_site.com"] start_urls = [ ...

2 answers

554 SMTP Mail Error Django

I've recently set up a Django 1.7.3 website on my Ubuntu 12.04 server using Apache and mod_wsgi. Everythink works fine except the mail sending. I don't understand why this does not work since I've ...

0 answers

Python Continue inside nested loops, getting to the right level of the nesting

I am working on something that needs to make it's way through several levels of checking if conditions are met before either exiting all together or setting certain variables and then starting the ...

1 answer

Generating addition combinations from an int list in python

I have an array of floats of unknown length. The numbers range from 0-1000. I'm looking to generate every possible addition combination from those numbers that is less than a user defined value and ...

1 answers | 1 hour ago by abd on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3