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.

learn more… | top users | synonyms (2) | python jobs

0
votes
0answers
2 views

CFG for python-style tuples

After having read for the zillionth time a question about "How do I parse HTML with Regex" on Stackoverflow, I got myself interested again in grammars, grabbed my university scripts and after a few ...
0
votes
0answers
3 views

Animation with pcolormesh routine in matplotlib, how do I initialize the data?

I am trying to animate a pcolormesh in matplotlib. I have seen many of the examples, most of them using a 1D plot routine, and some of them with imshow(). My problem is, first, that I do not know if I ...
0
votes
1answer
13 views

convert an integer number in a date to the month name using python

I do have this string '2013-07-01' and I want to convert it to July 1, 2013 How to do that using python? Thanks!
0
votes
0answers
8 views

Is ZODB Bloat necessarily a bad thing?

I'm writing a software which retrieves webpages, extracts some key information about them into an object and then writes that to a ZODB database. I end up with roughly 350,000 of these objects being ...
1
vote
0answers
11 views

Installing nose using pip, but bash doesn't recognize command on mac

I'm trying to install nose on my computer for the Learn Python the Hard Way tutorial, but can't seem to get it to work. I'm using pip to install: $ pip install nose And I get back: Requirement ...
0
votes
2answers
18 views

matching un-closed font tags in the same line using regex

i know that regex is not good for parsing html, however this is only a single line string that is imputed to a function. for example, <font color = "#ff0000"> hello </font>. now for the ...
0
votes
0answers
22 views

Passing Javascript Array to Flask

I have a function in flask called array that takes in a list and prints out the items in the list: def array(list): string = "" for x in list: string+= x return string On the ...
0
votes
0answers
5 views

How to split a notebook in wxpython?

I have placed a notebook on a panel, notebook has 4 pages. Now I want to split each page horizontally. Top split will contain grid cells, and bottom will contain chart. How to do this? Regards
0
votes
0answers
38 views

How does this code for Project Euler #73 work?

I've solved the problem 73 myself (using simple terms counting). But I saw a faster solution on the forum, which I couldn't understand: def calc_less_than(x, n): #a[q] - number irreducible ...
1
vote
0answers
12 views

How to handle a pointer to a pointer with Python and ctypes

I'm trying to model a struct found in a library I'm wrapping, where the struct has a pointer-to-a-pointer like this: typedef struct item_t { char* name; } typedef struct container_t { item_t ...
0
votes
0answers
5 views

Scikit Learn Gaussian HMM: ValueError: startprob must sum to 1.0

I am currently working with Scikit Learn and have been running into the following issue while trying to train a Gaussian HMM: File "/Library/Python/2.7/site-packages/sklearn/hmm.py", line 443, in ...
0
votes
0answers
10 views

django magic urls for user registration best practices

What's the best practice for creating 'magic' url's for user registration in django? Currently we're using allauth for the user reg part. I'll use groups for the example. You have a group and you want ...
1
vote
0answers
3 views

NSStream Delegate NSStreamEventHasBytesAvailable Not Being Called

I'm writing a messaging app that uses a NSStream to communicate with a server written in Python. The server works perfectly with a companion Python client. But when I connect to it with a NSStream, ...
0
votes
1answer
22 views

Use of -q Flag in Python

What does the -q flag in Python mean/do ? Also how do I access a list of the flags through the terminal (Cygwin) ? I tried help() and then -q but that said that -q could not be found.
0
votes
1answer
29 views

How do I execute a complex shell find command from Python?

I'm trying to execute a complex shell command from inside of python. The naive attempt: subprocess.call(["find", ".", "-exec touch {} \;"], cwd=".") is failing. How do I go about doing this?

15 30 50 per page