where can I find GladeGen?
I'd like to design a GUI using Glade, and generate python code from it. The thing is, I can't find GladeGen. Does anyone know where it can be downloaded from? ...
I'd like to design a GUI using Glade, and generate python code from it. The thing is, I can't find GladeGen. Does anyone know where it can be downloaded from? ...
In followup to an earlier question, I'd be interested to know whether anyone can recommend some open-source Python-based Google App Engine projects with complex user-role-permission models to consult as a reference. A link to the code would be nice. In my own project, I'd like to add a layer of organizations in addition to the usual ro...
I'm trying (in python) to use gtk.Widget.add_accelerator... what should I pass as accel_key to use the F keys? Have attempted to check the docs to no avail. Thanks ...
Is there any reason why a QMenu cannot be added from the Qt Designer? I find it weird that you can add other widget types but not this. ...
Python's file.read() function won't read anything. It always returns '' no matter what's inside the file. What can it be? I know it must be something straightforward, but I can't figure it out. UPD: I tried with 'r' and 'w+' modes. UPD: The code was: >>> file = open('helloworld', 'w+') >>> file.read() '' Solution: It jus...
The preferred size of the wx.TreeCtrl seems to be the minimum size into which all elements will fit when the tree is completely collapsed. Is there a good (ie cross-platform compatible) way to compute the width of the tree with everything expanded? My current solution is this: def max_width(self): dc = wx.ScreenDC() dc.SetFont...
This is related to question How to generate all permutations of a list in Python How to generate all permutations that match following criteria: if two permutations are reverse of each other (i.e. [1,2,3,4] and [4,3,2,1]), they are considered equal and only one of them should be in final result. Example: permutations_without_duplicate...
Why was the imputil module removed from python3.0 and what should be used in its place? ...
I want to create a dictionary whose values are lists. For example: {1: ['1'], 2: ['1', '2'], 3: ['1', '2']} If I do: d = dict() a = ['1', '2'] for i in a: for j in range(int(i), int(i) + 2): d[j].append(i) I get a KeyError, because d[...] isn't a list. In this case, I can add the following code after the assignment ...
Where can I find an example implementation of the "New Import Hooks" described in PEP 302? I would like to implement a custom finder and loader in the most forward compatible way possible. In other words, the implementation should work in python 2.x and 3.x. ...
I don't know if this is the place to ask about algorithms. But let's see if I get any answers ... :) If anything is unclear I'm very happy to clarify things. I just implemented a Trie in python. However, one bit seemed to be more complicated than it ought to (as someone who loves simplicity). Perhaps someone has had a similar problem? ...
I am building a web application that has a real-time feed (similar to Facebook's newsfeed) that I want to update via a long-polling mechanism. I understand that with Python, my choices are pretty much to either use Stackless (building from their Comet wsgi example) or Cometd + Twisted. Unfortunately there is very little documentation reg...
How can I get the class that defined a method in Python? I'd want the following example to print "__main__.FooClass": class FooClass: def foo_method(self): print "foo" class BarClass(FooClass): pass bar = BarClass() print get_class_that_defined_method(bar.foo_method) ...
I'm trying to reload a module I have already inputted. I understand that you only need to input once and retyping the input command won't produce the same affect without having had exited out of python's command prompt. I just don't understand why this statement: reload (script4.py) is giving me: Traceback (most recent call last): F...
This is somewhat of a simple question and I hate to ask it here, but I can't seem the find the answer anywhere else: is it possible to get multiple values from the user in one line of Python? For instance, in C I can do something like this: scanf("%d %d", &var1, &var2). However, I can't figure out what the Python equivalent of that is....
i have taken input in two different lists by splitting a line having integers 1 2 for eg 1 2 3 4 so now i have split it and kept it in lists , and want to multiply them like 1*3 +2*4, but when i try to do it , its giving me that it can only multiply integers and not lists !! help here can't multiply sequence by non-int of type 'list...
In the tutorial there is an example for finding prime numbers. >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print(n, 'equals', x, '*', n//x) ... break ... else: ... # loop fell through without finding a factor ... print(n, 'is a prime number') ... I...
I use python 2.4.1 on Linux, and a python package written inside the company I work in, for establishing a connection between 2 hosts for test purposes. Upon establishing the connection the side defined as the client side failed when calling socket.connect with the correct parameters (I checked) with the error code 111. After searching ...
I am trying to find out a^b in python, of really large no.s My code is this: t=raw_input() c=[] for j in range(0,int(t)): n=raw_input() a=[] a,b= (int(i) for i in n.split(' ')) c.extend(pow(a,b)) for j in c: print j And I am getting an error like this: raceback (most recent call last): File "C:/Python26/lastdi...
I want to convert a string into integer in python. I am typecasting it, but in vain please help!! t=raw_input() c=[] for j in range(0,int(t)): n=raw_input() a=[] a,b= (int(i) for i in n.split(' ')) d=pow(a,b) d.str() c.append(d[0]) for j in c: print j When I try to convert it to string, it's showing an erro...