Re: ctypes callback with char array

2012-06-02 Thread Diez B. Roggisch
ohlfsen writes: > Hello. > > Hoping that someone can shed some light on a tiny challenge of mine. > > Through ctypes I'm calling a c DLL which requires me to implement a callback > in Python/ctypes. > > The signature of the callback is something like > > void foo(int NoOfElements, char Elements[

Re: Python 2.7.3, C++ embed memory leak?

2012-06-02 Thread Diez B. Roggisch
Qi writes: > Hi guys, > > Is there any known memory leak problems, when embed Python 2.7.3 > in C++? > I Googled but only found some old posts. > > I tried to only call Py_Initialize() and Py_Finalize(), nothing else > between those functions, Valgrind still reports memory leaks > on Ubuntu? > >

Re: configobj validation

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > On 03/19/2012 12:59 PM, Andrea Crotti wrote: >> I seemed to remember that type validation and type conversion worked >> out of the box, but now >> I can't get it working anymore. >> >> Shouldn't this simple example actually fail the parsing (instead it >> parses perfectly

Re: pypi and dependencies

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > When I publish something on Pypi, is there a way to make it fetch the > list of dependencies needed by my project automatically? > > It would be nice to have it in the Pypi page, without having to look > at the actual code.. > Any other possible solution? I don't understa

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Diez B. Roggisch
John Nagle writes: > I think that somewhere in "suds", they subclass the "unicode" type. > That's almost too cute. > > The proper test is > > isinstance(s,unicode) Woot, you finally discovered polymorphism - congratulations! Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: A http server

2011-01-28 Thread Diez B. Roggisch
Back9 writes: > Hi, > I'm trying to set up a http server to handle a single POST request. > That POST request is to upload a huge file and the server is supposed > to handle it with the just POST request. > With my python sample code, multiple post requests are working well, > but that is not my

Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz writes: > On 3 Gen, 22:17, Adam Skutt wrote: >> On Jan 3, 4:06 pm, Jean-Paul Calderone >> wrote: >> >> >> >> > > Multiple processes, ok, but then regarding processes' interruption >> > > there will be the same problems pointed out by using threads? >> >> > No.  Processes can be terminate

Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
Gerry Reno writes: > On 01/03/2011 03:13 PM, Diez B. Roggisch wrote: >> >> A fun hack. Have you bothered to compare it to the PyPy javascript >> backend - perfomance-wise, that is? >> >> Diez >> > > I don't think that exists anymore. Didn

Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
azakai writes: > Hello, I hope this will be interesting to people here: CPython running > on the web, > > http://syntensity.com/static/python.html > > That isn't a new implementation of Python, but rather CPython 2.7.1, > compiled from C to JavaScript using Emscripten and LLVM. For more > details

Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz writes: > On 31 Dic 2010, 23:25, Alice Bevan–McGregor > wrote: >> On 2010-12-31 10:28:26 -0800, John Nagle said: >> >> > Even worse, sending control-C to a multi-thread program >> > is unreliable in CPython.  See "http://blip.tv/file/2232410"; >> > for why.  It's painful. >> >> AFIK, that

Re: Is there anyway to run JavaScript in python?

2011-01-03 Thread Diez B. Roggisch
crow writes: > Hi, I'm writing a test tool to simulate Web browser. Is there anyway > to run JavaScript in python? Thanks in advance. Not really. Yes, you can invoke spidermonkey. But the crucial point about running JS is not executing JS, it's about having the *DOM* of the browser available. Wh

Re: position independent build of python

2010-12-03 Thread Diez B. Roggisch
erikj writes: > If my understanding is correct, the sys.prefix variable holds the root > directory python uses to find related files, and eg its site-packages. > > the value of sys.prefix is specified at compile time. > > it seems that on windows, when I build/install python at one location, > an

Re: pyqt4: multi-threaded database access

2010-11-24 Thread Diez B. Roggisch
Adrian Casey writes: > I have a PyQt4 multi-threaded application which accesses many hosts > concurrently via ssh. I would like each thread to have access to a > database so that it can look up details about the particular system it > is connected to. > > The easy way is to have each thread crea

Re: Round Trip: C to Python to C Module

2010-11-19 Thread Diez B. Roggisch
Eric Frederich writes: > I have a proprietary software PropSoft that I need to extend. > They support extensions written in C that can link against PropLib to > interact with the system. > > I have a Python C module that wraps a couple PropLib functions that I > call PyProp. >>From an interactive

Re: How to correctly pass “pointer-to-pointer ” into DLL via ctypes?

2010-11-19 Thread Diez B. Roggisch
Grigory Petrov writes: > Hello. > > I have a DLL that allocates memory and returns it. Function in DLL is like > this: > > void Foo( unsigned char** ppMem, int* pSize ) > { >   * pSize = 4; >   * ppMem = malloc( * pSize ); >   for( int i = 0; i < * pSize; i ++ ) (* pMem)[ i ] = i; > } > > Also,

Re: QT window closes immediately

2010-11-16 Thread Diez B. Roggisch
Martin Caum writes: > I am attempting to open a window on mouse activity which works, but > the window fails to stay open. > I set it to terminate when the escape key is pressed even when the > program is not currently selected. This works fine. Originally I had > it create the window only with a

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Diez B. Roggisch
Artur Siekielski writes: > On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: >> You don't say what data you share, and if all of it is needed for each >> child. So it's hard to suggest optimizations. > > Here is an example of such a problem I'm de

Re: Getting references to objects without incrementing reference counters

2010-11-14 Thread Diez B. Roggisch
Artur Siekielski writes: > Hi. > I'm using CPython 2.7 and Linux. In order to make parallel > computations on a large list of objects I want to use multiple > processes (by using multiprocessing module). In the first step I fill > the list with objects and then I fork() my worker processes that d

Re: Why datetime module is so complicated?

2010-11-14 Thread Diez B. Roggisch
Zeynel writes: > It's about a week now I've been trying to convert a datetime object to > seconds since epoch; the object is set to current time by class Rep() > in Google App Engine: > > class Rep(db.Model): > ... > mCOUNT = db.IntegerProperty() > mDATE0 = db.DateTimeProperty(auto_no

Re: scipy code runs in empty directory, not another

2010-11-13 Thread Diez B. Roggisch
Beliavsky writes: > After installing numpy, scipy, and matplotlib for python 2.6 and > running the code from http://www.scipy.org/Cookbook/OptimizationDemo1 > (stored as xoptimize.py) in a directory with other python codes, I got > the error messages > > C:\python\code\mycode>python xoptimize.py

Re: strange behavor....

2010-11-13 Thread Diez B. Roggisch
alex23 writes: > Tracubik wrote: >> why the integer value doesn't change while the list value do? > > http://effbot.org/pyfaq/why-are-default-values-shared-between-objects.htm Not the issue here. The reason the OP sees a difference that there is only one way to pass parameters in python. Ther

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Diez B. Roggisch
macm writes: > Hi Folks > > How find all childrens values of a nested dictionary, fast! There is no faster than O(n) here. > a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,1

Re: no line breaks in xml file with elementTree

2010-10-31 Thread Diez B. Roggisch
hackingKK writes: > On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote: >> In message, hackingKK >> wrote: >> >> >>> I want to know if there is a way to have the ElementTree module write to >>> an xml file with line breaks? >>> >> Why does it matter? The XML files you generat

Re: xml : remove a node with dom

2010-10-28 Thread Diez B. Roggisch
alain walter writes: > Hello, > I have many difficulties to manipulate xml routines. I'm working with > python 2.4.4 and I cannot change to a more recent one, then I use dom > package, why not. > In the following code, I'm trying unsuccessfully to remove a > particular node. It seems to me that i

Re: downcasting problem

2010-10-25 Thread Diez B. Roggisch
Nikola Skoric writes: > Hi everybody, > > I need to downcast an object, and I've read repeatedly that if you > need to downcast, you did something wrong in the design phase. So, > instead of asking how do you downcast in python, let me explain my > situation. > > I have a 2-pass parser. 1st pass

Re: Getting returncode of a command executed with Popen through xterm

2010-10-19 Thread Diez B. Roggisch
amfr...@web.de writes: > Hi, > > i have a program that have to execute linux commands. I do it like this: > > retcode = Popen(["xterm", "-e", command],stdin=PIPE, stdout=PIPE, > stderr=PIPE) > > I have to use xterm because some commands need further input from the > user after they are executed. >

Re: error in loading data into the code

2010-10-18 Thread Diez B. Roggisch
nakisa writes: > hello , I have started python last week,so maybe my question is a bit > stupid. > I got this error in my simple python code while trying to load data > into the code. I have added this libaraies > from pylab import * > from scipy import * > import matplotlib.mlab as mlab > from n

Re: python/c api

2010-10-16 Thread Diez B. Roggisch
alex23 writes: > On Oct 15, 5:53 am, de...@web.de (Diez B. Roggisch) wrote: >> For example Ableton Live, an audio sequencer. > > I _have_ Live and I didn't realise this :O Thanks! Well, it's not a feature for end-users, it's used internally for some midi controll

Re: GCC process not working as expected when called in Python (3.1.2) subprocess-shell, but OK otherwise

2010-10-14 Thread Diez B. Roggisch
Kingsley Turner writes: > Hi, > > I'm using GCC as a pre-processor for a C-like language (EDDL) to > handle all the includes, macros, etc. producing a single source file > for another compiler. My python code massages the inputs (which > arrive in a .zip file), then calls GCC. > > I have a prob

Re: python/c api

2010-10-14 Thread Diez B. Roggisch
Tony writes: > hi, > > is the python/c api extensively used? and what world-famous software > use it? thanks! It is, for a lot of extensions for python, and a lot of embedding python into a software. For example Ableton Live, an audio sequencer. Arc GIS has it, and the Eve Online. Many more do,

Re: send command to parent shell

2010-10-14 Thread Diez B. Roggisch
Martin Landa writes: > Hi, > > is there a way how to send command from python script to the shell > (known id) from which the python script has been called? More > precisely, the goal is to exit running bash (on Linux) or cmd (on > Windows) directly from wxPython application, currently user needs

Re: how to add patch

2010-10-13 Thread Diez B. Roggisch
jimgardener writes: > hi > I have some demo python code hosted on a public host that uses > subversion..and I want to modify one of the files using a patch file > handed to me by another person..How do I do this?Generally I checkout > the code and make the change and then commit again..I have ne

Re: Difficulty in easy_install

2010-10-13 Thread Diez B. Roggisch
John Nagle writes: > On 10/11/2010 1:45 AM, sankalp srivastava wrote: >> >> I am having difficulty in easy_installing >> I use a proxy server and strange errors , like it can't fetch the >> package is showing up . >> the package is pyspeech ...please help me :( >> >> I don't know if the proxy s

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Diez B. Roggisch
Gregory Ewing writes: > Philip Semanchuk wrote: > >> Hi Greg, >> Are you talking about compiling Python itself or extensions? > > I've managed to get Python itself compiled as 32 bit, > and that also seems to take care of extensions built > using 'python setup.py ...'. > > I'm mainly concerned ab

Re: Difficulty in easy_install

2010-10-11 Thread Diez B. Roggisch
sankalp srivastava writes: > I am having difficulty in easy_installing > I use a proxy server and strange errors , like it can't fetch the > package is showing up . > the package is pyspeech ...please help me :( > > I don't know if the proxy server is causing the problems , in linux i > would ha

Re: emdding python gui in c code - OS independent

2010-10-11 Thread Diez B. Roggisch
tinauser writes: > On Oct 11, 6:49 pm, Chris Rebert wrote: >> On Mon, Oct 11, 2010 at 6:16 AM, tinauser wrote: >> > hi there, >> > i need to embed python GUI in a c++ code. I've seen that,while on >> > windows running GUI is no problem, in mac i need to use pythonw >> > instead python. >> > the

Re: Control webbrowser from Python script

2010-10-09 Thread Diez B. Roggisch
Johny writes: > On Oct 9, 5:17 pm, Tim Harig wrote: >> On 2010-10-09, Johny wrote: >> >> > Is it possible to control any webbrowser from Python ? For example to >> > issue http POST and GET  command >> >> The most reliable way to interact with a webserver is through the urllib >> and httplib mo

Re: how to find difference in number of characters

2010-10-09 Thread Diez B. Roggisch
harryos writes: > On Oct 9, 4:52 pm, Peter Otten <__pete...@web.de> wrote: > >> >> You might get more/better answers if you tell us more about the context of >> the problem and add some details that may be relevant. >> >> Peter > > I am trying to determine if a wep page is updated by x number of

Re: how to handle network failures

2010-10-09 Thread Diez B. Roggisch
harryos writes: > hi > I am trying to write a DataGrabber which reads some data from given > url..I made DataGrabber as a Thread and want to wait for some interval > of time in case there is a network failure that prevents read(). > I am not very sure how to implement this > > class DataGrabber(

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-07 Thread Diez B. Roggisch
Lawrence D'Oliveiro writes: > In message <87d3rorf2f....@web.de>, Diez B. Roggisch wrote: > >> Lawrence D'Oliveiro writes: >> >>> What exactly is the point of a BOM in a UTF-8-encoded file? >> >> It's a marker like the "coding:

Re: hashkey/digest for a complex object

2010-10-07 Thread Diez B. Roggisch
kj writes: > In <87pqvmp611@web.de> de...@web.de (Diez B. Roggisch) writes: > >>I tried codesearch first. Not satisfied after 30 seconds with the >>results, I did the most straight forward thing - I downloaded and >>un-packed the python source... and took a look

Re: hashkey/digest for a complex object

2010-10-07 Thread Diez B. Roggisch
kj writes: > In de...@web.de (Diez B. Roggisch) writes: > >>kj writes: > >>> The short version of this question is: where can I find the algorithm >>> used by the tuple class's __hash__ method? > >>Surprisingly, in the source: > >>http:

Re: ConFoo spam?

2010-10-07 Thread Diez B. Roggisch
Chris Withers writes: > Hi All, > > Is it just me or does the mailing of just about every single > python-based project mailing list with a 90% form email advertising a > conference that only has one python track *and* clashes with PyCon > feel just a bit like spam? > > I know it's enough to put

Re: how to write an xml file without dom.ext?

2010-10-07 Thread Diez B. Roggisch
hackingKK writes: > Hello all. > I need to create an xml file. > I am using dom.minidom module. > It works fine as long as the xml tree is created. > But I get the import error for dom.ext. > I searched through the python docs but can't find a solution. > I am pritty sure that there is way to wri

Re: list parameter of a recursive function

2010-10-07 Thread Diez B. Roggisch
TP writes: > Diez B. Roggisch wrote: > >> Back to your example: your solution is perfectly fine, although a bit >> costly and more error-prone if you happen to forget to create a copy. >> A safer alternative for these cases is using tuples, because they are >> immut

Re: help!!!

2010-10-06 Thread Diez B. Roggisch
Seebs writes: > On 2010-10-06, Diez B. Roggisch wrote: >> With an impressive amount of technological experience under his belt. So >> I'm a bit aghast to see him struggle with this rather simple >> problem. Thus my question... > > It does seem a bit odd. > &

Re: help!!!

2010-10-06 Thread Diez B. Roggisch
Seebs writes: > On 2010-10-06, Diez B. Roggisch wrote: >> writes: >>> plz can u convert this cpp file into python i need that badly as soon as >>> possible... I am new to python. I just wanna learn it > >> For such an aspiring student of the art of

Re: suggestions please "what should i watch for/guard against' in a file upload situation?"

2010-10-06 Thread Diez B. Roggisch
Martin Gregorie writes: > On Wed, 06 Oct 2010 09:02:21 -0700, geekbuntu wrote: > >> in general, what are things i would want to 'watch for/guard against' in >> a file upload situation? >> >> i have my file upload working (in the self-made framework @ work without >> any concession for multipart

Re: suggestions please "what should i watch for/guard against' in a file upload situation?"

2010-10-06 Thread Diez B. Roggisch
Seebs writes: > On 2010-10-06, Diez B. Roggisch wrote: >> Seebs writes: >>> On 2010-10-06, geekbuntu wrote: >>>> in general, what are things i would want to 'watch for/guard against' >>>> in a file upload situation? > >>> This q

Re: list parameter of a recursive function

2010-10-06 Thread Diez B. Roggisch
TP writes: > Hi, > > I have a function f that calls itself recursively. It has a list as second > argument, with default argument equal to None (and not [], as indicated at: > http://www.ferg.org/projects/python_gotchas.html#contents_item_6 ) > > This is the outline of my function: > > def f ( a

Re: hashkey/digest for a complex object

2010-10-06 Thread Diez B. Roggisch
kj writes: > The short version of this question is: where can I find the algorithm > used by the tuple class's __hash__ method? Surprisingly, in the source: http://google.com/codesearch/p?hl=de#-2BKs-LW4I0/trunk/python/src/Objects/tupleobject.c&q=python%20tuplehash&sa=N&cd=1&ct=rc > Now, for t

Re: suggestions please "what should i watch for/guard against' in a file upload situation?"

2010-10-06 Thread Diez B. Roggisch
Seebs writes: > On 2010-10-06, geekbuntu wrote: >> in general, what are things i would want to 'watch for/guard against' >> in a file upload situation? > > This question has virtually nothing to do with Python, which means you > may not get very good answers. In contrast to "comp.super.web.expe

Re: help!!!

2010-10-06 Thread Diez B. Roggisch
writes: > plz can u convert this cpp file into python i need that badly as soon as > possible... I am new to python. I just wanna learn it For such an aspiring student of the art of computer programming, I have the strange feeling of lack-of-effort-showing here. Do I have to lose my faith i

Re: subclass constructor problem

2010-10-05 Thread Diez B. Roggisch
Nikola Skoric writes: > I have a superclass Element and a subclass Family. All Family.__init__() does > is run Element.__init__() and self.__parse(). For some reason it seems like > self.__parse() isn't run. Here is the code: > http://github.com/dijxtra/simplepyged/blob/8d5a6d59268f6760352783cc

Re: direct print to log file

2010-10-05 Thread Diez B. Roggisch
Dirk Nachbar writes: > How can I direct all print to a log file, eg some functions have their > own print and I cannot put a f.write() in front of it. you can replace sys.stdout with something that performs logging. class MyWriter(object): def __init__(self, old_stream): self.o

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-05 Thread Diez B. Roggisch
Lawrence D'Oliveiro writes: > In message > <2752e2e4-76fe-475a-a476-e5458bbfd...@z30g2000prg.googlegroups.com>, TheOne > wrote: > >> Anyway, it would be great if I could make my eclipse/pydev to >> understand the BOM character and suppress the lexical error msg. > > What exactly is the point of

Re: Problem installing psycopg2 in virtualenv (Ubuntu 10.04, Python 2.5)

2010-10-05 Thread Diez B. Roggisch
Pascal Polleunus writes: > On 05/10/10 00:11, Diez B. Roggisch wrote: >> Pascal Polleunus writes: >> >>> Hi, >>> >>> I've problems to install psycopg2 in a virtualenv on Ubuntu 10.04. >>> >>> >>> My problem is also

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-05 Thread Diez B. Roggisch
TheOne writes: > On Oct 4, 9:26 pm, de...@web.de (Diez B. Roggisch) wrote: >> TheOne writes: >> > Hi. >> >> > I installed eclipse/pydev today. >> > I created a pydev project and added python source files with utf-8 >> > BOM. >> > E

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-05 Thread Diez B. Roggisch
Lawrence D'Oliveiro writes: > In message > , TheOne > wrote: > >> I want the source files to have BOM character. > > What exactly is the point of a BOM in a UTF-8-encoded file? It's a MS-specific thing that makes a file identifieable as UTF-8-encoded under windows. The name BOM is obviously BS,

Re: Deditor:Pythonic text editor

2010-10-04 Thread Diez B. Roggisch
Kruptein writes: > Hey, I released the 0.2.1 version of my text-editor written for linux > in python using the wxPython toolkit. > > I would like to know whether it is good/bad and what could be changed/ > added > > this version added > -syntax-highlighting for 78 languages > -Tab completion in

Re: Problem installing psycopg2 in virtualenv (Ubuntu 10.04, Python 2.5)

2010-10-04 Thread Diez B. Roggisch
Pascal Polleunus writes: > Hi, > > I've problems to install psycopg2 in a virtualenv on Ubuntu 10.04. > > > My problem is also explained on stackoverflow: > http://stackoverflow.com/questions/3847536/installing-psycopg2-in-virtualenv-ubuntu-10-04-python-2-5 > > > I tried different things explaine

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-04 Thread Diez B. Roggisch
TheOne writes: > Hi. > > I installed eclipse/pydev today. > I created a pydev project and added python source files with utf-8 > BOM. > Eclipse/Pydev reports lexical error : > Lexical error at line 1, column 1. Encountered: "\ufeff" (65279), > after : "" > > I want the source files to have BOM

Re: ElementTree handling nested tag

2010-10-04 Thread Diez B. Roggisch
tekion writes: > On Oct 3, 2:09 pm, de...@web.de (Diez B. Roggisch) wrote: >> tekion writes: >> > On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote: >> >> tekion writes: >> >> > All, >> >> > I have the following xml tag: &g

Re: Is there a Python Version Manager?

2010-10-04 Thread Diez B. Roggisch
TerryP writes: > On Oct 4, 4:12 am, Kushal Kumaran > wrote: >> Is virtualenv what you need? >> >> http://pypi.python.org/pypi/virtualenv >> >> > >> >> -- >> regards, >> kushal > > > Not quite. It basically amounts to a UNIX version of xcopy'ing an > existing Python installation. > > ... insta

Re: ElementTree handling nested tag

2010-10-03 Thread Diez B. Roggisch
tekion writes: > On Oct 2, 5:32 am, de...@web.de (Diez B. Roggisch) wrote: >> tekion writes: >> > All, >> > I have the following xml tag: >> > >> > >> >       httpRequest >> >       HTTP://cmd.wma.ibm.com:80/ >>

Re: Unclear datetime.date type when using isinstance

2010-10-02 Thread Diez B. Roggisch
"Mailing List" writes: > Was including a input check on a function argument which is expecting a > datetime.date. When running unittest no exception was raised when a > datetime.datetime instance was used as argument. Some playing with the > console lead to this: > import datetime > dt1

Re: Problem saving uploaded files in Python3

2010-10-02 Thread Diez B. Roggisch
Chris Rebert writes: > On Fri, Oct 1, 2010 at 11:13 PM, wrote: >> Hello, i control the problem of the data what is uploaded by the POST >> method, in the web if the file is a text theres no problem >> but the trouble comes when it's an enconded file as a Picture or other what >> the when the sy

Re: ElementTree handling nested tag

2010-10-02 Thread Diez B. Roggisch
tekion writes: > All, > I have the following xml tag: > > > httpRequest > HTTP://cmd.wma.ibm.com:80/ > GET > 200 > > > > I am interested in: >httpRequest > HTTP://cmd.wma.ibm.com:80/ > GET > 200 > as well as the upper layer tag. How do I ge

Re: Problems with wsgi Python3

2010-09-30 Thread Diez B. Roggisch
_chunked': >> > [Thu Sep 30 13:35:07 2010] [error] '0', >> > [Thu Sep 30 13:35:07 2010] [error] 'mod_wsgi.listener_host': >> > [Thu Sep 30 13:35:07 2010] [error] '', >> > [Thu Sep 30 13:35:07 2010] [error] 'mod_wsgi.listene

Re: Problems with wsgi Python3

2010-09-30 Thread Diez B. Roggisch
hid...@gmail.com writes: > Hello list, i had seriously troubles with the connection between a form and > the > wsgi, i' ve made an application on Python3 and was running perfectly but when > i > try to use the to pass the data this can't be see on the server, so > what > is your recommendation

Re: will Gnome 3.0 kill pygtk?

2010-09-30 Thread Diez B. Roggisch
Tracubik writes: > Hi! > It seem that the new version of gnome 3.0 will dismiss pygtk support. > > link: > > [1] http://live.gnome.org/TwoPointNinetyone/ (search killing pygtk) > > [2] http://live.gnome.org/GnomeGoals/PythonIntrospectionPorting > > > i'm studying pygtk right now, am i wasting

Re: utf-8 and ctypes

2010-09-30 Thread Diez B. Roggisch
Brendan Miller writes: > 2010/9/29 Lawrence D'Oliveiro : >> In message , Brendan >> Miller wrote: >> >>> It seems that characters not in the ascii subset of UTF-8 are >>> discarded by c_char_p during the conversion ... >> >> Not a chance. >> >>> ... or at least they don't print out when I go to p

Re: Example or recomendation of a webserver

2010-09-29 Thread Diez B. Roggisch
Hidura writes: > I am working on a web project written on Py3k and using mod_wsgi on > the Apache that have to recibes the request client via a xml structure > and i am facing a lot of troubles with the upload files mainly because > i can' t see where they are, so i' ve decide to write my own web

Re: function decorators

2010-09-28 Thread Diez B. Roggisch
Nick Donohue writes: > I came across this code just now: > > def time_me(function): > def wrap(*arg): > start = time.time() > r = function(*arg) > end = time.time() > print "%s (%0.3f ms)" %(function.func_name, (end-start)*1000) > return wrap > > @time_me > def some_function(s

Re: relative imports and sub-module execution

2010-09-28 Thread Diez B. Roggisch
King writes: > Hi, > > After reading couple of docs and articles, I have implemented a simple > test package with nested modules. > When running "main.py", everything is working fine. Some of my sub- > modules has some small test routines for debug purpose. > It's because I am using relative pack

Re: Check whether file is being written to

2010-09-23 Thread Diez B. Roggisch
Thomas Jollans writes: > On Thursday 23 September 2010, it occurred to loial to exclaim: >> How can I check whether a file is being written to by another process >> before I access it? >> >> Platform is unix. > > As such, you can't. But you can lock the file using the functions in the > fcntl

Re: creating python daemon ?

2010-09-22 Thread Diez B. Roggisch
vineet daniel writes: > On Sep 21, 9:47 pm, de...@web.de (Diez B. Roggisch) wrote: >> vineet daniel writes: >> > Hi >> >> > I have succesfully created daemon with python script and as next step >> > I am trying to give input to that python script daemo

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Ned Deily writes: > In article <87zkvbytnk@web.de>, de...@web.de (Diez B. Roggisch) > wrote: >> The point is that the distro doesn't care about the python eco >> system. Which is what I care about, and a lot of people who want to ship >> software. > &g

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
David Cournapeau writes: >> >> I don't deny them their experience. Do you deny the experience of other >> people with *other* needs? As I already said: I don't propose to ditch >> the package management. I'm all fine with a distro that carefully >> selects it's packages and dependencies. > > In y

Re: creating python daemon ?

2010-09-21 Thread Diez B. Roggisch
vineet daniel writes: > Hi > > I have succesfully created daemon with python script and as next step > I am trying to give input to that python script daemon from Apache > Logshere I have got stuck and I have even checked IRC python > channel for solution. Apache is able to call the file but

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Antoine Pitrou writes: > On Tue, 21 Sep 2010 17:59:27 +0200 > de...@web.de (Diez B. Roggisch) wrote: >> >> The problems explained are simply outdated and crippled python >> versions. >> >> And to me, a python version installed that has not the >&g

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
David Cournapeau writes: > On Tue, Sep 21, 2010 at 10:23 PM, Diez B. Roggisch wrote: >> Ant writes: >> >>> Hi all, >>> >>> I've just seen this: http://sheddingbikes.com/posts/1285063820.html >>> >>> Whatever you think of Zed

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Diez B. Roggisch
Ant writes: > Hi all, > > I've just seen this: http://sheddingbikes.com/posts/1285063820.html > > Whatever you think of Zed Shaw (author of the Mongrel Ruby server and > relatively recent Python convert), he has a very good point in this. I > run Fedora 12 on my home computers, and find it far to

Re: visual studio 2010 question

2010-09-20 Thread Diez B. Roggisch
David Cournapeau writes: > On Mon, Sep 20, 2010 at 3:08 PM, Ralf Haring wrote: >> >> After running into the error "Setup script exited with error: Unable >> to find vcvarsall.bat" when trying to use easy_install / setuptools a >> little digging showed that the MS compiler files in distutils only

Re: Python Monitoring

2010-09-20 Thread Diez B. Roggisch
Glazner writes: > On Sep 20, 6:03 pm, de...@web.de (Diez B. Roggisch) wrote: >> Glazner writes: >> > Hi, >> >> > I'm will be writing a distributed program with parallel python and i >> > would like to if there are any good monitoring utilities for

Re: match pattern

2010-09-20 Thread Diez B. Roggisch
rudikk00 writes: > I remember perl has a match function =~/H/ --> which searches if there > is "H" pattern in line. Is there a reasonable analog of it in python? It's called a regular expression, which can be matched or searched in a string. Take a look at the module "re" in python. http://d

Re: Python Monitoring

2010-09-20 Thread Diez B. Roggisch
Glazner writes: > Hi, > > I'm will be writing a distributed program with parallel python and i > would like to if there are any good monitoring utilities for python. > I would like each remote server to post messages and to see the > messages in a web-broweser or such. > > I googled python monito

Re: Encoding problem - or bug in couchdb-0.8-py2.7.egg??

2010-09-20 Thread Diez B. Roggisch
Ian Hobson writes: > Hi all, > > I have hit a problem and I don't know enough about python to diagnose > things further. Trying to use couchDB from Python. This script:- > > # coding=utf8 > import couchdb > from couchdb.client import Server > server = Server() > dbName = 'python-tests' > try: >

Re: Accessing windoze file attributes

2010-09-15 Thread Diez B. Roggisch
Douglas writes: > Hi, can anyone direct a relative newbie to the best source of info? > I am writing my own backup app in Python 2.5.2 (all my company will > allow me to use) using IDLE. > I intend to run this app daily via the Task Scheduler to back up a > mission-critical spreadsheet that only

Re: help with calling a static method in a private class

2010-09-14 Thread Diez B. Roggisch
lallous writes: > How can I keep the class private and have the following work: > > [code] > class __internal_class(object): > @staticmethod > def meth1(s): > print "meth1:", s > > @staticmethod > def meth2(s): > print "meth2:", > __internal_class.meth1(s)

Re: Distribute Non Library

2010-09-12 Thread Diez B. Roggisch
narke writes: > On 2010-09-12, Glazner wrote: >> On Sep 12, 5:10 am, narke wrote: >>> My simple tool writing in python get bigger and bigger and I think I'd >>> better split my code into several files.  But, unlike what in some other >>> languages, there is no way to compile these several files

Re: Distribute Non Library

2010-09-12 Thread Diez B. Roggisch
narke writes: > My simple tool writing in python get bigger and bigger and I think I'd > better split my code into several files. But, unlike what in some other > languages, there is no way to compile these several files into a single > executable. Before I splitting my simple tool program, I ju

Re: formatted input

2010-09-07 Thread Diez B. Roggisch
Bob writes: > Hi All, > I have another question about formatted input. Suppose I am reading a > text file, and that I want it to be something like this > > word11 = num11, word12 = num12, word13 = num13 etc... > word21 = num21, word22 = num12, word23 = num23 etc... > etc... > > where wordx1 belon

Re: What the \xc2\xa0 ?!!

2010-09-07 Thread Diez B. Roggisch
Brian D writes: > In an HTML page that I'm scraping using urllib2, a \xc2\xa0 > bytestring appears. > > The page's charset = utf-8, and the Chrome browser I'm using displays > the characters as a space. > > The page requires authentication: > https://www.nolaready.info/myalertlog.php > > When I

Re: Printing forms and labels in Python

2010-06-13 Thread Diez B . Roggisch
Monte Milanuk wrote: > On 6/13/10 8:00 AM, Joel Goldstick wrote: > > > Why not go the other direction. Use python to do your processing, > > and > > send the results to excel. There are python modules that read and > > write > > excel files. > > Well... partly because Excel is not exactly cross-

Re: can't get python 2.5.5 to work on mac os x 10.4.11

2010-04-26 Thread Diez B . Roggisch
new2Cocos wrote: > Hi everyone, > > I posted this in the cocos2d and pyglet discussion group, I thought > I'll get a response right away since my problem is quite general but I > got no response. I hope you will help me!!! this is the original post > > http://groups.google.com/group/cocos-discu

Re: How to automate accessor definition?

2010-03-21 Thread Diez B . Roggisch
kj wrote: > > > > > > > I need to create a class solely for the purpose of encapsulating > a large number of disparate data items. At the moment I have no > plans for any methods for this class other than the bazillion > accessors required to access these various instance variables. > (In c

Re: running a program on many processors

2010-03-07 Thread Diez B. Roggisch
Am 08.03.10 01:18, schrieb Paweł Banyś: Hello, I have already read about Python and multiprocessing which allows using many processors. The idea is to split a program into separate tasks and run each of them on a separate processor. However I want to run a Python program doing a single simple ta

Re: python SUDS library

2010-03-04 Thread Diez B. Roggisch
Am 04.03.10 06:23, schrieb yamamoto: Hi, I tried to make a simple script with SUD library for caching torrent files. it doenst work! [versions] suds: 0.4, python: 2.6.4 [code] from suds.client import Client import base64 path = 'sample.torrent' doc = open(path, 'rb').read() encoded_doc = base6

Re: conditional import into global namespace

2010-03-03 Thread Diez B. Roggisch
Am 02.03.10 21:41, schrieb mk: Jerry Hill wrote: Just import subprocess at the top of your module. If subprocess hasn't been imported yet, it will be imported when your module is loaded. If it's already been imported, your module will use the cached version that's already been imported. In othe

  1   2   3   4   5   6   7   8   9   10   >