I am trying to match a range of Unicode characters and I am wondering how to do it. I can match simple ranges like [a-zA-Z] but how do I specify a range of Unicode characters. I've tried
[#xD8-#xF6]
without any luck. Any ideas?
...
Hello.
I use wxPython to sketch up a user interface for the a python program. I need to put 2 toolbars on the same row. One toolbar is on the left while the other is on the right.
I use BoxSizer to achieve this (by putting a stretchable space between 2 toolbars)
However, the stretchable space produces a blank space between 2 toolbar...
I work on a python(django) project. I write csv code as follows,
response = HttpResponse(mimetype='text/csv')
response['Content-Disposition'] = 'attachment; filename=DueDateWiseSearch.csv'
writer = csv.writer(response)
writer.writerow(['Infant Name','Mother Name','Mother Address',
'Next Vaccine Dose','Due date','Coment...
I have put my Django web site up to my web server and have it set up using apache2 and mod_wsgi.. everything works fine most of the time but occasionally it will just give the error that it can't import a module (usually from my views file). However, it's not an issue with that module as it usually works, for example, I will get the erro...
Hellow every one.
I was wondering whether it would be possible to write a python script that retrieves header information from an .exe file. I tried googling but didn't really find any results that were usable.
Thanks.
Sept
...
I am using an io.StringIO object to mock a file in a unit-test for a class. The problem is that this class seems expect all strings to be unicode by default, but the builtin str does not return unicode strings:
>>> buffer = io.StringIO()
>>> buffer.write(str((1, 2)))
TypeError: can't write str to text stream
But
>>> buffer.write(str(...
Hello
Assume that I have a such set of pair datas where index 0 is the value and the index 1 is the type:
input = [('11013331', 'KAT'), ('9085267', 'NOT'), ('5238761', 'ETH'), ('5349618', 'ETH'), ('11788544', 'NOT'), ('962142', 'ETH'), ('7795297', 'ETH'), ('7341464', 'ETH'), ('9843236', 'KAT'), ('5594916', 'ETH'), ('1550003', 'ETH')]
...
I'm using FreeBSD 7.2. I upgraded to Python 2.6. However when I run any python app, it is still using /usr/local/lib/pytho25 as the library path. How do I change it? I cannot modify the python app. Basically I need to change the default lib path to python26.
...
I have a python script which generates some reports based on a DB.
I am testing the script using java Db Units which call the python script.
My question is how can I verify the code coverage for the python script while I am running the DB Units?
...
I've defined a Vector class which has three property variables: x, y and z. Coordinates have to be real numbers, but there's nothing to stop one from doing the following:
>>> v = Vector(8, 7.3, -1)
>>> v.x = "foo"
>>> v.x
"foo"
I could implement "type safety" like this:
import numbers
class Vector:
def __init__(self, x, y, z):
...
I have created web application using java.I wantted to download data from appengine datastroe so that I am using BulkLoader concept.
In my project I designed entity as follows
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long school_id;
@Basic
private String schoolname;
After that I tried to download data so th...
Hi, I have a web app which reads and displays log files generated by python test files. Currently I can launch the python files from cli and it works fine.
However I would like to be able to launch python tests from within the application.
At the minute I have a "Launch test" button which calls a function in the views.py file
def lau...
Hello Guys,
With psycopg2, i get result of query in this form :
[(15002325, 24, 20, 1393, -67333094L,
38, 4, 493.48763257822799,
493.63348372593703), (15002339, 76, 20, 1393, -67333094L, 91, 3,
499.95845909922201, 499.970048093743), (15002431, 24, 20, 1394, -67333094L,
38, 4, 493.493464900383,
493.63348372593703), (150024...
Hi,
I have the problem that objects were unexpectedly deleted and created a minimal example. I dont't know whether it's a bug or if a made a thinking error.
The models are something like that:
class A(models.Model):
related = models.ForeignKey('C', blank = True, null = True)
class B(models.Model):
title = models.CharField(max...
I want to know that why adding a trailing comma after a string makes it tuple. I.e.
abc = 'mystring',
print abc
# ('mystring,)
When I print abc it returns a tuple like ('mystring',).
...
I am connecting to a MS SQL server through SQL Alchemy, using pyodbc module. Everything appears to be working fine, until I began having problems with the encodings. Some of the non-ascii characters are being replaced with '?'
The DB has a collation 'Latin1_General_CI_AS' (I've checked also the specific fields and they keep the same col...
What is the best way to get something similar to django-debug-toolbar working on Google App Engine? At least I want to log all GQL at my local development environment. I am using django-nonrel + djangoappengine + djangotoolbox.
I tried:
debug-toolbar - does not work
http://popcnt.org/2008/05/google-app-engine-tips.html - link to the c...
Say,
I have a python function as following:
def ooxx(**kwargs):
doSomething()
for something in cool:
yield something
I would like to provide another function with named arguments for hints as following:
def asdf(arg1, arg2, arg3=1):
frame = inspect.currentframe()
args, _, _, values = inspect.getargvalues(fram...
I am in the process of writing a small HTTP/1.1 web server. I have threading turned off and am not currently using persistent connections. For normal requests where I specify the Content-Length and write the bytes out to the socket, everything works great.
However, I need the ability to support chunked transfer encoding. When some of th...
Hello,
I've been trying to search for a good Module to in order to use twitter live streaming API and Python. I have found "tweepy" but it seems like it is using the "Basic Authentication" which is now deprecated. Is there any new module out there to use for that purpose that use oAuth?
Thanks,
Joel
...