Re: [perl-python] 20050113 looking up syntax

2005-01-14 Thread Erik Max Francis
Peter Hansen wrote: So why duplicate the posts by posting them to the newsgroups? Because he's a well-known pest. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Yes I'm / Learning from falling / Hard lessons --

Re: XPath and XQuery in Python?

2005-01-14 Thread Uche Ogbuji
Interesting discussion. My own thoughts: http://www.oreillynet.com/pub/wlg/6224 http://www.oreillynet.com/pub/wlg/6225 Meanwhile, please don't make the mistake of bothering with XQuery. It's despicable crap. And a huge impedance mismatch with Python. --Uche -- http://mail.python.org/mailman/l

Re: porting C code

2005-01-14 Thread Peter Hansen
Lucas Raab wrote: Sorry, the third "byte" is what I meant. Fair enough. Note, however, that as someone pointed out, it's actually the *fourth* of something, and it would not necessarily be a byte. In fact, in your case, it's not: typedef unsigned long int word32 ; void mu(word32 *a) { int i ;

Re: finding/replacing a long binary pattern in a .bin file

2005-01-14 Thread John Lenton
On Wed, Jan 12, 2005 at 10:36:54PM -0800, yaipa wrote: > What would be the common sense way of finding a binary pattern in a > .bin file, say some 200 bytes, and replacing it with an updated pattern > of the same length at the same offset? > > Also, the pattern can occur on any byte boundary in th

Re: Com port interrupts again

2005-01-14 Thread Peter Hansen
engsol wrote: I didn't fully think through my application before posting my question. Async com port routines to handle com port interrups only work well if one has access to the low level operating system. In that case the receive buffer interrupt would cause a jump to an interrupt service routine

Re: Python.org, Website of Satan

2005-01-14 Thread Stephen Waterbury
Michael Hoffman wrote: Denis S. Otkidach wrote: Certainly, it can be done more efficient: Yes, of course. I should have thought about the logic of my code before posting. But I didn't want to spend any more time on it than I had to. ;-) Bah, you satanic types are so lazy. -- http://mail.python.org

Re: finding/replacing a long binary pattern in a .bin file

2005-01-14 Thread Bengt Richter
On 14 Jan 2005 15:40:27 -0800, "yaipa" <[EMAIL PROTECTED]> wrote: >Bengt, and all, > >Thanks for all the good input. The problems seems to be that .find() >is good for text files on Windows, but is not much use when it is >binary data. The script is for a Assy Language build tool, so I know Did

Re: import keyword behaviour - performance impact if used multiple times?

2005-01-14 Thread Nick Coghlan
neophyte wrote: Nick Coghlan wrote: > Is > this something to do with system modules being singletons? They aren't singletons in the GoF design pattern sense. However, Python's import machinery operates in such a way that it takes effort to get multiple version of the same module into memory at the

[perl-python] 20050114 if statement

2005-01-14 Thread Xah Lee
. # here's an example of if statement in python. . . x=-1 . if x<0: . print 'neg' . elif x==0: . print 'zero' . elif x==1: . print 'one' . else: . print 'other' . . # the elif can be omitted. . -- . # here's an example of if statement in perl . . $x=3

Re: Python Operating System???

2005-01-14 Thread JanC
jtauber schreef: > see http://cleese.sourceforge.net/ There is not much to see there, most of the wiki is filled with spam... -- JanC "Be strict when sending and tolerant when receiving." RFC 1958 - Architectural Principles of the Internet - section 3.9 -- http://mail.python.org/mailman/listi

Re: Threading Or Other Suggestions?!?

2005-01-14 Thread chrisg
You could also use os.spawnl to launch it in a separate process. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python.org, Website of Satan

2005-01-14 Thread Michael Hoffman
Denis S. Otkidach wrote: Certainly, it can be done more efficient: Yes, of course. I should have thought about the logic of my code before posting. But I didn't want to spend any more time on it than I had to. ;-) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: query python env

2005-01-14 Thread Michael Hoffman
Steve Holden wrote: I suspect rather that the OP is looking for os.environ, as in: He was using the examples of PYTHONHOME and PYTHONPATH which have specific meanings. Using sys.prefix is better than os.environ["PYTHONHOME"], which is unlikely to be set. -- Michael Hoffman -- http://mail.python.o

Looking for a few badass Python coders (Chicago).

2005-01-14 Thread Wendell III
Hello everyone, I am currently involved with a project involving instant messengers and social networks. We really need some talented individuals to help our team out with some Python code. Your work would be open sourced, and you would be credited in the application itself. Compensation is neg

Re: Python.org, Website of Satan

2005-01-14 Thread Brian Eable
"mr_little" <[EMAIL PROTECTED]> writes: > Brian Eable wrote: > > perl -e '$a="194.109.137.226"; @a = reverse split /\./, $a; for $i > (0..3) { $sum += $a[$i]*(256**$i) } print "sum = $sum\n"' > > > > 226 + 35072 + 7143424 + 3254779904 = 3261958626 > > > > http://3261958626/ > > > > Which is NOT 66

Handling fractions of seconds in strftime/strptime

2005-01-14 Thread skip
I'm looking for a solution (or ideas about a solution) to the problem that strftime(3) and strptime(3) don't understand time increments of less than one second. Most operating systems can provide times with subsecond resolution and like Python I'm pretty sure Ruby, Perl and Tcl have objects or pac

Re: Why 'r' mode anyway?

2005-01-14 Thread Tim Peters
[Tim Peters] >> That differences may exist is reflected in the C >> standard, and the rules for text-mode files are more restrictive >> than most people would believe. [Irmen de Jong] > Apparently. Because I know only about the Unix <-> Windows > difference (windows converts \r\n <--> \n when usin

Re: finding/replacing a long binary pattern in a .bin file

2005-01-14 Thread yaipa
Bengt, and all, Thanks for all the good input. The problems seems to be that .find() is good for text files on Windows, but is not much use when it is binary data. The script is for a Assy Language build tool, so I know the exact seek address of the binary data that I need to replace, so maybe

Re: What strategy for random accession of records in massive FASTA file?

2005-01-14 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Chris Lasher" <[EMAIL PROTECTED]> wrote: > Hello, > I have a rather large (100+ MB) FASTA file from which I need to > access records in a random order. The FASTA format is a standard format > for storing molecular biological sequences. Each record contains a > hea

Re: Class initialization from a dictionary, how best?

2005-01-14 Thread Bengt Richter
On 14 Jan 2005 07:32:06 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Yes, my examle here is a tiny part of a larger more complex issue. My >application is an DOM XML parser that is reading attributes one at a you mean like blah blah and you are grabbing things of interest out of a stream

Re: (objects as) mutable dictionary keys

2005-01-14 Thread Steven Bethard
Peter Maas wrote: I have summarized the discussion about the usability of lists (and and other mutable types) as dictionary keys and put it into the Python wiki.URL: http://www.python.org/moin/DictionaryKeys. Antoon Pardon wrote: > I had a look and I think you should correct the followingr: > > D

Re: oddities in the datetime module

2005-01-14 Thread Tim Peters
[Max M] > ... > First of, it should be possible to easily convert between the > datetime objects. Why? All the conversions people asked for when the module was being designed were implemented. > And eg. the date object doesn't have a datetime() method. Which > it could easily have. But not a *s

Re: Producer/consumer Queue "trick"

2005-01-14 Thread John Lenton
On Fri, Jan 14, 2005 at 04:26:02PM -0600, Evan Simpson wrote: > WEBoggle needs a new game board every three minutes. Boards take an > unpredictable (much less than 3min, but non-trivial) amount of time to > generate. The system is driven by web requests, and I don't want the > request that happ

Re: What strategy for random accession of records in massive FASTA file?

2005-01-14 Thread Steve Holden
Jeff Shannon wrote: Chris Lasher wrote: And besides, for long-term archiving purposes, I'd expect that zip et al on a character-stream would provide significantly better compression than a 4:1 packed format, and that zipping the packed format wouldn't be all that much more efficient than zipping th

Re: What strategy for random accession of records in massive FASTA file?

2005-01-14 Thread Steve Holden
Bengt Richter wrote: On 12 Jan 2005 14:46:07 -0800, "Chris Lasher" <[EMAIL PROTECTED]> wrote: [...] Others have probably solved your basic problem, or pointed the way. I'm just curious. Given that the information content is 2 bits per character that is taking up 8 bits of storage, there must be a g

Re: oddities in the datetime module

2005-01-14 Thread Serge Orlov
Max M wrote: > Serge Orlov wrote: >> Max M wrote: > >> Yes, you did. datetime.timetuple is those who want *time module* >> format, you should use datetime.data, datetime.time, datetime.year >> and so on... As they say, if the only tool you have is timetuple, everything >> looks like tuple Try this

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Steve Holden
Paul Rubin wrote: "Fredrik Lundh" <[EMAIL PROTECTED]> writes: Huh? Expressions are not statements except when they're "expression statements"? What kind of expression is not an expression statement? any expression that is used in a content that is not an expression statement, of course. Come on

Re: (objects as) mutable dictionary keys

2005-01-14 Thread Steve Holden
Antoon Pardon wrote: Op 2005-01-14, Peter Maas schreef <[EMAIL PROTECTED]>: I have summarized the discussion about the usability of lists (and and other mutable types) as dictionary keys and put it into the Python wiki.URL: http://www.python.org/moin/DictionaryKeys. This summary might be used as a

Re: Index server

2005-01-14 Thread Marcel van den Dungen
[EMAIL PROTECTED] wrote: Is there an Index server available in Python? For example: I have large intranet with several servers and I would like to index documents like search engines do. Users then can search for a domument in ALL intranet servers like I do on Google. Thanks for answers L.A. Take

Re: Octal notation: severe deprecation

2005-01-14 Thread Bengt Richter
On Fri, 14 Jan 2005 20:13:48 +0100, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On Thu, 13 Jan 2005 08:18:25 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: >> >>>[EMAIL PROTECTED] wrote: In Mythical Future Python I would like to be able to use any base in in

Re: Python.org, Website of Satan

2005-01-14 Thread Steve Holden
Lucas Saab wrote: Arich Chanachai wrote: Jane wrote: "Lucas Raab" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Jane wrote: <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is this website with such a

Producer/consumer Queue "trick"

2005-01-14 Thread Evan Simpson
WEBoggle needs a new game board every three minutes. Boards take an unpredictable (much less than 3min, but non-trivial) amount of time to generate. The system is driven by web requests, and I don't want the request that happens to trigger the need for the new board to have to pay the time cos

Re: win32net help

2005-01-14 Thread [EMAIL PROTECTED]
Have you tried using UDP instead of TCP? Also, it is common practice to choose a random port over 1024 for opening a connection to a remote server. -- http://mail.python.org/mailman/listinfo/python-list

Re: query python env

2005-01-14 Thread Steve Holden
Michael Hoffman wrote: David Bear wrote: How does one query the python environment, ie pythonhome sys.prefix > pythonpath sys.path etc. [...] I suspect rather that the OP is looking for os.environ, as in: [EMAIL PROTECTED] sholden]$ ENVAR=value [EMAIL PROTECTED] sholden]$ export ENVAR [EMAIL PRO

Re: query python env

2005-01-14 Thread Scott David Daniels
David Bear wrote: How does one query the python environment, ie pythonhome, pythonpath, etc. also, are there any HOWTO's on keeping multiple versions of python happy? In general, (and in this case) the answer is system-specific. You need to explain (A) what operating system, and (B) what you mean

Re: why are people still using classic classes?

2005-01-14 Thread Steve Holden
Michael Hobbs wrote: Simon Wittber <[EMAIL PROTECTED]> wrote: I've noticed that a few ASPN cookbook recipes, which are recent additions, use classic classes. I've also noticed classic classes are used in many places in the standard library. I've been using new-style classes since Python 2.2, and am

Re: Com port interrupts again

2005-01-14 Thread engsol
Thanks much..:) On 14 Jan 2005 12:25:43 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >A search on google gave me this library, I haven't tested it though: >http://groups-beta.google.com/group/comp.lang.python.announce/browse_frm/thread/6d3263250ed65816/291074d7bd94be63?q=com+port+python&

Re: Why would I get a TypeEror?

2005-01-14 Thread Reinhold Birkenfeld
Steven Bethard wrote: > It's me wrote: >> Say again??? > > Please stop top-posting -- it makes it hard to reply in context. > >> "Reinhold Birkenfeld" wrote... >>>It's me wrote: If this is true, I would run into trouble real quick if I do a: (1/x,1.0e99)[x==0] >>> >>>Lazy evaluation:

Re: oddities in the datetime module

2005-01-14 Thread Max M
Serge Orlov wrote: Max M wrote: Yes, you did. datetime.timetuple is those who want *time module* format, you should use datetime.data, datetime.time, datetime.year and so on... As they say, if the only tool you have is timetuple, everything looks like tuple Try this: dt = datetime(2005, 1, 1,

Re: Refactoring; arbitrary expression in lists

2005-01-14 Thread Steve Holden
Peter Maas wrote: Steven Bethard schrieb: BJörn Lindqvist wrote: [...] I believe this can be nicelier written as: if "Makefile" in basename: +1 for "nicelier" as VOTW (Vocabulation of the week) =) Me too, because nicelier is nicer than more nicely. :) Is that really the niceliest way to express th

Re: Why would I get a TypeEror?

2005-01-14 Thread Steven Bethard
It's me wrote: Say again??? Please stop top-posting -- it makes it hard to reply in context. "Reinhold Birkenfeld" wrote... It's me wrote: If this is true, I would run into trouble real quick if I do a: (1/x,1.0e99)[x==0] Lazy evaluation: use the (x==0 and 1e99 or 1/x) form! If you want short-circu

Re: why are people still using classic classes?

2005-01-14 Thread Steve Holden
Peter Hansen wrote: Paul Rubin wrote: Simon Wittber <[EMAIL PROTECTED]> writes: Is there a reason NOT to use them? If a classic class works fine, what incentive is there to switch to new style classes? Perhaps classic classes will eventually disappear? It just means that the formerly "classic"

Re: Python.org, Website of Satan

2005-01-14 Thread mr_little
Brian Eable wrote: > perl -e '$a="194.109.137.226"; @a = reverse split /\./, $a; for $i (0..3) { $sum += $a[$i]*(256**$i) } print "sum = $sum\n"' > > 226 + 35072 + 7143424 + 3254779904 = 3261958626 > > http://3261958626/ > > Which is NOT 666. Comrade, why perl here? :) Are you afraid python? :) --

Re: Threading Or Other Suggestions?!?

2005-01-14 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > > I have a wxPython application that does a lot of things. One of them, >in particular, I have doubts on how to implement it. Essentially, this part >of my application calls an external executable (an oil reservoir >simulator). What

Re: Why would I get a TypeEror?

2005-01-14 Thread Reinhold Birkenfeld
It's me wrote: > Say again??? > > "Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> It's me wrote: >> > Sorry if my question was a little "lazy" and yes, I was asking about the >> > "lazy evaluation". :=) >> > >> > I am surprised about this (and this can be da

Re: Why would I get a TypeEror?

2005-01-14 Thread It's me
Say again??? "Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's me wrote: > > Sorry if my question was a little "lazy" and yes, I was asking about the > > "lazy evaluation". :=) > > > > I am surprised about this (and this can be dangerous, I guess). > > > > I

Re: oddities in the datetime module

2005-01-14 Thread Serge Orlov
Max M wrote: > # -*- coding: latin-1 -*- > > """ > > I am currently using the datetime package, but I find that the design > is oddly > asymmetric. I would like to know why. Or perhaps I have misunderstood > how it should be used? Yes, you did. datetime.timetuple is those who want *time module* fo

Re: Pickled text file causing ValueError (dos/unix issue)

2005-01-14 Thread Tim Peters
[Tim Peters] >>Yes: regardless of platform, always open files used for pickles >> in binary mode. ... [John Machin] > Tim, the manual as of version 2.4 does _not_ mention the need > to use 'b' on OSes where it makes a difference, not even in the > examples at the end of the chapter. Further, it s

Re: python connect to db2

2005-01-14 Thread Jarek Zgoda
yuzx wrote: >>> conn = DB2.connect(dsn='sample', uid='db2inst1', pwd='ibmdb2') but i don't know about dsn, If the database is DB2/400 and you try to connect from iSeries, dsn would be '*local' for local database, or its name (not hostname or IP address!) as returned by dsprdbdire command

Index server

2005-01-14 Thread python
Is there an Index server available in Python? For example: I have large intranet with several servers and I would like to index documents like search engines do. Users then can search for a domument in ALL intranet servers like I do on Google. Thanks for answers L.A. -- http://mail.python.org/ma

Re: Pickled text file causing ValueError (dos/unix issue)

2005-01-14 Thread John Machin
On Fri, 14 Jan 2005 09:12:49 -0500, Tim Peters <[EMAIL PROTECTED]> wrote: >[Aki Niimura] >> I started to use pickle to store the latest user settings for the tool >> I wrote. It writes out a pickled text file when it terminates and it >> restores the settings when it starts. >... >> I guess DOS te

Re: What strategy for random accession of records in massive FASTA file?

2005-01-14 Thread Paul Rubin
"Chris Lasher" <[EMAIL PROTECTED]> writes: > Forgive my ignorance, but what does using mmap do for the script? My > guess is that it improves performance, but I'm not sure how. I read the > module documentation and the module appears to be a way to read out > information from memory (RAM maybe?).

Re: python to mssql

2005-01-14 Thread Richards Noah (IFR LIT MET)
"Robert Brewer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Brane wrote: > can someone please give me some info regarding subject > >http://sourceforge.net/projects/mysql-python > >Ask a broad question... > > >Robert Brewer Robert, the question was about 'mssql', not 'mysql'. As f

Re: Using Sqlite with Python under Windows

2005-01-14 Thread Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.
Thanks, for the link -- http://mail.python.org/mailman/listinfo/python-list

reusing Tkinter Canvases

2005-01-14 Thread Sean McIlroy
I'd like to save one Tkinter Canvas in order to use it on another Canvas later. The problem is that it gets saved as EPS but it needs to be GIF to be reuseable. How can I convert that format? Peace, STM -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-14 Thread Chris Lasher
Forgive my ignorance, but what does using mmap do for the script? My guess is that it improves performance, but I'm not sure how. I read the module documentation and the module appears to be a way to read out information from memory (RAM maybe?). -- http://mail.python.org/mailman/listinfo/python-

Re: python to mssql

2005-01-14 Thread Jarek Zgoda
Brane wrote: can someone please give me some info regarding subject From Windows machine: http://adodbapi.sourceforge.net/ From elsewhere: FreeTDS + unixODBC + mxODBC is one of possible solutions. -- Jarek Zgoda http://jpa.berlios.de/ | http://www.zgodowie.org/ -- http://mail.python.org/mailman/lis

Re: Com port interrupts again

2005-01-14 Thread [EMAIL PROTECTED]
A search on google gave me this library, I haven't tested it though: http://groups-beta.google.com/group/comp.lang.python.announce/browse_frm/thread/6d3263250ed65816/291074d7bd94be63?q=com+port+python&_done=%2Fgroups%3Fhl%3Den%26lr%3D%26safe%3Doff%26q%3Dcom+port+python%26qt_s%3DSearch+Groups%26&_do

Re: Why 'r' mode anyway?

2005-01-14 Thread Irmen de Jong
Tim Peters wrote: That differences may exist is reflected in the C standard, and the rules for text-mode files are more restrictive than most people would believe. Apparently. Because I know only about the Unix <-> Windows difference (windows converts \r\n <--> \n when using 'r' mode, right). So it

Re: Octal notation: severe deprecation

2005-01-14 Thread JCM
[EMAIL PROTECTED] wrote: ... > In Mythical Future Python I would like to be able to use any base in > integer literals, which would be better. Example random syntax: > flags= 2x00011010101001 > umask= 8x664 > answer= 10x42 > addr= 16x0E84 # 16x == 0x > gunk= 36x8H6Z9A0X I'd prefer using the

Free NNTP (was Re: how to stop google from messing Python code)

2005-01-14 Thread Aahz
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Fuzzyman wrote: >> >> I guess that most people use google to post to newsgroups is that they >> don't have nntp access. Telling htem to use a newsreader is facetious >> and unhelpful. Most people use Gooja to post because th

Re: Why 'r' mode anyway? (was: Re: Pickled text file causing ValueError (dos/unix issue))

2005-01-14 Thread Serge Orlov
Irmen de Jong wrote: > Tim Peters wrote: > > > Yes: regardless of platform, always open files used for pickles in > > binary mode. That is, pass "rb" to open() when reading a pickle file, > > and "wb" to open() when writing a pickle file. Then your pickle files > > will work unchanged on all pla

Re: Why would I get a TypeEror?

2005-01-14 Thread Reinhold Birkenfeld
It's me wrote: > Sorry if my question was a little "lazy" and yes, I was asking about the > "lazy evaluation". :=) > > I am surprised about this (and this can be dangerous, I guess). > > If this is true, I would run into trouble real quick if I do a: > > (1/x,1.0e99)[x==0] > > and that's not g

Re: [perl-python] 20050113 looking up syntax

2005-01-14 Thread Istvan Albert
Jürgen Exner wrote: Why don't you just stop posting this nonsense? He will, fairly soon. I'm suspecting that the original intent behind these posts was to stir up a perl vs python flamewar. That is unlikely to materialize since the poster does not seem to understand neither of these languages. I. -

Re: Octal notation: severe deprecation

2005-01-14 Thread Reinhold Birkenfeld
Bengt Richter wrote: > On Thu, 13 Jan 2005 08:18:25 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >>> In Mythical Future Python I would like to be able to use any base in >>> integer literals, which would be better. Example random syntax: >>> >>> flags= 2x00011010101

Re: Octal notation: severe deprecation

2005-01-14 Thread Reinhold Birkenfeld
Simon Brunning wrote: > On Thu, 13 Jan 2005 16:50:56 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: >> Tim Roberts wrote: >> > Stephen Thorne <[EMAIL PROTECTED]> wrote: >> > >> >>I would actually like to see pychecker pick up conceptual errors like this: >> >> >> >>import datetime >> >>datetime.da

Re: Integration with java

2005-01-14 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Istvan Albert <[EMAIL PROTECTED]> wrote: >Joachim Boomberschloss wrote: > >> the code is already written in Python, using the >> standard libraries and several extension modules > >One thing to keep in mind is that Jython does not >integrate CPython, instead it "u

Re: python connect to db2

2005-01-14 Thread Jacek
yuzx wrote: anyone can help me ? this might help: http://www6.software.ibm.com/reg/devworks/dw-db2pylnx-i?S_TACT=104AHW03&S_CMP=EDU jacek -- http://mail.python.org/mailman/listinfo/python-list

Com port interrupts again

2005-01-14 Thread engsol
I didn't fully think through my application before posting my question. Async com port routines to handle com port interrups only work well if one has access to the low level operating system. In that case the receive buffer interrupt would cause a jump to an interrupt service routine.. I don't bel

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Antoon Pardon wrote: Op 2005-01-14, Roel Schroeven schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: IMO we have a: dogs are mamals kind of relationship in Python. I see what you mean, but I don't think it's true. Every expression can be used where a statement is expected. (And this can be worded

Re: how to stop google from messing Python code

2005-01-14 Thread Fredrik Lundh
Fuzzyman wrote: > I guess that most people use google to post to newsgroups is that they > don't have nntp access. Telling htem to use a newsreader is facetious > and unhelpful. if you have internet access, you have NNTP access. gmane.org provides access to more than 6,500 mailing lists via NNTP

Re: Why 'r' mode anyway? (was: Re: Pickled text file causing ValueError (dos/unix issue))

2005-01-14 Thread Tim Peters
[Irmen de Jong] > I've been wondering why there even is the choice between binary mode > and text mode. Why can't we just do away with the 'text mode' ? > What does it do, anyways? At least, if it does something, I'm sure > that it isn't something that can be done in Python itself if > really requi

Re: Newbie: module structure and import question

2005-01-14 Thread Ziong
Thx Rob. yes i know it's related to search path, but i don't know how to set it in a practical way (beside hard coding). my concern is, if i want to create a custom module/library, i don't know what py file will import it and where the working directory should be. sometime like my example, even i

Re: Integration with java

2005-01-14 Thread andybak
How about this? http://jpype.sourceforge.net/ (I haven't used it myself) -- http://mail.python.org/mailman/listinfo/python-list

Why 'r' mode anyway? (was: Re: Pickled text file causing ValueError (dos/unix issue))

2005-01-14 Thread Irmen de Jong
Tim Peters wrote: Yes: regardless of platform, always open files used for pickles in binary mode. That is, pass "rb" to open() when reading a pickle file, and "wb" to open() when writing a pickle file. Then your pickle files will work unchanged on all platforms. The same is true of files contai

Re: Free python server.

2005-01-14 Thread Robin Becker
[EMAIL PROTECTED] wrote: Your file probably need to (a) be in the cgi-bin, not public_html, (b) be flagged executable ("chmod a+x file.py"), and (c) begin with the line: '#!/usr/bin/env python' If the server doesn't provide you with CGI (or, strongly preferable, SCGI or mod_python), you're probably

RE: python to mssql

2005-01-14 Thread Robert Brewer
Brane wrote: > can someone please give me some info regarding subject http://sourceforge.net/projects/mysql-python Ask a broad question... Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

python to mssql

2005-01-14 Thread Brane
can someone please give me some info regarding subject please advice regards brane -- http://mail.python.org/mailman/listinfo/python-list

Re: Static executable with shared modules

2005-01-14 Thread "Martin v. Löwis"
Rickard Lind wrote: Is there any way to build the python executable statically and still be able to load modules built as shared libraries? I'm not what "build statically" means; if you talking about building a statically linked interpreter binary - then no, this is not possible. At a minimum, you

Re: Unicode conversion in 'print'

2005-01-14 Thread "Martin v. LÃwis"
Ricardo Bugalho wrote: thanks for the information. But what I was really looking for was informaion on when and why Python started doing it (previously, it always used sys.getdefaultencoding())) and why it was done only for 'print' when stdout is a terminal instead of always. It does that since 2.

Re: Integration with java

2005-01-14 Thread Christopher De Vries
It is possible, though possibly painful, to call java modules from CPython using JNI. This is more difficult than Jython integration, but probably required if you want to keep using your extension modules. The JNI tutorial is available at http://java.sun.com/docs/books/tutorial/native1.1/index.htm

Re: (objects as) mutable dictionary keys

2005-01-14 Thread John Roth
"Peter Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have summarized the discussion about the usability of lists (and and other mutable types) as dictionary keys and put it into the Python wiki.URL: http://www.python.org/moin/DictionaryKeys. This summary might be used as a re

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: > Well IMO I have explained clearly that I understood this in a set > logical sense in my first response. what does "first" mean on your planet? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to stop google from messing Python code

2005-01-14 Thread Terry Reedy
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Xah Lee wrote: >> gmane is great! > I guess that most people use google to post to newsgroups is that they > don't have nntp access. Anyone with a normal internet connection has nntp access. What some do not get from t

Re: Free python server.

2005-01-14 Thread rootshell
> Your file probably need to (a) be in the cgi-bin, not public_html, (b) > be flagged executable ("chmod a+x file.py"), and (c) begin with the > line: '#!/usr/bin/env python' > > If the server doesn't provide you with CGI (or, strongly preferable, > SCGI or mod_python), you're probably out of luck.

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Roel Schroeven schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> IMO we have a: dogs are mamals kind of relationship in Python. > > I see what you mean, but I don't think it's true. > >> Every expression can be used where a statement is expected. >> (And this can be worded as: e

Re: newbie q

2005-01-14 Thread Steve Holden
Bengt Richter wrote: On Thu, 13 Jan 2005 09:16:40 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: [...] Any statement of the form for i in [x for x in something]: can be rewritten as for i in something: Note that this doesn't mean you never want to iterate over a list comprehension. It's the

Re: import keyword behaviour - performance impact if used multiple times?

2005-01-14 Thread neophyte
Nick Coghlan wrote: > > Is > > this something to do with system modules being singletons? > > They aren't singletons in the GoF design pattern sense. However, Python's import > machinery operates in such a way that it takes effort to get multiple version of > the same module into memory at the sa

Re: newbie ?s

2005-01-14 Thread Steve Holden
Venkat B wrote: Hi folks, I'm looking build a CGI-capable SSL-enabled web-server around Python 2.4 on Linux. It is to handle ~25 hits possibly arriving "at once". Content is non-static and built by the execution of py cgi-scripts talking to a few backend processes. 1) I was wondering if anyone has

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Antoon Pardon wrote: IMO we have a: dogs are mamals kind of relationship in Python. I see what you mean, but I don't think it's true. Every expression can be used where a statement is expected. (And this can be worded as: every expression is a statement.) Not really. An expression statement is a st

Re: lambda

2005-01-14 Thread Steve Holden
Antoon Pardon wrote: Op 2005-01-13, hanz schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: So if I have a call with an expression that takes more than one line, I should assign the expression to a variable and use the variable in the call? Yes, that's sometimes a good practice and can clarify the c

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Roel Schroeven
Skip Montanaro wrote: Fredrik> no, expressions CAN BE USED as statements. that doesn't mean Fredrik> that they ARE statements, unless you're applying belgian logic. Hmmm... I'd never heard the term "belgian logic" before. Googling provided a few uses, but no formal definition (maybe it's

Re: Writing huge Sets() to disk

2005-01-14 Thread Martin MOKREJÅ
Tim Peters wrote: [Martin MOKREJÅ] This comm(1) approach doesn't work for me. It somehow fails to detect common entries when the offset is too big. [...] I'll repeat: As I mentioned before, if you store keys in sorted text files ... Those files aren't in sorted order, so of course `comm` can't do

Re: [perl-python] 20050113 looking up syntax

2005-01-14 Thread Jürgen Exner
Xah Lee wrote: > - > > for perl syntax lookup, use perldoc in the command line. For example: > perldoc perl Wrong. That command will give you a high-level overview of Perl but tell you nothing about the syntax. To lookup the Perl syntax you would have to use perldoc perls

Re: Writing huge Sets() to disk

2005-01-14 Thread Tim Peters
[Martin MOKREJÅ] > This comm(1) approach doesn't work for me. It somehow fails to > detect common entries when the offset is too big. > > file 1: > > A > F > G > I > K > M > N > R > V > AA > AI > FG > FR > GF > GI > GR > IG > IK > IN > IV > KI > MA > NG > RA > RI > VF > AIK > FGR > FRA > GFG > GIN

Re: Writing huge Sets() to disk

2005-01-14 Thread Martin MOKREJÅ
Tim Peters wrote: [Martin MOKREJÅ] ... I gave up the theoretical approach. Practically, I might need up to store maybe those 1E15 keys. We should work on our multiplication skills here . You don't have enough disk space to store 1E15 keys. If your keys were just one byte each, you would need to

Re: Integration with java

2005-01-14 Thread Istvan Albert
Joachim Boomberschloss wrote: the code is already written in Python, using the standard libraries and several extension modules One thing to keep in mind is that Jython does not integrate CPython, instead it "understands" python code directly. So if you have a C extension that works with python i

Re: import problems *newbie*

2005-01-14 Thread Steve Holden
F. Petitjean wrote: Le 13 Jan 2005 21:58:36 -0800, mike kreiner a écrit : I am having trouble importing a module I created. I'm running PythonWin on Windows XP if that helps. I saved my module in a folder called my_scripts in the site-packages directory. I edited the python path to include the my_s

Re: How to list the global functions from a C program

2005-01-14 Thread Jack Diederich
On Fri, Jan 14, 2005 at 04:01:13PM +0100, Francesco Montorsi wrote: > PyObject *list = PyObject_Dir(m_pGlobals); > if (!list || PyList_Check(list) == FALSE) > return; > > for (int i=0,max=PyList_Size(list); i > PyObject *elem = PyList_GetItem(list, i); > if (PyCallable_Check(elem) !=

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Carl Banks
Tim Jarman wrote: > IANA French person, but I believe that Belgians are traditionally > regarded as stupid in French culture, so "Belgian logic" would be > similar to "Irish logic" for an English person. (Feel free to insert > your own cultural stereotypes as required. :) Ok. http://www.urbandic

  1   2   >