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.
1
vote
0answers
13 views
Python Simple Parse Tree Interpreter
HI I have a function parse() that takes a list of operators and operands (ex ['+', '20', '10']) tokens, and an index i, and constructs a tree from them. When an operator ( a node with a .left and ...
0
votes
0answers
4 views
PINAX, django-user-accounts and signup code
I am trying to use Pinax with the included django-user-accounts app. I cannot find how I can generate a "signup code" and send it to the user, after the former fills up a form. Is it supported by ...
0
votes
0answers
9 views
trying to modify my personal twitter feed to remove tweets containing links from the feed
Is there a way to create a twitter feed that does not include tweets that have links in them? Not sure what UI I could use for this...maybe make a feed for hootsuite.
I already port tweets with link ...
0
votes
0answers
14 views
How to make cross-module variables in python
I am trying to add a new Frame every time the user clicks "new" on the menu,but I can't seem to somehow import the core program to add the Frame to the notebook. This is my debugging error:
Exception ...
0
votes
0answers
4 views
Property tied to a task instance in celery
Let's say I have:
a list of 3 pairs (login, password) and I intend to create one urllib2 opener for each pair
one task in Celery
concurrency = 3
I want to tie each opener to a Task instance (so ...
1
vote
1answer
5 views
How do I specify an AMQP correlationId with Kombu?
The documentation suggests extra AMQP properties are passed as keyword arguments to publish as according to the AMQP spec, but correlationId="foo" does not seem to have the desired effect.
0
votes
1answer
34 views
how to make a proper object?
I have to create an OOP of a fake tv.
The challenge is
Write a program that simulates a television by creating it as an
object. The user should be able to enter a channel number and
raise or lower ...
0
votes
1answer
12 views
Fluid-like characteristics with Pygame
So I'm trying to write a little simulator thing with pygame, but im stuck
I'm trying to make particles that fall and settle but i want them to stack and stop when they hit a wall
This may sound ...
0
votes
0answers
10 views
Python 2.7 creating/referencing global c-like structure class
Novice python user here. I'm trying to create a class in python that is similar to a struct in C, or a record in other higher level programming languages, which can be used to pass parameters to other ...
0
votes
0answers
7 views
local histogram equalization
I am trying to use do some image analysis in python (I have to use python). I need to do both a global and local histogram equalization. The global version works well however the local version, using ...
0
votes
1answer
22 views
Going through Python the Hard Way and trying to improvise code
I'm on exercise 21 of Learn Python the Hard Way.
Here is the original code:
def add(a, b):
print "ADDING %d + %d" % (a, b)
return a + b
def subtract(a, b):
print "SUBTRACTING %d - %d" % ...
0
votes
0answers
8 views
How to Throw Custom 404 Messages in Python Bottle
With Python's Bottle framework, I'm trying to catch all 404s and replace the framework's output with my own.
How do I catch all thrown 404s and replace them with my own output?
So far, I've reduced ...
0
votes
0answers
6 views
How to enable HiDPI option on PyQt 4.10.3
I'm building a pyqt application on a Retina Macbook Pro, but all graphics seem blurry, as they are rendered on the default lower resolutions.
I've read elsewhere that some HiDPI options might be ...
0
votes
2answers
31 views
split a string on python math comparators
So guys here I am asking trivial questions.
I have this string filterE, I want to break filterE on valid mathematical comparators only.
filterE = "x.y.prop1 ==== 1 and x.y.prop2 >= 2 and x.y.prop1 ...
0
votes
0answers
9 views
extracting connected nodes from weighted undirected graph based on the weight of the edges
Is there a way to extract connected nodes from a weighted undirected networkx graph based on some weight threshold? For example get lists of connected nodes, where weight > 0.5.
So basically ...