Re: People's names (was Re: sqlite3 error)

2006-10-17 Thread Hendrik van Rooyen
"Florian Diesch" <[EMAIL PROTECTED]>wrote: 8<-- >In Germany "von" is just a part of the name since 1919 when the nobility >was abolished by law. Thanks - was not aware of this - 1919 - just after the Great War, 1914-1918... - Hendrik

What happened to RuleDispatch

2006-10-17 Thread exhuma.twn
Hi all, yesterday I wanted to install TurboGears, which depends on RuleDispatch. However, I failed to download it. First I got the error "Bad Gateway" from the server, today it's simply a "Not Found" error. So what happened to it? Does somebody know? I would really need to install TurboGears in t

Re: I would like write some data recovery software

2006-10-17 Thread Laurent Pointal
gel a écrit : > I would like to write some data recovery software as a learning thing. > The sort of thing that you would use to recover data from a currupt HDD > or floppy etc. I would like to be pointed in the right direction as > far as modules to use and suggested approaches. > Once you get

Flexable Collating (feedback please)

2006-10-17 Thread Ron Adam
I put together the following module today and would like some feedback on any obvious problems. Or even opinions of weather or not it is a good approach. While collating is not a difficult thing to do for experienced programmers, I have seen quite a lot of poorly sorted lists in commercial ap

Re: creating many similar properties

2006-10-17 Thread Michele Simionato
Lee Harr wrote: > I understand how to create a property like this: > > class RC(object): > def _set_pwm(self, v): > self._pwm01 = v % 256 > def _get_pwm(self): > return self._pwm01 > pwm01 = property(_get_pwm, _set_pwm) > > > But what if I have a whole bunch of these pwm

Re: Python wrapper for C++ core

2006-10-17 Thread Carl Banks
[EMAIL PROTECTED] wrote: > Hi All > > Apologies in advance for the pretty basic question - but I can't seem > to find an answer anywhere else. > > I am developing a fluid sim in C++ and have heard that many people use > Python in conjunction with C++ for this sort of thing (especially in > games de

Re: creating many similar properties

2006-10-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lee Harr wrote: > But what if I have a whole bunch of these pwm properties? > > I made this: > > class RC(object): > def _makeprop(name): > prop = '_%s' % name > def _set(self, v): > v_new = v % 256 > setattr(self, prop, v_new)

Re: Plotting histograms

2006-10-17 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Thanks Robert, > > My previous problem is solved(I was using 'from matplotlib.pylab import > *') but now I am facing another problem. I want to plot the histogram > of eigenvalues calculated and I am using the following code: > ___

Re: I would like write some data recovery software

2006-10-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gel wrote: > Dennis Lee Bieber wrote: >> On 17 Oct 2006 20:18:40 -0700, "gel" <[EMAIL PROTECTED]> declaimed >> the following in comp.lang.python: >> >> […] You also need very good documentation of the file system […] > > Yes, OK I guess NTFS would be of most interest to me

Re: string splitting

2006-10-17 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Hello, > I have thousands of files that look something like this: > > wisconsin_state.txt > french_guiana_district.txt > central_african_republic_province.txt > > I need to extract the string between the *last* underscore and the > extention. > So based on the files abov

Re: Plotting histograms

2006-10-17 Thread [EMAIL PROTECTED]
Thanks Robert, My previous problem is solved(I was using 'from matplotlib.pylab import *') but now I am facing another problem. I want to plot the histogram of eigenvalues calculated and I am using the following code: ___ import n

Re: I would like write some data recovery software

2006-10-17 Thread neoedmund
gel wrote: > I would like to write some data recovery software as a learning thing. > The sort of thing that you would use to recover data from a currupt HDD > or floppy etc. I would like to be pointed in the right direction as > far as modules to use and suggested approaches. what kind of recov

Re: Restart a Python COM Server

2006-10-17 Thread MC
Hi! It is the normal behavior of COM. Note that, Python being dynamic, you can modify Python script, OF THE INTERIOR, during execution. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: I would like write some data recovery software

2006-10-17 Thread gel
Dennis Lee Bieber wrote: > On 17 Oct 2006 20:18:40 -0700, "gel" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > I would like to write some data recovery software as a learning thing. > > The sort of thing that you would use to recover data from a currupt HDD > > or floppy

Re: httplib and HTTPS Connections

2006-10-17 Thread Heikki Toivonen
runningwild wrote: > This is the first time I have cared about httplib's HTTPSConnection. Please note that the Python builtin SSL support is not really secure. It does not make sure that you connect to the site you think you are connecting to, for example. If you really need secure SSL (what is t

Re: httplib and HTTPS Connections

2006-10-17 Thread Heikki Toivonen
runningwild wrote: > This is the first time I have cared about httplib's HTTPSConnection. Please note that the Python builtin SSL support is not really secure. It does not make sure that you connect to the site you think you are connecting to, for example. If you really need secure SSL (what is t

Re: creating many similar properties

2006-10-17 Thread James Stroud
Lee Harr wrote: > I understand how to create a property like this: > > class RC(object): > def _set_pwm(self, v): > self._pwm01 = v % 256 > def _get_pwm(self): > return self._pwm01 > pwm01 = property(_get_pwm, _set_pwm) > > > But what if I have a whole bunch of these

I would like write some data recovery software

2006-10-17 Thread gel
I would like to write some data recovery software as a learning thing. The sort of thing that you would use to recover data from a currupt HDD or floppy etc. I would like to be pointed in the right direction as far as modules to use and suggested approaches. -- http://mail.python.org/mailman/lis

pexpect with apache

2006-10-17 Thread [EMAIL PROTECTED]
Hi all. I try not to post until I am stuck in hole with no way out. I fought with this for several hours, and am currently in the hole. I'm doing a proof of concept for creating afp shares dynamically through a web interface from a client machine. I use a bit of php to setup a simple form, and

Re: Python wrapper for C++ core

2006-10-17 Thread Robert Heller
At 17 Oct 2006 17:19:03 -0700 "handful of nothing" <[EMAIL PROTECTED]> wrote: > > IMHO, > > What I learned with the time and of course with books =) : > > Python gives you rapid turnaround. You can try different approaches and > archictetures to solve the problem in much faster way than you wou

Restart a Python COM Server

2006-10-17 Thread m . errami
Hello all. I am desperately in need for you help guys. Here is the story: 1- I have created a small simple COM serve with python (along the lines read in Win32 Programming with python). 2- If I start the server and call a function from VBE everything works fine 3- I then want to modify the function

Re: Adding Worksheets to an Excel Workbook

2006-10-17 Thread Tom Plunket
wesley chun wrote: > welcome to Python!! i too, have (recently) been interested in COM > programming, so much so that i added some material... > from time import sleep > import win32com.client as win32 > > def excel(): > xl = win32.gencache.EnsureDispatch('Excel.Application') > ss = xl.

creating many similar properties

2006-10-17 Thread Lee Harr
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm) But what if I have a whole bunch of these pwm properties? I made this: class

Re: why should dict not be callable?

2006-10-17 Thread georgeryoung
On Oct 17, 3:37 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > A couple of times recently I've come across this problem: I have a > > large list to sort and I need to the the "key=function" argument to > > sort appropriately. But I actually have the key mapping in a b

Re: Python Web Site?

2006-10-17 Thread hg
[EMAIL PROTECTED] wrote: > wxpython is down for me also it did work befour my job interview at > around noon central. It may have been my wx.grid question for my > project finaly did the system in. I followed all the directions but > can only post and get one responce and I can't respond to the q

Re: Python Web Site?

2006-10-17 Thread [EMAIL PROTECTED]
wxpython is down for me also it did work befour my job interview at around noon central. It may have been my wx.grid question for my project finaly did the system in. I followed all the directions but can only post and get one responce and I can't respond to the questions (I get no email so I can

Re: Python wrapper for C++ core

2006-10-17 Thread handful of nothing
IMHO, What I learned with the time and of course with books =) : Python gives you rapid turnaround. You can try different approaches and archictetures to solve the problem in much faster way than you would with C++. When you really need to crunch numbers, and numpy/othermodule is not enough for

Re: Python wrapper for C++ core

2006-10-17 Thread Robert Heller
At 17 Oct 2006 16:05:40 -0700 [EMAIL PROTECTED] wrote: > > Hi All > > Apologies in advance for the pretty basic question - but I can't seem > to find an answer anywhere else. > > I am developing a fluid sim in C++ and have heard that many people use > Python in conjunction with C++ for this sor

Re: pylab package dependencies

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> wrote: > > > > I assume you are telling me to install ipython from a tar distribution > > using setup etc. I originally installed it from the SciPy Super Pack > > which apparently put in the site packages, but neglected the scrip

Boa Constructor error: "No section:editor"

2006-10-17 Thread Pat Nystrom
Hi, In case you haven't solved this already, the problem seems to be an empty or corrupt config file - \documents and settings\username\.boa-constructor\Explorer.msw.cfg. (at least under windows - don't know where it'd be in linux/elsewhere) When I deleted it, the next invocation of boa worked

Re: Python wrapper for C++ core

2006-10-17 Thread Jason
[EMAIL PROTECTED] wrote: > Hi All > > Apologies in advance for the pretty basic question - but I can't seem > to find an answer anywhere else. > > I am developing a fluid sim in C++ and have heard that many people use > Python in conjunction with C++ for this sort of thing (especially in > games de

OSDC 2006's fabulous keynotes

2006-10-17 Thread Richard Jones
Book before 31st October to save $50 and get a free conference t-shirt! Registrations are open for the Open Source Developers' Conference 2006: http://www.osdc.com.au/registration/index.html The conference is running in Melbourne from the 6th - 8th December, with a day of tutorials on the 5th.

Python wrapper for C++ core

2006-10-17 Thread holly . woodland
Hi All Apologies in advance for the pretty basic question - but I can't seem to find an answer anywhere else. I am developing a fluid sim in C++ and have heard that many people use Python in conjunction with C++ for this sort of thing (especially in games dev). What I can't understand why you wo

Re: Python Web Site?

2006-10-17 Thread johnf
"Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote: > Tim Chase wrote: >>> Is there a problem with the Python and wxPython web sites? >>> I cannot seem to get them up >> >> Sounds like someone needs some pyagra... >> >> (grins, ducks, and runs) >> > > Interesting. I thought at first i

right curly quote and unicode

2006-10-17 Thread TiNo
Hi all,I am trying to compare my Itunes Library xml to the actual files on my computer.As the xml file is in UTF-8 encoding, I decided to do the comparison of the filenames in that encoding.It all works, except with one file. It is named 'The Chemical Brothers-Elektrobank-04 - Don't Stop the Rock (

Re: string splitting

2006-10-17 Thread stefaan
> Anyone have any ideas? l = "wisconsin_state.txt" l.split(".")[0].split("_")[-1] Explanation: --- the split(".")[0] part takes everything before the "." the split("_")[-1] part selects in the last element in the list of substrings which are separated by "_" -- http://mail.pyth

Re: block devices

2006-10-17 Thread rick
Diez B. Roggisch wrote: > Reading it? Using read? > > f = open("/dev/foo") > f.read(1) > > Diez Wow, I didn't realize it was that simple. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: pylab package dependencies

2006-10-17 Thread Robert Kern
Lou Pecora wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> wrote: > >> Lou Pecora wrote: >> >>> The only problem I'm having is getting ipython to run. Not installed in >>> /usr/local/bin (although all other IPython files look to be installed in >>> /Library/Framewaor

Re: Python Web Site?

2006-10-17 Thread Richard Jones
*% <"mike$#at^&nospam!%trausch(*%)us"> wrote: > Is there a problem with the Python and wxPython web sites? I cannot > seem to get them up, and I am trying to find some documentation... The machine hosting www.python.org rebooted in response to a power failure. Richard -- http://mail.pytho

Re: Python Web Site?

2006-10-17 Thread Michael B. Trausch
Tim Chase wrote: >> Is there a problem with the Python and wxPython web sites? >> I cannot seem to get them up > > Sounds like someone needs some pyagra... > > (grins, ducks, and runs) > Interesting. I thought at first it was a problem with Python's sites... but I got through to the Python sit

Re: Python Web Site?

2006-10-17 Thread hg
Tim Chase wrote: >> Is there a problem with the Python and wxPython web sites? >> I cannot seem to get them up > > Sounds like someone needs some pyagra... > > (grins, ducks, and runs) > > the-red-or-blue-pill'ly yers, > > -tkc > > > > > lol ... got to rememner that one ! hg -- http://

Re: Python Web Site?

2006-10-17 Thread Tim Chase
> Is there a problem with the Python and wxPython web sites? > I cannot seem to get them up Sounds like someone needs some pyagra... (grins, ducks, and runs) the-red-or-blue-pill'ly yers, -tkc -- http://mail.python.org/mailman/listinfo/python-list

Python Web Site?

2006-10-17 Thread *%
Is there a problem with the Python and wxPython web sites? I cannot seem to get them up, and I am trying to find some documentation... Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about list

2006-10-17 Thread Larry Bates
Larry Bates wrote: > [EMAIL PROTECTED] wrote: >> Hello: >> Variable 'a' has the next values: >> [[1,1],[2,2]] >> and I want to take a to b as: >> [[1,1,'='],[2,2,'=']] >> How can I do this with only one line of instruction? >> Thanks!! >> > To copy a list use: > > b=a[:] > > -Larry Seems I may ha

Re: block devices

2006-10-17 Thread Diez B. Roggisch
rick schrieb: > What's the best way to read a byte of data directly from a block device > (a scsi hard drive) on Linux using Python? Reading it? Using read? f = open("/dev/foo") f.read(1) Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: pylab package dependencies

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> wrote: > Lou Pecora wrote: > > > The only problem I'm having is getting ipython to run. Not installed in > > /usr/local/bin (although all other IPython files look to be installed in > > /Library/Framewaorks/python..blah/site-pack

Re: making a valid file name...

2006-10-17 Thread Neil Cerutti
On 2006-10-17, Edgar Matzinger <[EMAIL PROTECTED]> wrote: > Hi, > > On 10/17/2006 06:22:45 PM, SpreadTooThin wrote: >> valid = >> ':./,^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' >> > > not specifying the OS platform, these are not all the > characters that may occur in a fil

block devices

2006-10-17 Thread rick
What's the best way to read a byte of data directly from a block device (a scsi hard drive) on Linux using Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Return returns nothing in recursive function

2006-10-17 Thread yellowalienbaby
Fredrik Lundh wrote: > Matthew Warren wrote: > > > I have the following code that implements a simple recursive tree like > > structure. > > > > The trouble is with the GetTreeBranch function, the print statement > > prints a valid value but the return immediatley afterward doesn't return > > anyt

Re: command text parsing and hints displaying on user input.

2006-10-17 Thread Kent Johnson
Andy wrote: > Hi guys, > > I'm writing a program with a feature of accepting user input as command > text and parsing it to correct function calls...example: > > "5 minutes later"/"5 min later"/"5 minute later"/"after 5 minutes"... > are being parsed as the same rule so the system will call a lat

Re: why should dict not be callable?

2006-10-17 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > A couple of times recently I've come across this problem: I have a > large list to sort and I need to the the "key=function" argument to > sort appropriately. But I actually have the key mapping in a big > dictionary. so use a bound method: L.sort(key=key_dict.g

Re: why should dict not be callable?

2006-10-17 Thread Robert Kern
[EMAIL PROTECTED] wrote: > A couple of times recently I've come across this problem: I have a > large list to sort and I need to the the "key=function" argument to > sort appropriately. But I actually have the key mapping in a big > dictionary. Now I have to make an intermediary function: > > d

Re: why should dict not be callable?

2006-10-17 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > A couple of times recently I've come across this problem: I have a > large list to sort and I need to the the "key=function" argument to > sort appropriately. But I actually have the key mapping in a big > dictionary. Now I have to make an intermediary function: > > d

Using pexpect with 'sudo'

2006-10-17 Thread [EMAIL PROTECTED]
I'm having a problem using pexpect with 'sudo' on Ubuntu 6.06 (Dapper). Here's the program: #!/usr/bin/env python import pexpect import sys child = pexpect.spawn("sudo apt-get update") child.logfile = sys.stdout try: i = child.expect(["Password:", pexpect.EOF, pexpect.TIMEOUT]) if i ==

Re: why should dict not be callable?

2006-10-17 Thread Brett Hoerner
[EMAIL PROTECTED] wrote: > A couple of times recently I've come across this problem: I have a > large list to sort and I need to the the "key=function" argument to > sort appropriately. But I actually have the key mapping in a big > dictionary. Is this what you mean? I suppose the lambda is an

Re: HTML Encoded Translation

2006-10-17 Thread Dave
Got it, great. This worked like a charm. I knew I was barking up the wrong tree with urllib, but I didn't know which tree to bark up... Thanks! Fredrik Lundh wrote: > Dave wrote: > > > How can I translate this: > > > > gi > > > > to this: > > > > "gi" > > the easiest way is to run it through an H

why should dict not be callable?

2006-10-17 Thread georgeryoung
A couple of times recently I've come across this problem: I have a large list to sort and I need to the the "key=function" argument to sort appropriately. But I actually have the key mapping in a big dictionary. Now I have to make an intermediary function: def key_fn(key): return key_dict[ke

Re: Book about database application development?

2006-10-17 Thread Wolfgang Keller
> Maybe you would like Martin Fowler's "Patterns of Enterprise Application > Architecture" http://martinfowler.com/books.html#eaa Thanks, this one is already on my list, just like "Data Access Patterns" from the same publisher. > Examples are mostly Java and C#, sorry! Which is precisely the

Re: where to I find:

2006-10-17 Thread Gabriel Genellina
At Tuesday 17/10/2006 13:50, [EMAIL PROTECTED] wrote: Can somebody tell me where to I find module name: "tele" It's not a standard module. Look on the documentation for the application/packages you are using. -- Gabriel Genellina Softlab SRL _

Re: ADO with Python

2006-10-17 Thread geskerrett
Ralf wrote: > Is their anybody with xperience in using the both and can provide me with > some xamples. > > Thx a lot > Ralf I found the tutorial on this site helpful. http://www.mayukhbose.com/python/ado/index.php -- http://mail.python.org/mailman/listinfo/python-list

Re: stdout not flushed before os.execvp()

2006-10-17 Thread [EMAIL PROTECTED]
If you wanted to make sure stdio was flushed you could always do... sys.stdout.write("Message\n") sys.stdout.flush() Thomas Guettler wrote: > Hi, > > I noticed, that sys.stout does not get flushed before the process is > replaced. The last print statements (before execvp()) disappear. > > It only

Re: OT: What's up with the starship?

2006-10-17 Thread Gabriel Genellina
At Tuesday 17/10/2006 08:58, A.M. Kuchling wrote: It might well be difficult to exploit to run arbitrary code because your exploit code needs to have no unprintable bytes in it; repr() turns unprintable characters into \xNN, after all, and isn't doing a straightforward string copy. (But hackers

Re: external file closed

2006-10-17 Thread Jordan
I think the win32all extension includes the findwindow() fuction, so you could make a loop that looks for the window name (or class if it takes that) of the pdf. You can also loop through a list of running processes looking for whatever the process name is. Note that both of these have serious lo

Re: Best IDE?

2006-10-17 Thread Christoph Haas
On Saturday 14 October 2006 00:40, [EMAIL PROTECTED] wrote: > Ahmer wrote: > > What do you guys use? > > vim > > Like: > > Built-in python interpreter so you can do any editor customizations in > Python > Good multilanguage support (Python, but also C, C++, Java, HTML, XML, > SQL, and dozens of oth

Re: external file closed

2006-10-17 Thread [EMAIL PROTECTED]
You may be able to use os.popen() kilnhead wrote: > I am opening a file using os.start('myfile.pdf') from python. How can I > know when the user has closed the file so I can delete it? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Encoded Translation

2006-10-17 Thread Sybren Stuvel
Dave enlightened us with: > How can I translate this: > > gi > > to this: > > "gi" > > I've tried urllib.unencode and it doesn't work. As you put so nicely in the subject: it is HTML encoding, not URL encoding. Those are two very different things! Try a HTML decoder, you'll have more luck with tha

Re: pylab package dependencies

2006-10-17 Thread Robert Kern
Lou Pecora wrote: > The only problem I'm having is getting ipython to run. Not installed in > /usr/local/bin (although all other IPython files look to be installed in > /Library/Framewaorks/python...blah/site-packages). I'm still searching > the web sites for answers. Create a file ~/.pydist

Re: HTML Encoded Translation

2006-10-17 Thread Fredrik Lundh
Dave wrote: > How can I translate this: > > gi > > to this: > > "gi" the easiest way is to run it through an HTML or XML parser (depending on what the source is). or you could use something like this: import re def fix_charrefs(text): def fixup(m): text = m.

Re: pylab package dependencies

2006-10-17 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Robert Kern <[EMAIL PROTECTED]> wrote: > > > > Is pylab part of matplotlib? > > Yes. > > > I always thought it was the other way > > around. I have a similar view of numpy as part of scipy. > > It is not. > > > Maybe I'm > > confused on the dependencies.

Re: Faulty encoding settings

2006-10-17 Thread Neil Cerutti
On 2006-10-17, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Neil Cerutti wrote: >> I'm writing an application that needs all internal character data >> to be stored in iso-8859-1. It also must allow input and output >> using stdin and stdout. > > Give the user the a

Re: Faulty encoding settings

2006-10-17 Thread Martin v. Löwis
Neil Cerutti schrieb: > The Cygwin binary I have (2.4.3) reports sys.stdin.encoding as > 'US-ASCII', which is quite wrong. A Cygwin terminal uses, as far > as I can tell, iso-8859-1. This renders the above construction > useless if the user enters any character codes above 128. > Using raw_input in

HTML Encoded Translation

2006-10-17 Thread Dave
How can I translate this: gi to this: "gi" I've tried urllib.unencode and it doesn't work. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

what are XLRDError and CompDocError?

2006-10-17 Thread kath
Hi, i am facing some problems with opening an excel file. I am using XLRD module. I am getting XLRDError: Can't find workbook in OLE2 compound document and CompDocError: Not a whole number of sectors exceptions in seperate try on different files. 1.Does any one know anout these exceptions? wha

Re: external file closed

2006-10-17 Thread utabintarbo
Jerry wrote: > On Oct 17, 12:43 pm, "kilnhead" <[EMAIL PROTECTED]> wrote: > > I am opening a file using os.start('myfile.pdf') from python. How can I > > know when the user has closed the file so I can delete it? Thanks. > > I assume you mean os.startfile. There is no way to do this directly. > o

Re: dynamic module loading via __import__, nonetype?

2006-10-17 Thread Gabriel Genellina
At Monday 16/10/2006 13:33, John Allman wrote: If i manually import a module, this method works a treat, however if i attempt to dynamically load a module at runtime the create method fails with the following error: TypeError: 'NoneType' object is not callable Can you cut down a reproducible

Re: external file closed

2006-10-17 Thread Jerry
On Oct 17, 12:43 pm, "kilnhead" <[EMAIL PROTECTED]> wrote: > I am opening a file using os.start('myfile.pdf') from python. How can I > know when the user has closed the file so I can delete it? Thanks. I assume you mean os.startfile. There is no way to do this directly. os.startfile simply hands

Re: A question about list

2006-10-17 Thread rzed
[EMAIL PROTECTED] wrote in news:1161102973.920895.141500 @i42g2000cwa.googlegroups.com: > Hello: > Variable 'a' has the next values: > [[1,1],[2,2]] > and I want to take a to b as: > [[1,1,'='],[2,2,'=']] > How can I do this with only one line of instruction? > Thanks!! > b = [[x,y,'='] for (x,y

Re: building extensions for Windows Python

2006-10-17 Thread Sybren Stuvel
JW enlightened us with: > Thanks to Michael and Nick, I can now cross-compile my Pyrex > extensions for bog-standard Python 2.5 [...] I can now use Linux to > cross-build my extension for Windows, and my preliminary testing > (under WINE -- See the original post. I must adhere to my > employment c

external file closed

2006-10-17 Thread kilnhead
I am opening a file using os.start('myfile.pdf') from python. How can I know when the user has closed the file so I can delete it? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: making a valid file name...

2006-10-17 Thread Tim Chase
>> If you're doing it on a time-critical basis, it might help to >> make "valid" a set, which should have O(1) membership testing, >> rather than using the "in" test with a string. I don't know >> how well the find() method of a string performs in relationship >> to "in" testing of a set. Test an

Re: building extensions for Windows Python

2006-10-17 Thread JW
Thanks to Michael and Nick, I can now cross-compile my Pyrex extensions for bog-standard Python 2.5. As I stumbled around in the dark trying to bump into a solution, I was bolstered by the belief that at least two other people had found the light at the end of the tunnel. I had been using a cruft

Re: pylab package dependencies

2006-10-17 Thread Robert Kern
Lou Pecora wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> wrote: > >> I presume what you did was something like this: >> >>from matplotlib import pylab >>[N,x] = hist(eig, 10) >> >> What you actually want is this: >> >>from matplotlib import pylab >>[N,

Re: Looking for assignement operator

2006-10-17 Thread Bruno Desthuilliers
Jerry wrote: > Okay, very well, then I put a couple of extra 'self' identifiers in > there when I hand-copied the code over. You should try copy/paste - it's both safer and less work !-) > That would be my mistake for > letting my fingers do the walking and forgetting my brain. Is there > anyth

Re: making a valid file name...

2006-10-17 Thread Neil Cerutti
On 2006-10-17, Tim Chase <[EMAIL PROTECTED]> wrote: > If you're doing it on a time-critical basis, it might help to > make "valid" a set, which should have O(1) membership testing, > rather than using the "in" test with a string. I don't know > how well the find() method of a string performs in re

Re: Faulty encoding settings

2006-10-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Neil Cerutti wrote: > I'm writing an application that needs all internal character data > to be stored in iso-8859-1. It also must allow input and output > using stdin and stdout. > > This works just fine with the Windows binary of Python. > sys.stdin.encoding is correctly

Re: making a valid file name...

2006-10-17 Thread Edgar Matzinger
Hi, On 10/17/2006 06:22:45 PM, SpreadTooThin wrote: > valid = > ':./,^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' > not specifying the OS platform, these are not all the characters that may occur in a filename: '[]{}-=", etc. And '/' is NOT valid. On a unix platform. And

Re: loop iterators?

2006-10-17 Thread Tim Chase
> l = ['a','b','c'] > for e in l: >print l, i >i = i + 1 > > Is there a way to get rid of the i processing in this script? > Sorry I'm still trying to learn python tricks here... for i, e in enumerate(l): print l, i -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: loop iterators?

2006-10-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, SpreadTooThin wrote: > Hi I need to get a for loop to give me an element from a list and an > index number... > for example: > > i = 0 > l = ['a','b','c'] > for e in l: >print l, i >i = i + 1 > > Is there a way to get rid of the i processing in this script? for i

Re: making a valid file name...

2006-10-17 Thread Tim Chase
> Sometimes the user inputs characters that aren't valid > characters for a file or directory name. Here are the > characters that I consider to be valid characters... > > valid = > ':./,^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ' Just a caveat, as colons and slashes can gi

loop iterators?

2006-10-17 Thread SpreadTooThin
Hi I need to get a for loop to give me an element from a list and an index number... for example: i = 0 l = ['a','b','c'] for e in l: print l, i i = i + 1 Is there a way to get rid of the i processing in this script? Sorry I'm still trying to learn python tricks here... -- http://mail.pyt

Re: Need a strange sort method...

2006-10-17 Thread Ron Adam
Ron Adam wrote: > Neil Cerutti wrote: >> On 2006-10-16, Tim Chase <[EMAIL PROTECTED]> wrote: >>> If you need it in a flat list, rather than as a list of >>> chunk_size lists (which are handy for iterating over in many >>> cases), there are ways of obtaining it, such as the hackish >>> >> sum([a

Re: Looking for assignement operator

2006-10-17 Thread Jerry
Okay, very well, then I put a couple of extra 'self' identifiers in there when I hand-copied the code over. That would be my mistake for letting my fingers do the walking and forgetting my brain. Is there anything else wrong with my code? -- Jerry -- http://mail.python.org/mailman/listinfo/pyt

where to I find:

2006-10-17 Thread vedran_dekovic
Hello, Can somebody tell me where to I find module name: "tele" import tele Regards, Vedran -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about list

2006-10-17 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Hello: > Variable 'a' has the next values: > [[1,1],[2,2]] > and I want to take a to b as: > [[1,1,'='],[2,2,'=']] > How can I do this with only one line of instruction? b = [item + ['='] for item in a] -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1

Re: Need a strange sort method...

2006-10-17 Thread Ron Adam
Neil Cerutti wrote: > On 2006-10-16, Tim Chase <[EMAIL PROTECTED]> wrote: >> If you need it in a flat list, rather than as a list of >> chunk_size lists (which are handy for iterating over in many >> cases), there are ways of obtaining it, such as the hackish >> > sum([a[i::chunk_size] for i in

Re: Looking for assignement operator

2006-10-17 Thread Bruno Desthuilliers
Jerry wrote: >> class MyClass:Descriptors don't work fine with old-style classes. > Interesting, I have used this construct before in Python 2.4.3 and not > run into the recursion problem you talk about. The recursion problem doesn't occur with you original code (for the good reason that there's a

Re: A question about list

2006-10-17 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hello: > Variable 'a' has the next values: > [[1,1],[2,2]] > and I want to take a to b as: > [[1,1,'='],[2,2,'=']] > How can I do this with only one line of instruction? > Thanks!! > To copy a list use: b=a[:] -Larry -- http://mail.python.org/mailman/listinfo/python-l

Re: A question about list

2006-10-17 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hello: > Variable 'a' has the next values: > [[1,1],[2,2]] > and I want to take a to b as: > [[1,1,'='],[2,2,'=']] > How can I do this with only one line of instruction? > Thanks!! >>> a = [[1,1], [2,2]] >>> map( lambda x: x + ['='], a ) [[1, 1, '='], [2, 2, '=']] >>>

Re: making a valid file name...

2006-10-17 Thread Jon Clements
SpreadTooThin wrote: > Hi I'm writing a python script that creates directories from user > input. > Sometimes the user inputs characters that aren't valid characters for a > file or directory name. > Here are the characters that I consider to be valid characters... > > valid = > ':./,^0123456789a

A question about list

2006-10-17 Thread pretoriano_2001
Hello: Variable 'a' has the next values: [[1,1],[2,2]] and I want to take a to b as: [[1,1,'='],[2,2,'=']] How can I do this with only one line of instruction? Thanks!! -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >