Read and extract text from pdf

2006-04-24 Thread Julien ARNOUX
Hi, Thanks I use that and is all right :) import commands txt = commands.getoutput('ps2ascii tmp.pdf') print txt -- http://mail.python.org/mailman/listinfo/python-list

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Martin v. Löwis
Alex Martelli wrote: > Can anybody suggest where to get a Framework SDK 1.1., or any other > legal way to get "the core msvcrt.lib for msvcr71.dll against which to > link your extensions. This is critically important"...??? From http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Martin v. Löwis
Alex Martelli wrote: > As suggested to me by David Rushby 10 hours ago, > > http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-4 > 9FD-9CB0-4BFA122FA91B&displaylang=en > > does work. Can you please try this again: I'm also getting the error message that AIM is getting. Regar

Re: MinGW and Python

2006-04-24 Thread Martin v. Löwis
Srijit Kumar Bhadra wrote: > Is there any specific reason for not using MinGW to build the official > distribution of Python for Win32? What could be the reasons to use MinGW? As for reasons not to do that: - there is no build process available to do that - people building extensions to Python mu

Re: i18n hell

2006-04-24 Thread Serge Orlov
fyleow wrote: > I just spent hours trying to figure out why even after I set my SQL > table attributes to UTF-8 only garbage kept adding into the database. > Apparently you need to execute "SET NAMES 'utf8'" before inserting into > the tables. > > Does anyone have experience working with other lang

Re: bug in modulus?

2006-04-24 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > But maybe I'm reading it wrong. In any case what I wanted was simply a > way to extract the angle from a complex number where the angle is > between 0 and 2*pi. I think I'll just take the modulus twice. > > def angle(complex): > """Returns angle where 2*pi > angle >

thread support help

2006-04-24 Thread jkiter
I installed Python 2.4.2 windows installer from python.org, but when I compiled a python related project on mingw, I got a error message. error: python must be compiled with thread support Thank you for any help you can provide. -- http://mail.python.org/mailman/listinfo/python-list

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Ben Sizer
[EMAIL PROTECTED] wrote: > i have a script that waits for message packets from a data server over > a socket. If you're using TCP, bear in mind that you do not receive packets - you receive a stream of data, which may usually come in the same quantities as it was sent, but not always. If you don't

Re: what has python added to programming languages? (lets be esoteric, shall we ;)

2006-04-24 Thread Boris Borcic
Wildemar Wildenburger wrote: > Over the time I've seen lots of remarks about python that read like "a > lot like lists in lisp" or "like the hashtable in java" or any other > form of "like in ". > > Are there any concepts that python has not borrowed, Esoterically speaking, you should better d

Re: Passing data attributes as method parameters

2006-04-24 Thread Piet van Oostrum
> "Panos Laganakos" <[EMAIL PROTECTED]> (PL) wrote: >PL> Thanks Ben. >PL> What does it mean that they're statically bound? It means that the default values are evaluated at definition time. At that time there isn't a variable 'self' defined. It would only work if the defaults would be evaluat

Re: getattr from local scope

2006-04-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I know I can use eval, but I've always been told that if you're using > eval, you're doing it wrong. Also not using eval limits the scope damage > that can be caused by any errors in my application which could cause > the database to be poisoned. a more robust approach

Re: MySql -Python question

2006-04-24 Thread Vladimir 'Yu' Stepanov
Dennis Lee Bieber wrote: > On 23 Apr 2006 21:25:48 -0700, [EMAIL PROTECTED] declaimed the following > in comp.lang.python: > > >> Hey all, I'm running a query within some python code, and I'm having >> difficulties doing something that seems to be really simple . I'm >> running a query in the fo

Re: Can you create an instance of a subclass with an existing instance of the base class?

2006-04-24 Thread bruno at modulix
Lawrence D'Oliveiro wrote: (snip) > I think you're taking Python's OO-ness too seriously. One of the > strengths of Python is that it can _look_ like an OO language without > actually being OO. According to which definition of OO ? -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread bruno at modulix
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "ToddLMorgan" <[EMAIL PROTECTED]> wrote: > > >>I'm looking for the common types of mistakes that say a Java/C# or >>even C++ developer may commonly make. > > > Using subclassing when you don't have to. For instance, you might have

Re: Missing interfaces in Python...

2006-04-24 Thread bruno at modulix
bruno at modulix wrote: > Neal Becker wrote: > (snip) > >>I see various answers that Python doesn't need interfaces. OTOH, there are >>responses that some large Python apps have implemented them (e.g., zope). >>Does anyone have an explanation of why these large systems felt they needed >>to impl

YOUR MESSAGE HAS BEEN BLOCKED

2006-04-24 Thread mailadmin
Message Delivery BLOCKED Reason: Virus found in message. Our Virus scanner found a virus in the message that you sent. Virus scanning report - 24 April 2006 @ 14:17 F-PROT ANTIVIRUS Program version: 4.3.2 Engine version: 3.14.7 VIRUS SIGNATURE FILES SIGN.DEF created 21 April 2006 SIGN2.DEF cre

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Roy Smith
[EMAIL PROTECTED] wrote: > hey there, > > i have a script that waits for message packets from a data server over > a socket. > it goes a little like this: > > while 1: > x+=1 > databack = sockobj.recv(158) > if databack: > > print 'caught a message %s byt

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Fredrik Lundh
Roy Smith wrote: > If you want to read fixed-length messages (as you appear to be trying to do > with your recv(158)), you need to build a buffering layer which reads from > the socket into a buffer and then doles out messages to a higher layer from > that buffer. > This is not a trivial problem.

Subclass str: where is the problem?

2006-04-24 Thread pascal . parent
Hello, can anybody explain/help me: Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 class Upper(str): def __new__(cls, value): return str.__new__(cls, value.upper()) u = Upper('test') u 'TEST' type(u) u = Upper('') u '' type(u)

GRIB to images

2006-04-24 Thread Sheldon
Hi, I am interesseted on reading some GRIB files using python and then converting the fields to gif images. Does anyone know if this is possible or have a program that does this? /Sheldon -- http://mail.python.org/mailman/listinfo/python-list

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread JW
On Sun, 23 Apr 2006 21:15:23 -0700, Alex Martelli wrote: > As suggested to me by David Rushby 10 hours ago, > > ... < huge URL snipped > ... Alas, somehow this URL was split in two, and all the kings horses and all the kings men can't seem to put it back together again (at least in my browser).

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Roy Smith
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > however, creating a buffered layer for reading is a trivial problem: just call > makefile on the socket object, and use the resulting object as a file handle: The problem with that is that makefile() requires the socket to be in blocking mode. If you'

Re: GRIB to images

2006-04-24 Thread Michele Petrazzo
Sheldon wrote: > Hi, > > I am interesseted on reading some GRIB files using python and then > converting the fields to gif images. > > Does anyone know if this is possible or have a program that does this? Yes of course with PIL. http://www.pythonware.com/products/pil/ http://effbot.org/imaging

Re: Subclass str: where is the problem?

2006-04-24 Thread harold
[EMAIL PROTECTED] schrieb: > Hello, can anybody explain/help me: > > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > > > class Upper(str): > def __new__(cls, value): > return str.__new__(cls, value.upper()) > > u = Upper('test

Re: Writing backwards compatible code - when?

2006-04-24 Thread Laurent Pointal
Scott David Daniels a écrit : > Bob Greschke wrote: >> Is there a list of all of the Python commands and modules that tell >> when (what version) they were added to Python? I was hoping the new >> Essential Reference would have it, but it doesn't. > > Here's a reference that stops at 2.3: > >

Re: MinGW and Python

2006-04-24 Thread Josef Meile
> Is there any specific reason for not using MinGW to build the official > distribution of Python for Win32? > A quick Google search did not reveal the answer to my question. If a > link is available, please post it. You may look at this thread: * E02 - Support for MinGW Open Source Compiler ht

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > hey there, > > i have a script that waits for message packets from a data server over > a socket. > it goes a little like this: > > while 1: > x+=1 > databack = sockobj.recv(158) > if databack: > > print 'caught a message %s bytes '

Re: what has python added to programming languages? (lets be esoteric, shall we ; )

2006-04-24 Thread beliavsky
Michael Tobis wrote: > Although somewhat more elegant, Python slices follow Matlab's slice > notation. In simpler cases they are identical. > > mt I think in Matlab, as in Fortran 90, i:j refers to the elements from i up to and including j, unlike Python, where j is excluded. Another language with

Update Demo/ and Tools/ directories

2006-04-24 Thread Dennis Benzinger
Hi! I'd like to help with updating the Demo/ and Tools/ directories as it is suggested in the Python Wiki . How exactly should the directories be updated? Should it just be made sure that the demos and examples are working or should they be updated to us

Python Evangelism

2006-04-24 Thread BartlebyScrivener
Python On WinXP: 7 Minutes To "Hello World!" Call it Python for the Complete XP Idiot if you must, but it's getting dugg on digg.com http://digg.com/programming rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: how to append to a list twice?

2006-04-24 Thread Petr Prikryl
"Fredrik Lundh" wrote: > Alex Martelli wrote: > > > > But of course that only does it once, and I don't want to have to copy > > > and paste the append line. Perhaps there's a better way than this. > > > > def makeseries(N): > > series = [N] > > append = series.append > > for tailer in xrang

Re: Subclass str: where is the problem?

2006-04-24 Thread pascal . parent
This is good... try this: value = 'test' value 'test' type(value) value = type(value) is type('') and Upper(value) or value value 'TEST' type(value) value = 1 value 1 type(value) value = type(value) is type('') and Upper(value) or value value 1 type(value) -- http://mail.python.org/mailman

Re: what has python added to programming languages? (lets be esoteric, shall we ; )

2006-04-24 Thread Steve Holden
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Carl Banks <[EMAIL PROTECTED]> wrote: > >>Cameron Laird wrote: >> >>>In article <[EMAIL PROTECTED]>, >>>Carl Banks <[EMAIL PROTECTED]> wrote: >>> Wildemar Wildenburger wrote: >Are there any concepts that python has not borrowed, concepts

Re: Can you create an instance of a subclass with an existing instance of the base class?

2006-04-24 Thread Sandra-24
Lawrence D'Oliveiro wrote: > > All you want is a dictionary, then. That's basically what Python objects > are. Yes, that's it exactly. I made a lazy wrapper for it, and I was really happy with what I was able to accomplish, it turned out to be very easy. Thanks, -Sandra -- http://mail.python.o

error

2006-04-24 Thread [EMAIL PROTECTED]
Anyone know what this error means? C:/Python24/pythonw.exe -u "C:/Python24/MyProjects/HeadsUp/cls_Bot.py" File "C:/Python24/MyProjects/HeadsUp/cls_Bot.py", line 10246 elif handname == 'straightflush': SystemError: com_backpatch: offset too large thanks -- http://mail.python.org/mailman/l

Re: proposed Python logo

2006-04-24 Thread Steve Holden
Michael Tobis wrote: > "Is this the right room for an argument?" > > http://geosci.uchicago.edu/~tobis/snake.png > Is that a gun in its pocket, or is it just glad to see me? (with apologies to Mae West). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd

Re: MySql -Python question

2006-04-24 Thread ataanis
both of your suggestions don't work, that's kind of what I was trying the whole time -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclass str: where is the problem?

2006-04-24 Thread Peter Otten
[EMAIL PROTECTED] wrote: > This is good... try this: > > value = 'test' > value > 'test' > type(value) > > value = type(value) is type('') and Upper(value) or value > value > 'TEST' > type(value) > Try again with value = "" This makes Upper(value) a False value in a boolean context: >>> cl

Re: proposed Python logo

2006-04-24 Thread Steve Holden
Michael Tobis wrote: >>Not that I'm disagreeing, but how to you rate "resonance with the product"? > > > Hmm, I'm not a marketing professional, but this is would I would do > with my focus groups: > > Ask people familar with the product to name what they like about the > image, and what they lik

Re: error

2006-04-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Anyone know what this error means? > > C:/Python24/pythonw.exe -u "C:/Python24/MyProjects/HeadsUp/cls_Bot.py" > File "C:/Python24/MyProjects/HeadsUp/cls_Bot.py", line 10246 > elif handname == 'straightflush': > SystemError: com_backpatch: offset too large Google

freebsd thread problem

2006-04-24 Thread Dorian Mcfarland
Hi there, I have installed python(2.4.3) & trac(0.9.4) on freebsd(4.8) from the ports collection and I seem to have an underlying problem with the thread module. Pysqlite is calling 'import thread' which is failing with "no such module" and causing it not to load. I thought that 'thread' was one

Re: proposed Python logo

2006-04-24 Thread Steve Holden
Michael Tobis wrote: > A more Monty sort of Python logo would be fine with me. A flying sheep > perhaps? An exploding penguin? A giant hedgehog? A dog license with the > word "dog" crossed out and "cat" written in crayon? A great big book on > how to put your budgie down? > > This http://www.infor

Re: Subclass str: where is the problem?

2006-04-24 Thread pascal . parent
Effectively. Thanks a lot Peter and Harold. -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclass str: where is the problem?

2006-04-24 Thread harold
Hi Pascal, Indeed, the example you show work corrctly. But in the code you posted before, you wonder about the behavior of these lines: > m = MyObject() > m.id > '' > type(m.id) > So what happens when you provide the empty string '' to your and-or construct? value = '' value = type(value) is ty

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Roy Smith
Serge Orlov <[EMAIL PROTECTED]> wrote: > sockobj.settimeout(550) > [...] > Also, as other people pointed out, you'd better make buffered socket > with .makefile() socket method. If I understand the docs for the socket module correctly, these two suggestions are mutually incompatable. -- http://ma

Twisted/wxPython Problem...

2006-04-24 Thread PeterG
Hi, I am relatively new to Python, and am learning it as part of a university module... Im currently undertaking a project to create an IM server and IM gui client. I have a very basic server, and a basic gui client. I can get my client to connect to my server, but cant get it to disconnect or

Re: MySql -Python question

2006-04-24 Thread Frank Millman
[EMAIL PROTECTED] wrote: > both of your suggestions don't work, that's kind of what I was trying > the whole time I am sure you have read this before somewhere, but - 1. Tell us what you have tried so far 2. Tell us what you expected (or hoped) would happen 3. Tell us what actually h

Re: How I learned Tkinter

2006-04-24 Thread Ken Dere
peter wrote: > I've been trying to teach myself Tkinter programming over the last few > months > (in a strictly amateur way), and have made a number of requests for > help in this > newsgroup and elsewhere. > > I've now (sort of) got there - in that I have used Tkinter for some > programs for > p

Re: Twisted/wxPython Problem...

2006-04-24 Thread Diez B. Roggisch
PeterG wrote: > Hi, > > I am relatively new to Python, and am learning it as part of a > university > module... > > Im currently undertaking a project to create an IM server and IM gui > client. > > I have a very basic server, and a basic gui client. I can get my > client to > connect to my se

Re: debugging in emacs

2006-04-24 Thread Steve Juranich
Gary Wessle wrote: > Gary Wessle <[EMAIL PROTECTED]> writes: > >> Hi python users >> >> I am using emacs and python-mode.el under dabian testing. >> is there a way to debug python code where I can step over each line >> and watch the value of all the variables and be able to change >> any during

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Alex Martelli
JW <[EMAIL PROTECTED]> wrote: ... > > As suggested to me by David Rushby 10 hours ago, > > > > ... < huge URL snipped > ... > > Alas, somehow this URL was split in two, and all the kings horses and all > the kings men can't seem to put it back together again (at least in my > browser). Could

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Alex Martelli
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > Can anybody suggest where to get a Framework SDK 1.1., or any other > > legal way to get "the core msvcrt.lib for msvcr71.dll against which to > > link your extensions. This is critically important"...??? > > From > > >http

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Alex Martelli
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > As suggested to me by David Rushby 10 hours ago, > > > > http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-4 > > 9FD-9CB0-4BFA122FA91B&displaylang=en > > > > does work. > > Can you please try this again

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Alex Martelli
Robert Kern <[EMAIL PROTECTED]> wrote: > Edward Elliott wrote: > > I think Apple switched to the Intel compiler for > > x86 macs, was python built with that or with gcc? > > I'm pretty sure MacTel OS X still uses gcc 4 (although I think there is a beta > version of the Intel compiler available).

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Serge Orlov
Roy Smith wrote: > Serge Orlov <[EMAIL PROTECTED]> wrote: > > sockobj.settimeout(550) > > [...] > > Also, as other people pointed out, you'd better make buffered socket > > with .makefile() socket method. > > If I understand the docs for the socket module correctly, these two > suggestions are mutu

Python C API question

2006-04-24 Thread Gabriele *darkbard* Farina
Hi, I'm a newbie in python extension development, and I'd like to ask you a simple question. I have to implement a simple estension that parses a source file and returns an xml.dom.minidom.Document instance. I'd like to know how can I import and then manage xml.dom.minidom.* objects using Python C

Re: freebsd thread problem

2006-04-24 Thread Ivan Voras
Dorian Mcfarland wrote: > Hi there, > I have installed python(2.4.3) & trac(0.9.4) on freebsd(4.8) from the > ports collection and I seem to have an underlying problem with the > thread module. > Salling 'import thread' from the python prompt yields the same result. > > I have a 'threading.py'

Re: Python C API question

2006-04-24 Thread Steve Juranich
Gabriele *darkbard* Farina wrote: > Hi, > > I'm a newbie in python extension development, and I'd like to ask you a > simple question. I have to implement a simple estension that parses a > source file and returns an xml.dom.minidom.Document instance. I'd like > to know how can I import and then

Re: Python C API question

2006-04-24 Thread Gabriele *darkbard* Farina
It seems to be what I need. Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple DAV server?

2006-04-24 Thread robert
Ivan Voras wrote: > robert wrote: > >> maybe thats a good idea to put it on sf.net to boil out all bugs. >> Yet I like it in that simple default manner, maybe switch on those >> additional creation functions with commandline switches (or config >> class instance passed to run..(config=None) ) >

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 24)

2006-04-24 Thread Peter Otten
QOTW: "Going from Python to Java (as it's in my case) is real pain I wish nobody to feel... Even with multi-million support for Java from giants like Sun, IBM or Oracle, I find it much easier to gain full control over my project when using Python than Java." - Jarek Zgoda "while 1: life.side.brigh

ANN: PyScript 0.6.0 released

2006-04-24 Thread cochrane
Overview: PyScript is a python module for producing high quality postscript graphics. Rather than use a GUI to draw a picture, the picture is programmed using python and the PyScript objects. Some of the key features are: * All scripting is done in python, which is a high level,

Re: i18n hell

2006-04-24 Thread Martin Blais
On 24 Apr 2006 00:38:42 -0700, Serge Orlov <[EMAIL PROTECTED]> wrote: > fyleow wrote: > > I just spent hours trying to figure out why even after I set my SQL > > table attributes to UTF-8 only garbage kept adding into the database. > > Apparently you need to execute "SET NAMES 'utf8'" before insert

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Robert Kern
Alex Martelli wrote: > Jocular, but not sarcastic. I have no problems using mingw if that's > what it takes -- the later instructions I saw were those suggesting the > Toolkit instead, so those are the ones I'm trying to follow. What's the > updated URL for the instructions about using mingw ins

Re: error

2006-04-24 Thread [EMAIL PROTECTED]
thanks for the heads up. I read other posts on this error, but it's unclear to me whether the following will be a problem as well. Suppose I break up my very long module into smaller modules and import them into another module 'main'. Will I get the same error running main if the total number of

Packing a list of lists with struct.pack()

2006-04-24 Thread Panos Laganakos
Hello, I have a list that includes lists of integers, in the form of: li = [[0, 1, 2], [3, 4, 5], ...] packed = struct.pack(str(len(li)*3)+'i', li) The frmt part is right, as I'm multiplying by 3, 'cause each inner list has 3 elements. What can I do to get li as a single list of integers? I tr

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Robert Kern
Alex Martelli wrote: > Jocular, but not sarcastic. I have no problems using mingw if that's > what it takes -- the later instructions I saw were those suggesting the > Toolkit instead, so those are the ones I'm trying to follow. What's the > updated URL for the instructions about using mingw ins

Re: Packing a list of lists with struct.pack()

2006-04-24 Thread Panos Laganakos
Just came up with this: litemp = [] [litemp.extend(i) for i in li] Seems to give me a list with all the inner elements of li, not sure if struct.pack will accept it now, but I'll give it a try. -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-24 Thread Robert Kern
Martin v. Löwis wrote: > Srijit Kumar Bhadra wrote: > >>Is there any specific reason for not using MinGW to build the official >>distribution of Python for Win32? > > What could be the reasons to use MinGW? > > As for reasons not to do that: > - there is no build process available to do that > -

Re: error

2006-04-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > thanks for the heads up. I read other posts on this error, but it's > unclear to me whether the following will be a problem as well. Suppose > I break up my very long module into smaller modules and import them > into another module 'main'. Will I get the same error r

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread gene tani
Ant wrote: > Take a look at the newgroup archives over the last week or two - there > seem to have been a glut of people coming from Java to Python and > asking the same sort of questions. There were some links to a bunch of > Python 'gotcha' pages which will be useful. > Here's a few gotchas whi

Re: Packing a list of lists with struct.pack()

2006-04-24 Thread Fredrik Lundh
Panos Laganakos wrote: > I have a list that includes lists of integers, in the form of: > li = [[0, 1, 2], [3, 4, 5], ...] > What can I do to get li as a single list of integers? > > I tried list comprehension in the form of: > [([j for j in i]) for i in li] > > But that doesn't seem to work, any

Pydev and Pydev Extensions 1.0.6 release

2006-04-24 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.0.6 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev Release Highlights in Pydev Extensions: - - New Feature: Sh

threads and sys.exit()

2006-04-24 Thread gangesmaster
calling sys.exit() from a thread does nothing... the thread dies, but the interpreter remains. i guess the interpreter just catches and ignore the SystemExit exception... does anybody know of a way to overcome this limitation? -tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: error

2006-04-24 Thread alisonken1
> Will I get the same error running main if the total number of lines in the smaller modules is > 10k? Not sure if this would solve your problem, but I noticed the 10K filesize. I don't know about other programmers, but I find it >much< easier to keep track of stuff if I keep the individual file

Re: threads and sys.exit()

2006-04-24 Thread Diez B. Roggisch
gangesmaster wrote: > calling sys.exit() from a thread does nothing... the thread dies, but > the interpreter remains. i guess the interpreter just catches and > ignore the SystemExit exception... > > does anybody know of a way to overcome this limitation? Use Thread.setDaemon(True) on your thre

Re: error

2006-04-24 Thread [EMAIL PROTECTED]
thanks for the help. cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: freebsd thread problem

2006-04-24 Thread Dorian Mcfarland
That was the problem. thanks for the clarity - finally working. > How did you install python? By default, if built from ports, it should > pop up a configuration dialog in which one of the options is to enable > thread support. If you have a bad configuration record, you can do a > "make config

Re: threads and sys.exit()

2006-04-24 Thread gangesmaster
>>> import threading >>> t=threading.Thread(target=sys.exit) >>> t.setDaemon(True) >>> t.start() >>> ? -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sys.exit()

2006-04-24 Thread gangesmaster
(i forgot to say it didn't work) -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and sys.exit()

2006-04-24 Thread Rene Pijlman
gangesmaster: >(i forgot to say it didn't work) It's the remaining threads that need to be daemon, when some thread performs sys.exit. When no non-daemon thread remains, the application terminates. -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread nephish
ok, thanks for all the suggestions, gents, i clearly have more to read on this. i have discovered that the server will send a request for the heartbeat ping if its almost timed out, so i use the length of the message to determine what to do with it. msg = sockobj.recv(1024) if len(msg) == 158:

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Roy Smith
<[EMAIL PROTECTED]> wrote: >elif len(msg) == (34): # length of request for ping >ping the server This seems really dangerous. You are obviously writing to some already defined (and hopefully, documented) protocol. What does the protocol spec say about ping request messages? I would be very

get "in reply to" with nntplib

2006-04-24 Thread Hanman
Hello, I am coding a small newsarchiv and have a question: When trying to read out the "in reply to" data with xhdr i always get a "(none)" as return. Example: s = nntplib.NNTP('freetext.usenetserver.com') resp, count, first, last, name = s.group('comp.lang.python') resp, subs = s.xhdr('In-Reply

Re: Looking for resources for making the jump from Java to Python easier and more productive

2006-04-24 Thread Harry George
Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > "ToddLMorgan" <[EMAIL PROTECTED]> wrote: > > >Are there python specific equivalents to the common Patterns, > >Anti-Patterns and Refactoring books that are so prevalent as > >reccomended reading in C++ and Java?

Re: i18n hell

2006-04-24 Thread Jarek Zgoda
Martin Blais napisał(a): > See > http://furius.ca/antiorm/ for something simple that works well. I'd like to know what is this module/library good for *before* I start downloading it. "Almost like ORM but not exactly" is rather vague term and can denote anything. Is it dishwasher? Or microwave ov

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Rene Pijlman
[EMAIL PROTECTED]: >i have discovered that the server will send a request for the heartbeat >ping if its almost timed out, so i use the length of the message to >determine what to do with it. > >msg = sockobj.recv(1024) > >if len(msg) == 158: >record the data >elif len(msg) == (34): # length of

Re: MS VC++ Toolkit 2003, where?

2006-04-24 Thread Ron Adam
Alex Martelli wrote: > "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> Alex Martelli wrote: >>> As suggested to me by David Rushby 10 hours ago, >>> >>> http://www.microsoft.com/downloads/details.aspx?FamilyId=272BE09D-40BB-4 >>> 9FD-9CB0-4BFA122FA91B&displaylang=en >>> >>> does work. >> Can you

Re: Recommended IDE for creating GUI?

2006-04-24 Thread [EMAIL PROTECTED]
Always nice to recommend myself: http://farpy.holev.com Free WYSIWYG GUI editor for wxPython (and wxRuby!). Have fun... -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended IDE for creating GUI?

2006-04-24 Thread Jarek Zgoda
Marty Christion napisał(a): > What are some good free or inexpensive (<$50) IDE's for learning how to > program and create GUI's for Python? I'm pretty good with the simple > programming aspect of the language, but I'm a little mystified by the world > of GUI's, and the options available in py

Re: threads and sys.exit()

2006-04-24 Thread robert
gangesmaster wrote: > calling sys.exit() from a thread does nothing... the thread dies, but > the interpreter remains. i guess the interpreter just catches and > ignore the SystemExit exception... > > does anybody know of a way to overcome this limitation? > call thread.interrupt_main() on *

Re: test assignmet problem

2006-04-24 Thread Paolo Pantaleo
2006/4/23, Paul McGuire <[EMAIL PROTECTED]>: > > "Paolo Pantaleo" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > So I tried this > > if(not (attr=global_re.match(line)) ): > break > > it says invalid syntax [on the =] > ... because this syntax is not valid ..

Re: MySql -Python question

2006-04-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > both of your suggestions don't work, that's kind of what I was trying > the whole time > Well it seems firly obvious that your universe is somehow broken. Please send it back to God in a plain wrapper and it will be replaced with a new universe in which all programming

Re: threads and sys.exit()

2006-04-24 Thread gangesmaster
i can't make the main thread daemonic. the situation is this: * the main thread starts a thread * the new thread does sys.exit() * the new thread dies, but the process remains i can do os.kill(os.getpid()), or TerminateProcess(-1) but that's not what i want -tomer -- http://mail.python.org/mail

Re: threads and sys.exit()

2006-04-24 Thread gangesmaster
that's not a question of design. i just want a child-thread to kill the process. in a platform agnostic way. -- http://mail.python.org/mailman/listinfo/python-list

SOAP server with WSDL?

2006-04-24 Thread Lonnie Princehouse
Does anyone know of a Python SOAP package that will publish a SOAP service /and/ generate a corresponding WSDL file? Looking at SOAPpy and ZSI, it seems that their WSDL support is limited to client-side stuff. -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-24 Thread Brian Elmegaard
Robert Kern <[EMAIL PROTECTED]> writes: > - gcc does not optimize particularly well. But well enough for other platforms. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html http://www.rugbyklubben-speed.dk -- http://mail.python.org/mailman/listinfo/python-list

C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
Hi, I'm using a tp_getattro function to call into a C library and get values the the lib keeps track of. This works: >>> o = obj.Obj() >>> o.var 'value' Thats great but I also want to expose some instance methods and I'm having trouble. But when I set tp_methods nothing shows up? If I unset t

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread André Malo
* [EMAIL PROTECTED] wrote: > I'm using a tp_getattro function to call into a C library and get > values the the lib keeps track of. This works: [...] > Thats great but I also want to expose some instance methods and I'm > having trouble. > > But when I set tp_methods nothing shows up? If I uns

Re: threads and sys.exit()

2006-04-24 Thread robert
gangesmaster wrote: > that's not a question of design. i just want a child-thread to kill the > process. in a platform agnostic way. > the clean kill is the 'KeyboardInterrupt'. your code finalizations are at least done corretly. thats also raised on SIGINT by default. so thread.interrupt_main

  1   2   >