Re: bool behavior in Python 3000?

2007-07-10 Thread Alan Isaac
Bjoern Schliessmann wrote: > Is there any type named "bool" in standard Python? >>> type(True) Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: bool behavior in Python 3000?

2007-07-10 Thread Alan Isaac
Stargaming wrote: > I think Bjoern just wanted to point out that all those binary > boolean operators already work *perfectly*. >>> bool(False-True) True But reread Steven. Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: storing pickles in sql data base

2007-07-10 Thread Philippe Bouige
In article <[EMAIL PROTECTED]>, David Bear wrote: >I need to store pickled objects in postgresql. You have this : http://blog.melhase.net/articles/2006/06/06/ a-tale-of-postgresql-types-and-python http://blog.melhase.net/articles/2006/06/13/ auto-postgresql-pickles Philippe Bouige

Re: concatenate file-like objects -> file-like object

2007-07-10 Thread Marc 'BlackJack' Rintsch
On Tue, 10 Jul 2007 17:55:52 -0700, kgk wrote: > I would like to concatenate several file-like objects > to create a single file-like object. I've looked at fileinput, > however > this returns a fileinput object that is not very file-like. > > something like > # a has 50 bytes, and b has 100 byt

Re: Simple search and Display system, no need for db?

2007-07-10 Thread Marc 'BlackJack' Rintsch
On Wed, 11 Jul 2007 01:57:28 +, flit wrote: > The user goes there: > > - Choose the building -- Department and the user receive an html table > with all names . > > So the user gives two inputs and receive the names. > > Currently we are using this in mysql, This is the reason of the > deba

Re: bool behavior in Python 3000?

2007-07-10 Thread Stargaming
Steven D'Aprano wrote: > On Tue, 10 Jul 2007 23:42:01 +0200, Bjoern Schliessmann wrote: > > >>Alan G Isaac wrote: >> >> >>>My preference would be for the arithmetic operations *,+,- >>>to be given the standard interpretation for a two element >>>boolean algebra: >>>http://en.wikipedia.org/wiki/Tw

Visualizing a wav file?

2007-07-10 Thread kaens
Hey everyone, I've done a good bit of google searching, and have found quite a few different libraries available for sound processing. I was wondering if anyone with more experience would like to say which one(s) they would use for displaying the waveform of a .wav file in real-time, or at least

Re: pattern match !

2007-07-10 Thread Asun Friere
On Jul 11, 1:40 pm, [EMAIL PROTECTED] wrote: > Extract the application name with version from an RPM string like > hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0 > from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3- > Linux.RPM. Now that list-like splicin

Re: pattern match !

2007-07-10 Thread Steven D'Aprano
On Wed, 11 Jul 2007 03:40:06 +, hari.siri74 wrote: > Extract the application name with version from an RPM string like > hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0 > from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3- > Linux.RPM. Thank you for s

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Matimus
> This not only happens when get() after a set(), but with all the use cases > above. An intervening write()/read() does not change things. > But I'm not sure it is a bug really. If all % were escaped automatically, > there is no way to write a templatized value. Maybe SafeConfigParser.set > should

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Matimus
> This not only happens when get() after a set(), but with all the use cases > above. An intervening write()/read() does not change things. > But I'm not sure it is a bug really. If all % were escaped automatically, > there is no way to write a templatized value. Maybe SafeConfigParser.set > should

Re: bool behavior in Python 3000?

2007-07-10 Thread Rustom Mody
Considering bools as ints -- Pros: The ALU of any computer uses boolean gates to build an arithmetic functions. Therefore considering the base type of ints and bools to be (strings of) bits seems natural Cons: This comes from the pioneering work of Dijkstra and his coworkers) The distributive law

Re: stripping the first byte from a binary file

2007-07-10 Thread Steven D'Aprano
On Wed, 11 Jul 2007 01:06:04 +, rvr wrote: > Is there a way to edit the file in place? The best I seem to be able to > do is to use your second solution to read the file into the string, then > re-open the file for writing and put the whole thing back (minus the > first byte). Thanks. I don't

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven D'Aprano
On Tue, 10 Jul 2007 16:56:36 -0700, Paul Rubin wrote: > We had a huge discussion of this stuff when bools were introduced in > Python 2.3 or thereabouts. The current system is about the best way > that doesn't break everything in sight. But Python 3 is allowed to break backwards compatibility,

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Matimus
> I agree, but that was a trivial example to demonstrate the problem. > Writing the file out to disk writes it exactly as set(), causing a get() > to fail just the same later. No... The above statement is not true. The following code: [code] from ConfigParser import * import sys cp = SafeConfig

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven D'Aprano
On Tue, 10 Jul 2007 17:47:47 -0600, Steven Bethard wrote: >> I mean, really, does anyone *expect* True+True to give 2, or that >> 2**True even works, without having learnt that Python bools are ints? I >> doubt it. >> >> And the old Python idiom for an if...then...else expression: >> >> ["someth

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven D'Aprano
On Tue, 10 Jul 2007 16:41:58 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Pretending that False and True are just "magic names" for 0 and 1 might >> be "easier" than real boolean algebra, but that puts the cart before >> the horse. Functionality comes first: Python has

Re: bool behavior in Python 3000?

2007-07-10 Thread Alexander Schmolck
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I mean, really, does anyone *expect* True+True to give 2, or that 2**True > even works, without having learnt that Python bools are ints? I doubt it. Sure, why not? It's pretty damn useful. Ever heard of things like "indicator functions", "Iverson bra

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Hamish Moffatt
Matimus wrote: >> Should SafeConfigParser.set() be escaping automatically? > > It seems like that would be a nice feature. However, may I offer up > that if you are setting an option and then later on getting that value > back in the same program, you probably should have used some other > storage

Re: How would I write this C code in Python?

2007-07-10 Thread DeveloperX
On Jul 10, 5:05 am, Bruno Desthuilliers wrote: > Mmm... We can't tell for sure since we have no use case, but I'm not > sure that the OP wants an immutable object here. > > > or an `array.array`. > > or a StringIO. > > > And is `BLOCK` > > really just a structure with *one* member? Looks a bit o

Re: socket.makefile() buggy?

2007-07-10 Thread ahlongxp
On Jul 11, 7:51 am, [EMAIL PROTECTED] (John J. Lee) wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > ahlongxp wrote: > >> On Jul 8, 9:54 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >>> That's a pretty pejorative subject line for someone who's been > >>> programming Python [guessing by the da

pattern match !

2007-07-10 Thread hari . siri74
Extract the application name with version from an RPM string like hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0 from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3- Linux.RPM. -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread Josiah Carlson
agc wrote: > Hi Josiah, > This recipe for asynchronous communication usingsubprocesscould be used to write an expect-like tool: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > I have played with the above recipe and it is excellent, > but could you please go i

PyCon Organizers' Meeting

2007-07-10 Thread David Goodger
I'd like to hold the inaugural organizers' meeting for PyCon 2008 on Tuesday, July 17, at 2PM Eastern/1PM Central/11AM Pacific (6PM UTC). Further meetings will be every other week. The meetings will be held via Google Talk/Jabber (group chat). We'll use the 'pycon' room on conference.jabber.org.

Re: Should I use Python for these programs?

2007-07-10 Thread CC
Bjoern Schliessmann wrote: > Grant Edwards wrote: > >>Most of the graphics I do with Python is with Gnuplot (not >>really appropriate for what you want to do. >>wxWidgets/Floatcanvas might be worth looking into. > > Agreed (I'm quite sure you mean wxPython though). Also, in "wxPython > in Action"

Re: Should I use Python for these programs?

2007-07-10 Thread CC
Michele Simionato wrote: > On Jul 10, 5:09 am, CC <[EMAIL PROTECTED]> wrote: >>2. Develop a simple vector drawing program that will allow one to >>freehand draw a sketch composed of a few lines, or perhaps render text >>in a vector form. Then sample the lines with a certain (user >>configurable)

Re: Should I use Python for these programs?

2007-07-10 Thread CC
Hendrik van Rooyen wrote: > "CC" <[EMAIL PROTECTED]> wrote:[edit] >>1. Develop a simple GUI program to run on Linux and Windows which can >>send parameters and small blocks of data to an embedded microcontroller >>device via RS-232 or USB. Also display simple data (probably single >>numbers)

Re: storing pickles in sql data base

2007-07-10 Thread Gabriel Genellina
En Tue, 10 Jul 2007 20:32:01 -0300, David Bear <[EMAIL PROTECTED]> escribió: > I need to store pickled objects in postgresql. I reading through the > pickle > docs it says to always open a file in binary mode because you can't be > sure > if the pickled data is binary or text. So I have 2 qu

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Gabriel Genellina
En Tue, 10 Jul 2007 20:53:51 -0300, Matimus <[EMAIL PROTECTED]> escribió: >> Should SafeConfigParser.set() be escaping automatically? > > It seems like that would be a nice feature. However, may I offer up > that if you are setting an option and then later on getting that value > back in the same

Re: Best architecture for proxy?

2007-07-10 Thread Steve Holden
Bjoern Schliessmann wrote: > Andrew Warkentin wrote: > >> I am going to write a general-purpose modular proxy in Python. It >> will consist of a simple core and several modules for things like >> filtering and caching. I am not sure whether it is better to use >> multithreading, or to use an event

Re: serializing datetime object

2007-07-10 Thread Gabriel Genellina
En Tue, 10 Jul 2007 13:13:54 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I want to serialize datetime.datetime.now() object . I could convert it > to > string but how do I get a datetime object back from the string? > Any suggestions? Use the pickle module. -- Gabriel Genellina

Re: Where is the syntax for the dict() constructor ?! (OT)

2007-07-10 Thread Steve Holden
Hendrik van Rooyen wrote: > "Steve Holden" <[EMAIL PROTECTED]> wrote: > >> Sorry - dreadful joke. Since teeth chew, I wondered whether esteeth >> might eschew. [Graon ...] >> > > *grin* > > *Wonders if he can extend this troll to get Steve to explain what "teeth" > are.* > > ; - ) > > - H

Re: Portable general timestamp format, not 2038-limited

2007-07-10 Thread Ilya Zakharevich
[A complimentary Cc of this posting was sent to Martin Gregorie <[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>: > >> If Stephen Hawking is right, the shape of the universe > >> is such that there isn't any time "before" the big bang > >> at all. It's like asking what's north of the

Re: os.wait() losing child?

2007-07-10 Thread Jason Zheng
greg wrote: > Jason Zheng wrote: >> while (True): >> pid = os.wait() >> ... >> if (someCondition): >> break > > ... > > Are you sure that someCondition() always becomes true > when the list of pids is empty? If not, you may end > up making more wait() calls than there are children. >

Simple search and Display system, no need for db?

2007-07-10 Thread flit
Hello All, I was discussing with a friend and we get in a hot debate. We have homepage that act like a name list. The user goes there: - Choose the building -- Department and the user receive an html table with all names . So the user gives two inputs and receive the names. Currently we are u

Re: os.wait() losing child?

2007-07-10 Thread Jason Zheng
Hate to reply to my own thread, but this is the working program that can demonstrate what I posted earlier: import os from subprocess import Popen pids = {} counts = [0,0,0] for i in xrange(3): p = Popen('sleep 1', shell=True, cwd='/home', stdout=file(os.devnull,'w')) pids[p.pid] = i

Re: Parsing Help

2007-07-10 Thread Gabriel Genellina
En Tue, 10 Jul 2007 11:32:48 -0300, Robert Rawlins - Think Blue <[EMAIL PROTECTED]> escribió: > I'm looking for some help building a function which can parse some XML > for > me using ElementTree. The document is of a very consistent format and > I've > copied an example of the document belo

Re: bool behavior in Python 3000?

2007-07-10 Thread Ben Finney
Steven Bethard <[EMAIL PROTECTED]> writes: > It's much easier to explain to newcomers that *, + and - work on > True and False as if they were 1 and 0 than it is to introduce them > to a two element boolean algebra. I've found exactly the opposite. When explaining that None is a value that is not

Re: stripping the first byte from a binary file

2007-07-10 Thread rvr
On Jul 10, 6:37 pm, Jeremy Sanders wrote: > rvr wrote: > > Would someone mind showing me how to strip the first byte from a > > binary file? For some reason I can't figure this out from the binary > > file editing examples I've read. Thanks. > > Do you mean something like this? > > f = open('test.

Re: os.wait() losing child?

2007-07-10 Thread greg
Jason Zheng wrote: > while (True): > pid = os.wait() > ... > if (someCondition): > break > ... Are you sure that someCondition() always becomes true when the list of pids is empty? If not, you may end up making more wait() calls than there are children. It might be safer to do wh

concatenate file-like objects -> file-like object

2007-07-10 Thread kgk
I would like to concatenate several file-like objects to create a single file-like object. I've looked at fileinput, however this returns a fileinput object that is not very file-like. something like # a has 50 bytes, and b has 100 bytes f = FileList (open('a'), open('b')) f.read (100) # read

Re: Transfer folders to ftp

2007-07-10 Thread Gabriel Genellina
En Tue, 10 Jul 2007 05:44:09 -0300, Laurentiu <[EMAIL PROTECTED]> escribió: > i am new to python and i made some digging about how > to send files and folders to ftp server. Welcome! > i manage to send a file, but i don't know how to send > folders with subfolders in it. > > please, can someon

profiling a C++ python extension

2007-07-10 Thread rasmus
I have used gprof to profile stand alone C++ programs. I am also aware of pure python profilers. However, is there a way to get profile information on my C++ functions when they are compiled in a shared library (python extension module) and called from python. From what I can tell, gmon.out will

Re: path backslash escaping trouble

2007-07-10 Thread Gabriel Genellina
En Mon, 09 Jul 2007 22:40:04 -0300, placid <[EMAIL PROTECTED]> escribió: > I have these files; which are Merge Request (ClearCase) files that are > created by a Perl CGI script (being re-written in Python, as the HTML/ > JavaScript have been mixed with Perl, maintainability is zero) > > MergeType:

os.wait() losing child?

2007-07-10 Thread Jason Zheng
This may be a silly question but is possible for os.wait() to lose track of child processes? I'm running Python 2.4.4 on Linux kernel 2.6.20 (i686), gcc4.1.1, and glibc-2.5. Here's what happened in my situation. I first created a few child processes with Popen, then in a while(True) loop wait o

Re: bool behavior in Python 3000?

2007-07-10 Thread Paul Rubin
Steven Bethard <[EMAIL PROTECTED]> writes: > So it seems like you're really arguing for raising exceptions in all > these situations. That would actually be fine with me since I never > use bools as ints, but I suspect getting it past python-dev will be an > uphill battle since it will break large

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread [EMAIL PROTECTED]
On Jul 10, 10:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 10, 4:00 am, agc <[EMAIL PROTECTED]> wrote: > > > > > > > Hi Josiah, > > > > >> This recipe for asynchronous communication usingsubprocesscould be > > > >> used to write an expect-like tool: > > > >>http://aspn.actives

Re: Portable general timestamp format, not 2038-limited

2007-07-10 Thread Gabriel Genellina
(Absolutely off topic!) En Mon, 09 Jul 2007 15:50:58 -0300, Steve Holden <[EMAIL PROTECTED]> escribió: > Brunel, of course, being an original, built his system with a wider > inter-rail gap, and passengers commented on the smoother ride they got. > But standardization wars aren't new, and IKB l

Re: SafeConfigParser can set unsafe values

2007-07-10 Thread Matimus
> Should SafeConfigParser.set() be escaping automatically? It seems like that would be a nice feature. However, may I offer up that if you are setting an option and then later on getting that value back in the same program, you probably should have used some other storage mechanism in the first pl

Re: socket.makefile() buggy?

2007-07-10 Thread John J. Lee
Steve Holden <[EMAIL PROTECTED]> writes: > ahlongxp wrote: >> On Jul 8, 9:54 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >>> That's a pretty pejorative subject line for someone who's been >>> programming Python [guessing by the date of your first post] for about a >>> month. >>> > [...] >> And las

storing pickles in sql data base

2007-07-10 Thread David Bear
I need to store pickled objects in postgresql. I reading through the pickle docs it says to always open a file in binary mode because you can't be sure if the pickled data is binary or text. So I have 2 question. Can I set the pickle to be text -- and then store it in a 'text' type field in my sql

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven Bethard
Steven D'Aprano wrote: > On Tue, 10 Jul 2007 13:13:38 -0600, Steven Bethard wrote: > >> It's much easier to explain to newcomers that *, + and - work on True >> and False as if they were 1 and 0 than it is to introduce them to a two >> element boolean algebra. So making this kind of change needs

Re: bool behavior in Python 3000?

2007-07-10 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Pretending that False and True are just "magic names" for 0 and 1 might be > "easier" than real boolean algebra, but that puts the cart before the > horse. Functionality comes first: Python has lists and dicts and sets > despite them not being ints, and

Re: What is the most efficient way to test for False in a list?

2007-07-10 Thread John J. Lee
Duncan Booth <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: > >> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >>> >> status = all(list) >>> > >>> > Am I mistaken, or is this no identity test for False at all? >>> >>> You are mistaken. all take an iterable and return

Re: Tool for finding external dependencies

2007-07-10 Thread John J. Lee
Rob Cakebread <[EMAIL PROTECTED]> writes: > Hi, > > I need to find external dependencies for modules (not Python standard > library imports). > > Currently I use pylint and manually scan the output, which is very > nice, or use pylint's --ext-import-graph option to create a .dot file > and extract

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven D'Aprano
On Tue, 10 Jul 2007 13:13:38 -0600, Steven Bethard wrote: > It's much easier to explain to newcomers that *, + and - work on True > and False as if they were 1 and 0 than it is to introduce them to a two > element boolean algebra. So making this kind of change needs a pretty > strong motivation

Re: Passing a CookieJar instead of a cookieproc to urllib2.build_opener

2007-07-10 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > urllib2.build_opener happily accepts and ignores a FileCookieJar.I > had a bug in my code which looked like > > urllib2.build_opener(func_returning_cookie_jar()) > > which should have been > > urllib2.build_opener(HTTPCookieProcessor(func_retur

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven D'Aprano
On Tue, 10 Jul 2007 23:42:01 +0200, Bjoern Schliessmann wrote: > Alan G Isaac wrote: > >> My preference would be for the arithmetic operations *,+,- >> to be given the standard interpretation for a two element >> boolean algebra: >> http://en.wikipedia.org/wiki/Two-element_Boolean_algebra >

Re: Portable general timestamp format, not 2038-limited

2007-07-10 Thread Martin Gregorie
Ilya Zakharevich wrote: > [A complimentary Cc of this posting was sent to > greg > <[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>: >> Ilya Zakharevich wrote: >>> In pedantic mode: negative timestamps make sense with Big Bang as the >>> epoch as well. (AFAIU, the current way of thi

Re: Purpose of delayload in cookielib.FileCookieJar?

2007-07-10 Thread John J. Lee
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > What is the reason for delayload=False in the FileCookieJar.__init__ > function? It doesn't seem to be used in any of the code that ships > with python2.4, That is true, as is in fact explicitly documented: http://docs.python.org/lib/cookie-jar-

Re: bool behavior in Python 3000?

2007-07-10 Thread Ben Finney
Michael Hoffman <[EMAIL PROTECTED]> writes: > Alan Isaac wrote: > > Is there any discussion of having real booleans > > in Python 3000? > > I'm not sure how the bools we have now are not "real." I'm guessing that Alan is referring (at least in part) to this behaviour: Python 2.4.4 (#2, Apr

RE: win32com ppt embedded object

2007-07-10 Thread Ryan Ginstrom
> On Behalf Of Lance Hoffmeyer > for Z in WB.Slides(29).Shapes: > if (Z.Type== 7): > ZZ=Z.OLEFormat.Object > WSHEET = ZZ.Worksheets(1) > WSHEET.Range("A1").Value = .50 > WSHEET.Range("A1").NumberFormat="0%" I think you need to call Acti

SafeConfigParser can set unsafe values

2007-07-10 Thread Hamish Moffatt
SafeConfigParser is supposed to be safer than ConfigParser, but calling set with a string value containing '%' generates exceptions when you get() it back. Python 2.5.1 (r251:54863, Apr 25 2007, 21:31:46) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "cr

Re: subprocess popen trouble

2007-07-10 Thread Nick Craig-Wood
nik <[EMAIL PROTECTED]> wrote: > I am having trouble using subprocess popen and stdin/stdout > > I have the following simple test application written in C++, that just > echoes back the stdin. It works fine running from the command line: > > #include > #include > > int main (int argc, ch

Re: bool behavior in Python 3000?

2007-07-10 Thread Terry Reedy
"Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Is there any discussion of having real booleans | in Python 3000? Say something along the line | of the numpy implementation for arrays of type 'bool'? As far as I know, there is no such discussion among the developers.

Re: subprocess popen trouble

2007-07-10 Thread Gal Diskin
Your code seems correct to me. Just as a long shot - have you tried setting bufsize=0 ? nik wrote: I am having trouble using subprocess popen and stdin/stdout I have the following simple test application written in C++, that just echoes back the stdin. It works fine running from the command

Re: Best architecture for proxy?

2007-07-10 Thread Bjoern Schliessmann
Andrew Warkentin wrote: > I am going to write a general-purpose modular proxy in Python. It > will consist of a simple core and several modules for things like > filtering and caching. I am not sure whether it is better to use > multithreading, or to use an event-driven networking library like > T

Re: bool behavior in Python 3000?

2007-07-10 Thread Bjoern Schliessmann
Alan G Isaac wrote: > My preference would be for the arithmetic operations *,+,- > to be given the standard interpretation for a two element > boolean algebra: > http://en.wikipedia.org/wiki/Two-element_Boolean_algebra >>> [bool(True+True), bool(True+False)] [True, True] Works for me, or did I m

Re: bool behavior in Python 3000?

2007-07-10 Thread Bjoern Schliessmann
Alan Isaac wrote: > Hoping the bool type will be fixed will be fixed, Is there any type named "bool" in standard Python? Regards, Björn -- BOFH excuse #207: We are currently trying a new concept of using a live mouse. Unfortunately, one has yet to survive being hooked up to the computer...

Re: Portable general timestamp format, not 2038-limited

2007-07-10 Thread Ilya Zakharevich
[A complimentary Cc of this posting was sent to greg <[EMAIL PROTECTED]>], who wrote in article <[EMAIL PROTECTED]>: > Ilya Zakharevich wrote: > > In pedantic mode: negative timestamps make sense with Big Bang as the > > epoch as well. (AFAIU, the current way of thinking is that it was > > "just

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-10 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>>If the assertion is wrong, the compiler signals an error. In >>>that sense it's like a unit test; it makes sure the function does what >>>the user expects. >> >>It still boils down to the same problem : possibly valid typ

Re: bool behavior in Python 3000?

2007-07-10 Thread Daniel
>> > Do you care to explain what is broken? >> My preference would be for the arithmetic operations *,+,- >> to be given the standard interpretation for a two element >> boolean algebra: >> http://en.wikipedia.org/wiki/Two-element_Boolean_algebra > > If I understand this right, the biggest differ

Re: bool behavior in Python 3000?

2007-07-10 Thread Steven Bethard
Alan G Isaac wrote: > > Do you care to explain what is broken? > > I suppose one either finds coercion of arithmetic operations to int > to be odd/broken or does not. But that's all I meant. > > My preference would be for the arithmetic operations *,+,- > to be given the standard interpretation

Re: xml yml and dependency hell

2007-07-10 Thread Bruno Desthuilliers
Rustom Mody a écrit : > On 7/11/07, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> Rustom Mody wrote: > > >> > So is it likely that yaml will make it to the standard python library >> > at some point?? >> >> That's up to the maintainers of PyYAML. If they want to get it in, >> there will >> be w

Re: Embedding Matplotlib in wxpython wx.Panel problem

2007-07-10 Thread abakshi11
I was wondering if you ever got to create a small GUI program that did plots using Matplotlib I am gettin an error where its saying "WXagg's accelerator requires the wxPython headers-the wxpython header files can not be located in any of the standard include directories reported by 'wx-config --cp

Re: xml yml and dependency hell

2007-07-10 Thread Bruno Desthuilliers
Rustom Mody a écrit : > yaml by its indent-orientation is quite pythonic. In comparison xml > is cumbersome and laborious. > > Strangely ruby supports yaml out of the box but python requires a > third party package PyYAML. > > Now this may not seem like a big deal for us -- installing pyYAML > t

Re: bool behavior in Python 3000?

2007-07-10 Thread Alan G Isaac
Peter Otten wrote: > The last I have seen is > http://mail.python.org/pipermail/python-3000/2007-January/005284.html OK. Thanks. > Do you care to explain what is broken? I suppose one either finds coercion of arithmetic operations to int to be odd/broken or does not. But that's all I meant

Re: Need Help

2007-07-10 Thread Paul McGuire
On Jul 10, 10:28 am, pycraze <[EMAIL PROTECTED]> wrote: > Hi , > > I need some info about the following snippet . > > --- > protocol = 'NTLMSSP\000'#name > type = '\001\000' #type 1 > zeros1 = '\000\000' > >

Re: xml yml and dependency hell

2007-07-10 Thread Rustom Mody
On 7/11/07, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Rustom Mody wrote: > > So is it likely that yaml will make it to the standard python library > > at some point?? > > That's up to the maintainers of PyYAML. If they want to get it in, there will > be ways to get there. If they do not want to -

Re: S2K DTS and Python

2007-07-10 Thread stefaan
> > However, I now want to update some tables in MSAccess, and it occurred > > to me that because Sequel Server 2000 DTS can interface with scripting > > languages that maybe I could call my first Python program from within > > DTS and then update the tables using DTS. (I am learning DTS hence the

Re: xml yml and dependency hell

2007-07-10 Thread Stefan Behnel
Rustom Mody wrote: > yaml by its indent-orientation is quite pythonic. In comparison xml > is cumbersome and laborious. > > Strangely ruby supports yaml out of the box but python requires a > third party package PyYAML. > > Now this may not seem like a big deal for us -- installing pyYAML > take

Re: win32com ppt embedded object

2007-07-10 Thread fynali
On Jul 10, 8:40 pm, Lance Hoffmeyer <[EMAIL PROTECTED]> wrote: > Hey all, > > I am trying to create some python code to edit embedded ppt slides and need > some help. > > import win32com.client > from win32com.client import constants > import re > import codecs,win32com.client > import time > impo

Re: C Extension Seg Faults

2007-07-10 Thread Daryl
> It's not worth staring at code to try to figure out things like that. > Run it under gdb, examine the relevant data objects when it crashes > and see what's broken (e.g. some pointer is unexpectedly null), then > set a conditional breakpoint that stops execution when that incorrect > condition ha

Re: C Extension Seg Faults

2007-07-10 Thread Paul Rubin
Daryl <[EMAIL PROTECTED]> writes: > The inner loop runs a few hundred times (263) then fails with a > segmentation fault. I've trolled through the documentation online and > in the various .h files but can't seem to find anything. > > Anybody have an idea what really obvious foolish thing I'm doi

C Extension Seg Faults

2007-07-10 Thread Daryl
I'm having trouble tracking down some segmentation faults with a C extension. I can see where it's failing but don't know how to fix it. Basically, my python programme builds a pair of large tuples of tuples. I want to unpack these tuples and process them. The code in question looks something l

Re: Abort trap - Fatal Python error: GC object already tracked

2007-07-10 Thread p . lavarre
> Is this interesting Python output? ... > > Fatal Python error: GC object already tracked > Abort trap > > ... tell me I can help by solving it, and > I'll look more closely. Sorry, never mind, not interesting after all. Newbie me did somehow forget the fact that ctypes.memmove doesn't bounds-ch

Re: Phoenix-iTorrent: iTunes Bit Torrent client v 0.3 release

2007-07-10 Thread Danyelle Gragsone
How is this related to python? -- http://mail.python.org/mailman/listinfo/python-list

Re: The best platform and editor for Python

2007-07-10 Thread Douglas Alan
[EMAIL PROTECTED] (Alex Martelli) writes: > Kay Schluehr <[EMAIL PROTECTED]> wrote: >> half of the community is happy with Emacs and the other half wants to >> program in a VS-like environment, neither consensus nor progress has > Calling all vi/vim users (and we'll heartily appreciate the suppo

Re: How do I remotely access Scheduled Tasks from Windows XP to Windows Server 2003?

2007-07-10 Thread fynali
On Jul 10, 4:51 am, kj7ny <[EMAIL PROTECTED]> wrote: > On Jun 30, 10:55 am, "Roger Upole" <[EMAIL PROTECTED]> wrote: > > > > > > > "kj7ny" wrote: > > > How can I access and manipulateScheduledTasksin Windows using > > > Python? > > > > I have a Windows XP workstation running Python 2.4.4 using the

Re: 2**2**2**2**2 wrong? Bug?

2007-07-10 Thread fynali
> > 19729 > > Did you count the 'L'? > (-: -- http://mail.python.org/mailman/listinfo/python-list

REALLY!

2007-07-10 Thread [EMAIL PROTECTED]
Is this for reals man! I hope this is not one of those rip-off emails. -- http://mail.python.org/mailman/listinfo/python-list

Abort trap - Fatal Python error: GC object already tracked

2007-07-10 Thread p . lavarre
Is this interesting Python output? $ gc-object-already-tracked.py ** File "/Users/admin/Desktop/lxio/gc-object-already-tracked.py", line 770, in __main__.REDACTED Failed example: nqzhexes(self.send()) Expected: '... [reda

xml yml and dependency hell

2007-07-10 Thread Rustom Mody
yaml by its indent-orientation is quite pythonic. In comparison xml is cumbersome and laborious. Strangely ruby supports yaml out of the box but python requires a third party package PyYAML. Now this may not seem like a big deal for us -- installing pyYAML takes all of one minute -- but it may n

subprocess popen trouble

2007-07-10 Thread nik
I am having trouble using subprocess popen and stdin/stdout I have the following simple test application written in C++, that just echoes back the stdin. It works fine running from the command line: #include #include int main (int argc, char * const argv[]) { int currenttemp = 0;

win32com ppt embedded object

2007-07-10 Thread Lance Hoffmeyer
Hey all, I am trying to create some python code to edit embedded ppt slides and need some help. import win32com.client from win32com.client import constants import re import codecs,win32com.client import time import datetime import win32com.client.dynamic

serializing datetime object

2007-07-10 Thread [EMAIL PROTECTED]
Hi I want to serialize datetime.datetime.now() object . I could convert it to string but how do I get a datetime object back from the string? Any suggestions? thanks mark -- http://mail.python.org/mailman/listinfo/python-list

Re: bool behavior in Python 3000?

2007-07-10 Thread Peter Otten
Alan Isaac wrote: > Is there any discussion of having real booleans > in Python 3000? The last I have seen is http://mail.python.org/pipermail/python-3000/2007-January/005284.html > Hoping the bool type will be fixed will be fixed, Do you care to explain what is broken? Peter -- http://ma

Re: bool behavior in Python 3000?

2007-07-10 Thread Michael Hoffman
Alan Isaac wrote: > Is there any discussion of having real booleans > in Python 3000? I'm not sure how the bools we have now are not "real." > Say something along the line of the numpy implementation for arrays of > type 'bool'? What aspect of this do you want? A bool typecode for the stdlib a

Re: allow scripts to use .pth files?

2007-07-10 Thread Alan Isaac
John Machin wrote: > I got the impression that the OP was suggesting that the interpreter > look in the directory in which it found the script. Right. > I got the impression that the problem was that the package was not > only not on sys.path but also not in the same directory as the script > t

bool behavior in Python 3000?

2007-07-10 Thread Alan Isaac
Is there any discussion of having real booleans in Python 3000? Say something along the line of the numpy implementation for arrays of type 'bool'? Hoping the bool type will be fixed will be fixed, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >