I am working on a small database application in Python (currently targeting 2.5 and 2.6) using sqlite3.
It would be helpful to be able to provide a series of functions that could setup the database and validate that it matches the current schema. Before I reinvent the wheel, I thought I'd look around for libraries that would provide som...
I can't figure out the problem and want some input as to whether my Python code is incorrect, or if this is an issue or design limitation of Python XMPP library. I'm new to Python by the way.
Here's snippets of code in question below. What I'd like to do is read in a text file of IM recipients, one recipient per line, in XMPP/Jabber ID ...
I have a string that is read from a usb apogee camera that is a 12-bit grayscale image with the 12-bits each occupying the lowest 12 bits of 16-bits words.
I want to create a 8-bit png from this string by ignoring the lowest 4 bits.
I can convert it to a 16-bit image where the highest 4 bits are always zero using PIL with
import Image...
Hi Guys,
I'm using wxPython to create a wizard using the wxWizard control. I'm trying to a draw a colored rectangle but when I run the app, there seems to be a about a 10px padding on each side of the rectangle. This goes for all other controls too. I have to offset them a bit so that they appear exactly where I want them to. Is there a...
hey guys, I need help considering win32com in Python:
I have a routine that opens a Workbook, creates a sheet and puts some data on it.
If everything runs fine the woorkbook is saved and closed - If not the python session is terminated but the woorkbook is left open. So the reference is lost. Now when restarting the code Excel prompts yo...
I got an access_token using facebook Graph API. https://graph.facebook.com/me?access_token=...
I want session key. is there any method to get session key from access_token?.
...
I often do this to prepare for some django debugging:
Open up a terminal window in os x (10.6)
start the python interpreter
run these commands in python:
from django.core.management import setup_environ
import settings
setup_environ(settings)
Is it possible to automate these actions and make a shortcut that I can doubleclick to in...
I am writing a function which prints out detailed Windows Version informations, the output may be a tuple like this:
('32bit', 'XP', 'Professional', 'SP3', 'English')
It will be supporting Windows XP and above. And I'm stuck with getting the Windows edition, e.g., "Professional", "Home Basic", etc.
platform.win32_ver() or sys.getwi...
After reinstalling service wrote in python on the virtual machine with gentoo i get strange situation with open new sockets in scripts.
Python wait(up to 1 minute) to start opening sockets for tcp connections, and this cause tcp timeouts on above servers.
Grateful for help)
...
this code is get the templates/blog1/page.html in b.py:
path = os.path.join(os.path.dirname(__file__), os.path.join('templates', 'blog1/page.html'))
but i want to get the parent dir location:
aParent
|--a
| |---b.py
| |---templates
| |--------blog1
| |-------page.html
|--t...
Hello,
I want to grep the error's out of a log file and save the value as an error. When I use:
errors = os.system("cat log.txt | grep 'ERROR' | wc -l")
I get the return code that the command worked or not. When I use:
errors = os.popen("cat log.txt | grep 'ERROR' | wc -l")
I get what the command is trying to do.
When I run this ...
Hello -
I am trying to send a GET request to a URL that I know returns data in the form of JSON using python. I would like to know how to send this request to http://someurl/path/to/json, and how to parse it - preferably to a python dict. thanks :)
...
Hello.
I'm trying to install dulwich for bzr-git.
now, I use Python 2.6 based bazaar.
(I use msys.)
My steps are as follows:
$ bzr branch lp:dulwich
$ cd dulwich/
$ python setup.py install
running install
running build
running build_py
creating build
:
:
creating build\lib.win32-2.6\dulwich\tests
:
:
running build_ext
building 'dulw...
I'm trying to get the generic views for a date-based archive working in django.
I defined the urls as described in a tutorial, but django returns a 404 error whenever I want to access an url with a variable (such as month or year) in it. It don't even produces a TemplateDoesNotExist-execption. Normal urls without variables work fine.
He...
I tried running this,
>>> urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
But it is giving error like this, can anyone tell me a solution ?
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
urllib2.urlopen('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
File "C:\Python26\lib\urllib2.py"...
Hi folks,
I have a list of functions... e.g.
def filter_bunnies(pets): ...
def filter_turtles(pets): ...
def filter_narwhals(pets): ...
Is there a way to call these functions by using a string representing their name?
e.g.
'filter_bunnies', 'filter_turtles', 'filter_narwhals'
...
I am trying to add the ability to send mails using the default mail client from my python app.
It can be done with the webbrowser module by opening a 'mailto:' URI. But, is there a better and direct way to do this like java's Desktop.mail(URI).
Thanks in advance.
...
Hello,
I am using nosetests to test several scripts. But when I run nosetests it prints out the logging. I know it stores logging info into sys.stderr. Does anyone know how to stop this from outputting to the screen?
I just want the test results to output like when you run unittest normally.
Thanks for any help
...
I realise there aren't any official ones, but I was hoping I could grab an unofficial one from somewhere?
I'm running 32-bit Windows XP on x86 hardware (Core 2 Duo).
...
So now I am still at the Django tutorial part 3:
http://docs.djangoproject.com/en/1.1/intro/tutorial03/#intro-tutorial03
Trying to set up the urls.py with this piece of code provided by the tutorial
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^polls/...