I have a somewhat complex problem or at least it appears like this. In my project I'm dealing with really big image files uploaded by users. Storage is provided by separate media server which also generates thumbnails. Thumbnails are not created immediately, so there will be a cron function to check if they're ready. There are also files...
I'm currently in the process of writing a client server app as an exercise and I've gotten pretty much everything to work so far, but there is a mental hurdle that I haven't been able to successfully google myself over.
In the server application am I correct in my thinking that threading the packet handler and database handler to work ...
After following the official tutorial here: tutorial
I'm still having issues adding rows/creating a TreeIter object. Here's what my code looks like:
builder = gtk.Builder()
self.treeview = builder.get_object("treeview")
self.treestore = gtk.TreeStore(str)
self.treeview.set_model(self.treestore)
self.id = gtk.TreeV...
I've decided to dip my toe into the world of asynchronous python with the help of twisted. I've implemented some of the examples from the documentation, but I'm having a difficult time finding an example of the, very simple, client I'm trying to write.
In short I'd like a client which establishes a tcp connection with a server and then ...
I am trying to use an application that has a dependency of ctypes, but am getting this error:
$ python peach.py -t ~/Desktop/fuzz/wav/template.xml
] Peach 2.3.6 Runtime
] Copyright (c) Michael Eddington
Traceback (most recent call last):
File "peach.py", line 335, in <module>
from Peach.Engine import *
File "/opt/Peach-2.3.6/...
I want to make a Google App Engine app that does the following:
Client makes an asynchronous http request
Server starts processing that request
Client makes ajax http requests to get progress
The problem is that the server processing (step #2) may take more than 30 seconds.
I know that you can't have threads on Google Application E...
Is there a way prevent tarfile.extractall (API) from overwriting existing files? By "prevent" I mean ideally raising an exception when an overwrite is about to happen. The current behavior is to silently overwrite the files.
...
I use GtkAboutDialog and everything works fine except the close button of this widget. All other buttons works fine, I don't know how but all buttons have default callbacks and they create and destroy the windows.
But the "Close" button of GtkAboutDialog widget does not work. I can not even see it's widget. So, can I access it?
[CLARIF...
Is it a linked list, an array? I searched around and only found people guessing. My C knowledge isn't good enough to look at the source code.
...
Hello everybody! I came up with the following problem: CODE A works right now.. I am saving a png file called chart.png locally, and then I am loading it into the proprietary function (which I do not have access).
However, in CODE B, am trying to use cStringIO.StringIO() so that I do not have to write the file "chart.png" to the disk. ...
Possible Duplicate:
Python blogs that you regularly follow?
I'm new to Python, from a .Net background, and am looking for advice on who's blogs I should follow? Which sites are good ones to subscribe to?
In .Net I follow codebetter.com, lostechies and a bunch of individual thought leaders. I'm looking for the same thing in ...
Possible Duplicate:
Absolute Beginner's Guide to Bit Shifting?
anyone can explain me that operator << or >>
...
Given 15 players - 2 Goalkeepers, 5 defenders, 5 midfielders and 3 strikers, and the fact that each has a value and a score, I want to calculate the highest scoring team for the money I have. Each team must consist of 1 GK then a formation e.g. 4:4:2, 4:3:3 etc. I started with sample data such as this
player role points cost
I then...
I'm currently using matplotlib to plot a measurement against 2 or 3 other measurements (sometimes categorical) on the x-axis. Currently, I am grouping the data on the x-axis into tuples and sorting them before plotting... the result looks something like the left image below. What I would like to do is to plot the data with multiple x-ax...
I want to do something like this:
parsetable = {
# ...
declarations: {
token: 3 for token in [_id, _if, _while, _lbrace, _println]
}.update({_variable: 2}),
#...
}
However this doesn't work because update doesn't return a...
I'd like to find a way to get a title to truncate if too long, like this:
'this is a title'
'this is a very long title that ...'
Is there a way to print a string in mako, and automatically truncate with "..." if greater than a certain number of characters?
Thanks.
...
Hello, I need your help,
I'm using Eclipse and Pydev plugin as python IDE.
I have configured and set environment variables, libraries etc etc
I created a project, and a module.
When I write these lines and run the program, it gives an error:
`a = 3
b = 4.6
print "%d is the value of a, %.2f is the value of b" %(a, b)`
and the error m...
I'm having a lot of trouble writing unit tests for my app engine patch solution.
I've asked this question on experts exchange (http://www.experts-exchange.com/Programming/Languages/Scripting/Python/Q_26509115.html) but it's been there for two weeks with no answer - hopefully the SO crew can improve on that!!
I've tried everything I've ...
I have an base class, and two subclasses. Each needs to implement a method that's defined in the base class (but in the base class raises an NotImplementedError.. the base class is basically an abstract class).
But, the implementation of the method in one of the subclasses requires more parameters than in the other subclass.
class Subc...
I have a question about how flock() works, particularly in python. I have a module that opens a serial connection (via os.open()). I need to make this thread safe. It's easy enough making it thread safe when working in the same module using threading.Lock(), but if the module gets imported from different places, it breaks.
I was thinkin...