Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-27 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] > Steve Holden <[EMAIL PROTECTED]> writes: >> Of course. But onc you (sensibly) decide to use an "if" then there >> really isn't much difference between -1, None, () and sys.maxint as >> a sentinel value, is the

Virtual Slicing

2005-08-27 Thread Bryan Olson
I recently wrote a module supporting value-shared slicing. I don't know if this functionality already existed somewhere, but I think it's useful enough that other Pythoners might want it, so here it is. Also, my recent notes on Python warts with respect to negative indexes were based on problems

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-27 Thread Bryan Olson
Steve Holden wrote: > Bryan Olson wrote: >> [...] I see no good reason for the following >> to happily print 'y'. >> >> s = 'buggy' >> print s[s.find('w')] >> >> > Before using the result you always have to perform >> > a test to discriminate between the found and not found cas

Re: Newbie question: Sub-interpreters for CAD program

2005-08-27 Thread David MacQuigg
On 24 Aug 2005 13:48:13 -0700, "sonicSpammersGoToHellSmooth" <[EMAIL PROTECTED]> wrote: >Hi all, > >I'm a newbie to Python, so I have a question about writing an >application that also has a scripting ability. I'm thinking of Eric3 >as an example. It's written in Python, but it also has an inter

Re: Python library/module for MSAccess

2005-08-27 Thread Christos Georgiou
On Sat, 27 Aug 2005 04:45:25 GMT, rumours say that Stephen Prinster <[EMAIL PROTECTED]> might have written: >Jonathon Blake wrote: > >> [ Editing/creating msaccess databases on a Linux Box, and WINE _not_ >> installed.] > >I'm pretty sure I don't understand what you are wanting to do. You say >y

Re: Any projects to provide Javascript-style client-side browser access via Python?

2005-08-27 Thread Alessandro Bottoni
Kenneth McDonald wrote: > So anyone know if there are projects underway on this? As long as I know, Mozilla (as Firefox, Thunderbird and Sunbird) can host Python as an internal scripting language thanks to PyXPCOM (the Python binding to the XPCOM cross-platform COM technology used by Mozilla). In

Re: Python library/module for MSAccess

2005-08-27 Thread Alessandro Bottoni
Christos Georgiou wrote: > I think the OP wants to *use* .mdb files on a linux system without using > any msjet*.dll libraries. Looks like you need a .mdb driver for the Python DB-API. Have a look here: http://www.python.org/topics/database/ http://www.mayukhbose.com/python/ado/ado-connection.php

Re: Embedding Python in other programs

2005-08-27 Thread webraviteja
Steve, He said VB6 not VB.NET Greg, Just write COM servers in Python and call them from VB6. No need to embed. Lot easier too. -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-27 Thread Ulrich Hobelmann
Mike Meyer wrote: >> This can be designed much better by using iframes, maybe even Ajax. > > Definitely with Ajax. That's one of the things it does really well. But then you're probably limited to the big 4 of browsers: MSIE, Mozilla, KHTML/Safari, Opera. Ok, that should cover most desktop user

Re: Jargons of Info Tech industry

2005-08-27 Thread Ulrich Hobelmann
Mike Meyer wrote: > Try turning off JavaScript (I assume you don't because you didn't > complain about it). Most of the sites on the web that use it don't > even use the NOSCRIPT tag to notify you that you have to turn the > things on - much less use it to do something useful. I had JS off for a l

Re: Closing programs that use sockets

2005-08-27 Thread billiejoex
Awesome. :-) Thank you. > You may find that CTRL/Break works even when CTRL/C doesn't. > > regards > Steve > -- > Steve Holden +44 150 684 7255 +1 800 494 3119 > Holden Web LLC http://www.holdenweb.com/ > -- http://mail.python.org/mailman/listinfo/python-list

Re: ideas for university project ??

2005-08-27 Thread Richard Lewis
On Fri, 26 Aug 2005 11:49:34 +0100, "Jon Hewer" <[EMAIL PROTECTED]> said: > > Areas of interested include AI, distributed systems. Have you considered looking at Semantic Web stuff? Its all still experimental but its quite AI and very distributed. Cheers, Richard -- http://mail.python.org/mailm

Re: need a little help with time

2005-08-27 Thread Randy Bush
i am doing disgusting looking junk based on calendar. example now = calendar.timegm(time.gmtime()) aWeek = 7*24*60*60 print time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(now + aWeek)) randy -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-27 Thread axel
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > Chris Head <[EMAIL PROTECTED]> wrote: >> What advantages would those be (other than access from 'net cafes, but >> see below)? > And workplaces. Some people have more then one computer in the house. My > partner can check her email

Re: Virtual Slicing

2005-08-27 Thread Sybren Stuvel
Bryan Olson enlightened us with: > I recently wrote a module supporting value-shared slicing. Maybe I'm dumb, but could you explain this concept? Why would someone whant this? Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but wh

Re: Virtual Slicing

2005-08-27 Thread Oren Tirosh
Bryan Olson wrote: > I recently wrote a module supporting value-shared slicing. I > don't know if this functionality already existed somewhere, In the Numarray module slices are a view into the underlying array rather than a copy. http://www.stsci.edu/resources/software_hardware/numarray -- htt

Re: Is there any module to play mp3 or wav format files?

2005-08-27 Thread Lucas Raab
el chupacabra wrote: > Is there any module to play mp3 or wav format files? > > any sample code available somewhere? > > thanks, > el chupacabra > > > --= Posted using GrabIt = > --= Binary Usenet downloading made easy =- > -= Get GrabIt for free from

Modify a C++ instance from the embed python interpreter

2005-08-27 Thread Wezzy
Hi, is there a tool that automatically expose an object to python? i have an instance of a C++ (or ObjC) object and i want to pass it to the embed interpreter that runs inside my program. Python code have to call c++ method and register some callback. I know that swig helps when python creates c++

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-27 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>If you want an exception from your code when 'w' isn't in the string >>you should consider using index() rather than find. > > > The idea is you expect w to be in the string. If w isn't in the > string, your code has a bug, and pr

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-27 Thread Steve Holden
Terry Reedy wrote: > "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message > news:[EMAIL PROTECTED] > >>Steve Holden <[EMAIL PROTECTED]> writes: >> >>>Of course. But onc you (sensibly) decide to use an "if" then there >>>really isn't much difference between -1, None, () and sys.maxint as

pcapy - print the DATA field of a packet

2005-08-27 Thread billiejoex
Hi all. I'm using pcapy module to sniff some ICMP packets. I would like to modify this source: http://www.google.it/search?hl=it&q=pcapy&btnG=Cerca+con+Google&meta= and visualize only the DATA filed of the sniffed packets instead of all fields that are generally visualized (for example: ip src, i

Re: Embedding Python in other programs

2005-08-27 Thread Gregory Piñero
see below On 27 Aug 2005 02:18:14 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Steve, > He said VB6 not VB.NET > > Greg, > Just write COM servers in Python and call them from VB6. No need to > embed. Lot easier too. > Any idea how I would get started on this? I'll do a search later

Twice bound method

2005-08-27 Thread Carlos
Hi! I want to instrumentate a class with a number of getter/setters. Each pair of getter/setter must keep it's own state gsState but also access to the state iState of instances of the instrumentated class. For example: class GetterSetter: def __init__(gsInstance, gsState): def ge

pydoc, best practices, and Data class

2005-08-27 Thread nathan_kent_bullock
I have a python program that I am trying to generate documentation for. But in one of my files I have a class called "Data", when pydoc gets to this class it just barfs. Well more specifically it generates documentation for only that one class in the file, it ignores the rest of the classes, plus i

Re: pcapy - print the DATA field of a packet

2005-08-27 Thread Peter Hansen
billiejoex wrote: > Hi all. I'm using pcapy module to sniff some ICMP packets. I would like to > modify this source: > http://www.google.it/search?hl=it&q=pcapy&btnG=Cerca+con+Google&meta= > and visualize only the DATA filed of the sniffed packets instead of all > fields that are generally visual

fontifying a pattern in a Tkinter Text widget

2005-08-27 Thread [EMAIL PROTECTED]
Hi, I'm writing a program which needs to change various format features of a specific pattern ("remote_user" for example) withing a Text widget. This pattern could potentially be anywhere within the widget. I'm unsure of how to implement the various tag methods, so a little push in the right direc

Re: Modify a C++ instance from the embed python interpreter

2005-08-27 Thread Diez B. Roggisch
Wezzy wrote: > Hi, is there a tool that automatically expose an object to python? i > have an instance of a C++ (or ObjC) object and i want to pass it to the > embed interpreter that runs inside my program. > Python code have to call c++ method and register some callback. > > I know that swig help

Re: SocketServer and a Java applet listener

2005-08-27 Thread Steve Horsley
[EMAIL PROTECTED] wrote: > Dear newsgroup, > > I give up, I must be overseeing something terribly trivial, but I can't > get a simple (Java) applet to react to incoming (python) SocketServer > messages. > > Without boring you with the details of my code (on request available, > though), here is w

Writing portable applications (Was: Jargons of Info Tech industry)

2005-08-27 Thread Mike Meyer
Ulrich Hobelmann <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>> This can be designed much better by using iframes, maybe even Ajax. >> Definitely with Ajax. That's one of the things it does really well. > But then you're probably limited to the big 4 of browsers: MSIE, > Mozilla, KHTML/Safari,

Re: global interpreter lock

2005-08-27 Thread Piet van Oostrum
> Paul Rubin (PR) wrote: >PR> [EMAIL PROTECTED] (phil hunt) writes: >>> >Let's see. Reality is that writing correct programs is hard. Writing >>> >correct programs that use concurrency is even harder, because of the >>> >exponential explosion of the order that operat

Re: Writing portable applications (Was: Jargons of Info Tech industry)

2005-08-27 Thread Rich Teer
On Sat, 27 Aug 2005, Mike Meyer wrote: > I think you're right - a web standard designed for writing real > applications probably wouldn't start life as a markup for text. The > only thing I can think of that even tries is Flash, but it's What about Java? -- Rich Teer, SCNA, SCSA, OpenSolaris CA

Re: Jargons of Info Tech industry

2005-08-27 Thread Chris Head
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Bokma wrote: > Chris Head <[EMAIL PROTECTED]> wrote: > > >>John Bokma wrote: >> >>>Chris Head <[EMAIL PROTECTED]> wrote: > > > [HTML] > > >>>It can be made much faster. There will always be a delay since >>>messages have to be downloaded, bu

Re: Jargons of Info Tech industry

2005-08-27 Thread Mike Meyer
Ulrich Hobelmann <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Try turning off JavaScript (I assume you don't because you didn't >> complain about it). Most of the sites on the web that use it don't >> even use the NOSCRIPT tag to notify you that you have to turn the >> things on - much less u

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-27 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > A corrected find() that returns None on failure is a five-liner. If I wanted to write five lines instead of one everywhere in a Python program, I'd use Java. -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: >> Chris Head <[EMAIL PROTECTED]> wrote: >>> What advantages would those be (other than access from 'net cafes, but >>> see below)? >> And workplaces. Some people have more then one computer in the house. My >

gdbm dying wierdly

2005-08-27 Thread Seth Nielson
Hi guys. I'm using a python script as a redirector for Squid. My python script uses gdbm and exhibits some weird behavior. 1. If I run the script stand-alone, it loads the gdbm database file just fine. 2. If the script is launched from squid, when it tries to load the gdbm database, it dies WITHO

Re: pcapy - print the DATA field of a packet

2005-08-27 Thread billiejoex
I'm really sorry. I was talking about this source: http://oss.coresecurity.com/impacket/sniff.py ...but nevermind. I discovered the get_data_as_string() function that resolved my problem > Sorry, but *which* source are you talking about? The link you provided > appears to be merely a page of G

Re: gdbm dying wierdly

2005-08-27 Thread Seth Nielson
Nevermind. The problem wasn't in gdbm. I had "exception" in stead of "Exception" in the try-except statement. -- SethNOn 8/27/05, Seth Nielson <[EMAIL PROTECTED]> wrote: Hi guys. I'm using a python script as a redirector for Squid. My python script uses gdbm and exhibits some weird behavior. 1. I

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-27 Thread skip
Paul> Steve Holden <[EMAIL PROTECTED]> writes: >> A corrected find() that returns None on failure is a five-liner. Paul> If I wanted to write five lines instead of one everywhere in a Paul> Python program, I'd use Java. +1 for QOTW. Skip -- http://mail.python.org/mailman/listi

Re: pre-PEP: Object-oriented file module

2005-08-27 Thread Gerrit Holl
Kenneth McDonald wrote: > Subject: pre-PEP: Object-oriented file module Please have a look at http://topjaklont.student.utwente.nl/creaties/path/pep-.html if you haven't done so already. Gerrit. -- Temperature in Luleå, Norrbotten, Sweden: | Current temperature 05-08-27 22:20:00 11.8 de

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-27 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>A corrected find() that returns None on failure is a five-liner. > > > If I wanted to write five lines instead of one everywhere in a Python > program, I'd use Java. We are arguing about trivialities here. Let's stop before it get

Re: classes and list as parameter, whats wrong?

2005-08-27 Thread Dirk Zimmermann
Thanks to everyone! I think I understand the things behind this behaviour, now. And as the life goes: Today I found the description of my "problem" in the Python Tutorial! I think I should read it more often, more carefully:-) Best, Dirk -- http://mail.python.org/mailman/listinfo/python-li

OpenSource documentation problems

2005-08-27 Thread Xah Lee
previously i've made serious criticisms on Python's documentations problems. (see http://xahlee.org/perl-python/re-write_notes.html ) I have indicated that a exemplary documentation is Wolfram Research Incorporated's Mathematica language. (available online at http://documents.wolfram.com/mathemati

Re: Any projects to provide Javascript-style client-side browser access via Python?

2005-08-27 Thread Terry Hancock
On Friday 26 August 2005 02:29 pm, Kenneth McDonald wrote: > I'm curious about this because, quite aside their function as web > browsers, it is now possible to build some very useable interfaces > using browsers with HTML, CSS, and JavaScript. (The biggest problem > is still the lack of a de

Re: OpenSource documentation problems

2005-08-27 Thread Rich Teer
On Sat, 27 Aug 2005, Xah Lee wrote: His usual crap. ___ /| /| | | ||__|| | Please do | / O O\__ NOT | /

Embedded python debug build crashing.

2005-08-27 Thread Adam Tomjack
I'm trying to embed Python 2.3.5 into a C++ application on Windows XP. When I build my app with debug symbols and link to a debug build of Python, then my program seems to crash most (but not all) of the time. Sometimes it crashes on startup, and sometimes at exit, sometimes not at all. I have

Windows/win32all, unicode and long filenames

2005-08-27 Thread Kevin Ollivier
Hi all, On Windows, it's very common to have a string of long directories in the pathname for files, like "C:\Documents and Settings\My Long User Name\My Documents\My Long Subdirectory Name\...". For a wxPython application I'm working on, this has actually caused me to run into what appears to be

network mapper Gui question

2005-08-27 Thread kyle.tk
I am trying to make a program much like cheops that will make a graphical representation of my network. What would be the best language to make the actuall interface in, Tkinter, wxPython, PyGtk? And in those what module would work for something like this. It needs to be able to redraw it self abou

Re: Windows/win32all, unicode and long filenames

2005-08-27 Thread Neil Hodgson
Kevin Ollivier: > On Windows, it's very common to have a string of long directories in the > pathname for files, like "C:\Documents and Settings\My Long User Name\My > Documents\My Long Subdirectory Name\...". For a wxPython application I'm > working on, this has actually caused me to run into wha

formal math ?

2005-08-27 Thread mehdi . rabah
Hi, I have just discovered python and it seems so easy ans so powerful to me that it remind me matlab or maple programming language (sorry free software purists ears). So I was wondering if there a sort of formal math library, that can do a thing like: lib.solve("x+1=0") -> x=-1 I have checked

Re: Newbie question: Sub-interpreters for CAD program

2005-08-27 Thread sonicSpammersGoToHellSmooth
Cool, I went to the UofA for my MS in ECE, 2000. I did my theses under Chuck Higgins. -- http://neuromorph.ece.arizona.edu/pubs/ma_schwager_msthesis.pdf The tools we had were constantly underwhelming me, so I've been thinking for years that a properly designed new toolset for students should be m

Re: Windows/win32all, unicode and long filenames

2005-08-27 Thread Kevin Ollivier
On Sat, 27 Aug 2005 23:30:46 +, Neil Hodgson wrote: > Kevin Ollivier: > >> On Windows, it's very common to have a string of long directories in the >> pathname for files, like "C:\Documents and Settings\My Long User Name\My >> Documents\My Long Subdirectory Name\...". For a wxPython applicati

Automatic language translation

2005-08-27 Thread Jon
Does python have a module that will translate between different spoken languages? My python program displays all of its messages in English currently and my boss wants it to default to Korean now. Any ideas how to go about doing this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic language translation

2005-08-27 Thread Mariano Draghi
Jon wrote: > Does python have a module that will translate between different spoken > languages? My python program displays all of its messages in English > currently and my boss wants it to default to Korean now. > > Any ideas how to go about doing this? > You need to use gettext. Please, have

Re: Writing portable applications (Was: Jargons of Info Tech industry)

2005-08-27 Thread Mike Meyer
Rich Teer <[EMAIL PROTECTED]> writes: > On Sat, 27 Aug 2005, Mike Meyer wrote: >> I think you're right - a web standard designed for writing real >> applications probably wouldn't start life as a markup for text. The >> only thing I can think of that even tries is Flash, but it's > What about Java?

Re: list insertion

2005-08-27 Thread Bengt Richter
On Tue, 23 Aug 2005 20:58:11 -0700, Randy Bush <[EMAIL PROTECTED]> wrote: >i am trying to insert into a singly linked list > >hold = self.next >self.next = DaClass(value) >self.next.next = hold > >but i suspect (from print statement insertions) that the result >is not as i expect. as

Re: Experience regarding Python tutorials?

2005-08-27 Thread Joal Heagney
Steve wrote: > Python is an excellent place to start. Avoid Perl at all costs. > > There is a new beginners book on Python that looks interesting. It is > from WROX (the red cover folks) and called "Beginning Python". > > http://www.amazon.com/exec/obidos/tg/detail/-/0764596543/qid=1125072498/s

python image thumbnail generator?

2005-08-27 Thread Chris Dewin
Hi. I run a website for my band, and the other guys want an image gallery. I'm thinking it would be nice and easy, if we could just upload a jpg into a dir called "gallery/". When the client clicks the "gallery" link, a cgi script could search the gallery/ dir, and create thumbnails of any jpeg i

Re: python image thumbnail generator?

2005-08-27 Thread Paul Rubin
"Chris Dewin" <[EMAIL PROTECTED]> writes: > (1) Can this be done with python? If so, what module do I need to look up? You could do it with PIL, or run jpegtran in an external process. jpegtran may be easier. -- http://mail.python.org/mailman/listinfo/python-list

Re: python image thumbnail generator?

2005-08-27 Thread Mike C. Fletcher
Chris Dewin wrote: >Hi. I run a website for my band, and the other guys want an image gallery. > >I'm thinking it would be nice and easy, if we could just upload a jpg into >a dir called "gallery/". When the client clicks the "gallery" link, a >cgi script could search the gallery/ dir, and create

Re: Experience regarding Python tutorials?

2005-08-27 Thread Randy Bush
> There is also a python tutor newsgroup at gmane > (gmane.comp.python.tutor). is there a mailing list to which it is gated? randy -- http://mail.python.org/mailman/listinfo/python-list

Re: Experience regarding Python tutorials?

2005-08-27 Thread Steve Holden
Randy Bush wrote: >>There is also a python tutor newsgroup at gmane >>(gmane.comp.python.tutor). > > > is there a mailing list to which it is gated? > > randy > It's actually primarily a mailing list ([EMAIL PROTECTED], IIRC). See http://mail.python.org/mailman/listinfo/tutor regards Steve

Re: Experience regarding Python tutorials?

2005-08-27 Thread Steve Holden
Sorry, that email address is [EMAIL PROTECTED] Steve Holden wrote: > Randy Bush wrote: > >>>There is also a python tutor newsgroup at gmane >>>(gmane.comp.python.tutor). >> >> >>is there a mailing list to which it is gated? >> >>randy >> > > It's actually primarily a mailing list ([EMAIL PROTECT

Re: list insertion

2005-08-27 Thread Randy Bush
>>hold = self.next >>self.next = DaClass(value) >>self.next.next = hold >> >> but i suspect (from print statement insertions) that the result >> is not as i expect. as the concept and code should be very >> common, as i am too old for pride, i thought i would ask. > I think you're fine

Cygwin font problems

2005-08-27 Thread Steve Holden
Is anyone aware of (a fix for) problems I'm having getting PIL 1.1.5 to create bitmaps using TrueType and openType fonts? When I create an image using the standard PIL fonts everything seems fine, but when I use ImageFont.truetype(, ) no text is drawn. setup.py reports from debug print statemen

Re: overload builtin operator

2005-08-27 Thread Bengt Richter
On Thu, 25 Aug 2005 16:12:20 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >Shaun wrote: >> Hi, >> >> I'm trying to overload the divide operator in python for basic arithmetic. >> eg. 10/2 ... no classes involved. >> >> I am attempting to redefine operator.__div__ as follows: >> >>

Re: formal math ?

2005-08-27 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > > I have just discovered python and it seems so easy ans so powerful to > me that it remind me matlab or maple programming language (sorry free > software purists ears). > > So I was wondering if there a sort of formal math library, that can do > a thing like: >

Re: Advanced concurrancy

2005-08-27 Thread travlr
Hi, I've been on the research pursuit regarding these subjects and I wonder why Erlang doesn't fit well into this category of concurrency. Also, from what I have seen, there hasn't been a recent interest in an updated interface. Maybe I'm mistaken and Erlang's features don't apply well. Thanks for

Re: Embedding Python in other programs

2005-08-27 Thread Ravi Teja
http://www.python.org/windows/win32com/QuickStartServerCom.html If you are using ActivePython, that tutorial is included (PyWin32 documentation -> Python COM -> Overviews) along with the needed win32all module. -- http://mail.python.org/mailman/listinfo/python-list