i am able to categorize chars but in telugu script one syllable may contain one or more chars, and when retrieving the chars from the file the syllable is divided and not able to combine them, so please help me out if any one know about telugu script text catagorization
...
I can download multiple files quite fast with many threads at once but the problem is that after a few minutes it tends to slow down gradually to almost a full stop, I have no idea why. There's nothing wrong with my code that I can see and my RAM/CPU is fine.. The only thing I can think of is that urllib2 isn't handling the massive amoun...
I know python can be run on GAE
what is different erlang and python in lay man term?
can erlang run on google app engine ?
...
I have a third-party library (the interface to Xerox's Finite State tools) which come as universal binaries with two variants internally: a PPC and an i386 variant. I also have a Python interface to the library (which uses ctypes).
But when I try to run the example code provided with the Python interface I get an error complaining about...
I'm writing an application in python using sqlalchemy (and Elixir) with sqlite as the database backend. I start a new transaction using the code session.begin_transaction(), but when I call session.rollback() I get the following error:
sqlalchemy.exceptions.OperationalError: (OperationalError) no such savepoint: sa_savepoint_1 u'ROLLBAC...
I'm writing a backup script I intend to execute in a cronjob every night.
The script sets sys.stdout and sys.stderr to an output file to keep a log of what happens.
To do the backup I use the following code
cmd = 'rsync -av --del --stats --filter "- .thumbnails/" ' + \
'--filter "- *~" --filter "- *.iso" --filter "- lost+found/" ...
I have a queue of workers that spawn external third party apps using subprocess. I'd like to control how much of the overall resources of my server these process consume. Some of these external apps also tend to hang for unknown reasons, fixed with a restart.
What's a good way to:
Monitor the overall server load (say, load average or ...
For the new computer science assignment we are to implement a list/array using an inorder binary tree. I would just like a suggestion rather than a solution.
The idea is having a binary tree that has its nodes accessible via indexes, e.g.
t = ListTree()
t.insert(2,0) # 1st argument is the value, 2nd the index to insert at
t.get(0) # ...
I'm really stuck on why the following code block 1 result in output 1 instead of output 2?
Code block 1:
class FruitContainer:
def __init__(self,arr=[]):
self.array = arr
def addTo(self,something):
self.array.append(something)
def __str__(self):
ret = "["
for item in sel...
I've searched all over the web and can't seem to find documentation or even a simple explanation of what PyAPI_DATA() does (even though it is used in the Python header files and cited on python.org). Could anyone care to explain what this is or point me to documentation I am overlooking?
Thanks.
...
What are the best books on how to optimize and profile Python code?
...
Hi, I'm subclassing dict, but ran into a problem with setitem where one assignment works, but another assignment does not. I've boiled it down to the following basic problem:
class CustomDict(dict):
def __setitem__(self, key, value):
super(CustomDict, self).__setitem__(key, value)
Test 1 fails:
data = {"message":"foo"}
CustomDict(...
Here is my situation...
I am trying to dynamically generate a bunch of stuff in my settings.py file on a django site.
I am setting up several sites, (via sites framework) and I want to have some values I plug in to a function that will generate a portion of the settings file for each site.
for example:
from universal_settings import ...
What is the following Python code in PHP?
import sys
li = range(1,777);
def countFigure(li, n):
m = str(n);
return str(li).count(m);
# counting figures
for substr in range(1,10):
print substr, " ", countFigure(li, substr);
Wanted output for 777
1 258
2 258
3 258
4 258
5 258
6 258
7 231
8 147...
Are there any built-in libraries in Python or Numpy to generate random numbers based on various common distributions, such as:
Normal
Poisson
Exponential
Bernoulli
And various others?
Are there any such libraries with multi-variate distributions?
...
I've written a server in Python that is meant to send data to the client in the form "Header:Message"
I would like to be able to have each message sent individually so that the client will need to perform minimal work in order to read the "header" and the "message"
Unfortunately, I can't figure out how to properly flush a python socke...
I've been trying to design a Google AppEngine Python handler regex and haven't been too successful in getting it to work.
I'm trying to handle API calls similar to OpenStreetMap's.
My current regex looks like this:
/api/0.6/(.*?)/(.*?)\/?(.*?)
But when this comes in:
/api/0.6/changeset/723/close
It incorrectly groups 723/close and ...
Ok, so here's the setup. In OS X (>= 10.5), is it possible, given a mounted usb device with a known location, say /Volumes/FLASHDRIVE, to find out whether this device is connecting through another usb device (a card reader for example) and if so, which one.
Ideally, this could all be done in python, but if not that's ok too.
...
I currently do this:
PYTHONPATH=/home/$USER:/home/$USER/respository:/home/$USER/repository/python-stuff
How can I make it so that the PYTHONPATH can include everything subdirectory?
PYTHONPATH = /home/$USER/....and-all-subdirectories
...
I'm writing a parser, and there is LOTS of text to decode but most of my users will only care about a few fields from all the data. So I only want to do the decoding when a user actually uses some of the data. Is this a good way to do it?
class LazyString(str):
def __init__(self, v) :
self.value = v
def __str__(self) :
...