Error accessing the system registery

2008-08-22 Thread SaqibKhan
Hello members ! a message box is appearing when I goto 'Tools> References' in VBA or VB6. I have tried many options but issue is not resolved yet. I have no administrator's rights in PC. can anybody resolve my problem ??? Best Regards M. Saqib Khan -- http://mail.python.org/mailman/listinfo/python

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread W. eWatson
Carl Banks wrote: On Aug 22, 7:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: Is there some simple operational device in Python that would allow me to create an array (vector) of 360 points from my data by interpolating between azimuth points when necessary? All my data I rounded to the nearest

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread W. eWatson
Maric Michaud wrote: Le Saturday 23 August 2008 01:12:48 W. eWatson, vous avez écrit : The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again)

Re: setattr and getattr, when to use?

2008-08-22 Thread Jason Scheirer
On Aug 22, 10:17 pm, Jason Scheirer <[EMAIL PROTECTED]> wrote: > On Aug 22, 8:50 pm, maestro <[EMAIL PROTECTED]> wrote: > > > Why are these functions there? Is it somehow more idiomatic to use > > than to do obj.field ? > > Is there something you can with them that you can't by obj.field > > refere

Re: setattr and getattr, when to use?

2008-08-22 Thread Jason Scheirer
On Aug 22, 8:50 pm, maestro <[EMAIL PROTECTED]> wrote: > Why are these functions there? Is it somehow more idiomatic to use > than to do obj.field ? > Is there something you can with them that you can't by obj.field > reference? You can generate them dynamically from strings. In some cases you don

Re: Sorted Returns List and Reversed Returns Iterator

2008-08-22 Thread ++imanshu
On Aug 22, 12:36 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > > ++imanshu wrote: > >> I agree. Iterator is more flexible. > > I disagree.  Neither is more flexible.  You can iter the list returned > by sorted and list the iter returned by reversed.  Both do the minimum > work n

Re: The Importance of Terminology's Quality

2008-08-22 Thread John W Kennedy
Rob Warnock wrote: What was the corresponding 1401 boot sequence? The 1401 had a boot-from-tape-1 button on the console, and a boot-from-card button on the card reader. You couldn't truly boot from a disk; you loaded a little starter deck of about 20 cards on the card reader. On the 1401, t

Re: Python one-liner??

2008-08-22 Thread Paddy
On Aug 22, 10:03 pm, Matimus <[EMAIL PROTECTED]> wrote: > > Do we have python one-liner like perl one-liner 'perl -e'?? > > The answer is python -c... > > but python -h is useful too. > > Matt And Python is not optimised for one-liner solutions. I have been known to construct multi-line -c argumen

Re: The Importance of Terminology's Quality

2008-08-22 Thread John W Kennedy
Martin Gregorie wrote: Not necessarily. An awful lot of CPU cycles were used before microcode was introduced. Mainframes and minis designed before about 1970 didn't use or need it No, most S/360s used microcode. -- John W. Kennedy "There are those who argue that everything breaks even in thi

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Paddy
On Aug 22, 4:55 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > DrScheme is an implementation of Scheme that is very newbie-friendly. > > It has several limited sub-languages, etc. > > > So maybe a command line option can be added to Python3 ( - > > newbie ? :-) ) that jus

Psyco == tracing optimization?

2008-08-22 Thread Paddy
Just wondered if this: http://arstechnica.com/news.ars/post/20080822-firefox-to-get-massive-javascript-performance-boost.html, is a new name for what is done by Psyco? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

setattr and getattr, when to use?

2008-08-22 Thread maestro
Why are these functions there? Is it somehow more idiomatic to use than to do obj.field ? Is there something you can with them that you can't by obj.field reference? -- http://mail.python.org/mailman/listinfo/python-list

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Carl Banks
On Aug 22, 10:42 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Sometimes it seems that barely a day goes by without some newbie, or not- > so-newbie, getting confused by the behaviour of functions with mutable > default arguments. No sooner does one thread finally, and painful

Pydev 1.3.20 Released

2008-08-22 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.20 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread George Sakkis
On Aug 22, 9:54 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 22 Aug 2008 14:39:11 -0700, Emile van Sebille wrote: > > Dan wrote: > >> I'd suggest that at the > >> end of the tutorial, when people have a better general idea of how > >> Python works, there would be a P

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread Carl Banks
On Aug 22, 7:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: > Is there some simple operational device in Python that would allow me to > create an array (vector) of 360 points from my data by interpolating between > azimuth points when necessary? All my data I rounded to the nearest integer. > Mayb

Re: Regex on a huge text

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 4:48 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Does not grep only work a line at a time? Just like the code below? My understanding was that if the regex contains "^" and "$", it will matches in the full file. I wasn't never test it. I tested just before, and didn't wor

__eq__ problem with subclasses

2008-08-22 Thread Daniel Israel
I am very confused by the following behavior. I have a base class which defines __eq__. I then have a subclass which does not. When I evaluate the expression a==b, where a and b are elements of these classes, __eq__ is always called with the subclass as the first argument, regardless of the o

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread Maric Michaud
Le Saturday 23 August 2008 01:12:48 W. eWatson, vous avez écrit : > The other night I surveyed a site for astronomical use by measuring the > altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north > clockwise around the site to 360 degrees, almost north again) of obstacles, > tr

Re: 'While' question

2008-08-22 Thread Ben Finney
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > John Machin a écrit : > (snip) > > A quick rule of thumb for Python: if your code looks ugly or > > strained or awkward, it's probably also wrong. > > +1 QOTW Merely a special case of the truism that "Your code is probably wrong (regardless of an

Re: The Importance of Terminology's Quality

2008-08-22 Thread Arne Vajhøj
Paul Wallich wrote: Martin Gregorie wrote: On Fri, 22 Aug 2008 22:56:09 +, sln wrote: On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: [EMAIL PROTECTED]> wrote: *IS* raw machine code, *NOT* assembler!! [snip] I don't see the distinction. Just dissasemble it and

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Steven D'Aprano
On Fri, 22 Aug 2008 14:39:11 -0700, Emile van Sebille wrote: > Dan wrote: >> I'd suggest that at the >> end of the tutorial, when people have a better general idea of how >> Python works, there would be a Python Gotchas section. >> >> > Hmmm, OK -- mutable defaults, integer division, name mangli

Re: The Importance of Terminology's Quality

2008-08-22 Thread Paul Wallich
Martin Gregorie wrote: On Fri, 22 Aug 2008 22:56:09 +, sln wrote: On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: [EMAIL PROTECTED]> wrote: *IS* raw machine code, *NOT* assembler!! [snip] I don't see the distinction. Just dissasemble it and find out. There's

Re: Early halt for iterating a_list and iter(a_list)

2008-08-22 Thread Steven D'Aprano
On Fri, 22 Aug 2008 07:23:18 -0700, Lie wrote: [...] >> iterators are once-only objects.  there's nothing left in "c" when you >> enter the inner loop the second time, so nothing is printed. >> >> > Ah, now I see. You have to "restart" the iterator if you want to use it > the second time (is it po

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread W. eWatson
Mensanator wrote: On Aug 22, 6:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstac

Re: Generators can only yield ints?

2008-08-22 Thread Steven D'Aprano
On Fri, 22 Aug 2008 15:44:15 -0700, defn noob wrote: > def letters(): > a = xrange(ord('a'), ord('z')+1) > B = xrange(ord('A'), ord('Z')+1) > while True: > yield chr(a) > yield chr(B) > > l = letters() l.next() > > Traceback (most recent c

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Steven D'Aprano
On Fri, 22 Aug 2008 11:14:09 -0700, Emile van Sebille wrote: > Steven D'Aprano wrote: >> I suggest that Python should raise warnings.RuntimeWarning (or >> similar?) when a function is defined with a default argument consisting >> of a list, dict or set. (This is not meant as an exhaustive list of

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Steven D'Aprano
On Fri, 22 Aug 2008 17:09:34 +0200, Christian Heimes wrote: > Steven D'Aprano wrote: >> I suggest that Python should raise warnings.RuntimeWarning (or >> similar?) when a function is defined with a default argument consisting >> of a list, dict or set. (This is not meant as an exhaustive list of a

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread Mensanator
On Aug 22, 6:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote: > The other night I surveyed a site for astronomical use by measuring the > altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north > clockwise around the site to 360 degrees, almost north again) of obstacles, > trees. M

Re: The Importance of Terminology's Quality

2008-08-22 Thread sln
On Fri, 22 Aug 2008 23:23:57 + (UTC), Martin Gregorie <[EMAIL PROTECTED]> wrote: >On Fri, 22 Aug 2008 22:56:09 +, sln wrote: > >> On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: >> >>>[EMAIL PROTECTED]> wrote: >>>*IS* raw machine code, *NOT* assembler!! >> [sni

Re: The Importance of Terminology's Quality

2008-08-22 Thread Martin Gregorie
On Fri, 22 Aug 2008 22:56:09 +, sln wrote: > On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: > >>[EMAIL PROTECTED]> wrote: >>*IS* raw machine code, *NOT* assembler!! > [snip] > > I don't see the distinction. > Just dissasemble it and find out. > There's a 1:1 relat

Re: The Importance of Terminology's Quality

2008-08-22 Thread sln
On Fri, 22 Aug 2008 11:11:09 -0400, George Neuner <[EMAIL PROTECTED]> wrote: >On Thu, 21 Aug 2008 02:30:27 GMT, [EMAIL PROTECTED] wrote: > >>On Wed, 20 Aug 2008 21:18:22 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: >> >>>Martin Gregorie <[EMAIL PROTECTED]> wrote: >>>+--- >>>| I was f

Filling in Degrees in a Circle (Astronomy)

2008-08-22 Thread W. eWatson
The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstacles, trees. My purpose was to feed this profile of obstacles (trees) to an as

Re: >> and << operators?

2008-08-22 Thread Mensanator
On Aug 22, 5:43 pm, "Medardo Rodriguez (Merchise Group)" <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 6:30 PM, defn noob <[EMAIL PROTECTED]> wrote: > > What does >> and << do? > > Normally they are bitwise operators:>> Shifts bits right > > << Shifts bits left > > print 1 << 3 > 8 > > becau

Re: Generators can only yield ints?

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 15:44:15 -0700 (PDT), defn noob wrote: > def letters(): > a = xrange(ord('a'), ord('z')+1) > B = xrange(ord('A'), ord('Z')+1) > while True: > yield chr(a) > yield chr(B) > > l = letters() l.next() > > Traceback (most recent

Re: Generators can only yield ints?

2008-08-22 Thread bearophileHUGS
defn noob: > Any way to get around this? Your code is wrong, this is one of the correct versions: from itertools import izip def letters(): lower = xrange(ord('a'), ord('z')+1) upper = xrange(ord('A'), ord('Z')+1) for lc, uc in izip(lower, upper): yield chr(lc) yield

Re: Generators can only yield ints?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:44 PM, defn noob <[EMAIL PROTECTED]> wrote: > def letters(): >a = xrange(ord('a'), ord('z')+1) >B = xrange(ord('A'), ord('Z')+1) >while True: >yield chr(a) >yield chr(B) > > > TypeError: an integer is required No. Th

Re: The Importance of Terminology's Quality

2008-08-22 Thread sln
On Thu, 21 Aug 2008 09:11:48 -0500, [EMAIL PROTECTED] (Rob Warnock) wrote: >[EMAIL PROTECTED]> wrote: >+--- >| [EMAIL PROTECTED] (Rob Warnock) wrote: >| >In the LGP-30, they used hex addresses, sort of[1], but the opcodes >| >(all 16 of them) had single-letter mnemonics chosen so that

Re: Having trouble with tail -f standard input

2008-08-22 Thread norseman
Derek Martin wrote: On Thu, Aug 21, 2008 at 02:58:24PM -0700, sab wrote: I have been working on a python script to parse a continuously growing log file on a UNIX server. If you weren't aware, there are already a plethora of tools which do this... You might save yourself the trouble by just u

Generators can only yield ints?

2008-08-22 Thread defn noob
def letters(): a = xrange(ord('a'), ord('z')+1) B = xrange(ord('A'), ord('Z')+1) while True: yield chr(a) yield chr(B) >>> l = letters() >>> l.next() Traceback (most recent call last): File "", line 1, in l.next() File "", line 5,

In-place memory manager, mmap (was: Fastest way to store ints and floats on disk)

2008-08-22 Thread castironpi
Hi, I've got an "in-place" memory manager that uses a disk-backed memory- mapped buffer. Among its possibilities are: storing variable-length strings and structures for persistence and interprocess communication with mmap. It allocates segments of a generic buffer by length and returns an offset

Re: >> and << operators?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:30 PM, defn noob <[EMAIL PROTECTED]> wrote: > What does >> and << do? Normally they are bitwise operators: >> Shifts bits right << Shifts bits left print 1 << 3 8 because 8 = 1000 in binary Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: >> and << operators?

2008-08-22 Thread Benjamin Kaplan
On Fri, Aug 22, 2008 at 6:30 PM, defn noob <[EMAIL PROTECTED]> wrote: > What does >> and << do? > > Googling on them and they are just ignored... > > -- > http://docs.python.org/lib/bitstring-ops.html > > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/l

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Benjamin Kaplan
On Fri, Aug 22, 2008 at 5:39 PM, Emile van Sebille <[EMAIL PROTECTED]> wrote: > Dan wrote: > >> I'd suggest that at the end of the tutorial, when people have a better >> general idea of how Python works, there would be a Python Gotchas section. >> >> > Hmmm, OK -- mutable defaults, integer divisio

>> and << operators?

2008-08-22 Thread defn noob
What does >> and << do? Googling on them and they are just ignored... -- http://mail.python.org/mailman/listinfo/python-list

Re: EOF

2008-08-22 Thread Eric Wertman
>> Im trying to download a file from a server. But how do I detect EOF ? Shouldn't this work as well? f1 = urllib2.urlopen('ftp://username:[EMAIL PROTECTED]/data.zip') f2 = file("data.zip", "wb") while f1: # When to stop ? try : f2.write(f1.read(1024)) except EOFError : b

Re: codecs, csv issues

2008-08-22 Thread John Machin
On Aug 22, 11:52 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm trying to use codecs.open() and I see two issues when I pass > encoding='utf8': > > 1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the > platform-specific byte(s). > > import codecs > f = codecs.open('tmp.txt',

Re: Generate alphabet?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:02 PM, ssecorp <[EMAIL PROTECTED]> wrote: > .['a'..'z'] for a list of the alphabet. > > Is there a way in Python to generate chars? Not as nice as in Haskell (or other languages), but: [chr(i) for i in xrange(ord('a'), ord('z')+1)] Regards -- http://mail.python.org/mai

Re: Generate alphabet?

2008-08-22 Thread Emile van Sebille
ssecorp wrote: In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list of the alphabet. Is there a way in Python to generate chars? How about: def haskellrange(sc,ec): if type(sc) is int: for ii in range(sc,ec): yield ii else: for ii in range(

Re: Generate alphabet?

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 15:02:19 -0700 (PDT), ssecorp wrote: > In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list > of the alphabet. > > Is there a way in Python to generate chars? It's not actually about generating anything, but why should one generate something if it's accessible

Generate alphabet?

2008-08-22 Thread ssecorp
In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list of the alphabet. Is there a way in Python to generate chars? -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex on a huge text

2008-08-22 Thread John Machin
On Aug 23, 6:19 am, "Medardo Rodriguez" <[EMAIL PROTECTED]> wrote: > On Fri, Aug 22, 2008 at 11:24 AM, Dan <[EMAIL PROTECTED]> wrote: > > I'm looking on how to apply a regex on a pretty huge input text (a file > > that's a couple of gigabytes). I found finditer which would return results > > iterat

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Emile van Sebille
Dan wrote: I'd suggest that at the end of the tutorial, when people have a better general idea of how Python works, there would be a Python Gotchas section. Hmmm, OK -- mutable defaults, integer division, name mangling... I'd think decimal precision is more a general problem than a python

Re: Newbie question about sending and receiving data to the command prompt.

2008-08-22 Thread n00m
Is it possible to communicate in loop fashion? import subprocess as s proc = s.Popen('cmd.exe', stdin=s.PIPE, stdout=s.PIPE) while 1: cmd = raw_input('cmd:') res = proc.communicate(cmd + '\n')[0] print res cmd:di

Re: rules of thumb for cross os code

2008-08-22 Thread Adam E
On Aug 22, 9:55 am, DwBear75 <[EMAIL PROTECTED]> wrote: > I am considering using python as a replacement for a lot of bash > scripting that I have been doing. I would like to be as cross platform > as possible, writing scripts for both windows and linux. Are there any > guides are general rules of

Re: Python one-liner??

2008-08-22 Thread James Matthews
What i use them for is to test for packages. e.g python -c "import django" On Fri, Aug 22, 2008 at 2:03 PM, Matimus <[EMAIL PROTECTED]> wrote: > > Do we have python one-liner like perl one-liner 'perl -e'?? > > > The answer is python -c... > > but python -h is useful too. > > Matt > -- > http://

Re: Python one-liner??

2008-08-22 Thread Matimus
> Do we have python one-liner like perl one-liner 'perl -e'?? The answer is python -c... but python -h is useful too. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, toplevel and images

2008-08-22 Thread Adam E
On Aug 22, 9:17 am, Pedro <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to build a small application that can display some images > in a toplevel window. I have this code: > > def Results(master): > from Tkinter import Toplevel, Button, Label > from PIL import ImageTk > > figures = ['f

Re: Seeking ideas for a cron implementation

2008-08-22 Thread Sean DiZazzo
On Aug 22, 1:30 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on a cron like functionality for my application. > The outer loops runs continuously waking every x seconds (say x=180, > 300, ..). > It needs to know what events in cron has expired and for each event do > the wo

Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Dan
> Further, the tutorial is the first link on the python for programmers page, > and on the non-programmers page it's the last link, so presumably any > non-programmer continuing on is pointed to the next step. > > ... so as to emphasized enough, how more? > > Emile In my experience, the problem i

Re: Regex on a huge text

2008-08-22 Thread Terry Reedy
Medardo Rodriguez wrote: On Fri, Aug 22, 2008 at 11:24 AM, Dan <[EMAIL PROTECTED]> wrote: I'm looking on how to apply a regex on a pretty huge input text (a file that's a couple of gigabytes). I found finditer which would return results iteratively which is good but it looks like I still need

Re: Trouble importing modules in IDLE (Win32)

2008-08-22 Thread Terry Reedy
Diez B. Roggisch wrote: [EMAIL PROTECTED] schrieb: Hello, In short: In a freshly (re)started shell, I can use "import odbc" by hand. I can't import odbc from within a script, or by hand after trying to start such a script. Screen capture follows. robert RE

Seeking ideas for a cron implementation

2008-08-22 Thread Karthik Gurusamy
Hi, I'm working on a cron like functionality for my application. The outer loops runs continuously waking every x seconds (say x=180, 300, ..). It needs to know what events in cron has expired and for each event do the work needed. It's basically like unix cron or like a calendar application with

Re: Usual practice: running/testing modules in a package

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 1:25 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > what if __init__.py contains code? Thats what I usually do to solve the "problem", but for my taste it's better to write the test code of a module inside it. The code I write in "__init__.py" is related to structures o

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Emile van Sebille
Diez B. Roggisch wrote: Emile van Sebille schrieb: http://docs.python.org/tut/node6.html#SECTION00671 People that just skim the surface get stung -- sorry. But obviously enough, it's not emphazized enough. Even if the interpreter isn't touched, at least the docs should be.

Re: Python one-liner??

2008-08-22 Thread Dan
On Fri, Aug 22, 2008 at 4:13 PM, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > -c? > -- > http://mail.python.org/mailman/listinfo/python-list > Yup. Stands for command python -c "print 'Hello World!'" Hello World! -- http://mail.python.org/mailman/listinfo/python-list

How to

2008-08-22 Thread Terry Reedy
Bart van Deenen wrote: I feel a bit dumb to ask a FAQ on the newsgroup. The problem with this particular question is that I found it hard to find a query that would give meaningful answers. See my new thread "How to search the Python manuals". tjr -- http://mail.python.org/mailman/listinfo

Re: Regex on a huge text

2008-08-22 Thread Medardo Rodriguez
On Fri, Aug 22, 2008 at 11:24 AM, Dan <[EMAIL PROTECTED]> wrote: > I'm looking on how to apply a regex on a pretty huge input text (a file > that's a couple of gigabytes). I found finditer which would return results > iteratively which is good but it looks like I still need to send a string > which

How to search the Python manuals

2008-08-22 Thread Terry Reedy
A number of questions asked here could easily be answered by a quick search of the Python Manuals. A prime example is about the behavior of default parameter values. A recent questioner ended the thread with "The problem with this particular question is that I found it hard to find a query th

Re: Python one-liner??

2008-08-22 Thread Wojtek Walczak
-c? -- http://mail.python.org/mailman/listinfo/python-list

Re: 'While' question

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 10:42:13 -0400, Ben Keshet wrote: > Thanks. I tried to use 'for' instead of 'while' as both of you > suggested. It's running well as my previous version but breaks > completely instead of just skipping the empty file. I suspect the > reason is that this part is inside anot

Re: property() usage - is this as good as it gets?

2008-08-22 Thread Medardo Rodriguez
On Fri, Aug 22, 2008 at 1:49 PM, Miles <[EMAIL PROTECTED]> wrote: > from operator import attrgetter > class attrsetter(object): >def __init__(self, attr): >self._attr = attr >def __call__(self, object, value): >setattr(object, self._attr, value) This solution is very nice,

Re: EOF

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 22:18:37 +0530, Anjanesh Lekshminarayanan wrote: > Im trying to download a file from a server. But how do I detect EOF ? Whenever read() method returns empty string/list. > while f1: # When to stop ? retval = f1.read() if not retval: break f2.write(ret

EOF

2008-08-22 Thread Anjanesh Lekshminarayanan
|Hi Im trying to download a file from a server. But how do I detect EOF ? || import urllib2 f1 = urllib2.urlopen('ftp://username:[EMAIL PROTECTED]/data.zip') f2 = file("data.zip", "wb") while f1: # When to stop ? f2.write(f1.read(1024)) f1.close() f2.close() || I can get the size & us

Regex on a huge text

2008-08-22 Thread Dan
I'm looking on how to apply a regex on a pretty huge input text (a file that's a couple of gigabytes). I found finditer which would return results iteratively which is good but it looks like I still need to send a string which would be bigger than my RAM. Is there a way to apply a regex directly on

Re: Is tempfile.mkdtemp() thread-safe?

2008-08-22 Thread Gabriel Rossetti
Dennis Lee Bieber wrote: On Thu, 21 Aug 2008 13:22:33 +0200, Gabriel Rossetti <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: have a solution? I have to create unique and temp. directories to use an external program that creates a temp. file with the same name every time, t

Re: 'While' question

2008-08-22 Thread Ben Keshet
Thanks. I tried to use 'for' instead of 'while' as both of you suggested. It's running well as my previous version but breaks completely instead of just skipping the empty file. I suspect the reason is that this part is inside another 'for' so it stops everything. I just want to it to break

[no subject]

2008-08-22 Thread Janno Tikka
Is there a way to make a fake mouse or something like that? I'm planning to create a frame with web open and then macro on it with that fake mouse. And i want fake mouse so i can use my computer while that fake mouse is doing its job. -- http://mail.python.org/mailman/listinfo/python-list

Python one-liner??

2008-08-22 Thread srinivasan srinivas
Hi, Do we have python one-liner like perl one-liner 'perl -e'?? Thanks, Srini Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/ -- http://mail.python.org/mailman/listinfo/python-list

Re: exception handling in complex Python programs

2008-08-22 Thread Gabriel Genellina
En Thu, 21 Aug 2008 14:48:45 -0300, magloca <[EMAIL PROTECTED]> escribió: Bruno Desthuilliers @ Thursday 21 August 2008 17:31: Java's "checked exception" system has proven to be a total disaster. Could you elaborate on that? I'm not disagreeing with you (or agreeing, for that matter); I'd

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Diez B. Roggisch
Emile van Sebille schrieb: Steven D'Aprano wrote: Sometimes it seems that barely a day goes by without some newbie, or not- so-newbie, getting confused by the behaviour of functions with mutable default arguments. No sooner does one thread finally, and painfully, fade away than another one sta

Re: Using Tkinter

2008-08-22 Thread adam2new
For references, you may use these PDF files (One URL changed since my last time there, but it should be correct for now): http://www.pythonware.com/media/data/an-introduction-to-tkinter.pdf http://infohost.nmt.edu/tcc/help/pubs/tkinter/tkinter.pdf (The first one may be useful for starting out) I'l

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Christian Heimes
MRAB wrote: Could there be a new special method __mutable__? Why should we add a new method? Seriously, why should Python be cluttered and slowed down to warn about mutable arguments. It's neither a design flaw nor a surprising feature *ONCE* you have understood how functions work. I agree t

Re: How to read and write the same socket in different threads?

2008-08-22 Thread Jean-Paul Calderone
On Sat, 23 Aug 2008 02:25:17 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: I'd like to read and write the same socket in different threads. one thr

Re: How to read and write the same socket in different threads?

2008-08-22 Thread Leo Jay
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: >> >> I'd like to read and write the same socket in different threads. >> one thread is only used to read from the socket, and the other is only >

Re: property() usage - is this as good as it gets?

2008-08-22 Thread Christian Heimes
David Moss wrote: Hi, I want to manage and control access to several important attributes in a class and override the behaviour of some of them in various subclasses. Below is a stripped version of how I've implemented this in my current bit of work. It works well enough, but I can't help feel

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread MRAB
On Aug 22, 4:09 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > I suggest that Python should raise warnings.RuntimeWarning (or similar?) > > when a function is defined with a default argument consisting of a list, > > dict or set. (This is not meant as an exhaustive lis

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread Emile van Sebille
Steven D'Aprano wrote: Sometimes it seems that barely a day goes by without some newbie, or not- so-newbie, getting confused by the behaviour of functions with mutable default arguments. No sooner does one thread finally, and painfully, fade away than another one starts up. I suggest that Pyt

Re: property() usage - is this as good as it gets?

2008-08-22 Thread George Sakkis
On Aug 22, 12:18 pm, David Moss <[EMAIL PROTECTED]> wrote: > Hi, > > I want to manage and control access to several important attributes in > a class and override the behaviour of some of them in various > subclasses. > > Below is a stripped version of how I've implemented this in my current > bit

Re: dict views implementation

2008-08-22 Thread Christian Heimes
[EMAIL PROTECTED] wrote: Where can I find an explanation of how the new light dict views of Python 3 are implemented (or what's the name of the C source file to look inside for their implementation)? The views are implemented next to the dict object. Grepping for PyTypeObject in http://svn.pyt

Re: How to read and write the same socket in different threads?

2008-08-22 Thread Jean-Paul Calderone
On Sat, 23 Aug 2008 01:47:23 +0800, Leo Jay <[EMAIL PROTECTED]> wrote: I'd like to read and write the same socket in different threads. one thread is only used to read from the socket, and the other is only used to write to the socket. But I always get a 10022 'Invalid argument' exception. Anyone

Re: property() usage - is this as good as it gets?

2008-08-22 Thread Miles
On Fri, Aug 22, 2008 at 12:18 PM, David Moss <[EMAIL PROTECTED]> wrote: > Hi, > > I want to manage and control access to several important attributes in > a class and override the behaviour of some of them in various > subclasses. > > Below is a stripped version of how I've implemented this in my c

How to read and write the same socket in different threads?

2008-08-22 Thread Leo Jay
I'd like to read and write the same socket in different threads. one thread is only used to read from the socket, and the other is only used to write to the socket. But I always get a 10022 'Invalid argument' exception. Anyone knows why? I'm using windows xp. my source code is here: http://pasteb

Re: pickle passing client/server design

2008-08-22 Thread castironpi
On Aug 22, 12:09 pm, DwBear75 <[EMAIL PROTECTED]> wrote: > I am contemplating the need for a way to handle high speed data > passing between two processes. One process would act as a queue that > would 'buffer' data coming from another processes. Seems that the > easiest way to handle the data woul

Re: semantics of the |= operator

2008-08-22 Thread Peter Pearson
On Fri, 22 Aug 2008 00:35:31 -0700 (PDT), akva <[EMAIL PROTECTED]> wrote: > > well, frankly I expected a |= b to mean exactly the same as a = a | b > regardless of the object type. So did I. I'm glad your post called this to my attention; I recently told my kid exactly that wrong thing. -- To

Re: Overwriting property-> can't set attribute

2008-08-22 Thread norseman
Gregor Horvath wrote: Hi, why is this code failing? class B(object): pass B.testattr = property(lambda s:"hallo") b = B() b.testattr = "test" Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) /tmp/python-14202ViU.py in () 14 B.testattr = property(lambda s:"hallo") 15 b = B() --

Re: Usual practice: running/testing modules in a package

2008-08-22 Thread Gabriel Genellina
En Fri, 22 Aug 2008 10:48:50 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: On 18 ago, 08:28, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: A package is a library, meant to be imported by some other code. Your main script (or the testing code) is a program, it uses (i.e. imports)

Re: pickle passing client/server design

2008-08-22 Thread John Krukoff
On Fri, 2008-08-22 at 10:09 -0700, DwBear75 wrote: > I am contemplating the need for a way to handle high speed data > passing between two processes. One process would act as a queue that > would 'buffer' data coming from another processes. Seems that the > easiest way to handle the data would be t

Re: programming toolbox

2008-08-22 Thread Mensanator
On Aug 22, 11:17 am, "Krishnakant Mane" <[EMAIL PROTECTED]> wrote: > hi william, > I am slightly more experienced in python than you (2 years to be presise). > Before this I handled pritty heavy as in coding and as in usage > projects in java. > Untill I came into the wonderful and powerful world o

pickle passing client/server design

2008-08-22 Thread DwBear75
I am contemplating the need for a way to handle high speed data passing between two processes. One process would act as a queue that would 'buffer' data coming from another processes. Seems that the easiest way to handle the data would be to just pass pickles. Further, I'm thinking that using a uni

  1   2   >