python connect to db2

2005-01-14 Thread yuzx
hi,all i am python newbie,i try to connect to db2 use python,i find it on python-db2 doc: $ python import DB2 conn = DB2.connect(dsn='sample', uid='db2inst1', pwd='ibmdb2') curs = conn.cursor() but i don't know about dsn, i think a way like python

Re: lambda

2005-01-14 Thread Antoon Pardon
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 call. But

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

2005-01-14 Thread Fredrik Lundh
Paul Rubin wrote: 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, that is vacuous. The claim was

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

2005-01-14 Thread Antoon Pardon
Op 2005-01-13, Terry Reedy schreef [EMAIL PROTECTED]: Antoon Pardon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Op 2005-01-13, Fredrik Lundh schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Well, it seems that Guido is wrong then. The documentation clearly states that an

Re: dynamically inserting function into an object

2005-01-14 Thread michael . bierenfeld
*damn* it :-) python rocks. thx michael .oO (resetting c/c++/java crap collected over the years) -- http://mail.python.org/mailman/listinfo/python-list

Re: Unclear On Class Variables

2005-01-14 Thread Pierre Barbier de Reuille
Pierre Barbier de Reuille a écrit : Antoon Pardon a écrit : Well I find this a confusing behaviour on python's part. The fact that instance.field can mean something different, depending on where in a statement you find it, makes the behaviour inconsistent. I know people in general here are against

Re: python connect to db2

2005-01-14 Thread Michael Ströder
yuzx wrote: i try to connect to db2 use python,i find it on python-db2 doc: $ python import DB2 conn = DB2.connect(dsn='sample', uid='db2inst1', pwd='ibmdb2') curs = conn.cursor() but i don't know about dsn, It's the host name. In a former project (using module

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

2005-01-14 Thread Neil Benn
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

Re: distutils linux script installation broken? Sorted

2005-01-14 Thread Cory Davis
Problem solved. I was actually using scipy_distutils and not distutils, without good reason. Changing setup.py to use distutils made the problem go away. Cory. Cory Davis wrote: Hi all, I have been successfully deploying my own python package with distutils for some time now, but lately,

Re: Debian says Warning! you are running an untested version of Python. on 2.3

2005-01-14 Thread Amand Tihon
rbt wrote: Nick Craig-Wood wrote: Alex Stapleton [EMAIL PROTECTED] wrote: Whenever I run python I get Warning! you are running an untested version of Python. prepended to the start of any output on stdout. This is with Debian and python 2.3 (running the debian 2.1 and 2.2

Re: import problems *newbie*

2005-01-14 Thread F. Petitjean
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_scripts folder

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

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Fredrik Lundh schreef [EMAIL PROTECTED]: Paul Rubin wrote: 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,

oddities in the datetime module

2005-01-14 Thread Max M
# -*- 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? I can make a datetime easily enough datetime(2005, 1, 1) datetime.datetime(2005, 1, 1, 0, 0)

Re: Octal notation: severe deprecation

2005-01-14 Thread Simon Brunning
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.datetime(2005, 04,04) Why is that a conceptual

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

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: no, expressions CAN BE USED as statements. that doesn't mean that they ARE statements, unless you're applying belgian logic. No I am applying set logic. Any string that is in the set of valid expressions is also in the set of valid statements. since you're arguing that

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

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Nick Coghlan schreef [EMAIL PROTECTED]: Antoon Pardon wrote: No I am applying set logic. Any string that is in the set of valid expressions is also in the set of valid statements. According to Python's grammar, this is not the case. It requires a NEWLINE or ; token on the end

Re: file uploading via urllib2 (multipart/form-data)

2005-01-14 Thread Fuzzyman
Clark C. Evans wrote: Hello. I was wondering if anyone has built a module that works with urllib2 to upload file content via POST multipart/form-data. I'm aware of ASPN 146306, however, I need to use urllib2 beacuse I'm using HTTP Digest over SSL. Cheers, Clark There is an example

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

2005-01-14 Thread Skip Montanaro
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 a European phrase so

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

2005-01-14 Thread Antoon Pardon
Op 2005-01-14, Fredrik Lundh schreef [EMAIL PROTECTED]: Antoon Pardon wrote: no, expressions CAN BE USED as statements. that doesn't mean that they ARE statements, unless you're applying belgian logic. No I am applying set logic. Any string that is in the set of valid expressions is also

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

2005-01-14 Thread Bengt Richter
On Thu, 13 Jan 2005 11:40:52 -0800, Jeff Shannon [EMAIL PROTECTED] wrote: Bengt Richter wrote: BTW, I'm sure you could write a generator that would take a file name and oldbinstring and newbinstring as arguments, and read and yield nice os-file-system-friendly disk-sector-multiple chunks, so

huygens lands on titan

2005-01-14 Thread John Thingstad
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- http://mail.python.org/mailman/listinfo/python-list

Re: query python env

2005-01-14 Thread Michael Hoffman
David Bear wrote: How does one query the python environment, ie pythonhome sys.prefix pythonpath sys.path etc. sys.etc also, are there any HOWTO's on keeping multiple versions of python happy? I think it is sufficiently trivial that none is needed. Just make sure the distributions are installed

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

2005-01-14 Thread Carl Banks
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: (objects as) mutable dictionary keys

2005-01-14 Thread Peter Maas
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 reference should the 'mutable dictionary keys' issue come up again in

Using Sqlite with Python under Windows

2005-01-14 Thread Michael Goettsche
Hello guys, I succeeded in convincing my CS teacher to use Python and Sqlite instead of Microsoft Access to get started with databases. We are working on a windows terminal server to which I have no admin access, so I'd like to ask you which module is best suited to use Sqlite with Python

Re: Python.org, Website of Satan

2005-01-14 Thread Michael Hoffman
Peter Renzland wrote: What is the simplest/fastest Python program to determine how many IP addresses sum up to 666? The simplest/fastest enumerator? The simplest/fastest that determines which ones of them are home pages? This seems to work although it could be made more efficient or elegant.

Re: Statement local namespaces summary (was Re: python3: 'where' keyword)

2005-01-14 Thread Nick Coghlan
Nick Coghlan wrote: as equivalent to: def __use_stmt(): use-suite def _in_clause(): in-suite return names return _in_clause() __use_stmt_args = {} names = __use_stmt() del __use_stmt The more I think about this return-based approach, the less I like it. It could probably be made to

Re: how to stop google from messing Python code

2005-01-14 Thread Fuzzyman
Xah Lee wrote: gmane is great! its renaming of newsgroups is quite a headache. i found that comp.lang.python corresponds to gmane.comp.python.general. do you know which one corresponds to comp.lang.perl.misc? there's no .misc or .general... -- i thought there a strick like preceding a line

Re: huygens lands on titan

2005-01-14 Thread Fuzzyman
John Thingstad wrote: -- huygens lands on titan Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ I bet it didn't... Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

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

2005-01-14 Thread Peter Maas
Craig Ringer schrieb: And then we have iteration (generator expressions, list comprehensions, for loops, ...?) over (sequences, iterators, generators) Just sequences and iterators. Generators are functions which return iterators. Sequences and iterators provide two ways to build containers.

Static executable with shared modules

2005-01-14 Thread Rickard Lind
Is there any way to build the python executable statically and still be able to load modules built as shared libraries? I'm trying to run python scripts on a stripped down FreeBSD (4.9) machine which has no shared system libraries so I want to link it statically against libc et al, but it would be

Re: porting C code

2005-01-14 Thread Lucas Raab
Peter Hansen wrote: Lucas Raab wrote: I have the statement: typedef unsigned long int word32 and later on: word32 b[3] referencing the third bit of the integer. If that's really exactly what you have, then you actually have something defining an array of three unsigned long integers named b.

Re: porting C code

2005-01-14 Thread Duncan Booth
Lucas Raab wrote: Sorry, the third byte is what I meant. As for code samples, I hope the following will work: typedef unsigned long int word32 ; void mu(word32 *a) { int i ; word32 b[3] ; b[0] = b[1] = b[2] = 0 ; for( i=0 ; i32 ; i++ ) { b[0] = 1 ; b[1] = 1 ; b[2] = 1 ;

Re: newbie q

2005-01-14 Thread TZOTZIOY
On Fri, 14 Jan 2005 00:08:09 GMT, rumours say that [EMAIL PROTECTED] (Bengt Richter) might have written: As I'm sure you know, with 2.4's generator expressions you don't have to build the temporary list. Which could be important if 'something' is (or generates) a huge sequence. for i in

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

2005-01-14 Thread Tim Peters
[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 text format is creating this problem. Yes. My question is Is there any elegant way

[Fwd: Re: Embedding Multiplr Python interpreter in C++]

2005-01-14 Thread Steve Holden
Yogesh Sharma [EMAIL PROTECTED] wrote: one more question to add: Is there a way to have 2 local copies of python interpreter ? Yogesh Sharma wrote: Hi, I have following setup: OS Linux Fedora Core 3 Python 2.3.4 How can I embed two python interpreters in one C++ program ? Thanks Take

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

2005-01-14 Thread Tim Jarman
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

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: snip PyObject *list = PyObject_Dir(m_pGlobals); if (!list || PyList_Check(list) == FALSE) return; for (int i=0,max=PyList_Size(list); imax; i++) { PyObject *elem = PyList_GetItem(list, i); if

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

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 it

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 wink. You don't have enough disk space to store 1E15 keys. If your keys were just one byte each, you would need

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 GRI IGI IGR IKI ING IVF KIG

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 perlsyn

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: 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 a

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

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

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: 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 same time

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: 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: every

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 their ISP

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? /F -- http://mail.python.org/mailman/listinfo/python-list

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: Unicode conversion in 'print'

2005-01-14 Thread Martin v. Lwis
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

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

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: 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

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: 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: 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 platforms. The

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

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's

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:

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/ --

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: 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

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 for mssql, a

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 text format

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. --

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* format, you

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). If this is true, I

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 I would

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: 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: 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 wink Try this: dt = datetime(2005,

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: use the (x==0 and 1e99 or

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:

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: 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

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

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

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 integer literals,

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: (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: 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 wink Try this: dt

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 good

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

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 header line

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

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: 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 --

[perl-python] 20050114 if statement

2005-01-14 Thread Xah Lee
. # here's an example of if statement in python. . . x=-1 . if x0: . 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 . .

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 you try

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. --

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

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 the

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: 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 --

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 -- Lamya

  1   2   >