Is it possible to change the color of one individual pixel in Python?
I need python to change the color of one individual pixel on a picture, how do I go about that? ...
I need python to change the color of one individual pixel on a picture, how do I go about that? ...
I am trying to list the disk drives that a system may have. On Windows, it may be something like "C:/", "D:/", "E:/". On Linux, it may be something like "/boot", "/media/SDCard", etc. And I don't know what it's like on a Mac. Maybe something under /Volumes. Does anyone know of a cross platform way (that is, one which works on Linux,...
I've found this regex based dispatcher but I'd really rather use something that only uses literal prefix strings. Does such a things exist? I know it wouldn't be hard to write but I'd rather not reinvent the wheel. ...
If I define: class Bar(object): @staticmethod def bar(): # code pass class Foo(Bar): # code pass Is it possible for a function call Foo.bar() to determine the class name Foo? ...
Hello everyone, I'm working on a random text generator -without using Markov chains- and currently it works without too many problems -actually generates a good amount of random sentences by my criteria but I want to make it even more accurate to prevent as many sentence repeats as possible-. Firstly, here is my code flow: 1-Enter a sen...
I am trying to select all the records from a sqlite db I have with sqlalchemy, loop over each one and do an update on it. I am doing this because I need to reformat ever record in my name column. Here is the code I am using to do a simple test: def loadDb(name): sqlite3.connect(name) engine = create_engi...
I have a python script which scrapes a page and receives a cookie. I want to append another cookie to the existing cookies that are being send to the server. So that on the next request I have the cookies from the original page plus ones I set manually. Anyway of doing this? I tried addheaders in mechanize but it was ignored. ...
That's all. It should be very nice to share the same libs on the client and on the server or not? Are JS VMs like HotRuby (http://hotruby.yukoba.jp/) a "real world" alternative or just a toy? PS: if I ask it is because I'd like know it, please don't close this question but just share your opinion. I'm not interested in programming lan...
Hi everybody. I am working on a gtk+ application written in python. I obviously use pygtk. My application is about collections of videos. It's a kind of F-spo or picasa, but for video. As you can see in these two apps, you have a central area where you can see all of your photos with tag thumbnails under. In my app, I want to implemen...
Hello, I have a Google App Engine application and my request hadnler has a decorator that does authentication. With WebTest I found out yesterday how you can set a logged in user and administrator. Now today my authentication decorator got a little more complex. It's also checking if a user has a profile in the database and if he doesn...
Hi, I am trying to display live images from my 1394 camera. Currently my code is able to obtain images in a loop from the camera and I was looking for any quick GUI that will update dynamically (as a separate thread). I can do this in PyQt maybe using QThreads but is there any recommendation or faster way of doing this?? Here's my code ...
I would like to use python to access the system cursor graphics (Xcursor files, I believe). Unfortunately, I do not know enough X to know how to do that. Any suggestions? ...
I am interested in getting the intermediate URLs in a redirect chain using pycURL. So, say I have a website, Site A, which redirects to Site B, which then redirects to Site C. Regularly I would only be able to see Site A (the starting URL) and Site C (the ending URL), however I am also interested in any sites that happen to reside in bet...
Here's my stripped-down setup.py script with non-code stuff removed: #!/usr/bin/env python from distutils.core import setup from whyteboard.misc import meta setup( name = 'Whyteboard', version = meta.version, packages = ['whyteboard', 'whyteboard.gui', 'whyteboard.lib', 'whyteboard.lib.pubsub', 'whyteboar...
Hi. Currently, to determine whether or not there is a next page of entities I'm using the following code: q = Entity.all().fetch(10) cursor = q.cursor() extra = q.fetch(1) has_next_page = False if extra: has_next_page = True However, this is very expensive in terms of the time it takes to execute the 'extra' query. I need to extra...
Hi, I'm just starting out learning python (for webapp usage) but I'm confused as to the best way for using it with html files and dynamic data. I know php has the tags which are great - does python have something like this or equivalent, if not how should I be doing it? Thanks ...
I'm trying to use the new readonly_fields in a ModelForm. class TrainingAddForm(forms.ModelForm): class Meta: model = TrainingTasks readonly_fields = ('trainee_signed','trainee_signed_date') But this does not work. Am I missing something or is this not possible? ...
Possible Duplicate: Choosing a web application framework in python If you were to create a new web app in Python from scratch now, which web framework would you choose and why? If Django is your favorite for example, why do you prefer it over others? For what kind of web apps is it suitable or unsuitable? What are the advant...
Title says it all. I looked through the related questions, there were quite a few but I don't think any answered this question. I am very new to Regex but I'm trying to get better so bear with me please. I am trying to match several groups in a string, but in any order. Is this something I should be using Regex for? If so, how? If it mat...
I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'" ./manage.py loaddata users I'm trying to load a fixture that has the following data: - model: fcl.User fields: firstname: test lastname:...