I am using pyAWS wrapper for Amazon Web services. I want to show amazon search results on my web sites. For search I am using following codes.
from pyaws import ecs
ecs.setLicenseKey('Your-AWS-License-Key')
books = ecs.ItemSearch('python', SearchIndex='Books')
But it gives an error:
u'ingParameter'
...
Hi,
I am trying to create a negative of this black and white image. The opposite of white (255) is black (0) and vice versa. The opposite of a pixel with a value of 100 is 155.
I cannot use convert, invert, point, eval, lambda.
Here is my code but it doesnt work yet. Could you please let me know which part i am wrong.
def bw_negative(...
Hi All,
Currently I'm talking to a MS SQLServer using 'Microsoft SQL Server Management Studio Express'. I would like to execute the scripts written using 'Microsoft SQL Server Management Studio Express' from the python environment.
For this, I have connected to the MS SQLServer using pymssql but I'm finding translating the existing SQ...
hi lets assume i have a simple programm in python. This programm is running every five minutes throught cron. but i dont know how to write it so the programm will allow to run multiple processes of its self simultaneously. i want to speed things up ...
...
I am solving a problem of transferring images from a camera in a loop from a client (a robot with camera) to a server (PC).
I am trying to come up with ideas how to maximize the transfer speed so I can get the best possible FPS (that is because I want to create a live video stream out of the transferred images). Disregarding the physica...
I want to make an interactive, simple web application. Where should I start? Preferably python/django because it sounds easiest? you tell me. tia.
...
Is there some function which will tell me how many bytes does a string occupy in memory?
I need to set a size of a socket buffer in order to transfer the whole string at once.
...
Hi,
I have a python project and wanted to make a exe for windows.
In my project I am using pyqt,python and miketex, xlrd.
How to bundle the project so that user in windows can run the exe and every package get install.
I am not able to find any reading materials on this.
Any link will be helpful.
Thanks.
...
I want to store an integer key in shelve. But when I try to store integer key in shelve it give me an error
Traceback (most recent call last):
File "./write.py", line 12, in
data[id] = {"Id": id, "Name": name}
File "/usr/lib/python2.5/shelve.py", line 124, in __setitem__
self.dict[key] = f.getvalue()
File "/usr/lib/pytho...
Hi,
I want to start writing python to support some of my web applications.
Mainly i'm trying to fetch pages, send POST data to urls and some string manipulation.
I understand that there are some disadvantages with the urllib in the new versions.
Can anyone please tell me which release is best for my needs?
Thanks
...
Possible Duplicate:
Python (creating a negative of this black and white image)
Hi,
I am trying to create a negative of this black and white image. The opposite of white (255) is black (0) and vice versa. The opposite of a pixel with a value of 100 is 155. I cannot use convert, invert, point, eval, lambda.
Here is my code but...
Hi folks,
I have successfully setup FastCGI/Django on a IIS 6 Server.
What I don't know how to do, is to enable SSL connections.
Any tips or ideas to get me started? I'm not an IIS expert, so this is quite confusing for me. :)
...
I have an app I'm writing in PySide that has a QML UI. I have subclassed QAbstractListModel in Python:
class MyModel(QtCore.QAbstractListModel):
def __init__(self, parent=None):
QtCore.QAbstractListModel.__init__(self, parent)
self._things = ["foo", "bar", "baz"]
def rowCount(self, parent=QtCore.QModelIndex()):
...
Dear all,
Given a variable that takes on, say, three values, I'm trying to generate all possible combinations of, say, triplets of these variables.
While this code does the trick,
site_range=[0,1,2]
states = [(s0,s1,s2) for s0 in site_range for s1 in site_range for s2 in site_range]
it's somewhat, uhm, clumsy, and is only getting...
Hi all,
Our product model can have multiple campaigns. Our customers change these campaigns frequently and generally on multiple products. So what we need right now seems that we need to show a multiple select widget on a change-list of Product model where our customers can easily change the campaigns.
Any idea on this? Maybe another...
I have an app that serves pages like this /stage/stagename. stagename is variable. The URL mappers just look for a [0-9A-Za-z]+ to fill that slot.
Now, because of my setup, My app will be rooted at /stage/stagename. I cannot change this (without massive changes to my setup which is too tedious right now and a last option).
I need to u...
How can I get a URL-encoded version of a multidimensional dictionary in Python? Unfortunately, urllib.urlencode() only works in a single dimension. I would need a version capable of recursively encoding the dictionary.
For example, if I have the following dictionary:
{'a': 'b', 'c': {'d': 'e'}}
I want to obtain the following string:
...
i am trying to wrap the read and write operation of an instance of a file object (specifically the readline() and write() methods).
normally, i would simply replace those functions by a wrapper, a bit like this:
def log(stream):
def logwrite(write):
def inner(data):
print 'LOG: > '+data.replace('\r','<cr>').repl...
HI, guys.
I am using cmd and optparse to develop a CLI.py for a collection of already-functional classes (CDContainer, CD, etc.). The following are some parts of the code. I have a problem here. when there are exceptions(wrong input type or missing values), the optparse will exit the whole program instead of the specific command method...
Hi all,
I am looking for some python code to efficiently compute interval overlaps.
I've used the interval tree of the bx-python package before, but now need to delete intervals from the tree (or better yet, modify them).
It seems the bx-python tree doesn't support this.
Any pointers?
Thanks.
...