Re: Python Book Recommendations

2007-08-15 Thread Laurent Pointal
Azazello a écrit : > On Aug 15, 7:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: >> If I could have only one book, I would buy "Core Python, Second >> Edition," by Wesley Chun. >> >> For the record, I own: >> Core Python, Second Edition (great) >> wxPython in Action (haven't used yet) >> Beginn

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread A.T.Hofkamp
On 2007-08-15, Larry Bates <[EMAIL PROTECTED]> wrote: > > What are they teaching in schools these days? I see questions like this and > the > equally perplexing "why don't floats represent numbers exactly?" or the mildy > amusing "how do I write bytes not characters to a file" questions at least

Re: Coroutines and argument tupling

2007-08-15 Thread Marshall T. Vandegrift
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Do you really need a generator or co-routine to do this? Maybe > you can just use a closure: For my trivial example, sure -- there are lots of ways to do it. Here's a slightly better example: the `read' method of a file-like object which sequent

Re: replacement for string.printable

2007-08-15 Thread Marc 'BlackJack' Rintsch
On Wed, 15 Aug 2007 23:15:12 +0100, John K Masters wrote: > help('string') > > DESCRIPTION > Warning: most of the code you see here isn't normally used nowadays. > Beginning with Python 1.6, many of these functions are > implemented as methods on the standard string object. They used to be > impl

Re: ElementTree surprise

2007-08-15 Thread Paul Rubin
Torsten Bronger <[EMAIL PROTECTED]> writes: > > > Technically, text is nodes as all other element nodes. In the > parrot example, there is no empty textnode but no textnode at all. That is required by the xml standard? If yes, elementtree is doing the right thing, but it surprises me, I wou

Re: ElementTree surprise

2007-08-15 Thread Torsten Bronger
Hallöchen! Paul Rubin writes: > I have a doc with a bunch of fields like: > > stuff > other stuff > > and sometimes > > > > I use ElementTree to parse the doc and I use the .text attribute > to get "stuff" or "other stuff" in the spam and penguin examples. > > I'd expect .text to be

Re: Retry: Question about FutureWarning

2007-08-15 Thread Peter Otten
Steven W. Orr wrote: > I'm trying again, since no response indicates that I'm not providing > enough info. No, you were providing too much irrelevant information. It would have been better to put it that way: > Thanks guys, but that's not my question. The question is this: Why does > the call t

ElementTree surprise

2007-08-15 Thread Paul Rubin
I have a doc with a bunch of fields like: stuff other stuff and sometimes I use ElementTree to parse the doc and I use the .text attribute to get "stuff" or "other stuff" in the spam and penguin examples. I'd expect .text to be the empty string in the parrot example, but instead i

Re: moving files in a seperate thread (and/or with progress?)

2007-08-15 Thread half . italian
On Aug 15, 2:28 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to make a small batch copy tool that scans for certain files, > and copies them to a specified directory. Since the files are huge > (AVI / DIVX) typical 300 to 700 Mb, I want to provide the user with > some feedback

Re: replacement for string.printable

2007-08-15 Thread Paul McGuire
On Aug 15, 1:56 pm, John K Masters <[EMAIL PROTECTED]> wrote: > >From what I have read the string module is obsolete and should not be > > used but I am working on a project that parses printable files created > in a DOS program and creates a web page for each file. I am using the > string.printabl

Re: sub-classing the types in the builtin module datetime

2007-08-15 Thread Colin J. Williams
I posted this about 5 hours ago, but it seems to have gone astray. cjw Jay Loden wrote: > Colin J. Williams wrote: > >> I wish to sub-class (if that's the right word) datetime and to use a >> different signature for the constructor. >> >> The second part has gone smoothly, but it is diffic

Re: Coroutines and argument tupling

2007-08-15 Thread [EMAIL PROTECTED]
On Aug 15, 3:37 pm, "Marshall T. Vandegrift" <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > >> I'm trying to write a decorator which allows one to produce simple > >> coroutines by just writing a function as a generator expression > >> which re-receives it's argument

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Chris Mellon
On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Aug 15, 2:55 pm, Kevin D. Smith <[EMAIL PROTECTED]> wrote: > > On 2007-08-15 13:02:24 -0600, "Chris Mellon" <[EMAIL PROTECTED]> said: > > > > > Not easily. The recycle bin is part of the shell, and the shell api > > > calls have very com

Re: replacement for string.printable

2007-08-15 Thread Jay Loden
John K Masters wrote: >>From what I have read the string module is obsolete and should not be > used but I am working on a project that parses printable files created > in a DOS program and creates a web page for each file. I am using the > string.printable constant to determine which characters sh

Re: Module imports during object instantiation

2007-08-15 Thread Steve Holden
Ritesh Raj Sarraf wrote: > On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: >> On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> [...] > Oops!!! Looks like I completely missed this. It _did_ print the error > message. > Apologies to all for not keeping a close eye on

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Dan Stromberg - Datallegro
On Wed, 15 Aug 2007 10:42:02 -0700, mfglinux wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > don

Re: threads, mutual exclusion, and lists

2007-08-15 Thread Matt McCredie
> My question is -- are python list operations atomic? If they are not, > then I assume I need to put some mutual exclusion around the append() > and pop() calls ? They are not, but there is one included in the standard library: http://docs.python.org/dev/lib/module-Queue.html Matt -- http://mai

Re: threads, mutual exclusion, and lists

2007-08-15 Thread Martin v. Löwis
> I have two threads that share a python list. One thread adds to the > list with append(), the other thread removes items with pop(). > > My question is -- are python list operations atomic? Yes, they are in the current implementation of CPython (all versions). Notice that not *all* operations a

Re: Coroutines and argument tupling

2007-08-15 Thread Marshall T. Vandegrift
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: >> I'm trying to write a decorator which allows one to produce simple >> coroutines by just writing a function as a generator expression >> which re-receives it's arguments as a tuple from each yield. > > May I ask why? Passing it the same argument

Re: Colored text

2007-08-15 Thread Grant Edwards
On 2007-08-13, Rohan <[EMAIL PROTECTED]> wrote: > Hello, > Can some one tell me how do I get colored text. Say when I want to > write something in a text file , how do I get it colored. The PyRTF module supports colored text, and RTF is portable (mostly). -- Grant Edwards grant

Re: replacement for string.printable

2007-08-15 Thread John K Masters
On 19:03 Wed 15 Aug , Marc 'BlackJack' Rintsch wrote: > On Wed, 15 Aug 2007 19:56:01 +0100, John K Masters wrote: > > > From what I have read the string module is obsolete and [???] > > The `string` module isn't obsolete. It even contains a more or less > recent new addition: `Template`. On

Re: wxPython before MainLoop

2007-08-15 Thread Grant Edwards
On 2007-08-14, [david] <[EMAIL PROTECTED]> wrote: > Steve, it wasn't me that raised the comparison > with MFC. If you don't think that's a helpful > comparison, why not reply to that post instead? > > I don't mind Björn's suggestion that I don't > know what I'm talking about, because I started > i

Re: sub-classing the types in the builtin module datetime

2007-08-15 Thread Colin J. Williams
Jay Loden wrote: Colin J. Williams wrote: I wish to sub-class (if that's the right word) datetime and to use a different signature for the constructor. The second part has gone smoothly, but it is difficult to access the type's methods from the sub-class instance. I'm beginni

Re: All names in the current module

2007-08-15 Thread Ian Clark
Ian Clark wrote: > Torsten Bronger wrote: >> Hallöchen! >> >> How can I get a list with all classes defined in the current module? >> Thank you! >> >> Tschö, >> Torsten. >> > > Assuming you want to see all classes in the re module: > > >>> import re > >>> help(re) #best way > >>> > >>> def is

Re: encrypting files + filestreams?

2007-08-15 Thread James Stroud
per9000 wrote: > Also I wonder if this can be solved with filestreams (Are there > streams in python? The only python file streams I found in the evil > search engine was stuff in other forums.) Check the source to: http://passerby.sf.net In it you will find the jenncrypt module that makes a file

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread kyosohma
On Aug 15, 2:55 pm, Kevin D. Smith <[EMAIL PROTECTED]> wrote: > On 2007-08-15 13:02:24 -0600, "Chris Mellon" <[EMAIL PROTECTED]> said: > > > Not easily. The recycle bin is part of the shell, and the shell api > > calls have very complicated struct parameters that are cumbersome to > > use correctly

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Francesco Guerrieri
On 8/15/07, mfglinux <[EMAIL PROTECTED]> wrote: > > > #Let's say x=3, then Period definition is > Period=Slab(Material1(12.5)+Material2(25)+Material3(12.5)) #Slab is a > python class > > I dont know how to automatize last piece of code for any x > Hello, you could use exec to create on the fly

Re: Coroutines and argument tupling

2007-08-15 Thread Bjoern Schliessmann
Marshall T. Vandegrift wrote: > I'm trying to write a decorator which allows one to produce simple > coroutines by just writing a function as a generator expression > which re-receives it's arguments as a tuple from each yield. May I ask why? Passing it the same arguments over and over is no use

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Peter Otten
mfglinux wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > done In Python you would build a list

Re: encrypting files + filestreams?

2007-08-15 Thread David Wahler
On 8/15/07, per9000 <[EMAIL PROTECTED]> wrote: > Hi python people, > > I am trying to figure out the best way to encrypt files in python. > > I've build a small script (see below) that encrypts the ubuntu 7.04 > iso file in 2 minutes (I like python :) ). > > But I have some thoughts about it. By pu

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Kevin D.Smith
On 2007-08-15 13:02:24 -0600, "Chris Mellon" <[EMAIL PROTECTED]> said: > Not easily. The recycle bin is part of the shell, and the shell api > calls have very complicated struct parameters that are cumbersome to > use correctly from ctypes. If you do the work to map the fileop > structs to ctypes y

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Shawn Milochik
On 8/15/07, mfglinux <[EMAIL PROTECTED]> wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > done > > W

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread Larry Bates
Steve Holden wrote: > Roel Schroeven wrote: >> Adam W. schreef: >>> After a fair amount of troubleshooting of why my lists were coming >>> back a handful of digits short, and the last digit rounded off, I >>> determined the str() function was to blame: >>> >> foonum >>> 0.0071299720384678782 >>

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread kyosohma
On Aug 15, 2:02 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/15/07, Kevin D.Smith <[EMAIL PROTECTED]> wrote: > > > I would like to move files and directories to the Recycle Bin on > > Windows from Python. I have found some older articles describing how > > to do this, but they require addi

Re: Who told str() to round my int()'s!!!

2007-08-15 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2007-08-11, Adam W. <[EMAIL PROTECTED]> wrote: > > After a fair amount of troubleshooting of why my lists were coming > > back a handful of digits short, and the last digit rounded off, I > > determined the str() functi

Coroutines and argument tupling

2007-08-15 Thread Marshall T. Vandegrift
Hi, I'm trying to write a decorator which allows one to produce simple coroutines by just writing a function as a generator expression which re-receives it's arguments as a tuple from each yield. For example: @coroutine def nextn(n=1): values = [] for i in itertools.count

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > On Aug 15, 11:39 am, Kevin D. Smith <[EMAIL PROTECTED]> wrote: >> I would like to move files and directories to the Recycle Bin on >> Windows from Python. I have found some older articles describing how >> to do this, but they require additional packages to be installe

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 16, 12:16 am, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > > On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > > > Or am I terribly missing something that you are trying to tell ? > > > I didn't see log = Log() in

Re: threads, mutual exclusion, and lists

2007-08-15 Thread [EMAIL PROTECTED]
On Aug 15, 1:36 pm, Scott <[EMAIL PROTECTED]> wrote: > I have two threads that share a python list. One thread adds to the > list with append(), the other thread removes items with pop(). > > My question is -- are python list operations atomic? If they are not, > then I assume I need to put some mu

threads, mutual exclusion, and lists

2007-08-15 Thread Scott
I have two threads that share a python list. One thread adds to the list with append(), the other thread removes items with pop(). My question is -- are python list operations atomic? If they are not, then I assume I need to put some mutual exclusion around the append() and pop() calls ? Thanks,

Python app to ration cell-phone minutes

2007-08-15 Thread Shawn Milochik
I wrote a little something so I could check my current minutes used to see how I was doing for the month. I only get 1,000 minutes, and I have three phones (two other family members share the plan). This way, I can (theoretically) know ahead of time if I'm trending towards going over my plan. By th

Re: encrypting files + filestreams?

2007-08-15 Thread Marshall T. Vandegrift
per9000 <[EMAIL PROTECTED]> writes: > I am trying to figure out the best way to encrypt files in python. Looking at your code and questions, you probably want to pick up a cryptography handbook of some sort (I'd recommend /Practical Cryptography/) and give it a read. > But I have some thoughts a

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
On Aug 15, 11:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > > Or am I terribly missing something that you are trying to tell ? > > I didn't see log = Log() in your example. Sorry for the > excursion. > > Are you sure os.name is 'posix

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Larry Bates
mfglinux wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > done > > Why I need this? Cause I have

Re: Layer 2 socket connection

2007-08-15 Thread alisonken1
On Aug 15, 12:05 pm, "Martin v. Löwis" > If your operating system supports the PF_PACKET protocol family, you > can try to use that. Python only wraps the socket interface of the > operating system, so if the system's socket implementation has no > facility for that, Python cannot expose it to you

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Marc 'BlackJack' Rintsch
On Wed, 15 Aug 2007 10:42:02 -0700, mfglinux wrote: > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > done You want a dictionary

Re: Simple python iteration question

2007-08-15 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, BartlebyScrivener <[EMAIL PROTECTED]> wrote: >On Aug 14, 11:59 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > >> Just for my own sanity: Isn't this the third response advocating the >> use of enumerate()? Did the other responses not get through, or was >> this a

Re: Layer 2 socket connection

2007-08-15 Thread Martin v. Löwis
> I'm looking at trying to write a python script to connect to a layer 2 > bridge (no IP available). > > Looking at the sockets function, it's not clear if I can connect using > only the mac address - it appears to want either a broadcast address > or a specific IP address. > > Can anyone give me

Re: All names in the current module

2007-08-15 Thread Ian Clark
Torsten Bronger wrote: > Hallöchen! > > How can I get a list with all classes defined in the current module? > Thank you! > > Tschö, > Torsten. > Assuming you want to see all classes in the re module: >>> import re >>> help(re) #best way >>> >>> def isclass(cls): ... try: ...

Re: replacement for string.printable

2007-08-15 Thread Marc 'BlackJack' Rintsch
On Wed, 15 Aug 2007 19:56:01 +0100, John K Masters wrote: > From what I have read the string module is obsolete and […] The `string` module isn't obsolete. It even contains a more or less recent new addition: `Template`. Only the functions that are also available as methods on `str` are depreca

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Chris Mellon
On 8/15/07, Kevin D.Smith <[EMAIL PROTECTED]> wrote: > I would like to move files and directories to the Recycle Bin on > Windows from Python. I have found some older articles describing how > to do this, but they require additional packages to be installed. I'm > working on a plugin for an exist

Re: encrypting files + filestreams?

2007-08-15 Thread Larry Bates
per9000 wrote: > Hi python people, > > I am trying to figure out the best way to encrypt files in python. > > I've build a small script (see below) that encrypts the ubuntu 7.04 > iso file in 2 minutes (I like python :) ). > > But I have some thoughts about it. By pure luck (?) this file happene

replacement for string.printable

2007-08-15 Thread John K Masters
>From what I have read the string module is obsolete and should not be used but I am working on a project that parses printable files created in a DOS program and creates a web page for each file. I am using the string.printable constant to determine which characters should be kept; the files conta

Re: Module imports during object instantiation

2007-08-15 Thread Neil Cerutti
On 2007-08-15, Ritesh Raj Sarraf <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: > >>> >>> Doesn't __init__ get called automatically ? >> >> It gets called automatically when you construct an instance of >> the class in which it's defined. > > I am a little confused by your statements now. > > In

Re: All names in the current module

2007-08-15 Thread Lawrence Oluyede
Fabio Z Tessitore <[EMAIL PROTECTED]> wrote: > to get names' list you can simply call globals() Not strictly true. globals() returns the current's scope global vars. If you import a module in the current scope globals() won't display the names inside it. -- Lawrence, oluyede.org - neropercaso.it

Layer 2 socket connection

2007-08-15 Thread alisonken1
Hello all - I'm looking at trying to write a python script to connect to a layer 2 bridge (no IP available). Looking at the sockets function, it's not clear if I can connect using only the mac address - it appears to want either a broadcast address or a specific IP address. Can anyone give me a

Re: Simple python iteration question

2007-08-15 Thread Roel Schroeven
Dennis Lee Bieber schreef: > On Wed, 15 Aug 2007 13:39:57 -0300, "Gabriel Genellina" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> "Never underestimate the bandwidth of a station wagon full of tapes >> hurtling down the highway" >> (Andrew S. Tanenbaum, Computer Network

Re: Hijack! Different book: (was: Opinions about this new Python book?

2007-08-15 Thread kyosohma
On Aug 15, 12:52 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 15 Aug 2007 08:32:30 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > More on the subject...the writer is very conversational in tone and it > > makes for a light read in the first 1 1/2 chapter

Re: Module imports during object instantiation

2007-08-15 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: >> >> Doesn't __init__ get called automatically ? > > It gets called automatically when you construct an instance of > the class in which it's defined. I am a little confused by your statements now. In my earlier posts in the same thread, I gave some code example which was s

Re: All names in the current module

2007-08-15 Thread Fabio Z Tessitore
Il Wed, 15 Aug 2007 19:01:17 +0200, Lawrence Oluyede ha scritto: > Torsten Bronger <[EMAIL PROTECTED]> wrote: >> How can I get a list with all classes defined in the current module? >> Thank you! > > [EMAIL PROTECTED] ~ % cat > t.py > class A: pass > > [EMAIL PROTECTED] ~ % python > Python 2.5.1

Re: ming on win32 anyone ? [help a noob]

2007-08-15 Thread daz.diamond
[EMAIL PROTECTED] wrote: > On Aug 15, 9:46 am, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: >> On Aug 15, 8:03 am, "daz.diamond" <[EMAIL PROTECTED]> wrote: >> >>> hoping someone can help ... >>> how do I install ming (with python) on win32? have downloaded the tar.gz >>> of ming-0.3.0 which doe

Re: sub-classing the types in the builtin module datetime

2007-08-15 Thread Jay Loden
Colin J. Williams wrote: > I wish to sub-class (if that's the right word) datetime and to use a > different signature for the constructor. > > The second part has gone smoothly, but it is difficult to access the > type's methods from the sub-class instance. > > I'm beginning to wonder whether i

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread kyosohma
On Aug 15, 11:39 am, Kevin D. Smith <[EMAIL PROTECTED]> wrote: > I would like to move files and directories to the Recycle Bin on > Windows from Python. I have found some older articles describing how > to do this, but they require additional packages to be installed. I'm > working on a plugin fo

"Variable variable name" or "variable lvalue"

2007-08-15 Thread mfglinux
Hello to everybody I would like to know how to declare in python a "variable name" that it is in turn a variable In bash shell I would wrote sthg like: for x in `seq 1 3` do M$i=Material(x) #Material is a python class done Why I need this? Cause I have a python module that obliges me to build

Re: sub-classing the types in the builtin module datetime

2007-08-15 Thread Michael Amrhein
Colin J. Williams wrote: > I wish to sub-class (if that's the right word) datetime and to use a > different signature for the constructor. > > The second part has gone smoothly, but it is difficult to access the > type's methods from the sub-class instance. > What's difficult? >>> from datetim

Importing DLLs

2007-08-15 Thread Corbitt, Kyle
I'm running Linux with Python 2.3. I have a C shared object file (*.so) and I need to be able to call its functions from within Python. I have found a couple of Python modules that allow me to do this (dl, ctypes) but unfortunately I am only able to get them to return integers, even for functi

Re: Python Book Recommendations

2007-08-15 Thread Beliavsky
On Aug 15, 10:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > If I could have only one book, I would buy "Core Python, Second > Edition," by Wesley Chun. I have bought about half a dozen Python books but will purchase only Python 3 books in the future, when they become available. I wonder whe

Re: ming on win32 anyone ? [help a noob]

2007-08-15 Thread Thomas Heller
daz.diamond schrieb: > hoping someone can help ... > > how do I install ming (with python) on win32? have downloaded the > tar.gz of ming-0.3.0 which doesn't have a handy self-installer, and > I'm absolutely foxed as to what to do next ... the install > instructions in the package seem to be linux

Re: Combinatorial of elements in Python?

2007-08-15 Thread Sebastian Bassi
On 8/15/07, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > What is unclear here is in what order the keys should be visited. The > following assumes that the keys should be considered in alphanumeric order. Yes, my fault. The orden should be given by a string, like: DCDBA Using this dictionay. A={'

Re: All names in the current module

2007-08-15 Thread Lawrence Oluyede
Torsten Bronger <[EMAIL PROTECTED]> wrote: > How can I get a list with all classes defined in the current module? > Thank you! [EMAIL PROTECTED] ~ % cat > t.py class A: pass [EMAIL PROTECTED] ~ % python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)

Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Kevin D.Smith
I would like to move files and directories to the Recycle Bin on Windows from Python. I have found some older articles describing how to do this, but they require additional packages to be installed. I'm working on a plugin for an existing project and only have the standard library to work wi

how to convert a c program to java program

2007-08-15 Thread Fred Shu (fshu)
I heard I need to port C program to JPython first and compile it to native JAVA. I don't know anything about JPython. Is there a tool to do the porting? If not, what is the quickest way to learn JPython? Thanks, Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: Combinatorial of elements in Python?

2007-08-15 Thread Mikael Olofsson
Sebastian Bassi wrote: > Hello, could you do it for an indefinite number of elements? You did > it for a fixed (2) number of elements. I wonder if this could be done > for all members in a dictionary. What is unclear here is in what order the keys should be visited. The following assumes that t

Re: Simple python iteration question

2007-08-15 Thread Gabriel Genellina
En Wed, 15 Aug 2007 10:37:16 -0300, Cameron Laird <[EMAIL PROTECTED]> escribi�: > Shawn Milochik <[EMAIL PROTECTED]> wrote: >> Just for my own sanity: Isn't this the third response advocating the >> use of enumerate()? Did the other responses not get through, or was >> this a time-delay thing? >

Re: Python Book Recommendations

2007-08-15 Thread vasudevram
On Aug 15, 8:34 pm, [EMAIL PROTECTED] wrote: > On Aug 15, 10:30 am, Azazello <[EMAIL PROTECTED]> wrote: > > > > > On Aug 15, 7:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > > > If I could have only one book, I would buy "Core Python, Second > > > Edition," by Wesley Chun. > > > > For the r

All names in the current module

2007-08-15 Thread Torsten Bronger
Hallöchen! How can I get a list with all classes defined in the current module? Thank you! Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus Jabber ID: [EMAIL PROTECTED] (See http://ime.webhop.org for ICQ, MSN, etc.) -- htt

Re: ctypes windll question

2007-08-15 Thread sturlamolden
On Aug 14, 11:45 am, Tzury <[EMAIL PROTECTED]> wrote: > I followed the tutorial about ctypes and I still cannot figure out how > to call a method of a calss within the dll. ctypes interfaces with C, not C++. C++ compilers do various forms of name manging, create virtual tables, etc. that are comp

Re: closing StringIO objects

2007-08-15 Thread Neil Cerutti
On 2007-08-15, Alex Martelli <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: >> The documentation says the following about StringIO.close: >> >> close( ) >> Free the memory buffer. >> >> Or else... what? > > Or else the memory buffer sticks around, so you can keep > ca

Re: Guitar Reviews

2007-08-15 Thread Steve Holden
Dustan wrote: > On Aug 15, 7:32 am, [EMAIL PROTECTED] wrote: > > op.mother.speak() > Congratulations! You've just given your email address to millions of > people across Usenet! > What do you have to say for yourself? Probably something along the lines of "that's OK, it's disposable so I d

Re: moving files in a seperate thread (and/or with progress?)

2007-08-15 Thread kyosohma
On Aug 15, 4:28 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to make a small batch copy tool that scans for certain files, > and copies them to a specified directory. Since the files are huge > (AVI / DIVX) typical 300 to 700 Mb, I want to provide the user with > some feedback

Re: Opinions about this new Python book?

2007-08-15 Thread Alex Martelli
Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > For some reason, the author makes the claim that the term > > "Predicate" is "bandied about quite a bit in the literature" of > > Python. I have 17 or so Python books and I don't think I've >

Re: Simple python iteration question

2007-08-15 Thread BartlebyScrivener
On Aug 14, 11:59 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > Just for my own sanity: Isn't this the third response advocating the > use of enumerate()? Did the other responses not get through, or was > this a time-delay thing? > > Thanks, > Shawn Look at the timestamps. All within ten minu

sub-classing the types in the builtin module datetime

2007-08-15 Thread Colin J. Williams
I wish to sub-class (if that's the right word) datetime and to use a different signature for the constructor. The second part has gone smoothly, but it is difficult to access the type's methods from the sub-class instance. I'm beginning to wonder whether it might might be simpler to write my o

Re: closing StringIO objects

2007-08-15 Thread Alex Martelli
Neil Cerutti <[EMAIL PROTECTED]> wrote: > The documentation says the following about StringIO.close: > > close( ) > Free the memory buffer. > > Or else... what? Or else the memory buffer sticks around, so you can keep calling getvalue as needed. I believe the freeing will happen anyway,

Re: Python, Sharepoint, .NET, NTLM

2007-08-15 Thread kyosohma
On Aug 15, 10:11 am, frikk <[EMAIL PROTECTED]> wrote: > Hey everyone, > I need to authenticate with a Sharepoint server. It looks to be > using 'NTLM' authentication. I've looked on the newsgroup and it > looks like there has been talk of using python and NTLM but no > definite solutions are app

Re: Opinions about this new Python book?

2007-08-15 Thread Neil Cerutti
On 2007-08-15, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For some reason, the author makes the claim that the term > "Predicate" is "bandied about quite a bit in the literature" of > Python. I have 17 or so Python books and I don't think I've > ever seen this used in conjunction with Python...

closing StringIO objects

2007-08-15 Thread Neil Cerutti
The documentation says the following about StringIO.close: close( ) Free the memory buffer. Or else... what? -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Book Recommendations

2007-08-15 Thread kyosohma
On Aug 15, 10:30 am, Azazello <[EMAIL PROTECTED]> wrote: > On Aug 15, 7:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > > If I could have only one book, I would buy "Core Python, Second > > Edition," by Wesley Chun. > > > For the record, I own: > > Core Python, Second Edition (great) > > wxP

Re: Opinions about this new Python book?

2007-08-15 Thread kyosohma
On Aug 14, 1:43 pm, [EMAIL PROTECTED] wrote: > On Aug 14, 12:46 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > > > > Yes, please post back to the list. I saw this book on Amazon, but > > there's no table of contents listed, nor is there one on the > > publisher's site. > > > Thanks, > > Shawn

Re: Python Book Recommendations

2007-08-15 Thread Azazello
On Aug 15, 7:47 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > If I could have only one book, I would buy "Core Python, Second > Edition," by Wesley Chun. > > For the record, I own: > Core Python, Second Edition (great) > wxPython in Action (haven't used yet) > Beginning Python (barely used) > P

Re: Memory leak when creating lots of object

2007-08-15 Thread Paul Moore
On 14 Aug, 05:57, Godzilla <[EMAIL PROTECTED]> wrote: > Hello, > > I have a program that create and pop an object off a queue, but it is > experiencing some memory leakage. I have been unable to detect where > the memory leakage occur. The strange thing is when i replace the > object creation with

Python, Sharepoint, .NET, NTLM

2007-08-15 Thread frikk
Hey everyone, I need to authenticate with a Sharepoint server. It looks to be using 'NTLM' authentication. I've looked on the newsgroup and it looks like there has been talk of using python and NTLM but no definite solutions are apparent. Can anyone provide me with any kind of help on this is

Re: Combinatorial of elements in Python?

2007-08-15 Thread Thomas Nelson
On Aug 15, 8:39 am, "Sebastian Bassi" <[EMAIL PROTECTED]> wrote: > That was easy :) > What about extending it for N elements inside the dictionary? Sounds > like a work for a recursive function. Here's my attempt: [code] def backtrack(groups,position=0, answer=''): if position==len(groups)

Re: ming on win32 anyone ? [help a noob]

2007-08-15 Thread kyosohma
On Aug 15, 9:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 15, 8:03 am, "daz.diamond" <[EMAIL PROTECTED]> wrote: > > > hoping someone can help ... > > > how do I install ming (with python) on win32? have downloaded the tar.gz > > of ming-0.3.0 which doesn't have a handy self-instal

Re: FM synthesis using Numpy

2007-08-15 Thread Bas
You got your math wrong. What you are calculating is: sin(2*pi*(1000+15*sin(2*pi*6*t))*t) = sin(2*pi*1000*t + 2*pi*15*sin(2*pi*6*t)*t) The 'instantaneous frequency' can be calculated by differentiating the argument of the sine and dividing by 2pi: x = sin(phi(t)) -> f_inst = d (phi(t)) / dt / (2*pi

Re: ming on win32 anyone ? [help a noob]

2007-08-15 Thread [EMAIL PROTECTED]
On Aug 15, 8:03 am, "daz.diamond" <[EMAIL PROTECTED]> wrote: > hoping someone can help ... > > how do I install ming (with python) on win32? have downloaded the tar.gz > of ming-0.3.0 which doesn't have a handy self-installer, and I'm > absolutely foxed as to what to do next ... the install instruc

Re: [Tutor] Python Book Recommendations

2007-08-15 Thread Shawn Milochik
If I could have only one book, I would buy "Core Python, Second Edition," by Wesley Chun. For the record, I own: Core Python, Second Edition (great) wxPython in Action (haven't used yet) Beginning Python (barely used) Python in a Nutshell (use as a reference, although interactive python dir() is m

Re: Using python for dynamic behavior from C++

2007-08-15 Thread [EMAIL PROTECTED]
On Aug 15, 8:35 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi all, > > I am looking into using Python to introduce dynamic behavior in my > C++, e.g. something like a simulation where objects can interact with > eachother. I know Python can be called from C++, but is it possible to > call a bi

Re: Free Air Conditioners!!!!!

2007-08-15 Thread Paul Heslop
Lepi Duja wrote: > > Air conditioning > posting this crap under different names doesn't make it any more on topic or make it any more likely we'll follow the link -- Paul (We won't die of devotion) --- Stop and Look http://www.geocities

Re: Retry: Question about FutureWarning

2007-08-15 Thread Steven W. Orr
Thanks guys, but that's not my question. The question is this: Why does the call to filterwarnings not work if it's placed inside the M1 module? Why do I have to place the call in M4 to make it work? This is more a question about how import works than it is about what the value of -1 is. ;-) O

  1   2   >