Interesting Tags
   11 tags on

2 answers

Adding stripped line to string/array in Python

I am a fairly new programmer. I am currently trying to find data from .txt files and add them to a string or array, which will then eventually be added to a .csv file. The data I am looking at are ...

1 answer

BeautifulSoup find only elements where an attribute contains a sub-string? Is this possible?

I have a call to find_all() in my BeautifulSoup code. This works currently to get me all images, but if I wanted to target only images which have a sub-string of "placeholder" in their src, how could ...

0 answers

PyGame AttributeError

So I wanted to learn some pygame but everytime I run this simple code it throws off the error: import pygame pygame.init() pygame.quit() quit() And the error: Traceback (most recent call last): ...

1 answer

The most appropriate way to use Neo4j from Python in 2015

I'm using latest community Neo4j (2.2.0-M03) for storing my graphs. I'm interested in accessing it from Python. According to the official Neo4j documentation, there are several alternatives. From ...

0 answers

pandas get “single” keywords from a list found in strings

this is a follow-up of this previous topic. I have a Series of strings w called "British" like this: British \bSkilful\b \bWilful\b \bfulfil\b \b.*favour.*\b \bappal\b \bappall.*\b \barbour.*\b ...

0 answers

HTTP GET request via android not working

I'm trying to code a simple android app to help me sign-in to workouts faster and easily. i did a POC with python: import httplib conn = httplib.HTTPConnection("") ...

1 answer

Time delay in butter filtered trace, why and how to remove it?

I'm filtering a time trace in python using butter from scipy.signal. I use here a low-pass (on a noisy 100 Hz sinus sampled at 10000 points/sec, for example), but the following is true for any filter ...

1 answers | 9 mins ago by fpdx on Stack Overflow
0 answers

explain murmurhash function code line by line

I was searching the web for any explanation about murmur hash code. could anybody explain the code line by line for me? please make it as simple as possible since i am new to programming link to the ...

2 answers

Rotation of a 2D array over an angle using rotation matrix

What I want to do is to rotate a 2D numpy array over a given angle. The approach I'm taking is using a rotation matrix. The rotation matrix I defined as: angle = 65. theta = (angle/180.) * numpy.pi ...

1 answer

Python XML parsing, lxml, urllib.request

I am a little bit stuck trying to parse a XML file retrieved from url, my goal is to get this xml file into a well structured object to easily retrieve its data. My current code results in the ...

1 answers | 12 mins ago by Toothfairy on Stack Overflow
0 answers

pip package to install from url — can it be encrypted?

We have our own internal tool kit that we are packaging into a pip package. Is there a way we can encrypt the packate itself to protect its contents? (Not the sources so much as some of the config ...

1 answer

conditional row read of csv in pandas

I have large csvs where I'm only interested in a subset of the rows. In particular, I'd like to read in all the rows which occur before a particular condition is met. For example, if read_csv would ...

1 answers | 15 mins ago by eretmochelys on Stack Overflow
0 answers

How to reflect and select records using SqlAlchemy and PostgreSQL

I'm in a struggle on how to reflect a Table and run a select() over the reflected Table object using SQLAlchemy and PostgreSQL. Anyone had this running over? Here's what I've tried (which does not ...

1 answer

Django model class methods for predefined values

I'm working on some Django-code that has a model like this: class Status(models.Model): code = models.IntegerField() text = models.CharField(maxlength=255) There are about 10 pre-defined ...

3 answers

How to properly subclass dict and override __getitem__ & __setitem__

I am debugging some code and I want to find out when a particular dictionary is accessed. Well, it's actually a class that subclass dict and implements a couple extra features. Anyway, what I would ...

3 answers | 18 mins ago by Michael Mior on Stack Overflow
1 answer

Updating image text programmatically

I made a mistake and renamed some images on my web-server. This has broken a bunch of image sources in my HTML (300 files or so....!). No back-ups unfortunately so this is a problem I need to fix with ...

2 answers

show reverse dependencies with pip?

Is it possible to show the reverse dependencies with pip? I want to know which package needs package foo. And which version of foo is needed by this package.

2 answers | 20 mins ago by guettli on Stack Overflow
1 answer

Still having “__init__() keywords must be strings” in python2.7 - ReviewBoard

I'm trying to install ReviewBoard( and I stuck with "init() keywords must be strings" problem when I was running it. I read that it is common problem in python2.6. I've ...

1 answers | 20 mins ago by e141757 on Stack Overflow
0 answers

Neither Pillow nor PIL could be imported: No module named Image : working in win 7 and not in ubuntu 14

I have a django project inside a virtualenv. And installed all the dependencies for it. But the when I try to upload photo to the server, I get an error: ImproperlyConfigured at / Neither ...

1 answer

suds error trying to load WSDL

I am trying to load a WSDL using the latest version of suds but getting the next error: from suds.client import Client //.... client = Client(url) Type not found: '(schema, ...

1 answers | 22 mins ago by user669003 on Stack Overflow
0 answers

How to programatically construct a format string for struct.unpack?

I'm attempting to read and parse a binary file with Python. The issue is that the data in the file can be in little-endian or big-endian format, as well as 32- or 64-bit values. In the file header ...

1 answer

How to use caret in lookbehind in Regex?

I want to find all separate words "is" in "is this is that this that this that this is" This finds is everywhere I need except beginning (?<= )is(?= |$) This leads to error with parenthesis ...

0 answers

Can I specify PyPI server information such as username and password on the command line instead of using .pypirc?

My .pypirc file: [distutils] index-servers = pypi internal [pypi] username:pypiusername password:pypipasswd [internal] repository: username: ning password: xxxx I want ...

1 answer

Issues in preserving Excel formatting with Python's xlrd and xlutils

Simply put, I would like to preserve all of the formatting of one Excel file into another. However, despite using the formatting_info=True flag, the formatting only appears for all of the unchanged ...

1 answers | 27 mins ago by user1185790 on Stack Overflow
0 answers

Explain the aggregate functionality in Spark using python

I am looking for some better explanation of the aggregate functionality that is available via spark in python. The example I have is as follows (using pyspark from Spark 1.2.0 version) ...

1 answer

Perform a WebDriverWait() or similar check on a Regular Expression in Python

I would like to be able to perform something similar to a WebDriverWait(), i.e: WebDriverWait(driver, 60).until( expected_conditions.text_to_be_present_in_element((By.XPATH, ...

1 answer

os.listdir throws Error 5 (IO Error) when in background

I am currently writing a plugin-based server for the VK social network. The plugin system is YAPSY, and the process is being backgrounded using os.fork(). I have written a file server plugin for the ...

1 answer

Problems with pip in a virtual environment

I have been trying to install python2.7 with pip on my old ipod 2g version 4.2.1 for a long time now basically following this guide. I always failed on the 10. step because of issues with installing ...

1 answer

Catch an exception and displaying a custom error page

I have a Flask app. I made a custom exception in one of my libraries related to a very specific error that I would like to notify the user about. What I would like to happen is whenever this ...

1 answers | 34 mins ago by clifgray on Stack Overflow
1 answer

Python HTTP server send JSON response

What im doing Im trying to get my hands dirty with python and im making a very simple http server so i can send commands to my arduino via serial. Im validating the commands as i sgould and ...

15 30 50 per page
1 2 3