Re: wxPy + Py2Exe + sys.argv[0]

2005-07-05 Thread Miki Tebeka
Hello fowlertrainer, Hi ! The problem that when I started the program from CMD, the sys.argv is show the good path (in my machine the c:\dev\...) from Dialog1.py. But when I compile it with Py2Exe, and try to start the exe, it has been not found the hwinfo.ini file what store the

Tkinter + Tcl help

2005-07-05 Thread sunitajain
Hello all, I have a Tcldot package which I am using with Tcl (I source the package by 'load .\libtcldot.so.0' command. Now I want to use this package in Tkinter. Can anyone suggest me how to do this? I tried the foll: root=Tk() root.tk.eval('load ..\libtcldot.so.0') root.mainloop() But I

Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-05 Thread Mathias Waack
Maurice LING wrote: What I am trying to do is port a workable program from my own machine (Mac OSX) to a larger machine (Linux). So, the DB and the program are also on the same Linux machine. On the Linux machine, I cannot use localhost, so I set host parameter in kinterbasdb.connect()

Re: What are __slots__ used for?

2005-07-05 Thread Simon Percivall
Most have already been said, but have a look at http://docs.python.org/ref/slots.html for authoritative documentation. -- http://mail.python.org/mailman/listinfo/python-list

what is __init__.py used for?

2005-07-05 Thread [EMAIL PROTECTED]
I am a new learner of Python Programming Language. Now. I am reading a book. In the section relating to module, I see an example. the directory tree looks like below: root\ system1\ __init__.py utilities.py main.py other.py system2\ __init__.py

Re: what is __init__.py used for?

2005-07-05 Thread Simon Brunning
On 5 Jul 2005 01:31:09 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am a new learner of Python Programming Language. Welcome! I was wonderring ... what is the __init__.py used for ? This question may seems to be stupid for an expert. But, if you can give the answer, it will

Re: what is __init__.py used for?

2005-07-05 Thread Lutz Horn
* [EMAIL PROTECTED]: root\ system1\ __init__.py utilities.py main.py other.py ... I was wonderring ... what is the __init__.py used for ? This question may seems to be stupid for an expert. The __init__.py is needed for Python to recognize the

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Guy Lateur
Thanks for the suggestion, Tim. Unfortunately, I get a 'connection refused' error on the line 'M = imaplib.IMAP4(server)'. It says socket.error: (10061, 'Connection refused'). I've tried both the external IP adress and the internal one (10.0.0.2). I'm sure there's a way to get over this, isn't

RE: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Golden
[Guy Lateur] | Thanks for the suggestion, Tim. Unfortunately, I get a | 'connection refused' | error on the line 'M = imaplib.IMAP4(server)'. It says socket.error: | (10061, 'Connection refused'). I've tried both the external | IP adress and | the internal one (10.0.0.2). I'm sure there's a

Re: Considering moving from Delphi to Python [Some questions]

2005-07-05 Thread Harald Armin Massa
I want some feedback on folllwing: anybody who has experience in writing SOAP servers in Python and data entry heavy web applications. Any suggestions? darkcowherd I have never written SOAP Servers. But I have very very good experience in creating entry heavy web application using Python and

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Richard Brodie
Tim Golden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Could simply be that the Exchange server isn't running an IMAP service (or whatever it's called). Ours doesn't. I would have thought most wouldn't run IMAP in the clear; over SSL maybe. --

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Guy Lateur
Are you saying it's unsafe to do that? I only need this for an application running locally, I mean, from within our LAN domain. We do have Exchange webmail. I've asked our Exchange expert wether or not IMAP is running; awaiting an answer.. Richard Brodie [EMAIL PROTECTED] schreef in bericht

Re: what is __init__.py used for?

2005-07-05 Thread Walter Dörwald
[EMAIL PROTECTED] wrote: I am a new learner of Python Programming Language. Now. I am reading a book. In the section relating to module, I see an example. the directory tree looks like below: root\ system1\ __init__.py utilities.py main.py other.py

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Richard Brodie
Guy Lateur [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Are you saying it's unsafe to do that? I only need this for an application running locally, I mean, from within our LAN domain. We do have Exchange webmail. I wasn't offering security advice but merely observing that your

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Williams (gmail)
On 7/5/05, Guy Lateur [EMAIL PROTECTED] wrote: Thanks for the suggestion, Tim. Unfortunately, I get a 'connection refused' error on the line 'M = imaplib.IMAP4(server)'. It says socket.error: (10061, 'Connection refused'). I've tried both the external IP adress and the internal one (10.0.0.2).

distutils is able to handle...

2005-07-05 Thread mg
Hello I work on an finite element framework and Python bindings have been developped. Actually, we use Boost.Build as build system but we would like to change it. We have two kinds of problems. First, the framework is used for generate pure C++ applications with static libraries ; second, the

(Win32 API) callback to Python, threading hiccups

2005-07-05 Thread Francois De Serres
Hiho, could somebody please enlighten me about the mechanics of C callbacks to Python? My domain is more specifically callbacks from the win32 API, but I'm not sure that's where the problem lies. Here's a description... I want a callback-based MIDI input/processing, so PortMidi was not an

Re: what is __init__.py used for?

2005-07-05 Thread John Roth
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am a new learner of Python Programming Language. Now. I am reading a book. ... == I was wonderring ... what is the __init__.py used for ? This question may seems to be stupid for an expert. But, if you can give the

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

2005-07-05 Thread Michael Hudson
Tim Peters [EMAIL PROTECTED] writes: All Python behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent accident, mostly inherited from that all C89 behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent crapshoot. As you may

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Guy Lateur
I just tried this and it failed with IP addresses but not hostnames/machine names, try it again with the server name. :) Nope, same problem. I think TJG might be right, and our server probably doesn't have IMAP running (yet). Depends how secure you need it to be.For my simple stuff I

Re: How do you program in Python?

2005-07-05 Thread Harald Armin Massa
Peter, I do all my work using Scite Me too! So, any time I need to test the changes, I hit four keys (which at this point is understandably more like a chord that I hit without direct awareness of it) and I'm done. Sounds pretty close to old-style BASIC and since I've come that route too

Re: f*cking re module

2005-07-05 Thread François Pinard
[D H] Gustavo Niemeyer wrote: That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way. ...and then someone else comes along and calls the first person stupid and arrogant, which is deemed QOTW. :)

Re: f*cking re module

2005-07-05 Thread Greg Lindstrom
That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way. Me, too. Indeed, that's a great reason to be a part of this community. I didn't see the original question as either stupid or arrogant; I read it as

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Tom Anderson
On Mon, 4 Jul 2005, George Sakkis wrote: Tom Anderson [EMAIL PROTECTED] wrote: I'll just chip in and say i'd quite like a flatten(), too; at the moment, i have one like this: def flatten(ll): return reduce(lambda a, l: a.extend(l), ll, []) This doesn't work; a.extend() returns None,

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Steven D'Aprano
On Tue, 05 Jul 2005 05:03:32 -0700, mcherm wrote: Steven D'Aprano writes: Lambda is no more an obscure name than function, decorator, closure, class, or module. The first time you come across it, you don't know what it means. Then you learn what it means, and then you know. I believe

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Tom Anderson
On Mon, 4 Jul 2005, Ron Adam wrote: George Sakkis wrote: And finally for recursive flattening: def flatten(seq): return reduce(_accum, seq, []) def _accum(seq, x): if isinstance(x,list): seq.extend(flatten(x)) else: seq.append(x) return seq

Re: How do you program in Python?

2005-07-05 Thread Tom Anderson
On Mon, 4 Jul 2005, Aahz wrote: In article [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] wrote: After 25 years doing this, I've become something of a Luddite as far as fancy IDEs and non-standard features go... and a huge believer in strict decoupling between my tools, to the point

Re: distutils is able to handle...

2005-07-05 Thread George Sakkis
mg [EMAIL PROTECTED] wrote: Hello I work on an finite element framework and Python bindings have been developped. Actually, we use Boost.Build as build system but we would like to change it. We have two kinds of problems. First, the framework is used for generate pure C++ applications

Re: what is __init__.py used for?

2005-07-05 Thread George Sakkis
John Roth [EMAIL PROTECTED] wrote: The other is as the module itself. Let's take a simple example. Assume you have a directory named breakfast which contains modules named spam.py, eggs.py, toast.py and jam.py, and that the directory containing breakfast is on the PYTHONPATH. If it try to

More On - deepcopy, Tkinter

2005-07-05 Thread phil
I posted the following yesterday and got no response and did some testing simplifying the circumstances and it appears that deepcopy fails when the object to be copied contains a reference to a Canvas Object. Perhaps any Tkinter object, didn't get that far. The problem arises because I have a

Re: readline: edit-and-execute-command

2005-07-05 Thread Michael Hoffman
josh wrote: anybody know why edit-and-execute-command doesn't work in python's readline? it doesn't even show up in a dump of readline functions: Is that a standard readline command? It's not in my readline(3). It might just be added for bash. That said, this

Re: f*cking re module

2005-07-05 Thread Michael Hoffman
Greg Lindstrom wrote: I hear that Perl 6 is going to have a rewrite of regular expressions; it will be interesting to see what their hard work produces. From what I saw a while ago, it didn't look like it would be any simpler or more elegant. But that was a while ago. -- Michael Hoffman

Py2Exe and the log file...

2005-07-05 Thread [EMAIL PROTECTED]
Hi ! 1. Thanx for your answer in the theme of Unicode, and other things. 2. The problem: I need to create an application that not need Python libs to install. Py2Exe is good for that, but I need to copy the dist to the network drive what mapped readonly. This is a protection. So: in this time I

Python exception hook simple example needed

2005-07-05 Thread [EMAIL PROTECTED]
Hi ! I wrote some mails to wxPy, and this list about wxPython and global exception handling theme. I need to port my Delphi apps to wxPy, and I want to use same exception mechanism like Delphi use. When any exception get unhandled, the app's main cycle get it, and show in a dialog (and I can

Re: pickle broken: can't handle NaN or Infinity under win32

2005-07-05 Thread Michael Hudson
Terry Reedy [EMAIL PROTECTED] writes: Grant Edwards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm working on it. I should have said it's trivial if you have access to the platforms to be supported. I've tested a fix that supports pickle streams generated under Win32 and

Re: Python exception hook simple example needed

2005-07-05 Thread Thomas Guettler
Am Tue, 05 Jul 2005 16:07:44 +0200 schrieb [EMAIL PROTECTED]: Hi ! I wrote some mails to wxPy, and this list about wxPython and global exception handling theme. I need to port my Delphi apps to wxPy, and I want to use same exception mechanism like Delphi use. When any exception get

Re: Tkinter + Tcl help

2005-07-05 Thread Jeff Epler
I think you need to write root.tk.eval('load', '...\\libtcldot.so.0') When you write root.tk.eval(x y z) it's like doing this at the wish/tclsh prompt: # {x y z} Not like this: # x y z Now, how useful it is to have a command called x y z, I can't guess... but tcl would let you do

Re: More On - deepcopy, Tkinter

2005-07-05 Thread Duncan Booth
phil wrote: It is frustrating to think that in a language like python there might be things which you can't make a copy of. That is bizarre enough to wonder about a deep flaw or hopefully I'm just doing something very wrong. To be honest, it doesn't really surprise me that you cannot copy

Re: Python exception hook simple example needed

2005-07-05 Thread Benji York
[EMAIL PROTECTED] wrote: If anyone has an idea, how to I catch exceptions globally, please write me. I believe there is an example of this in the demo that comes with wxPython (don't have an install handy to check). -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2Exe and the log file...

2005-07-05 Thread Thomas Heller
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Hi ! 1. Thanx for your answer in the theme of Unicode, and other things. 2. The problem: I need to create an application that not need Python libs to install. Py2Exe is good for that, but I need to copy the dist to the network drive what mapped

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Terry Hancock
On Tuesday 05 July 2005 08:17 am, Steven D'Aprano wrote: Sorry, but you are mistaken. lambda is a _reserved_ word in the Python language, while function etc are not, but they are certainly part of the language. Try explaining what def and import do without using the words function or module.

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

2005-07-05 Thread Tim Peters
[Tim Peters] All Python behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent accident, mostly inherited from that all C89 behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent crapshoot. [Michael Hudson] As you may have

Re: threads and sleep?

2005-07-05 Thread Jeffrey Maitland
Hello all, First off Thanks for the responses on the sleep() part I suspected as much but I wasn't 100% sure. To continue this I just want to pre thank anyone that contributes to this thread(lol). Ok here goes. The problem I have is I had an application (wrote/co-wrote) that has a long run

Re: More On - deepcopy, Tkinter

2005-07-05 Thread phil
The deepcopy protocol does allow you to specify how complicated objects should be copied. Try defining __deepcopy__() in your objects to just copy the reference to the Canvas object instead of the object itself. I can't figure out from the docs what __deepcopy__ is or how it works. I

Re: f*cking re module

2005-07-05 Thread jwaixs
To reply to the last part of the discussion and esspecially to Gustavo Niemeyer, I really apriciate the way in which I had been answered. And I won't have any questions about the re module that I had before I post this threat. I was frustration and should, probebly, not post this frustration. But

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

2005-07-05 Thread Terry Hancock
On Sunday 03 July 2005 10:47 pm, Steven D'Aprano wrote: Any floating point package that supports the IEEE standard should give you a test to see if a float represents a NaN. That's what you need. You certainly can't rely on x == SOME_NAN because there are 254 different NaNs. There is

Re: Considering moving from Delphi to Python [Some questions]

2005-07-05 Thread Benji York
Dark Cowherd wrote: I want some feedback on folllwing: anybody who has experience in writing [...] data entry heavy web applications. Any suggestions? You might be interested in Zope 3's ability to generate data entry/edit forms via schemas. -- Benji York --

Re: Folding in vim

2005-07-05 Thread Terry Hancock
On Monday 04 July 2005 12:41 am, Ron Adam wrote: Actually, I think this one is doing what I want now. It seems to be that it isn't robust against files with lots of mixed tabs and spaces. I also got space_hi.vim which highlights tabs and trailing spaces, which made it a lot easier to fix

Re: Folding in vim

2005-07-05 Thread Terry Hancock
On Monday 04 July 2005 01:12 am, Andrea Griffini wrote: - never ever use tabs; tabs were nice when they had - stick to 4-space indent Nice ideals to which I ascribe. But if your editor isn't configured to support you on this, spacing over to, say column 24 gets pretty dull. Mine wasn't

Re: What are the other options against Zope?

2005-07-05 Thread Terry Hancock
On Monday 04 July 2005 10:21 am, phil wrote: A data base with properties and methods. Cool. I am so sure I already said this. Well, I guess I typed too much else. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com --

Good starterbook for learning Python?

2005-07-05 Thread Lennart
Hi everybody, Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... I'm living in the Netherlands and I prefer a book from bol.com (see link) because i've to order more

Re: More On - deepcopy, Tkinter

2005-07-05 Thread Duncan Booth
phil wrote: The deepcopy protocol does allow you to specify how complicated objects should be copied. Try defining __deepcopy__() in your objects to just copy the reference to the Canvas object instead of the object itself. I can't figure out from the docs what __deepcopy__ is or how

Re: threads and sleep?

2005-07-05 Thread Jonathan Ellis
Jeffrey Maitland wrote: The problem I have is I had an application (wrote/co-wrote) that has a long run time dependant on some variables passed to it (mainly accuracy variables, the more accurate the longer the run time - makes sense). However in the hopes to speed it up I decided to write a

Re: Good starterbook for learning Python?

2005-07-05 Thread TechBookReport
Lennart wrote: Hi everybody, Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... I'm living in the Netherlands and I prefer a book from bol.com (see link)

Re: Good starterbook for learning Python?

2005-07-05 Thread Patrick Rutkowski
On Tuesday 05 July 2005 11:32, Lennart wrote: Hi everybody, Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... I'm living in the Netherlands and I prefer a book

Re: f*cking re module

2005-07-05 Thread George Sakkis
jwaixs [EMAIL PROTECTED] wrote: To reply to the last part of the discussion and esspecially to Gustavo Niemeyer, I really apriciate the way in which I had been answered. And I won't have any questions about the re module that I had before I post this threat. I was frustration and should,

Re: importing pyc from memory?

2005-07-05 Thread Bengt Richter
On Mon, 4 Jul 2005 13:01:06 -0500, Jeff Epler [EMAIL PROTECTED] wrote: --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This stupid code works for modules, but not for packages. It probably has bugs. import marshal, types class StringImporter:

Re: threads and sleep?

2005-07-05 Thread Grant Edwards
On 2005-07-05, Jeffrey Maitland [EMAIL PROTECTED] wrote: Ok here goes. The problem I have is I had an application (wrote/co-wrote) that has a long run time dependant on some variables passed to it (mainly accuracy variables, the more accurate the longer the run time - makes sense). However in

Re: precision problems in base conversion of rational numbers

2005-07-05 Thread Terry Hancock
On Monday 04 July 2005 06:11 am, Brian van den Broek wrote: As a self-directed learning exercise I've been working on a script to convert numbers to arbitrary bases. It aims to take any of whole numbers (python ints, longs, or Decimals), rational numbers (n / m n, m whole) and floating

Re: threads and sleep?

2005-07-05 Thread Jeffrey Maitland
Thanks. I was hoping that python would allow for the cpu threading such in Java etc.. but I guess not. (from the answers,and other findings) I guess I will have to write this part of the code in something such as java or c or something that allows for it then I can either wrap it in python or

Re: threads and sleep?

2005-07-05 Thread Grant Edwards
On 2005-07-05, Dennis Lee Bieber [EMAIL PROTECTED] wrote: Don't think you can do that with Python... The Python runtime interpreter itself is running on a single processor. I don't see how that can be. Under Linux at least, the Python threading module uses real OS threads, so there are

Re: pexpect question....

2005-07-05 Thread [EMAIL PROTECTED]
Hi, While I continue to look at the problem, I thought I would post more details. In a sense, this is more of a UNIX issue. I have a python script that uses pexpect to spawn a child process (p1). The python script then goes ahead and does a tail --pid=p1. Assuming that I do close(wait=0), P1

Re: threads and sleep?

2005-07-05 Thread Grant Edwards
On 2005-07-05, Grant Edwards [EMAIL PROTECTED] wrote: Don't think you can do that with Python... The Python runtime interpreter itself is running on a single processor. I don't see how that can be. Under Linux at least, the Python threading module uses real OS threads, so there are multiple

Re: More On - deepcopy, Tkinter

2005-07-05 Thread Michael Hoffman
phil wrote: I posted the following yesterday and got no response When you don't get as much of a response as you expected, you might consider the advice here: http://www.catb.org/~esr/faqs/smart-questions.html Pointing you here is only meant to be helpful. If you don't feel the advice

Re: what is __init__.py used for?

2005-07-05 Thread Terry Hancock
On Tuesday 05 July 2005 06:39 am, John Roth wrote: The real kicker here is that when I say that the first module will be completely empty, it's not quite true. First, it will have some standard identifiers that all modules have, and second it will have anything you put into the __init__.py

Python Regular Expressions: re.sub(regex, replacement, subject)

2005-07-05 Thread Vibha Tripathi
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject) method/function, I need the second argument 'replacement' to be another regular expression ( not a string) . So when I

Re: More On - deepcopy, Tkinter

2005-07-05 Thread phil
but you clearly haven't been getting the results from this forum that you expected. Yes I have, this is a wonderful forum. I was just providing more info due to more testing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Regular Expressions: re.sub(regex, replacement, subject)

2005-07-05 Thread Steven Bethard
Vibha Tripathi wrote: In the Python re.sub(regex, replacement, subject) method/function, I need the second argument 'replacement' to be another regular expression ( not a string) . So when I find a 'certain kind of string' in the subject, I can replace it with 'another kind of string' ( not

Re: f*cking re module

2005-07-05 Thread Don
jwaixs wrote: To reply to the last part of the discussion and esspecially to Gustavo Niemeyer, I really apriciate the way in which I had been answered. And I won't have any questions about the re module that I had before I post this threat. I was frustration and should, probebly, not post

resume upload

2005-07-05 Thread Jxzzy78
How can i resume a partial upload using ftplib ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Regular Expressions: re.sub(regex, replacement, subject)

2005-07-05 Thread Benjamin Niemann
Vibha Tripathi wrote: Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject) method/function, I need the second argument 'replacement' to be another regular

Re: Folding in vim

2005-07-05 Thread Sybren Stuvel
Andrea Griffini enlightened us with: - never ever use tabs I always use one tab for indents, and set my editor to display it as four spaces. I like being able to unindent a line by deleting a single character. I don't see a reason why _not_ to use tabs, really. As long as the use is consistent -

Re: f*cking re module

2005-07-05 Thread Gustavo Niemeyer
To reply to the last part of the discussion and esspecially to Gustavo Niemeyer, I really apriciate the way in which I had been answered. And I won't have any questions about the re module that I had before I post this threat. Great! As I said, that's a nice news group. I was frustration

Re: f*cking re module

2005-07-05 Thread Paul McGuire
Your elaboration on what problem you are actually trying to solve gave me some additional insights into your question. It looks like you are writing a Python-HTML templating system, by embedding Python within HTML using python.../python tags. As many may have already guessed, I worked up a

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

2005-07-05 Thread Michael Hudson
Tim Peters [EMAIL PROTECTED] writes: [Tim Peters] All Python behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent accident, mostly inherited from that all C89 behavior in the presence of infinities, NaNs, and signed zeroes is a platform-dependent

Re: Folding in vim

2005-07-05 Thread Mike Meyer
Sybren Stuvel [EMAIL PROTECTED] writes: Andrea Griffini enlightened us with: - never ever use tabs I always use one tab for indents, and set my editor to display it as four spaces. I like being able to unindent a line by deleting a single character. I don't see a reason why _not_ to use

Re: Folding in vim

2005-07-05 Thread Benji York
Sybren Stuvel wrote: I always use one tab for indents, and set my editor to display it as four spaces. I like being able to unindent a line by deleting a single character. Your editor probably supports a backspace unindents option. If using Vim it would be something like set softtabstop=4.

Re: precision problems in base conversion of rational numbers

2005-07-05 Thread [EMAIL PROTECTED]
Brian van den Broek wrote: Hi all, I guess it is more of a maths question than a programming one, but it involves use of the decimal module, so here goes: As a self-directed learning exercise I've been working on a script to convert numbers to arbitrary bases. It aims to take any of whole

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 5)

2005-07-05 Thread Simon Brunning
QOTW: That's what I love in that news group. Someone comes with a stupid and arrogant question, and someone else answers in a calm and reasonable way. - Gustavo Niemeyer After 25 years doing this, I've become something of a Luddite as far as fancy IDEs and non-standard features go... and a huge

Re: resume upload

2005-07-05 Thread Jeff Epler
probably by using REST. This stupid program puts a 200 line file by sending 100 lines, then using REST to set a resume position and sending the next 100 lines. import getpass, StringIO, ftplib lines = [Line %d\n % i for i in range(200)] part1 = .join(lines[:100]) part2 = .join(lines[:100]) f =

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Christopher Subich
[EMAIL PROTECTED] wrote: concept quickly familiar. But lambda has a very clear meaning... it's a letter of the greek alphabet. The connection between that letter and anonymous functions is tenuous at best, and fails the test of making Python read like executable pseudocode. But 'lambda' does

Re: Good starterbook for learning Python?

2005-07-05 Thread Lennart
With Dive Into Python in an other language i can learn python the russian language :-) Thanks anyway Now i can learn python Op Tue, 05 Jul 2005 16:43:03 +0100 schreef TechBookReport: Lennart wrote: Hi everybody, Can someone advice me with the following issue: i want to learn python in my

best options for oracle/python?

2005-07-05 Thread Mark Harrison
Any recommendations for Oracle bindings for the DB-API 2.0 specification? This is for Oracle 10g if that makes any difference. Also, any other Oracle related goodies that might be useful? Many TIA! Mark -- Mark Harrison Pixar Animation Studios --

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-05 Thread mcherm
Ralf W. Grosse-Kunstleve wrote: I often find myself writing:: class grouping: def __init__(self, x, y, z): self.x = x self.y = y self.z = z # real code, finally This becomes a serious nuisance in complex applications with long

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-05 Thread Thomas Heller
[EMAIL PROTECTED] writes: Ralf W. Grosse-Kunstleve wrote: I often find myself writing:: class grouping: def __init__(self, x, y, z): self.x = x self.y = y self.z = z # real code, finally This becomes a serious nuisance in

Re: Using Numeric 24.0b2 with Scientific.IO.NetCDF

2005-07-05 Thread bandw
Robert, Thanks for your reply. However, I am still having problems. Sometimes I get a scalar return and sometimes I get an array. For example, using the netCDF file: netcdf simple { dimensions: num = 3 ; variables: float temp0(num) ; int temp1(num) ;

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread mcherm
Up until a few years ago, I ran the computer science department at a high-school. I provided support for the English teachers who taught *all* students -- but they taught things like the use of a word processor or the internet, and never covered the meaning of lambda. I taught a computer

Re: How do you program in Python?

2005-07-05 Thread Peter Hansen
Tom Anderson wrote: +1 insight of the century. This is the heart of the unix way - lots of simple little programs that do exactly one thing well, and can be composed through simple, clean interfaces. For actually getting things done, a toolkit beats a swiss army knife. Perhaps, but I'm

Re: threads and sleep?

2005-07-05 Thread Peter Hansen
Jeffrey Maitland wrote: I was hoping that python would allow for the cpu threading such in Java etc.. but I guess not. (from the answers,and other findings) I guess I will have to write this part of the code in something such as java or c or something that allows for it then I can either wrap

PyUnicodeUCS4_AsUnicode error

2005-07-05 Thread fjs205
When I try to import gtk, or even start some programs that use Python I get the error: ImportError: /usr/lib/python2.4/site-packages/gtk-2.0/gobject.so: undefined symbol: PyUnicodeUCS4_AsUnicode Can anyone shed some light on this? FWIW, I have reinstalled python, tried v2.3.4 instead of 2.4,

Re: (Win32 API) callback to Python, threading hiccups

2005-07-05 Thread Christopher Subich
Francois De Serres wrote: - so, on callback, I create a new thread, after checking that the previous one has returned already (WaitOnSingleObject(mythread)) so we only have one thread involved. Uh... to me, this looks like a frighteningly inefficient way of doing things. How about using a

Re: How do you program in Python?

2005-07-05 Thread Grant Edwards
On 2005-07-05, Peter Hansen [EMAIL PROTECTED] wrote: Tom Anderson wrote: +1 insight of the century. This is the heart of the unix way - lots of simple little programs that do exactly one thing well, and can be composed through simple, clean interfaces. For actually getting things done, a

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Peter Hansen
[EMAIL PROTECTED] wrote: [snip description of experience teaching high school students] So I'd say that it's a pretty obscure name that most people wouldn't know. It would be hard to argue against that statement; certainly lambda in this context (or probably any) is not a word most people

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Grant Edwards
On 2005-07-05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Up until a few years ago, I ran the computer science department at a high-school. I provided support for the English teachers who taught *all* students -- but they taught things like the use of a word processor or the internet, That's

Re: Folding in vim

2005-07-05 Thread Sybren Stuvel
Benji York enlightened us with: Your editor probably supports a backspace unindents option. Yes, it does. I'm using vim. If using Vim it would be something like set softtabstop=4. This gives you a mixture of tabs and spaces, which I don't like. I'd rather use real tabs for indenting. If you

Re: Good starterbook for learning Python?

2005-07-05 Thread Sybren Stuvel
Lennart enlightened us with: Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... http://www.diveintopython.org/ - I read it during the weekend, and it's a very good

Re: Python Regular Expressions: re.sub(regex, replacement, subject)

2005-07-05 Thread George Sakkis
Vibha Tripathi [EMAIL PROTECTED] wrote: Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject) method/function, I need the second argument 'replacement' to be another

Re: precision problems in base conversion of rational numbers

2005-07-05 Thread Brian van den Broek
Terry Hancock said unto the world upon 05/07/2005 11:49: On Monday 04 July 2005 06:11 am, Brian van den Broek wrote: As a self-directed learning exercise I've been working on a script to convert numbers to arbitrary bases. It aims to take any of whole numbers (python ints, longs, or

Re: distutils is able to handle...

2005-07-05 Thread Robert Kern
George Sakkis wrote: mg [EMAIL PROTECTED] wrote: Hello I work on an finite element framework and Python bindings have been developped. Actually, we use Boost.Build as build system but we would like to change it. We have two kinds of problems. First, the framework is used for generate pure

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Devan L
def flatten(iterable): if not hasattr(iterable, '__iter__'): return [iterable] return sum([flatten(element) for element in iterable],[]) Recursion makes things so much shorter. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >