mod_python works as standalone, does not as service (Windows XP)

2005-10-02 Thread tt
My mod_python 3.1.4 installation works when Apache 2.0.54 is run in
standalone mode (apache -k standalone) but refuses to operate when run
as a service (apache -k restart).

Logs yield the usual and well-known "make_obcallback: could not import
mod_python.apache" error. I have tried PYTHONHOME, LoadFile
python24.dll (2.4.2) with no result.

I have read *all* threads about make_obcallback that google found.
What's even weirder I had this module working yesterday but had to make
apache cleanup (fresh installation) and now this is completely stuck. I
remember that last time I just had to reinstall Apache over existing
mod_python files to get it working but this time it just pointless.

I thank everyone who understand differences between standalone and
service modes of Apache better than I do.

-- 
http://mail.python.org/mailman/listinfo/python-list


65K length limitation in MySQLdb?

2008-06-09 Thread TT
I'm trying to using the following code insert a long string into a
MySQL table, the data type is of that column is TEXT. When the length
of the content is longer than 65K, it get truncated in the database.
Any idea about this?  Thanks

import MySQLdb
import MySQLdb.cursors

class MyDb:
def __init__(self):
self.conn = None
self.cursor = None

def connect(self):
self.conn = MySQLdb.Connect(
host='localhost', user='user',
passwd='password', db='testdb',compress=1,
cursorclass=MySQLdb.cursors.DictCursor)
self.cursor = self.conn.cursor()

def insert(self, id, content):
try:
self.cursor.execute("INSERT INTO `my_table`(`id`,
`content`) VALUES (%s, %s);", (id, content));
except:
print "Failed to insert new record"
pass
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python, subprocess, dump, gzip and Cron

2008-06-09 Thread TT
On Jun 10, 2:37 pm, Aidan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having a bit of trouble with a python script I wrote, though I'm not
> sure if it's related directly to python, or one of the other software
> packages...
>
> The situation is that I'm trying to create a system backup script that
> creates an image of the system, filters the output though gzip, and then
> uploads the data (via ftp) to a remote site.
>
> The problem is that when I run the script from the command line, it
> works as I expect it, but when it is run by cron I only get a 20 byte
> file where the compressed image should be...  does anyone have any idea
> as to why this might be happening?  Code follows
>
> 
>
> #!/usr/bin/python
>
> from subprocess import PIPE, Popen
> from ftplib import FTP
>
> host = 'box'
>
> filename = '%s.img.gz' % host
> ftp_host = '192.168.1.250'
> ftpuser, ftppass = 'admin', 'admin'
> dest_dir = '/share/%s' % host
>
> dump = Popen('dump 0uaf - /',shell=True,stdout=PIPE)
> gzip = Popen('gzip',shell=True,stdin=dump.stdout,stdout=PIPE)
>
> ftp = FTP(ftp_host)
> ftp.login(ftpuser,ftppass)
> ftp.cwd(dest_dir)
> ftp.storbinary('STOR %s' % filename,gzip.stdout)
> ftp.quit()
>
> print "Image '%s' created" % filename
>
> 
>
> I appreciate all feedback.  Thanks in advance.

it's possible that the cron doesn't have the environment variables you
have, especially $PATH. So the script failed to find the command it
need to create the image.
--
http://mail.python.org/mailman/listinfo/python-list


Package for fast plotting of many data points in Python?

2009-07-09 Thread tt-industries
Hi,

I am programming a oscilloscope module in Python. For this reason, I
want to plot very many data points as fast as possible. This can be
more than 100 000 at once. So far I have been using the ploting module
of wxPython. However, it becomes unstable for more than 25000 points.
Can someone recommend me a faster plotting library? It would be really
cool if one could embed this in wxPython. If someone has an idea I
would be very glad about answer.

With kind regards,

Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list