['a', 'b'][True] results 'b' But how?

2007-07-04 Thread kath
Hi, Can any one please tell me how is the following code is working? ['a','b'] is a list of string, and [True] is list of boolean value. How is it making effect? >>> ['a','b] [True] 'b' >>> ['a','b'] [False] 'a' >>> ['a','b']['some_string' == r'some_string'] 'b' >>> ['a','b']['some_string' =

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-04 Thread Diez B. Roggisch
Siegfried Heintze schrieb: > I love the typing assist I get when using C# in VS2005 to write COM clients. > > I need to write a program to automate some tasks in outlook. Givin that the > typing assist feature is very important to me, what would be the best > combination of IDE and language for

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-04 Thread Diez B. Roggisch
"M��" schrieb: > Hi! > >> I love the typing assist I get when using C# in VS2005 to write COM >> clients. > > But this run only for static-COM-servers. Dynamic-COM-servers are not > supported by these assists. No. The IDIspatch-interface explicitely list

Re: windows cetificates

2007-07-04 Thread m.banaouas
thank you I will take a look on capicom ... Roger Upole a écrit : > m.banaouas wrote: >> hi, >> >> is there any way to decrypt an email (already read with poplib, so available >> on client side) with python using a window >> certificate (those we can see on ie/internet options/content/certificat

Re: connecting to serial port + python

2007-07-04 Thread Gabriel Genellina
En Tue, 03 Jul 2007 10:01:51 -0300, Japan Shah <[EMAIL PROTECTED]> escribió: > I am trying to connect my Nokia 6610 using usb cable, > I have installed usb-serial driver of it. > I hv tested it with Hyperterminal and it works fine. > but when I wrote a python script I am not able to receive the

Re: login http://cheeseshop.python.org/pypi broken ?

2007-07-04 Thread Martin v. Löwis
gert schrieb: > tried reseting password but i can not login anymore to upload my new > source code ? Please try again. It was a misconfiguration which should be fixed now. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: need a variation algorithm for Lists in Dictionaries

2007-07-04 Thread Paddy
On Jul 5, 3:58 am, "Marc Stuart" <[EMAIL PROTECTED]> wrote: > Hi, I am trying to create a function, where I pass a dictionary with a > lits of strings, and try to return a > a list of strings, for all variations, any ideas ? > Thanks > > def getAllVariants(someDict): > keys = someDict.keys(

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-04 Thread M�ta-MCI
Hi! >I love the typing assist I get when using C# in VS2005 to write COM >clients. But this run only for static-COM-servers. Dynamic-COM-servers are not supported by these assists. And, all COM-servers builds with Python are dynamic-COM-server. And also, dynamic-COM-server is a marvelous way fo

IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-04 Thread Siegfried Heintze
I love the typing assist I get when using C# in VS2005 to write COM clients. I need to write a program to automate some tasks in outlook. Givin that the typing assist feature is very important to me, what would be the best combination of IDE and language for COM scripting? I was experimenting w

Re: windows cetificates

2007-07-04 Thread Roger Upole
m.banaouas wrote: > hi, > > is there any way to decrypt an email (already read with poplib, so available > on client side) with python using a window > certificate (those we can see on ie/internet options/content/certificates) ? > > the purpose is to decrypt an email sent and crypted by the send

Re: PyRun_String using my module in a def

2007-07-04 Thread Stuart
What command do you mean when you say "update main_dict with dlfl_dict"? I tried PyObject *rstring = PyRun_String( cmd, Py_file_input, dlfl_dict, dlfl_dict ); This worked, but has the side effect of not allowing other commands like "execfile" I was able to type that before, but now it just says "n

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread David Abrahams
on Wed Jul 04 2007, "Steven D'Aprano" wrote: > On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: > >> On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: >> >>> Here's an implementation of the functionality I propose, as a >>> free-standing function: >>> >>> de

Re: import mysteries

2007-07-04 Thread David Abrahams
on Wed Jul 04 2007, Peter Otten <__peter__-AT-web.de> wrote: >>> Explicitly passed, see >>> >>> > http://genshi.edgewall.org/browser/trunk/genshi/filters/tests/transform.py >> >> IIRC I ran doctest on the file I cited, not the one you're pointing >> at. Is there some new magic doctest feature I

Re: using subprocess for non-terminating command

2007-07-04 Thread Jerry Hill
On 7/4/07, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: > Only when the program has executed and the output available, subprocess can > read through PIPE's stdout it seems ( not at any other time). > With killing, I loose the output. I think you have to read the data from the process's stdout be

login http://cheeseshop.python.org/pypi broken ?

2007-07-04 Thread gert
tried reseting password but i can not login anymore to upload my new source code ? -- http://mail.python.org/mailman/listinfo/python-list

Re: PyRun_String using my module in a def

2007-07-04 Thread Alex Martelli
Stuart <[EMAIL PROTECTED]> wrote: ... > PyObject *rstring = PyRun_String( cmd, Py_file_input, main_dict, > dlfl_dict ); You're passing difl_dict as the "locals" to PyRun_String -- but a function has its own locals, so it won't use those locals. Just update main_dict with difl_dict (that's the

Re: need a variation algorithm for Lists in Dictionaries

2007-07-04 Thread Alex Martelli
Marc Stuart <[EMAIL PROTECTED]> wrote: > Hi, I am trying to create a function, where I pass a dictionary with a > lits of strings, and try to return a > a list of strings, for all variations, any ideas ? > Thanks > > def getAllVariants(someDict): > keys = someDict.keys() > for x in ke

debug(read source code and test) pypy in pydev

2007-07-04 Thread [EMAIL PROTECTED]
Hi, I am a newbie to python and pypy. I choose to read pypy source code to learn about python and python library. But when I try to run pypy in debug mode in pydev, I got the following problem: /// error message begin pydev debugger Traceback (most recent call last): File "F:\TOOLS\eclipse\plu

need a variation algorithm for Lists in Dictionaries

2007-07-04 Thread Marc Stuart
Hi, I am trying to create a function, where I pass a dictionary with a lits of strings, and try to return a a list of strings, for all variations, any ideas ? Thanks def getAllVariants(someDict): keys = someDict.keys() for x in keys: print len(someDict[x])

Re: Tkinter toggle a Label Widget based on checkbutton value

2007-07-04 Thread O.R.Senthil Kumaran
* Wojciech Mu?a <[EMAIL PROTECTED]> [2007-07-04 20:13:06]: > O.R.Senthil Kumaran wrote: > > Any suggestions on how can i make this checkbutton effect. > > 1) Press Enable IP, the Label IP should be shown. > > 2) Toggle Enable IP (So that its unset). the Label IP should not be shown. > > > > #!/us

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

2007-07-04 Thread Michael Hoffman
Eduardo "EdCrypt" O. Padoan wrote: > On 6/30/07, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Eduardo "EdCrypt" O. Padoan a écrit : >> > Remember that pure CPython has no different "compile time" and >> > runtiime. >> >> Oh yes ? So what's the compiler doing, and what are those .pyc files ?

Re: MethodType/FunctionType and decorators

2007-07-04 Thread greg
Alex Popescu wrote: > - for decorators, my test is executed before the class is defined and > so at that moment the function is still a function; it will become a > methodinstance only after the class definition is closed Closer, but still not quite right. Even after the class is defined, the func

PyRun_String using my module in a def

2007-07-04 Thread Stuart
I've written my own python modules with the C API, called dlfl. I've now embedded a python interpreter into my Qt application. I am able to execute multiline/singleline blocks and it has no problems remembering definitions from one execute to the next. The problem arises when i try and use a dlfl m

Re: object references/memory access

2007-07-04 Thread greg
John Nagle wrote: > C gets to > run briefly, drains out the pipe, and blocks. P gets to run, > fills the pipe, and blocks. The compute-bound thread gets to run, > runs for a full time quantum, and loses the CPU to C. Wash, > rinse, repeat. I thought that unix schedulers were usually a bit more

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread Roy Smith
ames Harris <[EMAIL PROTECTED]> wrote: > I have a requirement to store timestamps in a database. Simple enough > you might think but finding a suitably general format is not easy. The > specifics are > > 1) subsecond resolution - milliseconds or, preferably, more detailed > 2) not bounded by Unix

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread greg
James Harris wrote: > With that the time would range to +/- 9000 > quintillion years (18 digits) Use the Big Bang as the epoch, and you won't have to worry about negative timestamps. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

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

2007-07-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, John Nagle <[EMAIL PROTECTED]> wrote: > Non-enforced static typing requires a quality assurance group that > reads code and checks coding standards. In other words, it's enforced, but it's enforced by QA people instead of the compiler. -- http://mail.python.org/

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread richyjsm
On Jul 4, 8:14 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > However, there's a very subtle flaw in the idea. While "the intersection" > of two sets is well-defined, "these two sets intersect" is (surprisingly!) > _not_ well-defined. Poppycock! It's perfectly well defined: two sets intersect

Re: Building a Python app with Mozilla

2007-07-04 Thread greg
[EMAIL PROTECTED] wrote: > wxWidgets will give you native looking apps on both Linux and Windows Well, maybe. There's more to getting a native feel than just using the right widgets. I once saw a Qt-based app on MacOSX that had tiny little buttons that were too small for the text they contained -

Re: disappearing documentation of `coerce`

2007-07-04 Thread Neil Cerutti
On 2007-07-05, Alan Isaac <[EMAIL PROTECTED]> wrote: > Once upon a time, `coerce` was documented > with the other built-ins. > http://pydoc.org/1.5.2/__builtin__.html > Now it is not. > http://docs.python.org/lib/built-in-funcs.html > Reason? It's now documented in Library Reference 2.2 Non-essen

Re: MethodType/FunctionType and decorators

2007-07-04 Thread Alex Martelli
Alex Popescu <[EMAIL PROTECTED]> wrote: ... > - when testing from outside the class definition, the function is > already attached to the class instance and this is the reason why its > type is instancemethod To be more precise: when you access any attribute of a class (or instance thereof), Py

disappearing documentation of `coerce`

2007-07-04 Thread Alan Isaac
Once upon a time, `coerce` was documented with the other built-ins. http://pydoc.org/1.5.2/__builtin__.html Now it is not. http://docs.python.org/lib/built-in-funcs.html Reason? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: allow scripts to use .pth files?

2007-07-04 Thread Alan Isaac
> On Jul 3, 7:35 am, Alan Isaac <[EMAIL PROTECTED]> wrote: >>Suppose I have a directory `scripts`. >>I'd like the scripts to have access to a package >>that is not "installed", i.e., it is not on sys.path. >>On this list, various people have described a variety >>of tricks they use, but nobody has

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

2007-07-04 Thread greg
Roy Smith wrote: > greg <[EMAIL PROTECTED]> wrote: > > Then you get a bug report, you fix it, and you add a test > > for it so that particular bug can't happen again. > The TDD zealots would tell you you've got the order wrong. Instead of > "fix, then write a test", it should be "write a failin

Re: mod_python & doc file system layout

2007-07-04 Thread Graham Dumpleton
On Jul 5, 12:22 am, Jan Danielsson <[EMAIL PROTECTED]> wrote: > Hello all, > >This is probably more of an apache question, but I'm guessing there > will be other mod_python-beginners who are wondering the same thing. > >Let's say I have a web app called MyApp. It uses the usual images and >

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Erik Max Francis
Steven D'Aprano wrote: > The problem comes if we (perhaps naively) try to say that if a set A is a > subset of set B, set A must intersect with B. (Not all intersecting sets > are subsets, but all subsets are intersecting sets.) Unfortunately that is > not the same as asking if the intersection be

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

2007-07-04 Thread Eduardo \"EdCrypt\" O. Padoan
On 7/4/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On 6/22/07, Eduardo EdCrypt O. Padoan <[EMAIL PROTECTED]> wrote: > > Remember that pure CPython has no different "compile time" and > > runtiime. But Psyco and ShedSkin could use the annotations the way > > they want. > . > > def compile(s

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Steven D'Aprano
On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: > On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > >> Here's an implementation of the functionality I propose, as a >> free-standing function: >> >> def intersects(s1,s2): >> if len(s1) < len(s2):

Re: MethodType/FunctionType and decorators

2007-07-04 Thread Alex Popescu
On Jul 5, 1:52 am, Alex Popescu <[EMAIL PROTECTED]> wrote: > Hi all! > > I am pretty new to Python, so please excuse me if I am missing > something. Lately, I've been playing with decorators and I am a bit > confused about some behavior. Here is the code that puzzles me: > > in python shell: > > de

RE: deleated bios?

2007-07-04 Thread Delaney, Timothy (Tim)
acprkit wrote: > Hi > > I have an ibm thinkpad x23, and shut it down about an hour ago. When I > went to > reboot , all the lights come on then they go off and only the light > with the z in a circle stays on. The screen stays blank and the hard > drive spins. Could I have deleated the bios when

RE: Plugging a pseudo-memory leak

2007-07-04 Thread Delaney, Timothy (Tim)
Adam Atlas wrote: > I have a program that seemed to be leaking memory, but after > debugging, it seemed it just wasn't getting around to collecting the > objects in question often enough. The objects are very long-lived, so > they probably end up in generation 2, and don't get collected for a > lo

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

2007-07-04 Thread BJörn Lindqvist
On 6/22/07, Eduardo EdCrypt O. Padoan <[EMAIL PROTECTED]> wrote: > Remember that pure CPython has no different "compile time" and > runtiime. But Psyco and ShedSkin could use the annotations the way > they want. . > def compile(source: "something compilable", >filename: "where the c

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread James Harris
On 4 Jul, 22:18, "Peter J. Holzer" <[EMAIL PROTECTED]> wrote: ... > But it really doesn't matter much. If you ignore leap seconds, using > days instead of seconds is just a constant factor (in fact, the unix > timestamp ignores leap seconds, too, so it's always a constant factor). > You can't repre

MethodType/FunctionType and decorators

2007-07-04 Thread Alex Popescu
Hi all! I am pretty new to Python, so please excuse me if I am missing something. Lately, I've been playing with decorators and I am a bit confused about some behavior. Here is the code that puzzles me: in python shell: def function(): pass class A(object): def method(self): pass from

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

2007-07-04 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>Haskell - as other languages using type-inference like OCaml - are in >>a different category. Yes, I know, don't say it, they are statically >>typed - but it's mostly structural typing, not declarative >>typing. Which makes

Re: using subprocess for non-terminating command

2007-07-04 Thread Karthik Gurusamy
On Jul 4, 4:38 am, Phoe6 <[EMAIL PROTECTED]> wrote: > Hi all, > Consider this scenario, where in I need to use subprocess to execute a > command like 'ping 127.0.0.1' which will have a continuous non- > terminating output in Linux. > > # code > > >>>import subprocess > >>>process = subprocess.Popen

Re: Reversing a string

2007-07-04 Thread Jan Vorwerk
Martin Durkin a écrit , le 02.07.2007 06:38: > This is an interesting point to me. I am just learning Python and I > wonder how I would know that a built in function already exists? > At what point do I stop searching for a ready made solution to a > particular problem and start programming my o

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

2007-07-04 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Haskell - as other languages using type-inference like OCaml - are in > a different category. Yes, I know, don't say it, they are statically > typed - but it's mostly structural typing, not declarative > typing. Which makes them much more usable IMH

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread Peter J. Holzer
On 2007-07-04 18:46, James Harris <[EMAIL PROTECTED]> wrote: > On 1 Jul, 15:11, "Peter J. Holzer" <[EMAIL PROTECTED]> wrote: > ... >> Stick to unix timestamps but store them as a double precision floating >> point number. The 53 bit mantissa gives you currently a resolution of >> about 200 ns, slow

deleated bios?

2007-07-04 Thread acprkit
Hi I have an ibm thinkpad x23, and shut it down about an hour ago. When I went to reboot , all the lights come on then they go off and only the light with the z in a circle stays on. The screen stays blank and the hard drive spins. Could I have deleated the bios when I added memory (shocked the mo

Re: using subprocess for non-terminating command

2007-07-04 Thread prikar20
On Jul 4, 12:29 pm, "O.R.Senthil Kumaran" <[EMAIL PROTECTED]> wrote: > * Jerry Hill <[EMAIL PROTECTED]> [2007-07-04 11:23:33]: > > > > > That's because you tied stdin to a pipe in your Popen call, but then > > tried to read from stdout. Try this instead: > > My mistake. I had just 'typed' the co

Re: Does Python work with QuickBooks SDK?

2007-07-04 Thread walterbyrd
Thanks to Greg and Mike. I am not looking for specifics right now. I was just wondering if there was a practical way to do use python to integrate with intuit apps. Apparently, there is. -- http://mail.python.org/mailman/listinfo/python-list

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

2007-07-04 Thread Bruno Desthuilliers
Paul Rubin a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >>Because static type checks impose a lot of arbitrary restrictions, >>boilerplate code etc, which tends to make code more complicated than >>it needs to be, which is a good way of introducing bugs that wouldn't >>have existe

AIML, Python, Java

2007-07-04 Thread Boris Ozegovic
Hi I have a chatterbot written in AIML. I am using PyAIML, and HTTP server as a mediator between user and PyAIML. Server calls PyAIML, and sends the result string to the sensor network which is written in Java; and in the end, server returns value from Java method. Can I somehow call Java metho

Re: Find This Module

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 20:00:07 +, [EMAIL PROTECTED] wrote: > I'm looking at the source for the module sre_compile.py and it does > this import: > > import _sre > > But I can't find a file related to _sre anywhere. Where is it? And > more generally, how does one find the location of a built i

Re: 15 Exercises to Know A Programming Language

2007-07-04 Thread Martin
On Jul 3, 1:47 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 3, 7:58 pm, Martin <[EMAIL PROTECTED]> wrote: > > > > > I am trying to improve my Python skills through some exercises. > > Currently I am working on Larry's "15 exercises to know a programming > > language " (http://www.knowing.net

Re: Does Python work with QuickBooks SDK?

2007-07-04 Thread [EMAIL PROTECTED]
On Jul 4, 2:51 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > My guess is that it would, but I can find no mention of python in the > intuit developers site. I can find some references to PHP and Perl, > but no Python. > > I looks to me like Intuit develops have a strong preference for visual- > basi

Re: CGI vs WSGI

2007-07-04 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Dear all, > > what is the difference? Middleware? > > I'm wondering because the only variables I ever needed were PATH_INFO, > REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should > be available from CGI, too. > > Thanks. > WSGI is intented as a ga

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

2007-07-04 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > This has been tried. Original K&R C had non-enforced static typing. > All "struct" pointers were equivalent. It wasn't pretty. > > It takes strict programmer discipline to make non-enforced static > typing work. I've seen it work in an aerospac

Re: using subprocess for non-terminating command

2007-07-04 Thread zacherates
> Only when the program has executed and the output available, subprocess can > read through PIPE's stdout it seems ( not at any other time). > With killing, I loose the output. This is untrue. >>> process.stdout.read() # Blocks until end of stream. >>> process.stdout.read(1) # Reads one character

Re: Tkinter toggle a Label Widget based on checkbutton value

2007-07-04 Thread Wojciech Muła
O.R.Senthil Kumaran wrote: > Any suggestions on how can i make this checkbutton effect. > 1) Press Enable IP, the Label IP should be shown. > 2) Toggle Enable IP (So that its unset). the Label IP should not be shown. > > #!/usr/bin/python > from Tkinter import * > root = Tk() > root.title('somethi

Find This Module

2007-07-04 Thread [EMAIL PROTECTED]
I'm looking at the source for the module sre_compile.py and it does this import: import _sre But I can't find a file related to _sre anywhere. Where is it? And more generally, how does one find the location of a built in module? Thanks, Greg -- http://mail.python.org/mailman/listinfo/python

Tkinter toggle a Label Widget based on checkbutton value

2007-07-04 Thread O.R.Senthil Kumaran
Following is a tk code, which will display a checkbutton, and when checkbox is enabled, it will show the below present Label. What I was trying is, when checkbox is enabled the Label should be shown and when checkbox is disabled, the window should look like before. But, I am finding that once ena

Re: Does Python work with QuickBooks SDK?

2007-07-04 Thread kyosohma
On Jul 4, 1:51 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > My guess is that it would, but I can find no mention of python in the > intuit developers site. I can find some references to PHP and Perl, > but no Python. > > I looks to me like Intuit develops have a strong preference for visual- > basi

Re: Help search files

2007-07-04 Thread Mariano Mara
Alejandro Decchi escribió: > Hello Someone can help me how to search file in a directory. I need to > do a form where the user write the word to search and if the file was > found the user must could download the file making click in the link > Sorry my english > thz > Alex > You could try os.wa

Re: using subprocess for non-terminating command

2007-07-04 Thread O.R.Senthil Kumaran
* Jerry Hill <[EMAIL PROTECTED]> [2007-07-04 11:23:33]: > > That's because you tied stdin to a pipe in your Popen call, but then > tried to read from stdout. Try this instead: My mistake. I had just 'typed' the command in the mail itself and forgot to include the stdin, stdout, and stderr and

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

2007-07-04 Thread John Nagle
Paul Boddie wrote: > Paul Rubin wrote: > > The campaign for optional > static typing in Python rapidly became bogged down in this matter, > fearing that any resulting specification for type information might > not be the right combination of flexible and powerful to fit in with > the rest of the l

ReSTedit ported to Linux?

2007-07-04 Thread Helmut Jarausch
Hi, does anybody know if ReSTedit (originally for Mac OS X) has been ported to Linux? Many thanks for a hint, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread James Harris
On 3 Jul, 06:12, Scott David Daniels <[EMAIL PROTECTED]> wrote: ... > Inspired format: > Days since a some standard date (the TAI date may be a good such > date) expressed as fixed point 64-bit (32-bit day part, 32-bit > day-fraction part) or floating point (using Intel's double-precision, > f

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

2007-07-04 Thread Paul Boddie
Paul Rubin wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > > Because static type checks impose a lot of arbitrary restrictions, > > boilerplate code etc, which tends to make code more complicated than > > it needs to be, which is a good way of introducing bugs that wouldn't > > have exis

Re: object references/memory access

2007-07-04 Thread John Nagle
Karthik Gurusamy wrote: > On Jul 2, 10:57 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >I have found the stop-and-go between two processes on the same machine >leads to very poor throughput. By stop-and-go, I mean the producer and >consumer are constantly getting on and off of th

Re: Interest in a one-day business conference for Python, Zope and Plone companies ?

2007-07-04 Thread Thomas Heller
eGenix Team: M.-A. Lemburg schrieb: > Hello, > > eGenix is looking into organizing a one day conference > specifically for companies doing business with Python, Zope and > Plone. The conference will likely be held in or close to > Düsseldorf, Germany, which is lively medium-sized city, with good >

Does Python work with QuickBooks SDK?

2007-07-04 Thread walterbyrd
My guess is that it would, but I can find no mention of python in the intuit developers site. I can find some references to PHP and Perl, but no Python. I looks to me like Intuit develops have a strong preference for visual- basic, then c/c++, then delphi. I find it just a little bit surprising,

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread James Harris
On 1 Jul, 15:11, "Peter J. Holzer" <[EMAIL PROTECTED]> wrote: ... > Stick to unix timestamps but store them as a double precision floating > point number. The 53 bit mantissa gives you currently a resolution of > about 200 ns, slowly deteriorating (you will hit ms resolution in about > 280,000 year

Re: ActivePython

2007-07-04 Thread Steve Holden
Trent Mick wrote: > Frank Swarbrick wrote: [...] > Steve Holden wrote: > > ...the last time I looked the ActivePython distribution > > doesn't allow redistribution at all (i.e. it's not technically open > > source). > > Steve is correct that ActivePython isn't open source. It is free (as in >

Re: How can i change an Object type ?

2007-07-04 Thread kyosohma
On Jul 4, 12:40 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > KuhlmannSascha <[EMAIL PROTECTED]> wrote: > > >i tried now for several hours to read through a win32com API to access > >Itunes and read out myplaylists. > > >First of all the Code: > >... > >The current Logic is to access first Itunes an

Re: ActivePython

2007-07-04 Thread Trent Mick
Frank Swarbrick wrote: > Why might one choose to use ActivePython instead of using the free CPython? Expanding on what Alex already said, there are a few reasons: 1. On Windows, ActivePython also includes the PyWin32 [1] extensions which otherwise you'd have to install separately over a python.o

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

2007-07-04 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Because static type checks impose a lot of arbitrary restrictions, > boilerplate code etc, which tends to make code more complicated than > it needs to be, which is a good way of introducing bugs that wouldn't > have existed without static type chec

Re: what is wrong with that r"\"

2007-07-04 Thread Neil Cerutti
On 2007-07-04, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote: >> >>> If the escaped quotes didn't function in raw strings, I'd be >>> unable to construct (with a single notation)

Re: Reversing a string

2007-07-04 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: ... > This works in all versions of Python back to 1.5.2 IIRC. reversed() is > a moderately new built-in function; Yep: it came with Python 2.4, first alpha just 4 years ago, final release about 3 years and 8 months ago. "Moderately new" seems an appropriate ta

Help search files

2007-07-04 Thread Alejandro Decchi
Hello Someone can help me how to search file in a directory. I need to do a form where the user write the word to search and if the file was found the user must could download the file making click in the link Sorry my english thz Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: what is wrong with that r"\"

2007-07-04 Thread Neil Cerutti
On 2007-07-04, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote: > >> If the escaped quotes didn't function in raw strings, I'd be >> unable to construct (with a single notation) a regex that >> included both kinds of quotes at once. >> >

Re: Reversing a string

2007-07-04 Thread Aahz
In article <[EMAIL PROTECTED]>, Martin Durkin <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Alex Martelli) wrote in >news:[EMAIL PROTECTED]: >> >> So, something like: >> >> for c in reversed(x): print c >> >> is mostly likely how I'd present the solution to the task. > >This is an interesting

Re: using subprocess for non-terminating command

2007-07-04 Thread Steve Holden
O.R.Senthil Kumaran wrote: > * zacherates <[EMAIL PROTECTED]> [2007-07-04 12:09:03]: > >>> How should I handle these kind of commands (ping 127.0.0.1) with >>> subprocess module. I am using subprocess, instead of os.system because >>> at anypoint in time, I need access to stdout and stderr of exec

Memory leak issue with complex data structure

2007-07-04 Thread Alan Franzoni
Hello, I've got a complex data structure (graph-like). Each of my nodes may reference zero or more other nodes, internally managed by a set() object. I have a root node which is not referenced by any other node. So, I created a "clear()" method which is called on all children (by calling their cle

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

2007-07-04 Thread Alex Martelli
Roy Smith <[EMAIL PROTECTED]> wrote: > greg <[EMAIL PROTECTED]> wrote: > > > Paul Rubin wrote: > > > E.g. your program might pass its test and run properly for years > > > before some weird piece of input data causes some regexp to not quite > > > work. > > > > Then you get a bug report, you fix

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-04 Thread Jorgen Grahn
On Fri, 29 Jun 2007 12:53:49 -0400, Douglas Alan <[EMAIL PROTECTED]> wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >> "Python" doesn't *have* any refcounting semantics. > > I'm not convinced that Python has *any* semantics at all outside of > specific implementations. It has never been stand

Re: CGI vs WSGI

2007-07-04 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I'm wondering because the only variables I ever needed were PATH_INFO, > REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should > be available from CGI, too. CGI starts up a new process for every request, using stdin/stdout for passing information. I beli

Re: Memory leak issue with complex data structure

2007-07-04 Thread Josiah Carlson
Alan Franzoni wrote: > I have a root node which is not referenced by any other node. So, I > created a "clear()" method which is called on all children (by calling > their clear() method" and then clears the set with the references of the > node itself. Using the .clear() method on sets (or dictio

Re: using subprocess for non-terminating command

2007-07-04 Thread Jerry Hill
On 7/4/07, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: > Yes, I am aware of the ping -c option. But again even that does not help. > try > process = subprocess.Popen('ping -c 10 127.0.0.1', stdin=subprocess.PIPE, > shell=True) > process.stdout.read() # This will hang again. When I try that, it

reading email using django

2007-07-04 Thread filox
i've just installed django and it seems pretty cool. i've managed to send an email succesfully, but i didn't find any information on reading email. is that even possible with django (e.g. open my gmail inbox and read mail from it)? -- You're never too young to have a Vietnam flashback -- h

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > Here's an implementation of the functionality I propose, as a > free-standing function: > > def intersects(s1,s2): > if len(s1) < len(s2): > for x in s1: > if x in s2: return True >

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 16:18:58 +0200, Thomas Jollans wrote: > On Wednesday 04 July 2007, David Abrahams wrote: >> Right now, the only convenient thing to do is >> >> if s1 & s2 ... >> >> but that builds a whole new set. IMO that query should be available >> as a method of set itself. >

Re: using subprocess for non-terminating command

2007-07-04 Thread O.R.Senthil Kumaran
* zacherates <[EMAIL PROTECTED]> [2007-07-04 12:09:03]: > > How should I handle these kind of commands (ping 127.0.0.1) with > > subprocess module. I am using subprocess, instead of os.system because > > at anypoint in time, I need access to stdout and stderr of execution. > > Ping, for one, allo

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread Thomas Jollans
On Wednesday 04 July 2007, David Abrahams wrote: > Here's an implementation of the functionality I propose, as a > free-standing function: > > def intersects(s1,s2): > if len(s1) < len(s2): > for x in s1: > if x in s2: return True >

[mostly OT] mod_python & doc file system layout

2007-07-04 Thread Jan Danielsson
Hello all, This is probably more of an apache question, but I'm guessing there will be other mod_python-beginners who are wondering the same thing. Let's say I have a web app called MyApp. It uses the usual images and style sheets. I keep it all in ~/projects/MyApp/{styles,images,index.py,

Re: Python 2.5 from source without tcl/tk

2007-07-04 Thread Florian Demmer
ok... cannot get rid of the "INFO: Can't locate Tcl/Tk libs and/or headers". Now same thing but weirder with curses: i do not have ncurses-devel installed. still make trys to compile the curses module. how do i prevent that? imo the configure should have more with/without switches... or do i just

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

2007-07-04 Thread Roy Smith
greg <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > E.g. your program might pass its test and run properly for years > > before some weird piece of input data causes some regexp to not quite > > work. > > Then you get a bug report, you fix it, and you add a test > for it so that particular bu

Re: ignoring a part of returned tuples

2007-07-04 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jul 2007 05:25:01 -0700, noamtm wrote: > On Jul 4, 11:29 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > >> A common idiom is to use '_' for unused values, ie: >> >> for (dirpath, _, filenames) in os.walk(...): > > That's what I need - this avoids PyLint telling me that I have an

Proposal: s1.intersects(s2)

2007-07-04 Thread David Abrahams
Here's an implementation of the functionality I propose, as a free-standing function: def intersects(s1,s2): if len(s1) < len(s2): for x in s1: if x in s2: return True else: for x in s2: if x i

  1   2   >