Re: Determining an operating system's default browser

2006-02-12 Thread Jorgen Grahn
On 11 Feb 2006 11:44:29 -0800, Paul Boddie <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: ... >> On my machines, there is One Correct Way of doing these things, and that's >> to look in the MIME support/configuration files (~/.mailcap, and so on), >> first for the user, then system-wide. Somethin

Re: Is Forth for real?

2006-02-12 Thread Daniel Ciesinger
Steven D'Aprano schrieb: > On Sun, 12 Feb 2006 17:08:02 +, Cameron Laird wrote: > > >>In article <[EMAIL PROTECTED]>, >>Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >>>on the web for each language. By comparison, even Forth gives 13 million >>>plus hits, and who uses Forth? 13m hits for fo

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread mwt
Pardon my ignorance here, but could you give me an example of what would constitute file that is unreasonably or dangerously large? I'm running python on a ubuntu box with about a gig of ram. Also, do you know of any online examples of the kind of robust, real-world code you're describing? Thank

Re: python and webcam

2006-02-12 Thread dfaber
Hi again, I've tried a the Sane interface from PIL and I get the following error, when I run the demo_pil.py from the Sane directory. SANE version: (16777231, 1, 0, 15) Available devices= [('v4l:/dev/video0', 'Noname', 'Logitech QuickCam

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread Alex Martelli
mwt <[EMAIL PROTECTED]> wrote: ... > The process is pretty opaque, however. This downloads and writes the > file with no feedback whatsoever. You don't see how many bytes you've > downloaded already, etc. Especially the "g = f.read()" step just sits > there while downloading a large file, presen

Re: Single-file executables

2006-02-12 Thread Martin v. Löwis
Thomas Heller wrote: > I wonder if anyone is actually using freeze on Windows, with scripts > that use, say, pywin32 and wxPython. Interesting question. I've never done so myself (only on Linux and Solaris), and given the relatively small interest in having a static Python library on Windows, I g

Re: Netstat in python. Does it's possible?

2006-02-12 Thread Martin v. Löwis
Jorgen Grahn wrote: > I was thinking mostly about /proc, /sys and related file systems. I have a > feeling parts of them they change quite frequently under Linux, and of > course under other Unices they may look completely different, or be absent. > > Like Mr Laird said elsewhere, the best thing m

Re: PEP 353: Using ssize_t as the index type

2006-02-12 Thread Martin v. Löwis
Tony Nelson wrote: > Minor typo: "too" Thanks, fixed. Martin -- http://mail.python.org/mailman/listinfo/python-list

Another n00b: Removing the space in "print 'text', var"

2006-02-12 Thread HappyHippy
More of a minor niggle than anything but how would I remove the aforementioned space? eg. strName = 'World' print 'Hello', strName, ', how are you today?' comes out as "Hello World , how are you today?" Have googled, and worked my way through the first 7 chapters of Byte of Python, but to no a

Re: Determining an operating system's default browser

2006-02-12 Thread Paul Boddie
Jorgen Grahn wrote: > On 11 Feb 2006 11:44:29 -0800, Paul Boddie <[EMAIL PROTECTED]> wrote: > > > > Indeed. Thanks for reminding me about mailcap/metamail - I used them in > > And thanks for mentioning the real name of that mechanism! Happy memories! ;-) [...] > > import mailcap > > I guess I sh

Re: Another n00b: Removing the space in "print 'text', var"

2006-02-12 Thread Fredrik Lundh
"HappyHippy" wrote: > More of a minor niggle than anything but how would I remove the > aforementioned space? > > eg. > strName = 'World' > print 'Hello', strName, ', how are you today?' > > comes out as "Hello World , how are you today?" > > Have googled, and worked my way through the first 7 cha

Re: Another n00b: Removing the space in "print 'text', var"

2006-02-12 Thread Alex Martelli
HappyHippy <[EMAIL PROTECTED]> wrote: > More of a minor niggle than anything but how would I remove the > aforementioned space? > > eg. > strName = 'World' > print 'Hello', strName, ', how are you today?' > > comes out as "Hello World , how are you today?" > > Have googled, and worked my way t

Re: Another n00b: Removing the space in "print 'text', var"

2006-02-12 Thread Felipe Almeida Lessa
Em Dom, 2006-02-12 às 22:11 +, HappyHippy escreveu: > More of a minor niggle than anything but how would I remove the > aforementioned space? > > eg. > strName = 'World' > print 'Hello', strName, ', how are you today?' > > comes out as "Hello World , how are you today?" strname = 'World' pr

Re: How to invoke a tkinter menu *itself*

2006-02-12 Thread James Stroud
Edward K. Ream wrote: > Hi, > > > > I've spent a pleasant hour or so trying to bring up a top-level Tk menu at > the same spot as it would appear if I had actually clicked the menu. That > is, I want to bring up a menu from the keyboard. > > > > The problem is computing the x and y args to

Re: Clearing the screen

2006-02-12 Thread Fredrik Lundh
"mwt" wrote: > Arrgghh... Is there any way to edit posts on this thing? are you aware that you're posting to a usenet newsgroup? > The os.system("clear") doesn't work at all in a module. works for me (as long as I'm running the code on a platform that has a clear command). in what way does it

Need a bit of help with a list..

2006-02-12 Thread rh0dium
Hi all, Why doesn't this work as expected.. I expect that the the lines within the sections will get modified - permanently. It is modifying them during the first section but they never get saved to the new values.. Can anyone help me and even better explain why it's not working.. for

Re: Need a bit of help with a list..

2006-02-12 Thread Alex Martelli
rh0dium <[EMAIL PROTECTED]> wrote: ... > Why doesn't this work as expected.. I expect that the the lines within > the sections will get modified - permanently. It is modifying them > during the first section but they never get saved to the new values.. > Can anyone help me and even better expl

Re: Tracking down memory leaks?

2006-02-12 Thread MKoool
> How big is the file you are reading in? If it is (say) 400 MB, then it is > hardly surprising that you will be using 500MB of RAM. If the file is 25K, > that's another story. Actually, I am downloading the matrix data from a file on a server on the net using urllib2, and then I am running severa

Re: Tracking down memory leaks?

2006-02-12 Thread John J. Lee
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sun, 12 Feb 2006 05:11:02 -0800, MKoool wrote: [...] > I may be mistaken, and if so I will welcome the correction, but Python > does not return memory to the operating system until it terminates. > > Objects return memory to Python when they are gar

Re: by reference

2006-02-12 Thread dirvine
Yes I did I was trying to do something like (pseudo code) write: get files in path for each filename get size, type create dic called filename assign size:xx,type:y pickle to file read: open pickled file read dict name and contents (hoping unpickling file gives me the dict name as it was saved,

Re: Yet another GUI toolkit question...

2006-02-12 Thread John J. Lee
Kevin Walzer <[EMAIL PROTECTED]> writes: [...] > Commercial Qt is a little out of my price range. Commercial *PyQt* (including a license for Qt for use only with PyQt) is $400 (USD) per developer (plus an extra $300/year if you want upgrades). That's compared to Qt license for use *with C++* vary

Python equivilant to msgbox()

2006-02-12 Thread LittlePython
Is there an equivalent to a msgbox() or wscript.echo (via wcsript) . I would like to call this instead of print (to the screen) . I would like to write a simple script that is not an event drive gui but calls input boxes, message boxes, or maybe even a file open browser box as well? -- htt

Re: Python equivilant to msgbox()

2006-02-12 Thread Kent Johnson
LittlePython wrote: > Is there an equivalent to a msgbox() or wscript.echo (via wcsript) . I > would like to call this instead of print (to the screen) . I would like > to write a simple script that is not an event drive gui but calls input > boxes, message boxes, or maybe even a file open brows

Re: Python equivilant to msgbox()

2006-02-12 Thread Andre Burgaud
Hi,   If you target Windows, you may try ctypes http://starship.python.net/crew/theller/ctypes/:   >>> from ctypes import *>>> windll.user32.MessageBoxA(None, "MessageBox Text", "MessageBox Caption", 0)1>>>     or win32api http://starship.python.net/crew/mhammond/win32/: >>> import win32api>>> win3

Re: Python equivilant to msgbox()

2006-02-12 Thread LittlePython
That is exactly what I was look for .. thx "Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > LittlePython wrote: > > Is there an equivalent to a msgbox() or wscript.echo (via wcsript) . I > > would like to call this instead of print (to the screen) . I would like > > to

Questions for BitTorrent's Author, Bram Cohen

2006-02-12 Thread Steve Holden
Hi: Bram Cohen will be a keynoter at this year's PyCon, and has asked that the presentation be in the form of an interview. I'd like the questions to be representative of as broad a cross-section of the Python community as possible. If you have a question you'd like to hear Bram answer please

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread Steven D'Aprano
mwt wrote: > Pardon my ignorance here, but could you give me an example of what > would constitute file that is unreasonably or dangerously large? I'm > running python on a ubuntu box with about a gig of ram. 1GB of RAM plus (say) 2GB of virtual memory = 3GB in total. Your OS and other running p

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread mwt
Thanks for the explanation. That is exactly what I'm looking for. In a way, it's kind of neat that urlopen just *does* it, no questions asked, but I'd like to just know the basics, which is what it sounds like urlretrieve covers. Excellent. Now, let's see what I can whip up with that. -- just bou

Re: Is python very slow compared to C

2006-02-12 Thread bonono
Steven D'Aprano wrote: > > Programming in Lua > > Object-Oriented Programming > > http://www.lua.org/pil/16.html > > Did you actually bother to read the page you linked to? It describes how > you can emulate object-like behaviour for Lua tables. The following page > is even more explicit: "Lua doe

Re: Python equivilant to msgbox()

2006-02-12 Thread André
Kent Johnson wrote: > LittlePython wrote: > > Is there an equivalent to a msgbox() or wscript.echo (via wcsript) . I > > would like to call this instead of print (to the screen) . I would like > > to write a simple script that is not an event drive gui but calls input > > boxes, message boxes, or m

Re: Questions for BitTorrent's Author, Bram Cohen

2006-02-12 Thread Felipe Almeida Lessa
Em Dom, 2006-02-12 às 20:10 -0500, Steve Holden escreveu: > I'd like the questions to be representative of as broad a cross-section > of the Python community as possible. If you have a question you'd like > to hear Bram answer please let me know and I'll try to include them. Something I think lo

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread mwt
>It isn't written in C, but get your hands on wget. It >is probably already on your Linux distro, but if not, >check it out here: >http://www.gnu.org/software/wget/wget.html Thanks. I'm checking it out. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Forth for real?

2006-02-12 Thread Elizabeth D Rather
"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > . > . > . >>on the web for each language. By comparison, even Forth gives 13 million >>plus hits, and who uses Forth? > . > . > . > The prog

Re: Questions for BitTorrent's Author, Bram Cohen

2006-02-12 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: > Bram Cohen will be a keynoter at this year's PyCon, and has asked that > the presentation be in the form of an interview. > > I'd like the questions to be representative of as broad a cross-section > of the Python community as possible. If you have a ques

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread Alex Martelli
mwt <[EMAIL PROTECTED]> wrote: > Thanks for the explanation. That is exactly what I'm looking for. In a > way, it's kind of neat that urlopen just *does* it, no questions asked, > but I'd like to just know the basics, which is what it sounds like > urlretrieve covers. Excellent. Now, let's see wha

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread mwt
So, I just put this little chunk to the test, which does give you feedback about what's going on with a file download. Interesting that with urlretrieve, you don't do all the file opening and closing stuff. Works fine: -- import urllib def download_file(filename, URL): f = ur

Re: Downloading Large Files -- Feedback?

2006-02-12 Thread Alex Martelli
mwt <[EMAIL PROTECTED]> wrote: ... > import urllib > > def download_file(filename, URL): > f = urllib.urlretrieve(URL, filename, reporthook=my_report_hook) If you wanted to DO anything with the results, you'd probably want to assign to f, m = ... not just f. This way, f is the filenam

how do you pronounce 'tuple'?

2006-02-12 Thread John Salerno
Yes, silly question, but it keeps me up at night. :) I know it comes from the suffix -tuple, which makes me think it's pronounced as 'toople', but I've seen (at m-w.com) that the first pronunciation option is 'tuhple', so I wasn't sure. Maybe it's both, but which is most prevalent? Thanks! No

Re: Jython socket typecasting problems

2006-02-12 Thread Steve Holden
Diez B. Roggisch wrote: >>This is the code section of my server class (I cut this from a Python >>example): >>def establishConnection(self): >>self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >>self.socket.connect((self.host, self.port)) >>Do I have to use explici

Re: Newbie

2006-02-12 Thread Steve Holden
LittlePython wrote: > I am very new to python. I have been studying it for only a month or so. I > have been using vbscript for about 2-3 yrs and only recently been using it > rather heavily the past 9 months or so. I am new very new to oop. My main > use will be administrative scripting into the w

Re: ordered sets operations on lists..

2006-02-12 Thread Steve Holden
Alex Martelli wrote: > Bengt Richter <[EMAIL PROTECTED]> wrote: >... > >>>Personally, I'd always use (depending on guesses regarding lengths of >>>lists) [x for x in l1 if x in l2] or the setified equivalent, of course. >>> >> >>Perhaps newbies should be advised that >> >>[x for x in l1 if

Re: how do you pronounce 'tuple'?

2006-02-12 Thread Steve Holden
John Salerno wrote: > Yes, silly question, but it keeps me up at night. :) > Silly you! > I know it comes from the suffix -tuple, which makes me think it's > pronounced as 'toople', but I've seen (at m-w.com) that the first > pronunciation option is 'tuhple', so I wasn't sure. Maybe it's both,

Re: how do you pronounce 'tuple'?

2006-02-12 Thread Grant Edwards
On 2006-02-13, John Salerno <[EMAIL PROTECTED]> wrote: > I know it comes from the suffix -tuple, which makes me think > it's pronounced as 'toople', but I've seen (at m-w.com) that > the first pronunciation option is 'tuhple', so I wasn't sure. > Maybe it's both, but which is most prevalent? In m

Re: ordered sets operations on lists..

2006-02-12 Thread Felipe Almeida Lessa
Em Dom, 2006-02-12 às 23:15 -0500, Steve Holden escreveu: > Given that Python 2.4 doesn't even perform simple constant folding for > arithmetic expressions > [snip] May I ask why doesn't it perform such optimization? Is there any special difficulties in doing so with the Python compiler? Also, I

Re: ordered sets operations on lists..

2006-02-12 Thread Steve Holden
Felipe Almeida Lessa wrote: > Em Dom, 2006-02-12 às 23:15 -0500, Steve Holden escreveu: > >>Given that Python 2.4 doesn't even perform simple constant folding for >>arithmetic expressions >>[snip] > > > May I ask why doesn't it perform such optimization? Is there any special > difficulties in d

Re: how do you pronounce 'tuple'?

2006-02-12 Thread Markus Wankus
John Salerno wrote: > Yes, silly question, but it keeps me up at night. :) > > I know it comes from the suffix -tuple, which makes me think it's > pronounced as 'toople', but I've seen (at m-w.com) that the first > pronunciation option is 'tuhple', so I wasn't sure. Maybe it's both, but > whic

Re: Newbie

2006-02-12 Thread bonono
LittlePython wrote: > I am very new to python. I have been studying it for only a month or so. I > have been using vbscript for about 2-3 yrs and only recently been using it > rather heavily the past 9 months or so. I am new very new to oop. My main > use will be administrative scripting into the

RE: ordered sets operations on lists..

2006-02-12 Thread Delaney, Timothy (Tim)
Steve Holden wrote: > The basic answer is that so far no developer has felt it worthwhile to > expend time on adding these optimizations. Mainly because it's rare to find such constructs in anything except contrived examples ... Nearly every time you use a literal, it's being added to (subtracted

Re: ordered sets operations on lists..

2006-02-12 Thread Felipe Almeida Lessa
Em Dom, 2006-02-12 às 23:51 -0500, Steve Holden escreveu: > The basic answer is that so far no developer has felt it worthwhile to > expend time on adding these optimizations. I always thought these small optimizations could lead Python to be faster overall. I remember about this every time I see

RE: ordered sets operations on lists..

2006-02-12 Thread Delaney, Timothy (Tim)
Delaney, Timothy (Tim) wrote: > Adding such optimisations to Python may improve it's benchmark scores, Blegh! Time to give myself a good kicking! Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: ordered sets operations on lists..

2006-02-12 Thread Steve Holden
Felipe Almeida Lessa wrote: > Em Dom, 2006-02-12 às 23:51 -0500, Steve Holden escreveu: > >>The basic answer is that so far no developer has felt it worthwhile to >>expend time on adding these optimizations. > > > I always thought these small optimizations could lead Python to be > faster overa

Re: Is python very slow compared to C

2006-02-12 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: > I can speak the same about Python if I view it from a prototype based > perspective, where one get them for free in Lua but need to implement > them in Python. Sure. And if you need prototypes, then all else being equal that would be a disadvantage of Python compared

Re: Is python very slow compared to C

2006-02-12 Thread Steve Holden
Steven D'Aprano wrote: > [EMAIL PROTECTED] wrote: > > >>I can speak the same about Python if I view it from a prototype based >>perspective, where one get them for free in Lua but need to implement >>them in Python. > > > Sure. And if you need prototypes, then all else being > equal that would

Re: Is python very slow compared to C

2006-02-12 Thread bonono
Steven D'Aprano wrote: > [EMAIL PROTECTED] wrote: > > > I can speak the same about Python if I view it from a prototype based > > perspective, where one get them for free in Lua but need to implement > > them in Python. > > Sure. And if you need prototypes, then all else being > equal that would b

how to create a movie ?

2006-02-12 Thread seb . haase
Hi, I have a series of images (either from numarray or from PIL) After googling if read something about pyMedia... Can I create an AVI movie from my images with that ? How about quicktime ? Thanks, Sebastian Haase -- http://mail.python.org/mailman/listinfo/python-list

Python 3000 deat !? Is true division ever coming ?

2006-02-12 Thread seb . haase
Hi, Is it true that that "Python 3000" is dead ? Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would just break to much code :-( On the otherhand I'm using Python as "Matlab replacement" and would generally like 5/2 ==2.5 So, I was contemplating to default all my modules/script

Re: Newbie

2006-02-12 Thread mcbooczech
For me (I am newbie as well) was following link very useful: http://benyoonline.com/pqr/PQR2.4.html Good luck with Python Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Slightly OT: Ranking noise

2006-02-12 Thread Kay Schluehr
For those people who use google groups to access comp.lang.python may enjoy now looking at contentess shiny yellow stars - shining brighter than anything else on the site. The only pattern I've found are one or two shiny yellow stars for many newbie postings. According to the staring semantics the

Re: Is python very slow compared to C

2006-02-12 Thread PA
On Feb 13, 2006, at 06:44, [EMAIL PROTECTED] wrote: > And if we use market penetration as measure, Perl seems to be easier > for people ? Perl: Shell scripts/awk/sed are not enough like programming languages. Python: Perl is a kludge. "What Languages Fix" http://www.paulgraham.com/fix.html Ch

Re: Is python very slow compared to C

2006-02-12 Thread bonono
PA wrote: > On Feb 13, 2006, at 06:44, [EMAIL PROTECTED] wrote: > > > And if we use market penetration as measure, Perl seems to be easier > > for people ? > > Perl: Shell scripts/awk/sed are not enough like programming languages. > > Python: Perl is a kludge. > > "What Languages Fix" > http://www

Re: how do you pronounce 'tuple'?

2006-02-12 Thread Erik Max Francis
John Salerno wrote: > Yes, silly question, but it keeps me up at night. :) > > I know it comes from the suffix -tuple, which makes me think it's > pronounced as 'toople', but I've seen (at m-w.com) that the first > pronunciation option is 'tuhple', so I wasn't sure. Maybe it's both, but > whi

Re: ordered sets operations on lists..

2006-02-12 Thread Brett Cannon
On 2/12/06, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: > Em Dom, 2006-02-12 às 23:15 -0500, Steve Holden escreveu: > > Given that Python 2.4 doesn't even perform simple constant folding for > > arithmetic expressions > > [snip] > > May I ask why doesn't it perform such optimization? Is there a

Re: Slightly OT: Ranking noise

2006-02-12 Thread Fredrik Lundh
Kay Schluehr wrote: > For those people who use google groups to access comp.lang.python may > enjoy now looking at contentess shiny yellow stars - shining brighter > than anything else on the site. The only pattern I've found are one or > two shiny yellow stars for many newbie postings. According

Re: ordered sets operations on lists..

2006-02-12 Thread Kay Schluehr
Bengt Richter wrote: > Perhaps newbies should be advised that > > [x for x in l1 if x in set(l2)] But the resulting list is a representative of bag not a set ( contains multiple occurrences of elements ): >>> [x for x in [3, 3] if s in Set([3])] [3,3] Same with Raymonds solution: >>> filt

Re: how do you pronounce 'tuple'?

2006-02-12 Thread [EMAIL PROTECTED]
Grant Edwards wrote: > On 2006-02-13, John Salerno <[EMAIL PROTECTED]> wrote: > > > I know it comes from the suffix -tuple, which makes me think > > it's pronounced as 'toople', but I've seen (at m-w.com) that > > the first pronunciation option is 'tuhple', so I wasn't sure. > > Maybe it's both, bu

Wanted Python and C developer Urgently

2006-02-12 Thread Rozario, Sophia_Diana
Hi, I am posting a couple of requirements in my organization. Any one interested can reply me directly. Maestro Software Developer We are seeking experienced software professionals to design and develop new components as well as to enhance and maintain Maestro, a best-of-breed computational chem

newbie SWIG typemap question

2006-02-12 Thread Syrinx
Hi everyone. I'm new to SWIG, and I'm trying to wrap a C library for Python. I have a function that is declared similarly to this: double *foo(int x); The function returns a pointer to an array of 7 double values. I want to return a 7-tuple to Python. I've been trying variations of the follow

<    1   2