Registry and Spyware Cleaner (Free Download)

2008-02-28 Thread stelevision
Netcom3(tm) is a recognized global leader in internet security software. With Netcom3 Internet Security Suite, it's key focus is on securing sensitive consumer online interactions, as well as prevent and remove Spyware, Adware, optimize, fix PC errors, and make your system run faster and error free

Re: Problems Generating HTML With pydoc

2008-02-28 Thread Juha S.
Ron DuPlain wrote: > I also expected "pydoc -w mypackage" to recursively generate html for > the whole package, but it only wrote the top-level file for me as well > (on Linux, for the record) > > I use the workaround: > pydoc -w ./ > > This runs "pydoc -w" on all Python files in the current dir

Re: SV: Running test01.py under Windows (basic level)

2008-02-28 Thread Gabriel Genellina
En Fri, 29 Feb 2008 02:38:04 -0200, K Viltersten <[EMAIL PROTECTED]> escribió: >>> def bloppA (): >>> print "a very advanced piece of code" >> >> go to File -> Open, open your saved file, >> and use the Run menu (or press F5). > > When i try that i get this. > == RESTART === >>>

Re: SV: Running test01.py under Windows (basic level)

2008-02-28 Thread Gabriel Genellina
En Fri, 29 Feb 2008 02:30:43 -0200, K Viltersten <[EMAIL PROTECTED]> escribió: >>> I have v2.5.2 installed and i've composed >>> a source code i'm sure everybody will be >>> impressed by. It goes like this. >>> >>> def bloppA (): >>> print "a very advanced piece of code" >>> >>> What i get t

buy cheap tibia gold here gameotl.com

2008-02-28 Thread kyla
http://www.gameotl.com/tibia.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-28 Thread dave_mikesell
Good article. Re: the comparisons with C++, most of my experience is with C++ and I like it because it's powerful, flexible, portable, and keeps me employable. However, I can't think of any application or system I've written in C++ (or Java or Perl) that could not have been written in Python. In

Re: (Newbie) Help with sockets.

2008-02-28 Thread Grant Edwards
On 2008-02-29, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Fri, 29 Feb 2008 00:20:26 -0200, <[EMAIL PROTECTED]> escribió: > >> Hi everyone. I'm fairly new to Python, and even more new to socket >> programming. I think I've wrapped my head around sockets, and with >> that I want to create a Te

SV: Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
>> def bloppA (): >> print "a very advanced piece of code" > > go to File -> Open, open your saved file, > and use the Run menu (or press F5). When i try that i get this. >>> == RESTART === >>> And nothing more. Do i use wrong "print"?! -- Regards Konrad Viltersten

Re: pySQLite Insert speed

2008-02-28 Thread Carsten Haese
On Thu, 28 Feb 2008 19:35:03 -0800 (PST), mdboldin wrote > I hav read on this forum that SQL coding (A) below is preferred over > (B), but I find (B) is much faster (20-40% faster) > > (A) > > sqla= 'INSERT INTO DTABLE1 VALUES (%d, %d, %d, %f)' % values > curs.execute(sqla) > > (B) >

SV: Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
>> I have v2.5.2 installed and i've composed >> a source code i'm sure everybody will be >> impressed by. It goes like this. >> >> def bloppA (): >> print "a very advanced piece of code" >> >> What i get to work is to make it run from >> the the snakes shell. Then, i realised >> that such a mas

Re: Is crawling the stack "bad"? Why?

2008-02-28 Thread Russell Warren
> OK, if you crawl the stack I will seek you out and hit you with a big > stick. Does that affect your decision-making? How big a stick? :) > Seriously, crawling the stack introduces the potential for disaster in > your program, since there is no guarantee that the calling code will > provide the

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
Ross Ridge wrote: > You're just going to have to accept that there that there is no > concensus on this issue and there never was. Steven D'Aprano <[EMAIL PROTECTED]> wrote: >But that's not true. The consensus, across the majority of people (both >programmers and non-programmers alike) is that

Re: Article of interest: Python pros/cons for the enterprise

2008-02-28 Thread Robert Brown
Paul Rubin writes: > Robert Brown <[EMAIL PROTECTED]> writes: >> This is the approach taken by Common Lisp. Often just a few type >> declarations, added to code in inner loops, results in vastly faster code. > That is just a dangerous hack of improving performance by t

Re: Windows gzip problem

2008-02-28 Thread John Earls
On Feb 28, 6:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 28 Feb 2008 21:09:30 -0200, John Earls <[EMAIL PROTECTED]> > escribió: > > > > > I am having a problem with gzip. The code worked fine under linux but > > when I moved it over to windows it is getting stuck unzipping a gz

Re: Problems Generating HTML With pydoc

2008-02-28 Thread Ron DuPlain
On Feb 26, 3:23 am, "Juha S." <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to generate HTML docs for a Python package (directory) > currently containing an empty __init__.py and a Module.py file with some > classes and docstrings. I tried using the command > "F:\path\to\project\pydoc.py -w myPac

Re: (Newbie) Help with sockets.

2008-02-28 Thread Gabriel Genellina
En Fri, 29 Feb 2008 00:20:26 -0200, <[EMAIL PROTECTED]> escribió: > Hi everyone. I'm fairly new to Python, and even more new to socket > programming. I think I've wrapped my head around sockets, and with > that I want to create a Telnet-based chat server, the idea being > people connect to the tel

pySQLite Insert speed

2008-02-28 Thread mdboldin
I hav read on this forum that SQL coding (A) below is preferred over (B), but I find (B) is much faster (20-40% faster) (A) sqla= 'INSERT INTO DTABLE1 VALUES (%d, %d, %d, %f)' % values curs.execute(sqla) (B) pf= '?, ?, ?, ?' sqlxb= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf

Re: Permission to use Mac OS 'rocketship' dock icon?

2008-02-28 Thread Benjamin
On Feb 28, 3:37 pm, "Anand Patil" <[EMAIL PROTECTED]> wrote: > Hi all, > > The image of a rocket with the Python logo that occasionally shows up > in the dock would make part of a nice logo for PyMC, an open-source > Python Bayesian statistics package. Anyone know who we would have to > ask to get

Re: (Newbie) Help with sockets.

2008-02-28 Thread Miki
Hello, > Hi everyone. I'm fairly new to Python, and even more new to socket > programming. I think I've wrapped my head around sockets, and with > that I want to create a Telnet-based chat server, the idea being > people connect to the telnet servers with their clients and they all > communicate.

(Newbie) Help with sockets.

2008-02-28 Thread mentaltruckdriver
Hi everyone. I'm fairly new to Python, and even more new to socket programming. I think I've wrapped my head around sockets, and with that I want to create a Telnet-based chat server, the idea being people connect to the telnet servers with their clients and they all communicate. I've got the code

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Benoit wrote: > Forgive my language concerning C++ as its turned the thread into > something I did not intend. I merely wished to point out that Python > was easier for me to learn than C++. To Schwab, its likely that Mark > Lutz is simply a better instructor than my professor. Sorry for hijackin

Re: How to configure Python in Windows

2008-02-28 Thread cosmo_general
On 2月28日, 下午6时52分, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi Folks, > > > I just downloaded precompiled Python for Windows, and it runs. Now I > > have got the command line coding. However, I can't run my python > > scripts. My python script, foo.py, is located in C:\

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 5:26 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote: > On Feb 28, 3:50 pm, Bjoern Schliessmann > [EMAIL PROTECTED]> wrote: > > Sean DiZazzo wrote: > > > Is there something special you have to do to get a wxPython app to > > > run remotely under xwindows?  My Tkinter apps always automaticall

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 3:50 pm, Bjoern Schliessmann wrote: > Sean DiZazzo wrote: > > Is there something special you have to do to get a wxPython app to > > run remotely under xwindows?  My Tkinter apps always automatically > > work that way, so I was surprised to even be confronted with this > > problem. > >

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Thu, 28 Feb 2008 10:34:45 -0800, Jeff Schwab wrote: > >>> Hey a flame bait. I'll bite. >> Excuse me? Somebody posts about an introductory course on C++ covering >> "dynamic arrays using pointers" and literally says "kill me now," and >> I'm the flamer for a

Re: Nested module import clutters package namespace?

2008-02-28 Thread Arnaud Delobelle
On Feb 29, 12:16 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 28 Feb 2008 11:00:08 -0200, Dr. Rüdiger Kupper   > <[EMAIL PROTECTED]> escribió: > > > > > I'd be grateful for help with a problem of package and module > > namespaces. The behaviour I observe is unexpected (to me), and I

Re: Windows gzip problem

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 21:09:30 -0200, John Earls <[EMAIL PROTECTED]> escribió: > I am having a problem with gzip. The code worked fine under linux but > when I moved it over to windows it is getting stuck unzipping a gz > file. > > -- snippet -- > > fileObj = gzip.GzipFile(iceGetter.file.

Re: Snackages [Re: is there enough information?]

2008-02-28 Thread Gabriel Genellina
En Wed, 27 Feb 2008 21:06:56 -0200, Micah Cowan <[EMAIL PROTECTED]> escribi�: > Gabriel Genellina wrote: >>> Speak not of Wendy's -- they moved into town in my college days... >>> The "hot and juicy" was commonly taken to mean: patty dipped in pan >>> drippings, then nuked in microwave... An

Re: Nested module import clutters package namespace?

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 11:00:08 -0200, Dr. Rüdiger Kupper <[EMAIL PROTECTED]> escribió: > I'd be grateful for help with a problem of package and module > namespaces. The behaviour I observe is unexpected (to me), and I > couldn't find the answer in the docs, the tutorial, or the mailing > list arch

Re: Running test01.py under Windows (basic level)

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 21:05:45 -0200, K Viltersten <[EMAIL PROTECTED]> escribió: > I have v2.5.2 installed and i've composed > a source code i'm sure everybody will be > impressed by. It goes like this. > > def bloppA (): > print "a very advanced piece of code" > > What i get to work is to mak

Re: How about adding rational fraction to Python?

2008-02-28 Thread Arnaud Delobelle
On Feb 28, 10:41 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: [...] > The interesting case is -1/2. According to the argument that "2 doesn't > go into 1", -1/2 should also return 0. But that's not what Python > returns, so it looks like the "int division" camp is screwed no ma

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
On Feb 28, 3:50 pm, Bjoern Schliessmann wrote: > Sean DiZazzo wrote: > > Is there something special you have to do to get a wxPython app to > > run remotely under xwindows?  My Tkinter apps always automatically > > work that way, so I was surprised to even be confronted with this > > problem. > >

Re: How to configure Python in Windows

2008-02-28 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi Folks, > > I just downloaded precompiled Python for Windows, and it runs. Now I > have got the command line coding. However, I can't run my python > scripts. My python script, foo.py, is located in C:\\\pydir, and I > have set the python interpreter on the directo

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Bjoern Schliessmann
Sean DiZazzo wrote: > Is there something special you have to do to get a wxPython app to > run remotely under xwindows? My Tkinter apps always automatically > work that way, so I was surprised to even be confronted with this > problem. Could you please provide more detail? My wxPython apps run p

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Grant Edwards
On 2008-02-28, Sean DiZazzo <[EMAIL PROTECTED]> wrote: > Is there something special you have to do to get a wxPython > app to run remotely under xwindows? My Tkinter apps always > automatically work that way, so I was surprised to even be > confronted with this problem. AFAIK, running them remot

Re: Python app at startup!

2008-02-28 Thread Larry Bates
SMALLp wrote: > Hy. I create simple application. Yust an windows and "compile" it with > py2exe. I add registry value > reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v > MyApp /t REG_SZ /d C:\myapp.exe /f' > > And it wont start. When i use console instead od window i

Re: Decorators and buffer flushing

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 18:04:38 -0200, Ethan Metsger <[EMAIL PROTECTED]> escribió: > On Thu, 28 Feb 2008 14:48:55 -0500, <[EMAIL PROTECTED]> wrote: > >> Can you reproduce the bug on the console? Or, try starting with a new >> line in the output. Or, try a input(). > > I can reproduce the issue in

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread Larry Bates
davidj411 wrote: > i am parsing a cell phone bill to get a list of all numbers and the > total talktime spend on each number. > > i already have a unique list of the phone numbers. > now i must go through the list of numbers and add up the totals for > each number. > on the bill, each line has a f

Run wxPython app remotely under XWindows

2008-02-28 Thread Sean DiZazzo
Is there something special you have to do to get a wxPython app to run remotely under xwindows? My Tkinter apps always automatically work that way, so I was surprised to even be confronted with this problem. ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Odd handling of type.__init__ bases

2008-02-28 Thread Arnaud Delobelle
On Feb 28, 10:50 pm, [EMAIL PROTECTED] wrote: > I encountered an oddity in attempting to use a metaclass to perform mix-in > inheritance for classes.  I've attached a small demonstration file.  Have I > misunderstood the bases argument for type.__init__ or should this be submitted > as a bug? Afte

Re: Raising exception on STDIN read

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 15:22:21 -0200, Ian Clark <[EMAIL PROTECTED]> escribió: > On 2008-02-28, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> En Thu, 28 Feb 2008 14:29:04 -0200, Ian Clark <[EMAIL PROTECTED]> >> escribió: >> >>> On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: En

How to configure Python in Windows

2008-02-28 Thread cosmo_general
Hi Folks, I just downloaded precompiled Python for Windows, and it runs. Now I have got the command line coding. However, I can't run my python scripts. My python script, foo.py, is located in C:\\\pydir, and I have set the python interpreter on the directory. When I run os.listdir(), I found

Re: How about adding rational fraction to Python?

2008-02-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Calculating machines that handled > > floating point are older than Python by far. > > Yes, and they almost universally give the result 1/2 -> 0.5. Can you name an example of a calculating machine that both: 1) represents the integer 1 and the rea

Re: convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread D'Arcy J.M. Cain
On Thu, 28 Feb 2008 14:56:10 -0800 (PST) davidj411 <[EMAIL PROTECTED]> wrote: > ValueError: invalid literal for int() with base 10: '"2"' > > > here is the question: > > How can i convert a string number like "2" to a true number that can > be added. You have to get rid of the double quotes fir

Re: How about adding rational fraction to Python?

2008-02-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > any restriction that functions must return the same > type as all its arguments is just crazy. I don't think anyone is saying that they should necessarily do that in general. Just in some specific cases. -- http://mail.python.org/mailman/listinfo/py

Python app at startup!

2008-02-28 Thread SMALLp
Hy. I create simple application. Yust an windows and "compile" it with py2exe. I add registry value reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d C:\myapp.exe /f' And it wont start. When i use console instead od window in py2exe i get console op

Windows gzip problem

2008-02-28 Thread John Earls
Hello, I am having a problem with gzip. The code worked fine under linux but when I moved it over to windows it is getting stuck unzipping a gz file. -- snippet -- fileObj = gzip.GzipFile(iceGetter.file.localFileName, 'rb') uncompressedFileName = iceGetter.file.localFileName[:-3

convert string number to real number - ValueError: invalid literal for int() with base 10: '"2"'

2008-02-28 Thread davidj411
i am parsing a cell phone bill to get a list of all numbers and the total talktime spend on each number. i already have a unique list of the phone numbers. now i must go through the list of numbers and add up the totals for each number. on the bill, each line has a few fields,one field containing

Odd handling of type.__init__ bases

2008-02-28 Thread quick
I encountered an oddity in attempting to use a metaclass to perform mix-in inheritance for classes. I've attached a small demonstration file. Have I misunderstood the bases argument for type.__init__ or should this be submitted as a bug? Python 2.5 (r25:51908, Feb 22 2007, 19:05:27) [GCC 4.1

Running test01.py under Windows (basic level)

2008-02-28 Thread K Viltersten
I have v2.5.2 installed and i've composed a source code i'm sure everybody will be impressed by. It goes like this. def bloppA (): print "a very advanced piece of code" What i get to work is to make it run from the the snakes shell. Then, i realised that such a masterpiece needs storing in

Re: How about adding rational fraction to Python?

2008-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2008 14:41:56 -0500, Ross Ridge wrote: > You're just going to have to accept that there that there is no > concensus on this issue and there never was. But that's not true. The consensus, across the majority of people (both programmers and non-programmers alike) is that 1/2 should

Re: How about adding rational fraction to Python?

2008-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2008 11:22:43 -0500, D'Arcy J.M. Cain wrote: > Calculating machines that handled > floating point are older than Python by far. Yes, and they almost universally give the result 1/2 -> 0.5. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: How about adding rational fraction to Python?

2008-02-28 Thread Steven D'Aprano
On Thu, 28 Feb 2008 11:13:27 -0500, D'Arcy J.M. Cain wrote: >> >Automatic conversions, okay... but converting a result when all >> > inputs are of one time, NO... >> >> What? How does that make any sense? >> >> By that logic, we should see this: >> >> >>> len("a string") >> '8' >> >>> len([

You have to see this - http://ilaarijs.blogspot.com/ :D

2008-02-28 Thread [EMAIL PROTECTED]
You have to see this - http://ilaarijs.blogspot.com/ :D -- http://mail.python.org/mailman/listinfo/python-list

Permission to use Mac OS 'rocketship' dock icon?

2008-02-28 Thread Anand Patil
Hi all, The image of a rocket with the Python logo that occasionally shows up in the dock would make part of a nice logo for PyMC, an open-source Python Bayesian statistics package. Anyone know who we would have to ask to get permission to use it? Thanks, Anand -- http://mail.python.org/mailman/

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread subeen
rstrip() works fine in python 2.4.3. May be the problem lies in somewhere else. I tried it in FC6 with Python 2.4.3: >>> url = "abc.com\n" >>> url.rstrip() 'abc.com' regards, Subeen. http://love-python.blogspot.com/ On Feb 29, 2:30 am, dirkheld <[EMAIL PROTECTED]> wrote: > Hi, > > I wrote some

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread Terry Reedy
"dirkheld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | I wrote some python code that retrieves urls from a txt file. In this | code I use .rstrip() for removing the '\n' at the end of every url. | While this code works on my mac (leopard) with python 2.5.1, this same | c

Re: Indentation and optional delimiters

2008-02-28 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | But the default behavior may become the "true" copy, that seems | simpler for a newbie to grasp. To me, it is the opposite. If I say gvr = Guido_van_Russum # or any natural language equivalent do you really think a copy is made? Cop

Re: Pythons & Ladders

2008-02-28 Thread Paul Boddie
On 28 Feb, 21:08, Benoit <[EMAIL PROTECTED]> wrote: > Forgive my language concerning C++ as its turned the thread into > something I did not intend. I merely wished to point out that Python > was easier for me to learn than C++. To Schwab, its likely that Mark > Lutz is simply a better instructor

Re: XML expat error

2008-02-28 Thread Marc 'BlackJack' Rintsch
On Thu, 28 Feb 2008 12:37:10 -0800, dirkheld wrote: >> Yes of course: handle the exception instead of letting it propagate to the >> top level and ending the program. > > Ehm, maybe a stupid question... how. I'm rather new to python and I > never user error handling. Then you should work through

Re: Decorators and buffer flushing

2008-02-28 Thread Ethan Metsger
On Thu, 28 Feb 2008 14:48:55 -0500, <[EMAIL PROTECTED]> wrote: > Can you reproduce the bug on the console? Or, try starting with a new > line in the output. Or, try a input(). I can reproduce the issue in the console. I'm not convinced it's actually a bug, unless for some reason the interpre

Re: Pythons & Ladders

2008-02-28 Thread Marc 'BlackJack' Rintsch
On Thu, 28 Feb 2008 10:34:45 -0800, Jeff Schwab wrote: >> Hey a flame bait. I'll bite. > > Excuse me? Somebody posts about an introductory course on C++ covering > "dynamic arrays using pointers" and literally says "kill me now," and > I'm the flamer for asking him not to hold the language re

Re: How about adding rational fraction to Python?

2008-02-28 Thread D'Arcy J.M. Cain
On 28 Feb 2008 12:25:14 -0800 Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote: > "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > > > I'd like to point out that now you are talking about int OP int > > > returning a tuple, not an int. > > > > Which would be stupid. Good thing I don't think that

Re: XML expat error

2008-02-28 Thread Stefan Behnel
dirkheld wrote: > On 28 feb, 08:18, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 27 Feb 2008 14:02:25 -0800, dirkheld wrote: >>> Something strange here. The xml file causing the problem has only 361 >>> lines. Isn't there a way to catch this error, ignore it and continu >>> with t

Re: XML expat error

2008-02-28 Thread dirkheld
On 28 feb, 08:18, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 27 Feb 2008 14:02:25 -0800, dirkheld wrote: > > Something strange here. The xml file causing the problem has only 361 > > lines. Isn't there a way to catch this error, ignore it and continu > > with the rest of the othe

rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread dirkheld
Hi, I wrote some python code that retrieves urls from a txt file. In this code I use .rstrip() for removing the '\n' at the end of every url. While this code works on my mac (leopard) with python 2.5.1, this same code fails to work on an ubuntu server with python 2.4.3 I was wondering if there is

Re: How about adding rational fraction to Python?

2008-02-28 Thread Paul Rubin
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > > I'd like to point out that now you are talking about int OP int > > returning a tuple, not an int. > > Which would be stupid. Good thing I don't think that "obvious" should > be the criteria. We already have that function (divmod) and it is very

Re: TypeError: only length-1 arrays can be converted to Python scalars.

2008-02-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi All, > > Could anybody tell me what is the problem with the following sequence > with which I always get the above error message. I use Numeric and > Python 2.4 > > x=array([1,2,3,4]) > y=exp(x) The meaning of the error message is fairly obvious - exp() can't operat

Re: Pythons & Ladders

2008-02-28 Thread Benoit
Forgive my language concerning C++ as its turned the thread into something I did not intend. I merely wished to point out that Python was easier for me to learn than C++. To Schwab, its likely that Mark Lutz is simply a better instructor than my professor. -- http://mail.python.org/mailman/listin

Re: Pythons & Ladders

2008-02-28 Thread castironpi
On Feb 28, 12:34 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch wrote: > > Hey a flame bait.  I'll bite. [ redirected to OP ] >>> OP.flamebait= 1.0. >>> bait.bite() Traceback (most recent call last): File "", line 1, in AttributeError: 'FlameBait' object has no attribute

Re: Python's BNF

2008-02-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Implemented all your suggestions, with two exceptions. > > Changed file read to readlines(), but not open(...).readlines(). I > love to say file.close(). Gives me a feeling of security. (We could > discuss RAM waste v. I/O speed but this input file is just 10KB, so > nei

Re: How about adding rational fraction to Python?

2008-02-28 Thread D'Arcy J.M. Cain
On Thu, 28 Feb 2008 13:32:06 -0500 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > On Thu, 2008-02-28 at 11:22 -0500, D'Arcy J.M. Cain wrote: > > Not obvious to you. You are using subjective perception as if it was > > a > > law of nature. If "obvious" was the criteria then I would argue that > > th

Re: Place n indistinguishable items into k distinguishable boxes

2008-02-28 Thread castironpi
On Feb 28, 10:07 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 28, 5:02 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > > > Thanks again for your efforts here.  This particular problem didn't > > appear in any course I took...certainly similar problems did. > > And here's the obligatory

Re: call by reference howto????

2008-02-28 Thread castironpi
On Feb 27, 6:02 pm, Tamer Higazi <[EMAIL PROTECTED]> wrote: > Hi! > Can somebody of you make me a sample how to define a function based on > "call by reference" ??? > > I am a python newbie and I am not getting smart how to define functions, > that should modify the variable I passed by reference.

Re: TypeError: only length-1 arrays can be converted to Python scalars.

2008-02-28 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi All, > > Could anybody tell me what is the problem with the following sequence > with which I always get the above error message. I use Numeric and > Python 2.4 > > x=array([1,2,3,4]) > y=exp(x) Presumably, you are using exp() from the builtin module math, which kno

Re: How about adding rational fraction to Python?

2008-02-28 Thread Ross Ridge
D'Arcy J.M. Cain wrote: > Not obvious to you. You are using subjective perception as if it was > a law of nature. If "obvious" was the criteria then I would argue that > the only proper result of integer division is (int, int). Give me the > result and the remainder and let me figure it out. J

Re: Decorators and buffer flushing

2008-02-28 Thread castironpi
On Feb 28, 11:49 am, "Ethan Metsger" <[EMAIL PROTECTED]> wrote: > Hi, all. > > I apologize for what is perhaps a newb question.  I'm in the process of   > transitioning our testing framework from Perl to Python.  While that alone   > probably sets off some red flags, I'm afraid it's what I'm stuck

Re: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-28 Thread Eric von Horst
On Feb 27, 9:44 pm, "Bronner, Gregory" <[EMAIL PROTECTED]> wrote: > The operator= stuff is usually innocuous. > The compiler died because it couldn't find 'vector', which is reasonable, > since it thought it was compiling a C file. > > Probably because you swigged the file without the magic "-c++"

Decorators and buffer flushing

2008-02-28 Thread Ethan Metsger
Hi, all. I apologize for what is perhaps a newb question. I'm in the process of transitioning our testing framework from Perl to Python. While that alone probably sets off some red flags, I'm afraid it's what I'm stuck with. I'm modeling a test with five operations: build, execute, validate, p

Re: message entry box at center

2008-02-28 Thread Peter Otten
asit wrote: > On Feb 28, 7:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> asit wrote: >> > i want to show the entry button at the center of the window. How is it >> > possible ?? >> > from Tkinter import * >> >> > def callback(): >> > print e.get() >> >> > master=Tk() >> > e=Entry(master) >> >>

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Wed, 27 Feb 2008 19:18:27 -0800, Jeff Schwab wrote: > >> Benoit wrote: >>> I've been teaching myself the python language over the past few months >>> using Mark Lutz' Learning Python, 3ed. Python is also the first >>> programming language I've ever taken up.

Re: How about adding rational fraction to Python?

2008-02-28 Thread J. Cliff Dyer
On Thu, 2008-02-28 at 11:22 -0500, D'Arcy J.M. Cain wrote: > Not obvious to you. You are using subjective perception as if it was > a > law of nature. If "obvious" was the criteria then I would argue that > the only proper result of integer division is (int, int). Give me the > result and the re

Re: message entry box at center

2008-02-28 Thread asit
On Feb 28, 7:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > asit wrote: > > i want to show the entry button at the center of the window. How is it > > possible ?? > > from Tkinter import * > > > def callback(): > > print e.get() > > > master=Tk() > > e=Entry(master) > > e.pack(expand=True) > > > e

Re: Raising exception on STDIN read

2008-02-28 Thread Ian Clark
On 2008-02-28, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 28 Feb 2008 14:29:04 -0200, Ian Clark <[EMAIL PROTECTED]> > escribió: > >> On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>> En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> >>> escribi�: >>

Re: anydbm safe for simultaneous writes?

2008-02-28 Thread chris
On Feb 28, 7:47 am, "Brian Smith" <[EMAIL PROTECTED]> wrote: > Chris wrote: > > I need simple data persistence for a cgi application that > > will be used potentially by multiple clients simultaneously. > > So I need something that can handle locking among writes. > > Sqlite probably does this, but

Re: Place n indistinguishable items into k distinguishable boxes

2008-02-28 Thread Arnaud Delobelle
On Feb 28, 4:44 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > ... here is another attempt on the same principle: > > --- > def boxings(n, k): >     """boxings(n, k) -> iterator > >     Generate all ways to place n indistiguishable items into k >     distinguishable boxes >     """

Re: Raising exception on STDIN read

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 14:29:04 -0200, Ian Clark <[EMAIL PROTECTED]> escribió: > On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> >> escribi�: >> >>> On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: Hi, >>

Re: Place n indistinguishable items into k distinguishable boxes

2008-02-28 Thread Arnaud Delobelle
On Feb 28, 2:40 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > Hi, > > I need a generator which produces all ways to place n indistinguishable > items into k distinguishable boxes. > > For n=4, k=3, there are (4+3-1)!/(3-1)!/4! = 15 ways. > > (0,0,4) [...] Here is my little function:

TypeError: only length-1 arrays can be converted to Python scalars.

2008-02-28 Thread nure123
Hi All, Could anybody tell me what is the problem with the following sequence with which I always get the above error message. I use Numeric and Python 2.4 x=array([1,2,3,4]) y=exp(x) Nure -- http://mail.python.org/mailman/listinfo/python-list

Re: Raising exception on STDIN read

2008-02-28 Thread Ian Clark
On 2008-02-27, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> > escribi�: > >> On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I would like to raise an exception any time a subprocess tries to read >>> fro

Re: How about adding rational fraction to Python?

2008-02-28 Thread D'Arcy J.M. Cain
On Thu, 28 Feb 2008 06:10:13 -0800 (PST) Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 28, 3:30 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > Automatic conversions, okay... but converting a result when all > > inputs are of one time, NO... > > People, this is so cognitive dissonanc

Re: Python's BNF

2008-02-28 Thread Gabriel Genellina
En Thu, 28 Feb 2008 12:33:33 -0200, <[EMAIL PROTECTED]> escribi�: > Implemented all your suggestions, with two exceptions. > > Changed file read to readlines(), but not open(...).readlines(). I > love to say file.close(). Gives me a feeling of security. (We could > discuss RAM waste v. I/O speed b

Re: How about adding rational fraction to Python?

2008-02-28 Thread D'Arcy J.M. Cain
On Thu, 28 Feb 2008 10:39:51 - "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 28 Feb 2008 00:30:11 -0800, Dennis Lee Bieber wrote: > > Automatic conversions, okay... but converting a result when all > > inputs are of one time, NO... > > What? How does that make any sense? > > By t

feedback requested

2008-02-28 Thread castironpi
I have a data structure I think would be very useful. It passes a few test cases, but one attempt to optimize it failed, so that may indicate a bug. Will anyone help me debug it, verify it, or clean it? It pertains to multi-threading and is a synchro. structure. If it is not an interest of your

Re: Place n indistinguishable items into k distinguishable boxes

2008-02-28 Thread Mark Dickinson
On Feb 28, 5:02 am, Michael Robertson <[EMAIL PROTECTED]> wrote: > Thanks again for your efforts here.  This particular problem didn't > appear in any course I took...certainly similar problems did. And here's the obligatory not-very-obfuscated one-liner: from itertools import combinations as c;

Re: more pythonic

2008-02-28 Thread Paul McGuire
On Feb 28, 8:58 am, Temoto <[EMAIL PROTECTED]> wrote: > On 28 ÆÅ×, 15:42, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 28, 5:40 am, Temoto <[EMAIL PROTECTED]> wrote: > > > > Hello. > > > > There is a Django application, i need to place all its data into > > > Access mdb file and sen

Re: Indentation and optional delimiters

2008-02-28 Thread castironpi
On Feb 28, 8:40 am, [EMAIL PROTECTED] wrote: > But the default behavior may become the "true" copy, that seems > simpler for a newbie to grasp. The language then may give a tool to > use references too (like passing arrays to functions in Pascal, you > can use "var" for pass-by-reference reference)

Re: How about adding rational fraction to Python?

2008-02-28 Thread Carl Banks
On Feb 28, 9:36 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-28, Carl Banks <[EMAIL PROTECTED]> wrote: > > >> Automatic conversions, okay... but converting a result when > >> all inputs are of one time, NO... > > > People, this is so cognitive dissonance it's not even funny. > > > Ther

Re: How about adding rational fraction to Python?

2008-02-28 Thread Torsten Bronger
Hallöchen! Grant Edwards writes: > [...] > >> You people can't tell the difference between "obvious" and >> "learned conventions that came about because in limitations in >> the hardware at the time". > > It seems to me that the expectation that 1/2 yield 0.5 is just as > much a convention as tha

Re: more pythonic

2008-02-28 Thread Temoto
On 28 фев, 15:42, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Feb 28, 5:40 am, Temoto <[EMAIL PROTECTED]> wrote: > > > > > Hello. > > > There is a Django application, i need to place all its data into > > Access mdb file and send it to user. > > It seems to me that params filling for statement cou

  1   2   >