Re: set and frozenset unit tests?

2005-07-14 Thread Raymond Hettinger
[Jacob Page] > there are two minor things I > don't see documented that caught me by surprise: > > * Since the <=, <, >, and >= operators raise an exception if the > right-hand operand is not a set or frozenset, it seemed reasonable to > me to assume that == and != should, too. However, the test

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread could ildg
You are quite right~ On 7/15/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > Jesse Noller wrote: > > A question in a similiar vein: > > > > I have appended 2 different directories to my path (viaY > > sys.path.append) now - without knowing the names of the files in those > > directories, I want to f

Re: Earthquake Forecasting Program July 11, 2005

2005-07-14 Thread edgrsprj
"Hank Oredson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >> >> > "edgrsprj" <[EMAIL PROTECTED]> wrote in message > >> >> > news:[EMAIL PROTECTED] > >> >> >> PROPOSED EARTHQUAKE FORECASTING > >> >> >> COMPUTER PROGRAM DEVELOPMENT EFFORT > I am looking for the SOURCE of the data

Re: more newbie list questions

2005-07-14 Thread Ali
sTemplate.replace() returns a string with that substitution. so you need to reassign it such as: sTemplate = sTemplate.replace('author1', author1) Anyway, Sion Arrowsmith above showed you a much better technique of filling all those values at once. Hope this helps, Ali -- http://mail.python.

Re: math.nroot [was Re: A brief question.]

2005-07-14 Thread Tim Peters
[Michael Hudson] > In what way does C99's fenv.h fail? Is it just insufficiently > available, or is there some conceptual lack? [Tim Peters] Just that it's not universally supported. Look at fpectlmodule.c for a sample of the wildly different ways it _is_ spelled across some >>

Re: set and frozenset unit tests?

2005-07-14 Thread Jacob Page
Steven Bethard wrote: > Jacob Page wrote: > >> Oye, there's quite a number of set and frozenset features that aren't >> well-documented that I now need to implement. What a fun chore! > > It would be a great help if you could submit appropriate documentation > patches for the areas you don't t

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread Peter Hansen
Jesse Noller wrote: > A question in a similiar vein: > > I have appended 2 different directories to my path (via > sys.path.append) now - without knowing the names of the files in those > directories, I want to force an import of the libraries ala: > > for f in os.listdir(os.path.abspath(libdir))

Re: Generating a list of None

2005-07-14 Thread Dan Sommers
On 14 Jul 2005 19:28:14 -0700, "Nicolas Couture" <[EMAIL PROTECTED]> wrote: > if vals == [None * len(vals)]: if vals == [None] * len(vals): Regards, Dan -- Dan Sommers -- http://mail.python.org/mailman/listinfo/python-list

Re: System calls not using correct permissions?

2005-07-14 Thread Dan Sommers
On 14 Jul 2005 15:51:52 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: [ os.system doesn't work right, even when I set umask to 0 ] > Anyone know what the deal might be? It might be anything, but without more details (like what operating system you're running, what version of Python you'r

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread could ildg
for f in os.listdir(os.path.abspath(libdir)): module_name = f.strip('.py') __import__(module_name, globals(), locals(), []) On 7/14/05, Jesse Noller <[EMAIL PROTECTED]> wrote: > A question in a similiar vein: > > I have appended 2 different directories to my path (via > sys.path.append) now

Re: Generating a list of None

2005-07-14 Thread Nicolas Couture
of course the later snipplet should be: --- def get_options(opts): """Return True or False if an option is set or not""" vals = opts.__dict__.values() if vals == [None * len(vals)]: return False return True --- -- http://mail.python.org/mailman/listinfo/python-list

Generating a list of None

2005-07-14 Thread Nicolas Couture
Hi, Is it possible to generate a list of `None' ? opts.__dict__.values() below could be represented by [None, None, None] --- def get_options(opts): """Return True or False if an option is set or not""" vals = opts.__dict__.values() for val in vals: if val is not None:

Re: Newbie question: Explain this behavior

2005-07-14 Thread Ross Wilson
On Thu, 14 Jul 2005 15:46:40 -0700, David Smith wrote: > Why does code snippet one work correctly, but not two. The only > difference is the placement of the "else". I know that indentation > affects execution, but how does it change behavior in the following > examples? Thank you. > > 1. for

Re: Native ODBC access for python on linux?

2005-07-14 Thread Mike Meyer
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: > Although I hear rumors about ODBC drivers on Linux, I confess I don't > understand the need. Certainly you can use Python with the MySQLdb module > from any Linux machine and query away at the server. As long as the MySQL > server accepts your IP/usr/

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Christopher Subich
Sheeps United wrote: > I'm far from sure if it's the right one, but I think it could be > SetConsoleScreenBufferSize from Kernel32. Hrr, for some reason I have nasty > feeling in back of my head... That could also be totally wrong way of > approaching. I have the source code to a win32-console

Re: Newbie question: Explain this behavior

2005-07-14 Thread George Sakkis
"David Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why does code snippet one work correctly, but not two. The only > difference is the placement of the "else". I know that indentation > affects execution, but how does it change behavior in the following > examples? Thank

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Tim Peters
[Grant Edwards] >> 1/0 is defined by the standard as +Inf and 0/0 is NaN. [Martin v. Löwis] > I wonder why Tim hasn't protested here: Partly because this thread (unlike the other current thread on the topic) isn't moving toward making progress, and I have little time for this. But mostly becaus

Re: readlines() doesn't read entire file

2005-07-14 Thread John Machin
Jeremy wrote: > I have a most aggravating problem. I don't understand what is causing > readlines() not to read all the lines in the file. Answer all of Peter Hansen's questions, then read on ... You are on platform X; did you get the file from platform Y where Y != X? Where did you get the fi

Re: eBay.py - Has anyone looked at this???

2005-07-14 Thread George Sakkis
"provato" <[EMAIL PROTECTED]> wrote > I'm somewhat of a newbie was confused by the following code that I > downloaded from eBay's developer site: > > One of the classes in the file is called "Call". What I don't get is > that in "MakeCall" function, there's a use of self.Session.Server. > Where is

Newbie question: Explain this behavior

2005-07-14 Thread David Smith
Why does code snippet one work correctly, but not two. The only difference is the placement of the "else". I know that indentation affects execution, but how does it change behavior in the following examples? Thank you. 1. for n in range(2, 10): for x in range(2, n): if n % x =

Re: all possible combinations

2005-07-14 Thread Peter Hansen
Bengt Richter wrote: > On Thu, 14 Jul 2005 17:10:37 -0400, William Park <[EMAIL PROTECTED]> wrote: > It's a one liner in Python too ;-) > > >>> print ' '.join([x+y+z+q for s in ['abc'] for x in s for y in s for z in > s for q in s]) Or for the cost of an import and a lambda, you can keep it loo

Re: readlines() doesn't read entire file

2005-07-14 Thread Jeremy
Peter Hansen wrote: > Jeremy wrote: > >>I have a most aggravating problem. I don't understand what is causing >>readlines() not to read all the lines in the file. I have the following >>syntax: >> > > ... > >>self.xsdir = file(Datapath, 'r')# File object >> >>I can see all th

Re: readlines() doesn't read entire file

2005-07-14 Thread Peter Hansen
Jeremy wrote: > I have a most aggravating problem. I don't understand what is causing > readlines() not to read all the lines in the file. I have the following > syntax: > ... > self.xsdir = file(Datapath, 'r')# File object > > I can see all the lines in the list self.lines, b

Re: Python and MySQL server

2005-07-14 Thread Bruno Desthuilliers
Unknown a écrit : > Python 2.4 > Linux kernel 2.6.12 > > Hi, > > 1. How do I make the following statement to search for all Strings I > input from console? > > for example, with the code below I need to enter %hello world% (yeah, > including the % symbols) to find all entries for hello world on

ANN: KirbyBase 2.0 beta 1

2005-07-14 Thread Jamey Cribbs
I would like to announce the first beta of version 2 of KirbyBase, a simple, pure-Python database management system that stores it's data in plain-text files. Version 2 is a total rewrite of the code, a major change in the api, and a major improvement (I hope) in the syntax used to express que

readlines() doesn't read entire file

2005-07-14 Thread Jeremy
I have a most aggravating problem. I don't understand what is causing readlines() not to read all the lines in the file. I have the following syntax: # some initial stuff XS = xsdir(Datapath + '/xsdir', options.debug) # some more stuff class xsdir(object):#{{{1 """This class handle

Re: all possible combinations

2005-07-14 Thread Bengt Richter
On Thu, 14 Jul 2005 17:10:37 -0400, William Park <[EMAIL PROTECTED]> wrote: >rbt <[EMAIL PROTECTED]> wrote: >> Say I have a list that has 3 letters in it: >> >> ['a', 'b', 'c'] >> >> I want to print all the possible 4 digit combinations of those 3 >> letters: >> >> 4^3 = 64 >> >> >> abaa

System calls not using correct permissions?

2005-07-14 Thread [EMAIL PROTECTED]
My Python script is basically glue for a lot of batch files and whatnot, so it uses os.system liberally. However, there is a strange problem where the scripts called by os.system do not function correctly in the Python code, but work fine when I simply copy and paste the command into the shell myse

Re: httplib/HTTPS Post Problem

2005-07-14 Thread Peter A.Schott
Have you tried using pycurl? That may be an easier way to port over your CURL code directly. Relatively easy to use, too. -Pete [EMAIL PROTECTED] wrote: > Hi, > > Sorry to post what might seem like a trivial problem here, but its > driving me mad! > > I have a simple https client that uses h

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Grant Edwards
On 2005-07-14, Martin v. Löwis <[EMAIL PROTECTED]> wrote: >> 1/0 is defined by the standard as +Inf and 0/0 is NaN. > > I wonder why Tim hasn't protested here: I thought this was *not* > the case. I thought IEEE 754 defined +Inf and NaN as only a possible > outcome of these operations with other p

ANN: CherryPy-2.1.0-beta released

2005-07-14 Thread remi
Hello everyone, I am happy to announce the first beta release of CherryPy-2.1 This release is a major step forward for CherryPy. It is packed with new features and bug fixes. Also, the CherryPy community is now growing quite fast and it is very active. Many people contributed to this release. He

Re: Frankenstring

2005-07-14 Thread [EMAIL PROTECTED]
well that appears to have been munged up ... that tell() belongs immediately after self.str. making it self.str.tell() class FrankenString: def __init__(self,string=None): self.str = StringIO(string) self.atEnd = False self.lastidx = 0 self.seek = self.str.seek

linking GUI apps using different Toolkits...possible?

2005-07-14 Thread MooMaster
This is more of a wxPython centric question, but not seeing reference to this on the wx group I thought I'd try here since many here also use wxPython toolkit. I started learning GUI development with Tkinter, and developed a few screens as part of an application I'm building with it. I've recently

Re: Frankenstring

2005-07-14 Thread [EMAIL PROTECTED]
Here is a cStringIO based version: class FrankenString: def __init__(self,string=None): self.str = StringIO(string) self.atEnd = False self.lastidx = 0 self.seek = self.str.seek self.tell = self.str.tell

Re: Native ODBC access for python on linux?

2005-07-14 Thread Grig Gheorghiu
1. Download and install MySQL-python from 2. Try to connect to a MySQL database that you have running. In this example I'm connecting to the bugs database installed with Bugzilla, and I'm connecting as MySQL user root (

[linked lists] Newbie - chapter 19 in "How to think like a CS in python"

2005-07-14 Thread Philip
Hi, I'm reading "How to think like a computer scientist in python". So far, it's been smooth sailing, but the final exercise in chapter 19 really has me stumped. Is it just me, or did this book get very difficult, very quickly? It says: "As an exercise, write an implementation of the Priority Queu

Re: all possible combinations

2005-07-14 Thread John Machin
rbt wrote: > Thanks to all who were helpful... some of you guys are too harsh and > cynical. Reality check: wander down to your nearest military establishment, ask a drill sergeant to demonstrate "harsh and cynical". > Here's what I came up with. I believe it's a proper > combination, but I'm su

Re: all possible combinations

2005-07-14 Thread George Sakkis
"rbt" <[EMAIL PROTECTED]> wrote: > Thanks to all who were helpful... some of you guys are too harsh and > cynical. Here's what I came up with. I believe it's a proper > combination, but I'm sure someone will point out that I'm wrong ;) > > groups = [list('abc'),list('abc'),list('abc'),list('abc')]

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Martin v. Löwis
Grant Edwards wrote: > 1/0 is defined by the standard as +Inf and 0/0 is NaN. I wonder why Tim hasn't protested here: I thought this was *not* the case. I thought IEEE 754 defined +Inf and NaN as only a possible outcome of these operations with other possible outcomes being exceptions... In that c

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Martin v. Löwis
Grant Edwards wrote: > I often foget how old Python is. Still, I've been using IEEE > floating point in C programs (and depending on the proper > production and handling of infinities and NaNs) for more than > 20 years now. I had thought that Python might have caught up. As should be clear by no

eBay.py - Has anyone looked at this???

2005-07-14 Thread provato
I'm somewhat of a newbie was confused by the following code that I downloaded from eBay's developer site: One of the classes in the file is called "Call". What I don't get is that in "MakeCall" function, there's a use of self.Session.Server. Where is this property coming from?

Re: Frankenstring

2005-07-14 Thread [EMAIL PROTECTED]
>jay graves wrote: >> see StringIO or cStringIO in the standard library. > Just as with files, iterating over them returns whole lines, which is > unfortunately not what I want. Then why not subclass it and alter the iteration scheme to do a read(1) or something? from StringIO import StringIO

Re: Python Installation error on Solaris-9-SPARC

2005-07-14 Thread Madhu R. Vajrala
This TIP worked GREAT !!! I was able to install python-2.4.1 on Sun Solaris by executing below steps ( I am not a 'root' user) 1. wget http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz 2. gunzip Python-2.4.1.tgz 3. /usr/sfw/bin/gtar -xvf Python-2.4.1.tar 5. cd Python-2.4.1 6. ./configure

How to create "cross-backend" python web app

2005-07-14 Thread matt
Hi all- I'm trying to port an ajax spell-checker (http://www.broken-notebook.com/spell_checker/index.php) to use with the moin moin wiki and have been somewhat successful. (By successful I mean I can spell check using the php backend and my python port running as cgi-bin). My question is this:

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Chris Lambacher
Referring to the documenation you will have to use that function and SetConsoleWindowInfo to get the effect you want. Basically SetConsoleScreenBufferSize sets the size for the console and SetConsoleWindowInfo sets the size for the window containing the console. The window size can't be bigger th

Re: all possible combinations

2005-07-14 Thread Erik Max Francis
William Park wrote: > Since you're doing cross product (ie. 3*3*3*3), manual loop of 4 level > deep would be the fastest in terms of algorithm. That's a Cartesian product, actually :-). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W

Re: all possible combinations

2005-07-14 Thread William Park
rbt <[EMAIL PROTECTED]> wrote: > Say I have a list that has 3 letters in it: > > ['a', 'b', 'c'] > > I want to print all the possible 4 digit combinations of those 3 > letters: > > 4^3 = 64 > > > abaa > aaba > aaab > acaa > aaca > aaac > ... > > What is the most efficient way to do this?

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Grant Edwards
On 2005-07-14, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-07-14, Tim Peters <[EMAIL PROTECTED]> wrote: > >> You may have forgotten how much richer the "plausible HW" landscape >> was at the time too. > > I've probably blocked most of it out intentionally. I seem to > have vague, repressed,

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Jason Drew
SetConsoleWindowInfo looks like a better candidate. See http://tinyurl.com/budzk (I.e. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setconsolewindowinfo.asp) Haven't tried it though. Good luck! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Grant Edwards
On 2005-07-14, Tim Peters <[EMAIL PROTECTED]> wrote: > You may have forgotten how much richer the "plausible HW" landscape > was at the time too. I've probably blocked most of it out intentionally. I seem to have vague, repressed, memories of working on a Sperry machine that used base 4 floating

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Sheeps United
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Which Windows API call did you try using? Can you show us a line or two > of code that you tried? Most likely then someone will be able to point > out what went wrong and it will work. (Chances are that very few here

Re: all possible combinations

2005-07-14 Thread Rocco Moretti
rbt wrote: > Say I have a list that has 3 letters in it: > > ['a', 'b', 'c'] > > I want to print all the possible 4 digit combinations of those 3 > letters: When I have occasion to do an iteration of iterations, I either use recursion (already posted) or use an accumulator type loop: items = [

Re: Tkinter Button widget

2005-07-14 Thread William Park
Peter Otten <[EMAIL PROTECTED]> wrote: > Shankar Iyer ([EMAIL PROTECTED]) wrote: > > > I have another Tkinter-related question. At the beginning of my > > program, a tkinter window is created with six buttons. Each of these > > buttons is assigned a function that should be execute

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Tim Peters
[Tim Peters] ... >> What does your platform C return for the integer expression >> 42/0? Is any other outcome "wrong"? [Grant Edwards] > I guess I though it was obvious from my reference to IEEE 754 > that I was referring to floating point operations. Yes, that was obvious. Since I thought my

Re: Changing size of Win2k/XP console?

2005-07-14 Thread Peter Hansen
Sheeps United wrote: > Hi, I'm quite a newbie but I've managed to google around before asking > stupid Q's here. > > I'm wrestling with little (amateurish) console program and I would like > change its size. I also know that it could be done with Windows API call. I > tried doing that myself bu

Re: Native ODBC access for python on linux?

2005-07-14 Thread callmebill
Can you tell me what I have to use in order to utilize the MySQL native API? There's some gap (chasm, really) in my knowledge that is keeping me from following that route. If you could provide a small example or a couple names, that would be extremely helpful. Thanks again for your time. Larry

Python and MySQL server

2005-07-14 Thread Unknown
Python 2.4 Linux kernel 2.6.12 Hi, 1. How do I make the following statement to search for all Strings I input from console? for example, with the code below I need to enter %hello world% (yeah, including the % symbols) to find all entries for hello world on the tableName. But I want to set the %

Re: Native ODBC access for python on linux?

2005-07-14 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm getting my feet wet with making Python talk to MySQL via ODBC. I > started on Windows, and it went smoothly enough due to the ODBC stuff > that apparently is native to Python at least on windows (I've been > following ch. 13 of Mar

Re: all possible combinations

2005-07-14 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > Say I have a list that has 3 letters in it: > > ['a', 'b', 'c'] > > I want to print all the possible 4 digit combinations of those 3 > letters: for i in xrange(81): print ''.join(['abcd'[j] for j in [(i//d)%3 for d in (27,9,3,1)]]) -- http:

Re: Native ODBC access for python on linux?

2005-07-14 Thread Grig Gheorghiu
I concur with Larry. I find that by properly abstracting the database connection code in my own class, I can then use any DB-API-compliant Python module to connect to a variety of databases. I use for example cxOracle to connect to Oracle and kinterbasdb to connect to firebird. I haven't tried conn

Re: Tkinter Button widget

2005-07-14 Thread Fuzzyman
Peter Otten wrote: > Shankar Iyer ([EMAIL PROTECTED]) wrote: > [snip..] > > Change your source code from > > # wrong > button = Tkinter.Button(..., command=some_function(),...) > > to > > # correct > button = Tkinter.Button(..., command=some_function,...) > > to pass the *function* to the widget

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Grant Edwards
On 2005-07-14, Tim Peters <[EMAIL PROTECTED]> wrote: > Python does go out of its way to raise ZeroDivisionError when > dividing by 0. > >> 1/0 is defined by the standard as +Inf and 0/0 is NaN. >> >> That's what my platform does for programs written in C. > > IOW, that's what your platform C does

Changing size of Win2k/XP console?

2005-07-14 Thread Sheeps United
Hi, I'm quite a newbie but I've managed to google around before asking stupid Q's here. I'm wrestling with little (amateurish) console program and I would like change its size. I also know that it could be done with Windows API call. I tried doing that myself but no good. Could anyone help me?

Re: Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Tim Peters
[Grant Edwards] > I've read over and over that Python leaves floating point > issues up to the underlying platform. > > This seems to be largely true, but not always. My underlying > platform (IA32 Linux) correctly handles 1.0/0.0 and 0.0/0.0 > according to the IEEE 754 standard, but Python goes o

Re: Tkinter Button widget

2005-07-14 Thread Peter Otten
Shankar Iyer ([EMAIL PROTECTED]) wrote: > I have another Tkinter-related question. At the beginning of my > program, a tkinter window is created with six buttons. Each of these > buttons is assigned a function that should be executed only when the > button is pressed. Howeve

Re: Native ODBC access for python on linux?

2005-07-14 Thread Larry Bates
ODBC is a vanilla interface that puts a layer between the program and the database. In theory, this would allow you to write a program that supports ODBC compliant databases and it would work with any of them. In practice it always seems like this doesn't work as well as everyone had hoped (perfo

Tkinter Button widget

2005-07-14 Thread Shankar Iyer ([EMAIL PROTECTED])
Hi, I have another Tkinter-related question. At the beginning of my program, a tkinter window is created with six buttons. Each of these buttons is assigned a function that should be executed only when the button is pressed. However, it seems that these functions are all executed once w

Why does python break IEEE 754 for 1.0/0.0 and 0.0/0.0?

2005-07-14 Thread Grant Edwards
I've read over and over that Python leaves floating point issues up to the underlying platform. This seems to be largely true, but not always. My underlying platform (IA32 Linux) correctly handles 1.0/0.0 and 0.0/0.0 according to the IEEE 754 standard, but Python goes out of its way to do the w

Re: Python Installation error on Solaris-9-SPARC

2005-07-14 Thread Skip Montanaro
Madhu> I did... Madhu> 1. wget http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz Madhu> 2. gunzip -c Python-2.4.1.tgz | tar xvf - Madhu> the above step errors: Madhu> Madhu> tar: directory checksum error Madhu> gunzip: stdout: Broken pipe Madhu> ---

Native ODBC access for python on linux?

2005-07-14 Thread callmebill
I'm getting my feet wet with making Python talk to MySQL via ODBC. I started on Windows, and it went smoothly enough due to the ODBC stuff that apparently is native to Python at least on windows (I've been following ch. 13 of Mark Hammond's py on win32 book). But now I'm trying to do equivalent s

unbuffer script using pexpect

2005-07-14 Thread Krutibas Biswal
Hi, I am using a script 'unbuffer' for unbuffering my outputs when using pipes. This script is based on expect and looks like this : -- #!/usr/bin/expect -- # Description: unbuffer stdout of a program # Author: Don Libes, NIST eval spawn -noecho $argv s

Re: Python Installation error on Solaris-9-SPARC

2005-07-14 Thread casevh
Madhu R. Vajrala wrote: > > 2. gunzip -c Python-2.4.1.tgz | tar xvf - > Use gtar. The Solaris tar does not hnadle long file names correctly. gtar should be found in /usr/sfw/bin. cvh -- http://mail.python.org/mailman/listinfo/python-list

Re: more newbie list questions

2005-07-14 Thread googleboy
Thanks for this. It ahs been very helpful. I realised that my problem using getattr were because I was trying to use it over the list of lists, instead of each book. I have written up a for loop now, and I think I am a lot closer: for book in all_books: author1 = getattr(book, 'auth

Re: Python Installation error on Solaris-9-SPARC

2005-07-14 Thread Madhu R. Vajrala
I did... 1. wget http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz 2. gunzip -c Python-2.4.1.tgz | tar xvf - the above step errors: tar: directory checksum error gunzip: stdout: Broken pipe 3. Later in ./configure step... This step also fails...(I did run this by ig

Differences between RDFlib - 4RDF and Redfoot - 4Suite?

2005-07-14 Thread Elmo Mäntynen
I was wondering about the differences with the referred libs and servers. Since the documentation isn't so thorough(and a bit because of my laziness), I thought I'd make request for usage accounts etc. stating the pros and cons of the aforementioned. Any notes would be appreciated. -- http://mail.

Re: threads and sleep?

2005-07-14 Thread Christopher Subich
Jp Calderone wrote: > On 14 Jul 2005 05:10:38 -0700, Paul Rubin > <"http://phr.cx"@nospam.invalid> wrote: > >> Andreas Kostyrka <[EMAIL PROTECTED]> writes: >> >>> Basically the current state of art in "threading" programming doesn't >>> include a safe model. General threading programming is unsaf

Re: Who uses input()? [was Re: question on "input"]

2005-07-14 Thread Terry Hancock
On Thursday 14 July 2005 07:00 am, Michael Hoffman wrote: > Devan L wrote: > > Use raw_input instead. It returns a string of whatever was typed. Input > > expects a valid python expression. > > Who actually uses this? It's equivalent to eval(raw_input(prompt)) but > causes a lot of newbie confusi

Re: Python Installation error on Solaris-9-SPARC

2005-07-14 Thread Grig Gheorghiu
Why don't you donwload the source from python.org? Also, on Solaris tar is sometimes broken (i.e. can't deal with long directory names etc.) You may want to donwload and install gnu tar. Grig -- http://mail.python.org/mailman/listinfo/python-list

Re: all possible combinations

2005-07-14 Thread rbt
Thanks to all who were helpful... some of you guys are too harsh and cynical. Here's what I came up with. I believe it's a proper combination, but I'm sure someone will point out that I'm wrong ;) groups = [list('abc'),list('abc'),list('abc'),list('abc')] already = [] while 1: LIST = []

trouble importing modules

2005-07-14 Thread Brandon Metcalf
I come from a Perl and C background and have been given an application written in Python to maintain and I know very little about Python. I'm having trouble at run time with importing modules. Specifically, in several places time.strptime() is being used and Freeze is being used to produce binarie

Python Installation error on Solaris-9-SPARC

2005-07-14 Thread Madhu R. Vajrala
Hello All, I am very new to Python, trying to install it from source (ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/python-2.3.3.tar.gz) on Sun Solaris-9 (SPARC). But getting the below error message during configure. Also while uncompressing, it is returning the checksum doesnt match error as wel

Re: Synthesis Toolkit bindings for python?

2005-07-14 Thread Cappy2112
Have you tried emailing the authors? -- http://mail.python.org/mailman/listinfo/python-list

How do I send keystrokes to a console window in Windows XP?

2005-07-14 Thread GoogleGroups
How do I use Python to send keystrokes to a console window in Windows XP? Or perhaps there is an application that I can call to do this? Thank you for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting on a word

2005-07-14 Thread qwweeeit
Hi Bernhard, firstly you must excuse my English ("angry" is a little ...strong, but my vocabulary is limited). I hope that the experts keep on helping us newbie. Also if I am a newbie (in Python), I disagree with you: my solution (with the help of Joe) answers to the problem of splitting a string u

Re: Efficiently Split A List of Tuples

2005-07-14 Thread Peter Hansen
Richard wrote: > On Wed, 13 Jul 2005 20:53:58 -0400, Peter Hansen wrote: >>a = ((1,2), (3, 4), (5, 6), (7, 8), (9, 10)) >>zip(*a) > This seems to work. Thanks. > > Where do I find documentation on "*args"? In the language reference: http://docs.python.org/ref/calls.html#calls -Peter -- http:/

Re: 2.4 Recent File list not working

2005-07-14 Thread Roger Upole
There was a bug in MFC 7 that prevented Pythonwin from closing properly. Build 204 of Pywin32 has a workaround, but I'm not sure if it's been incorporated into ActiveState's distribution yet. Roger "Larry Bates" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I recently

Re: Efficiently Split A List of Tuples

2005-07-14 Thread Richard
On Wed, 13 Jul 2005 20:53:58 -0400, Peter Hansen wrote: > a = ((1,2), (3, 4), (5, 6), (7, 8), (9, 10)) > zip(*a) > This seems to work. Thanks. Where do I find documentation on "*args"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Consecutive Character Sequences

2005-07-14 Thread Aries Sun
Hi George, Here's the result: >>> [list(group) for _,group in it.groupby("taaypiqee88adbbba")] [['t'], ['a', 'a'], ['y'], ['p'], ['i'], ['q'], ['e', 'e'], ['8', '8'], ['a'], ['d'], ['b', 'b', 'b'], ['a']] >>> [len(list(group)) for _,group in it.groupby("taaypiqee88adbbba")] [1, 2, 1, 1, 1, 1, 2, 2

Re: Consecutive Character Sequences

2005-07-14 Thread Walter Brunswick
Thank you [EMAIL PROTECTED] <[EMAIL PROTECTED]>, George Sakkis <[EMAIL PROTECTED]> and Aries Sun <[EMAIL PROTECTED]> for your code contributions. I haven't tested them yet, but they look alright and enough for me to work with. Thanks to everyone else for your comments. W. Brunswick. -- http

Re: Help - Classes and attributes

2005-07-14 Thread Bruno Desthuilliers
rh0dium a écrit : > Hi > > I really like your approach but when do you actually get connected?? > You never call the method connect? oops :( (snip whole code) >>if __name__ == '__main__': >> truc = NSCLdap() truc.connect() # was missing >> truc.search() > BTW, you'd better let

Re: more newbie list questions

2005-07-14 Thread googleboy
Ali wrote: > It's not really clear what you mean? Ah. sorry. Let me try again. I start with a csv that looks something like this: title, author1, author2, publisher, code, ISBN frogs of canada, andy humber, , springer press, foc2, 111-20345-556 newts of the UK, nigel snodgrass, sarah strauss,

Re: how to get rate of pop3 receiving progress?

2005-07-14 Thread Jp Calderone
On Thu, 14 Jul 2005 17:09:10 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: when i use POP3.retr() in poplib module, the retr() function will not return until the receiving progress is finished so, is there any way to get the rate of receiving progress? An extremely rudamentary example of how you

Re: Ann: Tkinter drag and drop module

2005-07-14 Thread [EMAIL PROTECTED]
i remember freezing a python console app i wrote some time ago using the mcmillan installer (kinda like py2exe) and was surprised to discover that binaries dragged and dropped onto the .exe file were handled properly as args...making a kind of no-gui drag and drop... how about a no-gui drag and dr

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread Peter Hansen
Jesse Noller wrote: > for f in os.listdir(os.path.abspath(libdir)): > module_name = f.strip('.py') > import module_name > > Obviously, this throws: > ImportError: No module named module_name > > Is there some way to do this? Use the __import__ builtin function. -- http://mail.python.org

Re: how to get rate of pop3 receiving progress?

2005-07-14 Thread Peter Hansen
Leo Jay wrote: > when i use POP3.retr() in poplib module, the retr() function will not > return until the receiving progress is finished > > so, is there any way to get the rate of receiving progress? Not a supported one, but you could just create a POP3 subclass and override the implementation

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread harold fellermann
> for f in os.listdir(os.path.abspath(libdir)): > module_name = f.strip('.py') > import module_name > > Obviously, this throws: > > ImportError: No module named module_name > > Is there some way to do this? have a look at help(__import__) to import a module whose name is given as a string

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread Jesse Noller
A question in a similiar vein: I have appended 2 different directories to my path (via sys.path.append) now - without knowing the names of the files in those directories, I want to force an import of the libraries ala: for f in os.listdir(os.path.abspath(libdir)): module_name = f.strip('.py')

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread Ralf W. Grosse-Kunstleve
% python Python 2.4.1 (#1, Apr 7 2005, 11:06:30) [C] on osf1V5 Type "help", "copyright", "credits" or "license" for more information. >>> execfile.__doc__ 'execfile(filename[, globals[, locals]])\n\nRead and execute a Python script from a file.\nThe globals and locals are dictionaries, defaulting

Synthesis Toolkit bindings for python?

2005-07-14 Thread clemenr
Hi. Are there any python bindings for the Synthesis Toolkit? http://ccrma.stanford.edu/software/stk/ I've done a quick search on the web but found nothing. Cheers, Ross-c -- http://mail.python.org/mailman/listinfo/python-list

Re: Porting from Python 2.3 to 2.4

2005-07-14 Thread Rocco Moretti
Joseph Garvin wrote: > Anand wrote: > >> Hi >> >> Are there any tools that would help in porting code from >> Pyton 2.3 to 2.4 ? I have gone through the whatsnew documents >> and created a document comparing Python 2.4 to 2.3. But so far >> has not been able to find any tool that will signal cod

  1   2   >