Re: how to write thread-safe module ? and pytz

2005-08-14 Thread nicolas_riesch
Thank you very much for all your explanation ! Your pytz module is great ! -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I exclude a word by using re?

2005-08-14 Thread Peter Otten
could ildg wrote: > But what should I do if there are more than one hello and I only want > to extract what's before the first "hello". For example, the raw > string is "hi, how are you? hello I'm fine, thank you hello. that's it > hello", I want to extract all the stuff before the first hello? T

Re: distutils on Win32 using .NET Framework SDK

2005-08-14 Thread Martin v. Löwis
Jerry He wrote: > Hi, > I was trying to build a C++ extension on Win32 with > distutils. The extension worked on Cygwin but when I > tried it with the Win32-build python, it complained > that I don't have .NET Framework SDK installed. But > after I installed .NET Framework SDK 2.0, it still > co

Dynamic autoscaling of axes with pyqwt ?

2005-08-14 Thread Madhusudan Singh
How does one enable dynamic autoscaling of the axes ? I am using setAxisAutoScale in an application which acquires data, and when the application ends, I do get correctly autoscaled axes, but not while the measurement is in progress. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spaces and tabs again

2005-08-14 Thread John Machin
Paul Watson wrote: > John Machin wrote: > >> Paul Watson wrote: >> >>> Dan Sommers wrote: >>> On Sun, 14 Aug 2005 01:04:04 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed the > following > in comp.lang.

Re: Spaces and tabs again

2005-08-14 Thread Paul Watson
John Machin wrote: > Paul Watson wrote: > >> Dan Sommers wrote: >> >>> On Sun, 14 Aug 2005 01:04:04 GMT, >>> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >>> >>> On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed the following in comp.lang.python: >>> >>> >>> >>> > Are

Re: Loading classes dynamically

2005-08-14 Thread Steven Bethard
Ramza Brown wrote: > try: > load = eval('%s(props)' % (props['plugin.generate'])) > except: > > It works, doesnt seem very safe. Where props['plugin.generate'] is a > class name string. And 'props' is the first arg in the constructor. Where is the class defined? The right answer to this

Re: Spaces and tabs again

2005-08-14 Thread John Machin
Paul Watson wrote: > Dan Sommers wrote: > >> On Sun, 14 Aug 2005 01:04:04 GMT, >> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> >> >>> On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed the following >>> in comp.lang.python: >> >> >> Are you kidding? You are going to MANDATE spaces?

Re: client server question

2005-08-14 Thread John
Thanks a lot, I think I could modify this to get my work done. --j Chris Curvey wrote: > import threading > import logging > > ## > class Reader(threading.Thread): > def __init__(self, clientsock): > threading.Thread.__i

Re: python-Excel: Chinese Characters

2005-08-14 Thread John Machin
zxo102 wrote: > Hi there, > I am trying to put data including Chinese Characters into Excel > through python. But I got some problems. Here is my sample code: > > ## > # > import win32com.client > xlapp = win32com.client.DispatchEx("Excel.Applic

Re: GUI tookit for science and education

2005-08-14 Thread Paul Rubin
Mateusz £oskot <[EMAIL PROTECTED]> writes: > Thank you for any piece of advice in advance. Ask yourself why you want a GUI toolkit. Maybe you can write a web application instead, and use a browser as the GUI. That's a lot easier to write (just use html), and makes it trivial to run the applicati

GUI tookit for science and education

2005-08-14 Thread Mateusz Łoskot
Hi, I'd like to ask some scientists or students which GUI toolkit they would recommend to develop scientific prototypes (for education and testing some theories). I think such toolkit should fill a bit different needs and requirements: - very simple to learn - easy to install - beautyfiers and adv

Re: Python and games

2005-08-14 Thread Eric Lavigne
>Like XML, scripting was extremely useful as both a mod tool and an >internal development tool. If you don't have any need to expose code >and algorithms in a simple and safe way to others, you can argue that >providing a scripting language is not worth the effort. However, if you >do have that n

Re: Spaces and tabs again

2005-08-14 Thread Paul Watson
Dan Sommers wrote: > On Sun, 14 Aug 2005 01:04:04 GMT, > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > >>On 13 Aug 2005 13:18:21 -0700, [EMAIL PROTECTED] declaimed the following >>in comp.lang.python: > > >>>Are you kidding? You are going to MANDATE spaces? >>> >> >> After the backlash,

python-Excel: Chinese Characters

2005-08-14 Thread zxo102
Hi there, I am trying to put data including Chinese Characters into Excel through python. But I got some problems. Here is my sample code: ## # import win32com.client xlapp = win32com.client.DispatchEx("Excel.Application") xlbook = xlapp.Workboo

distutils on Win32 using .NET Framework SDK

2005-08-14 Thread Jerry He
Hi, I was trying to build a C++ extension on Win32 with distutils. The extension worked on Cygwin but when I tried it with the Win32-build python, it complained that I don't have .NET Framework SDK installed. But after I installed .NET Framework SDK 2.0, it still complains "error: The .NET Frame

Loading classes dynamically

2005-08-14 Thread Ramza Brown
What is the most pythonic way to load a class and instaniate an object dynamically. Right now, I am using eval: try: load = eval('%s(props)' % (props['plugin.generate'])) except: It works, doesnt seem very safe. Where props['plugin.generate'] is a class name string. And 'props' is the

Re: py2exe: no exe produced?

2005-08-14 Thread Titi Anggono
I never use python2.4, I use python 2.3 and here is (maybe it works). For example, the hello.py is under directory C:\Python23\latihan\ and put the setup.py under that directory -- #setup.py from distutils.core import setup import py2exe setup(console=["hel

Re: Standalone applications ?

2005-08-14 Thread Maurice LING
henne wrote: > > I should have added that my platform is Linux. > > http://davidf.sjsoft.com/mirrors/mcmillan-inc/install1.html > > Squeeze works on Linux too. It tells me that the installer files are not found. M -- http://mail.python.org/mailman/listinfo/python-list

Python and games

2005-08-14 Thread Josiah Carlson
Perhaps some of you would get a kick out of this. - Josiah Like XML, scripting was extremely useful as both a mod tool and an internal development tool. If you don't have any need to expose code and algorithms in a simple and safe way to others, you can argue that providing a scripting languag

Re: wx.MessageDialog displayed without components inside

2005-08-14 Thread perchef
yes, it did work. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a log file

2005-08-14 Thread Andreas Kostyrka
Completly untested: #!/usr/bin/env python import sys, datetime user = sys.argv[1] starttime = None for l in sys.stdin: flds = l.strip().split() datestr, timestr, prog, op, to, sname = flds month, day, year = [int(x) for x in datestr.split("-", 2)] hour, min, sec, ms = [int(x) fo

Re: Parsing a log file

2005-08-14 Thread Andreas Kostyrka
Completly untested: #!/usr/bin/env python import sys, datetime user = sys.argv[1] starttime = None for l in sys.stdin: flds = l.strip().split() datestr, timestr, prog, op, to, sname = flds month, day, year = [int(x) for x in datestr.split("-", 2)] hour, min, sec, ms = [int(x) fo

Re: Parsing a log file

2005-08-14 Thread googleboy
I am similarly not a programmer but am trying to learn python to do tasks like this. I would read through the regular expressions tutorial. You could probably easily read in all teh lines of the log file, and then split them up by " " (spaces).. If you're right about the lines all being consis

Persistent XMLRPC Connection

2005-08-14 Thread Chris Spencer
I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for remote procedure call. I've written a simple IP based authentication scheme for the Server, and I'd like to include the port in the authentication, which is currently not possible since the port keeps changing. I've looked a

Intalling psycopg

2005-08-14 Thread ys
Hi I am getting "ImportError: No module named psycopg" i downloaded windows binary from http://stickpeople.com/projects/python/win-psycopg/ It is intalled in python24\lib\site-packages\psycopg2\ please help! Thanks YS -- http://mail.python.org/mailman/listinfo/python-list

Re: help with mysql cursor.execute()

2005-08-14 Thread William Gill
I have been testing and it seems that: 1- Cursor.execute does not like '?' as a placeholder in sql 2- Cursor.execute accepts '%s' but puts the quotation mark around the substitution. sql = 'select * from %s where cusid = ? ' % name Cursor.execute(sql, (recID,)) still fails, but: sql

cgi form validation problems

2005-08-14 Thread googleboy
Hi. I am writing up my own web form. I'm a bit of a newb, and read up many different how-tos and examples and documentaion. I finally had it working just great until I decided that I wanted to add some extra logic because there's one form that submits a particular type of information. a little e

Re: How can I exclude a word by using re?

2005-08-14 Thread Bruno Desthuilliers
could ildg a écrit : > Thank you. > But what should I do if there are more than one hello and I only want > to extract what's before the first "hello". Read The Fine Manual ?-) > For example, the raw > string is "hi, how are you? hello I'm fine, thank you hello. that's it > hello", I want to ex

Re: pickle.load not working?

2005-08-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > it reads a file saved this way: > -- > import pickle > > class chatuser: #container for storing user information... > login = "" > authcode = "" > cookie = "" > ip = "" > loggedin = 0 > invalid_logins =

Re: help with mysql cursor.execute()

2005-08-14 Thread Scott David Daniels
William Gill wrote: > I have been trying to pass parameters as indicated in the api. > when I use: > sql= 'select * from %s where cusid = %s ' % name,recID) > Cursor.execute(sql) > it works fine, but when I try : > sql= 'select * from %s where cusid like %s ' > Cursor.execute(sql,(name,recI

help with mysql cursor.execute()

2005-08-14 Thread William Gill
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql= 'select * from %s where cusid like %s ' Cursor.execute(sql,(name,recID)) or sql= 'select *

Re: FTP over SSL (explicit encryption)

2005-08-14 Thread Paul Rubin
"David Isaac" <[EMAIL PROTECTED]> writes: > Just found this: > http://trevp.net/tlslite/ > I haven't even had time to try it, > but I thought you'd want to know. Tlslite is a very well done and promising package, but in its present form it's not really complete. It's missing important functionali

Re: FTP over SSL (explicit encryption)

2005-08-14 Thread David Isaac
> > http://www.lag.net/paramiko/ "Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > sock.settimeout(20) > sock.connect((hostname, port)) > my_t = paramiko.Transport(sock) > my_t.connect(hostkey=None ,username=userna

Re: Euclid's Algorithm in Python?

2005-08-14 Thread James Dennett
Antoon Pardon wrote: > On 2005-08-08, Bengt Richter <[EMAIL PROTECTED]> wrote: > >>On 7 Aug 2005 17:31:02 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: >> >> >>>Good point. I suppose I'd only ever seen it implemented with the if >>>test, but you're right, the plain while loop should work fi

Re: FTP over SSL (explicit encryption)

2005-08-14 Thread David Isaac
"Eric Nieuwland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm having a look at FTP/S right now. That's a little > more complicated, but it seems doable. > If I succeed, I guess I'll donate the stuff as an extension to ftplib. Just found this: http://trevp.net/tlslite/ I haven

Re: A PIL Question

2005-08-14 Thread Cyril Bazin
Try Image.new in place of Image.Image if you want to build a new image. At which level are you? CyrilOn 14 Aug 2005 10:34:38 -0700, Ray <[EMAIL PROTECTED]> wrote: Hello,I'm using latest PIL version with Python 2.4.1. (for solving a level inPython Challenge actually...). Anyway, I'm trying to draw

Re: A PIL Question

2005-08-14 Thread Max Erickson
"Ray" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > image = Image.Image() > > Anybody has any idea why this is the case? > Image.Image() isn't the way to get a new image object in PIL. Try Image.new(), which needs at least mode and size arguments. You can get those from your ori

Re: A PIL Question

2005-08-14 Thread Terry Hancock
On Sunday 14 August 2005 12:34 pm, Ray wrote: > import Image > > im = Image.open("something.jpg") > seq = im.getdata() > > image = Image.Image() > image.putdata(seq) > > image.show() > > I always get: > > Traceback (most recent call last): > File "Script1.py", line 31, in ? > image.putda

Re: Permutation Generator

2005-08-14 Thread David Isaac
"Casey Hawthorne" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's hard to make "complete" permutation generators, Knuth has a whole > fascicle on it - "The Art of Computer Programming - Volume 4 Fascicle > 2 - Generating All Tuples and Permutations" - 2005 Can you elaborate a

Re: Permutation Generator

2005-08-14 Thread Casey Hawthorne
It's hard to make "complete" permutation generators, Knuth has a whole fascicle on it - "The Art of Computer Programming - Volume 4 Fascicle 2 - Generating All Tuples and Permutations" - 2005 -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry ... and Xah Lee (I mean Jerry) Springer

2005-08-14 Thread Keith Thompson
Alex <[EMAIL PROTECTED]> writes: > Xah Lee wrote: [SSSNNNIIIPPP!!!] > I've extracted the preceding castigating snippets from Mr. Lee's > Jargon "thesis". [SSSNNNIIIPPP!!!] *Please stop posting followups to this off-topic nonsense. Just ignore it. Responding to spam is spam; responding to a troll

A PIL Question

2005-08-14 Thread Ray
Hello, I'm using latest PIL version with Python 2.4.1. (for solving a level in Python Challenge actually...). Anyway, I'm trying to draw a picture. My question is, why is it that putdata() won't work? Even this won't run: import Image im = Image.open("something.jpg") seq = im.getdata() image =

Re: Standalone applications ?

2005-08-14 Thread Madhusudan Singh
TPJ wrote: >> I should have added that my platform is Linux. > > In this case you shouldn't bother yourself with executables. Python is > available on any major distribution. > > My Python apps are available as pyc files for Linux (and for those > Windows users, who have Python installed) and as

Re: Euclid's Algorithm in Python?

2005-08-14 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: > On 2005-08-08, Bengt Richter <[EMAIL PROTECTED]> wrote: > > On 7 Aug 2005 17:31:02 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: > > > >>Good point. I suppose I'd only ever seen it implemented with the if > >>test, but you're right, the plain while loop should work fin

Re: How can I exclude a word by using re?

2005-08-14 Thread could ildg
Thank you. But what should I do if there are more than one hello and I only want to extract what's before the first "hello". For example, the raw string is "hi, how are you? hello I'm fine, thank you hello. that's it hello", I want to extract all the stuff before the first hello? On 14 Aug 2005 08

Re: How can I exclude a word by using re?

2005-08-14 Thread Jeff Schwab
could ildg wrote: > In re, the punctuation "^" can exclude a single character, but I want > to exclude a whole word now. for example I have a string "hi, how are > you. hello", I want to extract all the part before the world "hello", > I can't use ".*[^hello]" because "^" only exclude single char "

Re: How can I exclude a word by using re?

2005-08-14 Thread Christoph Rackwitz
re.findall('(.*)hello|(.*)', 'hi, how are you. hello') re.findall('(.*)hello|(.*)', 'hi, how are you. ello') take a look at the outputs of these. -- http://mail.python.org/mailman/listinfo/python-list

Re: wx.MessageDialog displayed without components inside

2005-08-14 Thread stas
On Sun, 14 Aug 2005 07:45:10 -0700, perchef wrote: > >> Just a thought, do you call the event loop ? > yes i do. > I really can't see my a MessageDialog would appear without components > inside. maybe a thread problem ? Does the example I gave work? I mean when you copy and paste it does it show

Re: Euclid's Algorithm in Python?

2005-08-14 Thread Antoon Pardon
On 2005-08-08, Bengt Richter <[EMAIL PROTECTED]> wrote: > On 7 Aug 2005 17:31:02 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: > >>Good point. I suppose I'd only ever seen it implemented with the if >>test, but you're right, the plain while loop should work fine. Silly >>me. >> >>def gcd(a,b)

Re: wx.MessageDialog displayed without components inside

2005-08-14 Thread perchef
> Just a thought, do you call the event loop ? yes i do. I really can't see my a MessageDialog would appear without components inside. maybe a thread problem ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing a log file

2005-08-14 Thread CG
John, Your comments are very helpful. I will take the datetime stamp as the way to go. I don't have a need to throw away the time info, it is You said: >What do you do if servers are in different >timezones? This is all inhouse in a non-daylight savings country and would not be an issue You a

Re: Parsing a log file

2005-08-14 Thread CG
Thanks Andreas, In your first paragraph, you ask about incorrect input. I guess it is possible, but without that information, my collection of the data is useless, so I really don't know what I would do with that. As for the other stuff, I can hack the data in other ways, such as with VBA and MS

Re: Standalone applications ?

2005-08-14 Thread Peter Decker
On 14 Aug 2005 03:49:08 -0700, TPJ <[EMAIL PROTECTED]> wrote: > > I should have added that my platform is Linux. > > In this case you shouldn't bother yourself with executables. Python is > available on any major distribution. > > My Python apps are available as pyc files for Linux (and for those

How can I exclude a word by using re?

2005-08-14 Thread could ildg
In re, the punctuation "^" can exclude a single character, but I want to exclude a whole word now. for example I have a string "hi, how are you. hello", I want to extract all the part before the world "hello", I can't use ".*[^hello]" because "^" only exclude single char "h" or "e" or "l" or "o". W

Re: Permutation Generator

2005-08-14 Thread Jack Diederich
On Fri, Aug 12, 2005 at 03:48:38PM -0400, Michael J. Fromberger wrote: > In article <[EMAIL PROTECTED]>, > Talin <[EMAIL PROTECTED]> wrote: > > > I'm sure I am not the first person to do this, but I wanted to share > > this: a generator which returns all permutations of a list: > > You're right

Re: What does the word "quiet" mean in this paragraph?

2005-08-14 Thread could ildg
Thank you very much. I am not a native English speeker so I have problem when understanding this sentense. Now I know that the word "quiet" is an adjective and I'm totally catch it. Thank you~ On 8/14/05, Peter Decker <[EMAIL PROTECTED]> wrote: > On 8/14/05, could ildg <[EMAIL PROTECTED]> wrote:

Re: Jargons of Info Tech industry ... and Xah Lee (I mean Jerry) Springer

2005-08-14 Thread Alex
Xah Lee wrote: > Jargons of Info Tech industry > > (A Love of Jargons) > > Xah Lee, 2002 Feb > > The jargon-soaked stupidity in computing field can be grouped into > classes ... One flagrant example is Sun Microsystem's > Java stuff ... fucking stupid Java and fuck Sun > Microsystems. This i

Re: wx.MessageDialog displayed without components inside

2005-08-14 Thread stas
On Sat, 13 Aug 2005 16:34:17 -0700, perchef wrote: > nope, I have put md.Destroy() away and it didn't change something. > I don't think that's the problem because ShowModal() is a blocking > method, execution is stop until you press YES or NO (in my case with > wx.YES_NO) Just a thought, do you ca

help with TixComboBox usage in python

2005-08-14 Thread [EMAIL PROTECTED]
Hi, I have to write a code in which based on a user selection in a combo box, pages in NoteBook should be automatically added or deleted. So, I have the following class. class myActionsDialog: def __init__ (self, top): self.ActionsWidget = dict() self.sd=None self.ActionsWidget['Label'] = Labe

Re: What does the word "quiet" mean in this paragraph?

2005-08-14 Thread Peter Decker
On 8/14/05, could ildg <[EMAIL PROTECTED]> wrote: > The paragraph is as below, I mark the word quiet with *** ***. > ___ > One problem with distributed applications is that if no data arrives > over a long period of time, you need to wonder why. On one hand, it > cou

Re: Parsing a log file

2005-08-14 Thread John Machin
CG wrote: [snip] > What I basically want to do is end up with a text file that can be > easily imported into a database with a format like this (or I guess it > could be written in a SQL script form that could write directly to a > database like Mysql): > > Connect_Date Connect_Time Disconnect_dat

What does the word "quiet" mean in this paragraph?

2005-08-14 Thread could ildg
The paragraph is as below, I mark the word quiet with *** ***. ___ One problem with distributed applications is that if no data arrives over a long period of time, you need to wonder why. On one hand, it could be that the other program just hasn't had any information

Re: Parsing a log file

2005-08-14 Thread Andreas Kostyrka
Am Samstag, den 13.08.2005, 14:01 -0700 schrieb CG: Well, you have described your problem nicely. One thing that's missing is how to deal with incorrect input. (For example missing connect or disconnect messages). Furthermore, you can now: a) try to find somebody who writes it for you. How you mo

Re: Standalone applications ?

2005-08-14 Thread TPJ
> I should have added that my platform is Linux. In this case you shouldn't bother yourself with executables. Python is available on any major distribution. My Python apps are available as pyc files for Linux (and for those Windows users, who have Python installed) and as executables for Win (for

Re: Standalone applications ?

2005-08-14 Thread henne
> I should have added that my platform is Linux. http://davidf.sjsoft.com/mirrors/mcmillan-inc/install1.html Squeeze works on Linux too. -- http://mail.python.org/mailman/listinfo/python-list