Re: python vs perl lines of code

2006-05-20 Thread John Bokma
"George Sakkis" <[EMAIL PROTECTED]> wrote: > John Bokma wrote: >> "George Sakkis" <[EMAIL PROTECTED]> wrote: [ Xah Lee ] >> [1] He is looking for another hoster btw. > > This must feel really empowering huh ? I am sure I've had quite some help. Also, you made quite a mistake. I have 0 power,

Re: Python - Web Display Technology

2006-05-20 Thread foxtree
None of you seem to know what you are talking about. Flash should be used where one needs to use Flash, and HTML/JS/CSS (+XML+XSLT) likewise. Flash can play video. That is not possible w/ HTML/CSS/JS. Flash also behaves consistently cross-browser, cross/platform -- and most features cannot be di

Re: Name conflict in class hierarchy

2006-05-20 Thread Ralf Muschall
Jeffrey Barish wrote: [overriding of base class member functions by subclass] > but then B does not inherit other functions of A that I would like to use. > It struck me that this must be a common problem in OOP, so I'm wondering > whether there is a simple solution that I am missing. In C++, o

Re: Feature request: sorting a list slice

2006-05-20 Thread Robert Kern
Steve Holden wrote: > Robert Kern wrote: >>I believe that John was asking George for a use case rather than asking >>Fredrik >>what a use case was. > > In which case, as I pointed out, John would have done better to quote a > little more context. No argument here. -- Robert Kern "I have com

Re: Feature request: sorting a list slice

2006-05-20 Thread Steve Holden
Robert Kern wrote: > Steve Holden wrote: > >>The effbot wrote: >> >> >>>George Sakkis wrote: >>> >>> >It would be useful if list.sort() accepted two more optional >parameters >>> >>>useful for what? what's the use case ? >> >>John Machin then wrote, without quoting any context at all: >>

Re: WeakrefValueDictionary of Callables?

2006-05-20 Thread Steve Holden
Lloyd Weehuizen wrote: > Hey > > I'm trying to set up a WeakrefValueDictionary of callables however as > soon as my method that adds the callable to the dictionary exits the > value is removed? Is there any way around this? > > Example: > import weakref > TEST_EVENT = 1 > > class TestBinder: >

Re: Feature request: sorting a list slice

2006-05-20 Thread Robert Kern
Steve Holden wrote: > The effbot wrote: > >>George Sakkis wrote: >> It would be useful if list.sort() accepted two more optional parameters >> >>useful for what? what's the use case ? > > John Machin then wrote, without quoting any context at all: > >>Use case? > > He means "under what

Re: Feature request: sorting a list slice

2006-05-20 Thread Steve Holden
The effbot wrote: > George Sakkis wrote: > >>> It would be useful if list.sort() accepted two more optional >>> parameters > > useful for what? what's the use case ? > John Machin then wrote, without quoting any context at all: > Use case? > He means "under what circumstances do you see someo

Re: python vs perl lines of code

2006-05-20 Thread George Sakkis
John Bokma wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > > John Bokma wrote: > > > >> "George Sakkis" <[EMAIL PROTECTED]> wrote: > >> > >> > Not trying to be as ass, but can you take this offline or at least in > >> > a perl newsgroup ? Arguing on a particular fact or speculation about >

Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
I reply again attaching a file as I see the editor wrecked the tab indentation. Gonzalo Monzón escribió: Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose

Re: Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
I reply again attaching a file as I see the editor wrecked the tab indentation. Gonzalo Monzón escribió: Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose

Python update trouble (2.3 to 2.4): x<

2006-05-20 Thread Gonzalo Monzón
Hi all! I have been translating some Python custom C extension code into Python, as I need these modules to be portable and run on a PocketPC without the need of compile (for the purpose its a must 2.4 as it is the last PythonCE release with great improvements). But I've been stuck with a scri

Re: python vs perl lines of code

2006-05-20 Thread John Bokma
"George Sakkis" <[EMAIL PROTECTED]> wrote: > John Bokma wrote: > >> "George Sakkis" <[EMAIL PROTECTED]> wrote: >> >> > Not trying to be as ass, but can you take this offline or at least in >> > a perl newsgroup ? Arguing on a particular fact or speculation about >> > the perl community is rather

WeakrefValueDictionary of Callables?

2006-05-20 Thread Lloyd Weehuizen
Hey I'm trying to set up a WeakrefValueDictionary of callables however as soon as my method that adds the callable to the dictionary exits the value is removed? Is there any way around this? Example: import weakref TEST_EVENT = 1 class TestBinder: def __init__( self ):

Re: Feature request: sorting a list slice

2006-05-20 Thread Edward Elliott
John Machin wrote: > Use case? quicksort! :) -- Edward Elliott UC Berkeley School of Law (Boalt Hall) complangpython at eddeye dot net -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tell if function was passed a list or a string?

2006-05-20 Thread Edward Elliott
Roy Smith wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: >> Currently there's no good duck-typing way to differentiate >> strings from other sequences. > > I suppose you could do something like: > > try: >foo.isalpha > except AttributeError: >print "foo is not a string" Another way: if

Re: misleading prefix ++

2006-05-20 Thread Edward Elliott
Peter Otten wrote: class Int(object): [snip] > ... def __pos__(self): > ... if self.half: > ... self.value += 1 > ... self.half = not self.half > ... return self [snip] i = Int() which leads us to: i > 0 +i > 0

Re: python vs perl lines of code

2006-05-20 Thread George Sakkis
John Bokma wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > > Not trying to be as ass, but can you take this offline or at least in > > a perl newsgroup ? Arguing on a particular fact or speculation about > > the perl community is rather unproductive and offtopic for a python > > newsgroup.

CRLF handling in the rfc822 module

2006-05-20 Thread Nikolaus Schulz
Hi, while playing with the rfc822 module and imaplib, I've found the following weird behaviour. Quickstart: rfc822.Message(fp) instantiates a rfc822.Message object from a file object fp. The docs for the rfc822 module say here: Input lines as read from the file may either be terminated by

Re: buffers readlines and general popen2 confusion...

2006-05-20 Thread [EMAIL PROTECTED]
That's just it. I was hoping to have python listening for events and responding continually according to the demaons stdout. That's why I mention popen2. -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs perl lines of code

2006-05-20 Thread Edward Elliott
Larry Bates wrote: > Sorry, I don't buy this. I can write REALLY short programs that don't > handle exceptions, don't provide for logging for debugging purposes, don't > allow > for future growth, etc. I find that 60% of my code has nothing to do with > the actual algorithm or function I'm tryin

Re: FAQ for XML with Python

2006-05-20 Thread BartlebyScrivener
I have one suggestion. It's a beautiful page, and one day I'll know enough to appreciate the help it provides, but until then it's always a big help to the novice (in many fields of knowledge) if the first use of an acronym includes the words it stands for in parenthesis. In law and medicine and m

Re: buffers readlines and general popen2 confusion...

2006-05-20 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >I'm interested in taking the output of a daemonized shell script that >greps for patterns which would act as an argument to a script. Is it >better to write this stuff to file and visit the file every few seconds >or can

Re: 'error reading datastream' -- loading file only when transfer is complete?

2006-05-20 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Andrew Robert <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> hello -- >> >> i'm running python/pygame on maemo (nokia 770). my situation is that >> i'm continually scouring this one directory for incoming files. if i >> see if there's a new file (coming in

Re: 'error reading datastream' -- loading file only when transfer is complete?

2006-05-20 Thread liuliuliu
thanks - i'm looking, but i found this as well. actually, does this work? import os os.access(file, os.R_OK) # is it readable? is this valid: { i have my file identified } isFileAccessible = os.access(file, os.R_OK) while !isFileAccessible: isFileAccessible = os.access(file, os.R_OK) and t

Re: python vs perl lines of code

2006-05-20 Thread Edward Elliott
George Sakkis wrote: > Not trying to be as ass, but can you take this offline or at least in a > perl newsgroup ? Arguing on a particular fact or speculation about the > perl community is rather unproductive and offtopic for a python > newsgroup. No offense taken. It's definitely OT. I left it

Re: python vs perl lines of code

2006-05-20 Thread John Bokma
"George Sakkis" <[EMAIL PROTECTED]> wrote: > Not trying to be as ass, but can you take this offline or at least in > a perl newsgroup ? Arguing on a particular fact or speculation about > the perl community is rather unproductive and offtopic for a python > newsgroup. Use a real Usenet client, an

Re: python vs perl lines of code

2006-05-20 Thread John Bokma
Edward Elliott <[EMAIL PROTECTED]> wrote: > You lecturing people on pissing contests, that's rich. Nice way to > duck the issue and sound like a winner. Then you've missed what a discussion really is. It's not about winning, it's about learning. Sadly you missed that point. > Wake me when you

Re: python vs perl lines of code

2006-05-20 Thread Larry Bates
Edward Elliott wrote: > This is just anecdotal, but I still find it interesting. Take it for what > it's worth. I'm interested in hearing others' perspectives, just please > don't turn this into a pissing contest. > > I'm in the process of converting some old perl programs to python. These > pr

Re: python vs perl lines of code

2006-05-20 Thread George Sakkis
Edward Elliott wrote: > John Bokma wrote: > > > Edward Elliott <[EMAIL PROTECTED]> wrote: > > > >> A little out-of-order execution seems useful here. ;) > > > > No, not interested in a pissing contest. Your statement that the Perl > > community encourages importing is *encouraged* (over using OO w

Re: buffers readlines and general popen2 confusion...

2006-05-20 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I'm interested in taking the output of a daemonized shell script that > greps for patterns which would act as an argument to a script. Is it > better to write this stuff to file and visit the file every few seconds > or can this be done a better way. I'm hoping for a more

Re: Name conflict in class hierarchy

2006-05-20 Thread Larry Bates
Jeffrey Barish wrote: > I believe that the answer to my question is no, but I want to be sure that I > understand this issue correctly: Suppose that there are two classes > defined as follows: > > class A(object): > def f1(self): > print 'In A.f1, calling func' > self.func() >

PHP's openssl_sign() using M2Crypto?

2006-05-20 Thread KW
I'm trying to convert some PHP code using OpenSSL to Python and I'm stuck on openssl_sign() which uses an RSA private key to compute a signature. Example PHP code: $privkeyid = openssl_get_privatekey($priv_key, $key_pass); openssl_sign($data, $signature, $privkeyid); openssl_free_key($privk

Re: python vs perl lines of code

2006-05-20 Thread Edward Elliott
John Bokma wrote: > Edward Elliott <[EMAIL PROTECTED]> wrote: > >> A little out-of-order execution seems useful here. ;) > > No, not interested in a pissing contest. Your statement that the Perl > community encourages importing is *encouraged* (over using OO without > importing) is false. The c

Re: python vs perl lines of code

2006-05-20 Thread John Bokma
Edward Elliott <[EMAIL PROTECTED]> wrote: > A little out-of-order execution seems useful here. ;) No, not interested in a pissing contest. Your statement that the Perl community encourages importing is *encouraged* (over using OO without importing) is false. -- John

buffers readlines and general popen2 confusion...

2006-05-20 Thread [EMAIL PROTECTED]
I'm interested in taking the output of a daemonized shell script that greps for patterns which would act as an argument to a script. Is it better to write this stuff to file and visit the file every few seconds or can this be done a better way. I'm hoping for a more elegant solution. So far I've se

Re: 'error reading datastream' -- loading file only when transfer is complete?

2006-05-20 Thread Andrew Robert
[EMAIL PROTECTED] wrote: > hello -- > > i'm running python/pygame on maemo (nokia 770). my situation is that > i'm continually scouring this one directory for incoming files. if i > see if there's a new file (coming in via wireless scp), i proceed to > load it and process it. > > however, i think

File encoding strategy question

2006-05-20 Thread Andrew Robert
Hi everyone, I am in the process of creating a file transmit/receiver program using MQSeries. The way it works is through creation of an XML message. Elements within the XML message contain things such as file name, size, and the file contents. The file contents are encoded, currently using Bas

'error reading datastream' -- loading file only when transfer is complete?

2006-05-20 Thread liuliuliu
hello -- i'm running python/pygame on maemo (nokia 770). my situation is that i'm continually scouring this one directory for incoming files. if i see if there's a new file (coming in via wireless scp), i proceed to load it and process it. however, i think i am running into the issue that my prog

LocaWapp 0a - localhost web application

2006-05-20 Thread .
http://daviderognoni.blogspot.com?locawapp - MAIN NEWS === * add ajax * new "Request" methods * fixed editor.py * fixed files.py * ... - DESCRIPTION = LocaWapp want use HTML and Python not only for the web, but also for the local applications: Local + HTML + Python = Loca

Re: Question about exausted iterators

2006-05-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Christophe wrote: > Well, the main reason for such change is and will always be to catch > bugs. The fact is, using duct typing is something very common with the > Python language. Duct typing? I guess you mean duct taping, or duck taping [1] or maybe duck typing. :-)

Name conflict in class hierarchy

2006-05-20 Thread Jeffrey Barish
I believe that the answer to my question is no, but I want to be sure that I understand this issue correctly: Suppose that there are two classes defined as follows: class A(object): def f1(self): print 'In A.f1, calling func' self.func() def func(self): print 'In

Re: mod_python, COM, on win2k3 server

2006-05-20 Thread drs
Some details, and this is weirder than I thought. It is working fine with internet explorer or mozilla as the client, but only crashes with Firefox. Moreover, even while firefox is getting errors, IE stilll works fine. The error I get is: Mod_python error: "PythonHandler mod_python.publisher"

Re: Question about Python on Mac

2006-05-20 Thread James Stroud
elventear wrote: > Hello, > > I am working with Python 2.4.3 built from source courtesy of Fink. So > far so good, until now. I want to use a module called GMPY > (http://gmpy.sf.net/). I am able to build correctly the module, but > once I try to import it I get the following error: > > ImportErr

mod_python, COM, on win2k3 server

2006-05-20 Thread drs
I have an application that runs on mod_python/apache using the publisher handler. It uses an access db as the backend and connects via ADO. In a test environment on XP it runs fine, but when on a win2k3 server it will load one page, but all subsequent page loads throw a pythoncom.CoInitialize

Re: Simple DAV server?

2006-05-20 Thread fuzzylollipop
webfolders is broken, I have worked on webdav support at the isp level ( for millions of customers to use ) webfolders is NOT something you should base compliancey on. It is broken so badly that we decided to just not even test against it. We provide our customers with our own application with whic

Re: combining a C# GUI with Python code?

2006-05-20 Thread James
Yes! It is. Just make your GUI in C# and assign event handlers using Python for .NET http://www.zope.org/Members/Brian/PythonNet/ Python for .NET is a great tool and has a minimal learning curve. Unfortunately, it hasn't attracted enough attention from the Python community. It does not have a .NET

Re: combining a C# GUI with Python code?

2006-05-20 Thread Luis M. González
PythonCard is based on wxpython and it's free: http://pythoncard.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal and Exponentiation

2006-05-20 Thread Tim Peters
[Raymond L. Buvel, on http://calcrpnpy.sourceforge.net/clnumManual.html ] >>> The clnum module handles this calculation very quickly: >>> >>> >>> from clnum import mpf >>> >>> mpf("1e1") ** mpf("3.01") >>> mpf('9.99932861e30099',26) [Tim Peters] >> That's probably good e

Re: [silly] Does the python mascot have a name ?

2006-05-20 Thread Edward Elliott
John D Salt wrote: > Most things don't have names? > > I'll believe you if you can give me a list of ten things that don't have > names. Chairs, couches, tables, desks, beds, cars, pens, phones, trees, windows (can you tell how I came up with this list? ;). Those are all object types without n

[OT] - Requesting Comments for "Open Source Rework" Business Concept

2006-05-20 Thread Ilias Lazaridis
You may remember the request for comments at the start of this year: http://groups.google.com/group/comp.lang.python/msg/b0e3487ef8b13eed http://groups.google.com/group/comp.lang.ruby/msg/b0e3487ef8b13eed - The services of "Lazaridis System Design" have reached pre-release state and will be soo

Re: python vs perl lines of code

2006-05-20 Thread Edward Elliott
A little out-of-order execution seems useful here. ;) John Bokma wrote: > Edward Elliott <[EMAIL PROTECTED]> wrote: >> I can readily believe that the "community" frequenting the newsgroups, >> mailing lists, and blogs don't encourage it anymore. But that's a >> tiny fraction of all perl programm

Re: Generating Cutter numbers

2006-05-20 Thread Terry Reedy
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm cataloging a small library and want to generate a unique id (called > a 'call number') for each book. This id is composed of: > > * Dewey 3-digit Subject Classification Number > * Dewey Decimal (always 0 for the

Find Your Soul Mate

2006-05-20 Thread Knowledge
Find Your Soul Mate ! Cheat Your Wife/Husband! Try New Things! Or Just Met Friends! http://affiliatecash.designerlove.com/idevaffiliate.php?id=3537 -- http://mai

Re: Generating Cutter numbers

2006-05-20 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Gerard Flanagan wrote: > > All > > > > would anyone happen to have code to generate Cutter Numbers: > > > > eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm > > > > or is anyone looking for something to do?-) (I'm under pressure!) > > > > def cutter(lnam

Re: DO NOT USE file()

2006-05-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: >"Tim Peters" <[EMAIL PROTECTED]> writes: >> [John Salerno, on the difference between `open` and `file`] >>> >>> Interesting. What is the difference between them now? >> >> In 2.5 `file` is unchanged but `open` becomes a functi

Re: combining a C# GUI with Python code?

2006-05-20 Thread BartlebyScrivener
John, I know you started out asking about .NET, but peruse this thread, wherein some old hands recommend staying with what you know, if what you know is VBA guis. http://tinyurl.com/ehujm rick -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal and Exponentiation

2006-05-20 Thread Raymond L. Buvel
Tim Peters wrote: > [Raymond L. Buvel, on >http://calcrpnpy.sourceforge.net/clnumManual.html > ] > >> The clnum module handles this calculation very quickly: >> >> >>> from clnum import mpf >> >>> mpf("1e1") ** mpf("3.01") >> mpf('9.99932861e30099',26) > > > That's pr

Re: combining a C# GUI with Python code?

2006-05-20 Thread John Salerno
Rony Steelandt wrote: > Isn't it a bit overkill to implement the whole .net framework 'Just' > for a GUI ?? > > If you want to build quickly nice GUI's for your python program, have a > look at wxpython & wxdesigner wxdesigner looked good until I had to pay. :( -- http://mail.python.org/mailma

Re: Decimal and Exponentiation

2006-05-20 Thread Tim Peters
[Raymond L. Buvel, on http://calcrpnpy.sourceforge.net/clnumManual.html ] > The clnum module handles this calculation very quickly: > > >>> from clnum import mpf > >>> mpf("1e1") ** mpf("3.01") > mpf('9.99932861e30099',26) That's probably good enough for the OP's needs

Re: Generating Cutter numbers

2006-05-20 Thread Rick Zantow
[EMAIL PROTECTED] wrote in news:1148133784.844430.23130@ 38g2000cwa.googlegroups.com: > Gerard Flanagan wrote: >> All >> >> would anyone happen to have code to generate Cutter Numbers: >> >> eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm >> [...] > > I wrote a script to see if

Re: Generating Cutter numbers

2006-05-20 Thread Tim Chase
> I am stumped about what to do when the first letter is Q not > followed by U. It says to use numbers 2-29 for the second > letters a-t, but that is obviously not right (for one thing t > would be 21, not 29). > > Since you seem a little bit more experienced in library > science could you ex

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-20 Thread Christophe Cavalaria
Christopher Weimann wrote: > On 05/19/2006-07:18AM, Duncan Booth wrote: >> >> My experience of programming with either spaces or tabs has taught me >> that tabs are evil not for themselves, but simply because no matter how >> hard you try they always end up being mixed with spaces. >> > > Swap

Re: Generating Cutter numbers

2006-05-20 Thread skryskalla
Gerard Flanagan wrote: > All > > would anyone happen to have code to generate Cutter Numbers: > > eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm > > or is anyone looking for something to do?-) (I'm under pressure!) > > def cutter(lname, fname, book_title): > What do you use lna

Re: misleading prefix ++

2006-05-20 Thread Peter Otten
[EMAIL PROTECTED] wrote: > but when I input: ++i > and the interpreter replies > 0 > > Don't you think it is misleading when you expect a variable to > increment? You have been warned... $ cat pp.py i = 42 ++i print i --i $ pychecker pp.py Processing pp... 42 Warnings... pp.py:2: Operato

Re: misleading prefix ++

2006-05-20 Thread Tim Chase
>++i >> >>and the interpreter replies >>0 >> >>Don't you think it is misleading when you expect a variable to >>increment? >> > > Terribly. So stop expecting it to increment :) > > Seriously, --i is also valid Python. Both expressions apply two unary > operators to a name. Would you have the

Re: misleading prefix ++

2006-05-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Don't you think it is misleading when you expect a variable to > increment? no. and in my experience, most people know that they cannot just type random stuff into a computer and expect it to do what they want. (have you figured out *why* this is valid syntax, and wh

Re: misleading prefix ++

2006-05-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: > given i = 0, > I know i = i + 1 and i += 1 are all correct > but when I type: > i++ > > the interpreter replies: > File "", line 1 > i++ > ^ > SyntaxError: invalid syntax > > so I get the idea that suffix ++ is invalid in python > but when I input: > >

misleading prefix ++

2006-05-20 Thread LuciferLeo
given i = 0, I know i = i + 1 and i += 1 are all correct but when I type: >>> i++ the interpreter replies: File "", line 1 i++ ^ SyntaxError: invalid syntax so I get the idea that suffix ++ is invalid in python but when I input: >>> ++i and the interpreter replies 0 Don't you think it

The ONE TRUE WAY to use tabs (Re: Tabs versus Spaces in Source Code)

2006-05-20 Thread Andy Sy
achates wrote: > Yeah - we've got to the repeating ourselves stage. Actually a couple of the responses on this newsgroup have settled the question for me. I did learn something new by engaging in this holy war. Tabs need not be evil, but ONLY if they are used in one particular way: If you rea

Re: Simple DAV server?

2006-05-20 Thread robert
Kyler Laird wrote: > Ivan Voras <[EMAIL PROTECTED]> writes: > > >>Most of the problems are probably because I didn't mean it to be a >>fully-compliant WebDAV server, but to serve my need at the time :) > > > I am *so* close to having a WebDAV solution. Unfortunately when I finally > moved to

Re: Decimal and Exponentiation

2006-05-20 Thread Raymond L. Buvel
Tim Peters wrote: > The GNU GMP library (for which Python bindings are available) also > supports "big floats", but their power operation is also restricted to > integer powers and/or exact roots. This can be painful even to try; > e.g., > >>>> from gmpy import mpf >>>> mpf("1e1") *

Re: Decimal and Exponentiation

2006-05-20 Thread Raymond L. Buvel
elventear wrote: > Hi, > > I am the in the need to do some numerical calculations that involve > real numbers that are larger than what the native float can handle. > > I've tried to use Decimal, but I've found one main obstacle that I > don't know how to sort. I need to do exponentiation with re

Re: open file with whitespaces

2006-05-20 Thread Claudio Grondi
mardif wrote: > OK OK GUYS > I've found the solution: ( effectly, a friend of mine has found the > solution ) > > import os > > os.spawnl(os.P_WAIT, "c:\programmi\internet > explorer\iexplore.exe",'"C:\Documents and > Settings\michele\Desktop\ciccio.html"','"C:\Documents and > Settings\michel

Re: noob import question

2006-05-20 Thread Carl Banks
PA wrote: > On May 19, 2006, at 15:33, Diez B. Roggisch wrote: > > > And it seems as if you have some JAVA-background, putting one class in > > one > > file called the same as the class. Don't do that, it's a stupid > > restriction > > in JAVA and should be avoided in PYTHON. > > Restrictive or not

Re: Exception style (was: calling python functions using variables)

2006-05-20 Thread Carl Banks
Dennis Lee Bieber wrote: > On Fri, 19 May 2006 14:41:13 +, [EMAIL PROTECTED] (Cameron Laird) > declaimed the following in comp.lang.python: . > > Guys, I try--I try *hard*--to accept the BetterToAskForgiveness > > gospel, but this situation illustrates the discomfort I consistently > >

Re: Exception style (was: calling python functions using variables)

2006-05-20 Thread Carl Banks
Fredrik Lundh wrote: > Cameron Laird wrote: > > > Guys, I try--I try *hard*--to accept the BetterToAskForgiveness > > gospel, but this situation illustrates the discomfort I consistently > > feel: how do I know that the NameError means VARIABLE didn't resolve, > > rather than that it did, but that

Re: combining a C# GUI with Python code?

2006-05-20 Thread Gerard Flanagan
John Salerno wrote: > Is it possible to construct a C# form (using Visual Studio) but write > only Python code for the events? Is there some way to tell your program > to run Python whenever code is run, since it will be all Python code > (e.g. for button presses, etc.)? > > I know it's sort of si

Generating Cutter numbers

2006-05-20 Thread Gerard Flanagan
All would anyone happen to have code to generate Cutter Numbers: eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm or is anyone looking for something to do?-) (I'm under pressure!) def cutter(lname, fname, book_title): (maybe more to it than that). cheers Gerard -- http:/

Re: combining a C# GUI with Python code?

2006-05-20 Thread Rony Steelandt
Isn't it a bit overkill to implement the whole .net framework 'Just' for a GUI ?? If you want to build quickly nice GUI's for your python program, have a look at wxpython & wxdesigner Rony > Is it possible to construct a C# form (using Visual Studio) but write only > Python code for the even

Re: PEP 3102 for review and comment

2006-05-20 Thread Carl Banks
Talin wrote: > Specification > > Syntactically, the proposed changes are fairly simple. The first > change is to allow regular arguments to appear after a varargs > argument: > > def sortwords(*wordlist, case_sensitive=False): >... > > This function accepts any

Re: Creating a new file object; open() vs file()

2006-05-20 Thread Fredrik Lundh
Ben Finney wrote: >> I see what you mean, but I think that's why I like using open, >> because I like having my functions be verbs instead of nouns. > > Note though that you're calling a class (in this case, type) > constructor, to return a new object. no, he's calling a factory function to get

Help Needed plz :)

2006-05-20 Thread Yasmeen Alkadi
Hello . .   I am trying to control an NIDS (network intustion detection system) that uses Snort via mobile phones, but I need urgent help please in the following topics below:  1. How to send a text file from a PC running windows to a nokia mobile phone series 60, for example nokia 6680 via bluet

Re: altering an object as you iterate over it?

2006-05-20 Thread netvaibhav
bruno at modulix wrote: > fin = open(path, 'r') > fout = open(temp, 'w') > for line in fin: > if line.strip(): > fout.write(line) > fin.close() > fout.close() > > then delete path and rename temp, and you're done. And yes, this is > actually the canonical way to do this !-) What if there's a

Re: Using python for a CAD program

2006-05-20 Thread David Cuthbert
Terry Hancock wrote: > I disagree that transactions are bad for CAD -- they may have > a different semantic role and the needed granularity may be > different, but the need to roll data back to an earlier revision > is just as present in drawings as it is for code or financial > transactions. Sure

mysql

2006-05-20 Thread yogesh shrikhande
hello sir i want to aceess database at any location i know my.ini config. setting but my problem is suppose my i have two database ie. abc & xyz  abc database is stored at path c:\apache\mysql\data  this path is also in my.ini . & xyz database at path c:\mydocument i want to access both database

Re: hidden file detection

2006-05-20 Thread Fabian Steiner
Lenny G. wrote: > What's the best way to do cross-platform hidden file detection? I want > to do something like weed-out the files that should be 'hidden' from > os.listdir() (which would be files that start with '.' under Unix, > files that have the hidden attribute set on windows, and whatever i

Re: Using metaclasses to inherit class variables

2006-05-20 Thread [EMAIL PROTECTED]
Hmm. setattr() only does a shallow search. Good to know. Your if not name in dict: setattr(cls, name, value) is a more succinct/better way of writing if not cls.__dict__.has_key(var): setattr(cls, var, val) Which i tested a fair bit. OK it appears that both are working for the simple