hi,everyone. a problem with shelve Module

2006-05-26 Thread softwindow
according to the book instruduction , i use shelve Module to write record to file. i only write ten records like this: name sex age jimmale 22 tom male 23 lucy female

Parsing python dictionary in Java using JPython

2006-05-26 Thread sandip desale
Dear All, I have a python dictionary file. I want to create a map of that dictionary and want to use the same in my Java Program. Can anybody please tell me how to use the same python dictionary in Java as well as in Python. Thanks in advance... Regards, Sandip -- India.com free e-mail - ww

Re: Anyone compiling Python 2.3 on an SCO OpenServer 5 box?

2006-05-26 Thread rbsharp
I have a lot to do with Python and SCO but I never got above Python2.2 but that probably relates to the fact that I need to statically link some libraries into python. My notes on this subject are that if you need dynamic linking configure has a problem finding libdl.so, and that therefore you have

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Ant
It really depends on how you are trying to pass the dictionary across to Java, what sort of objects are in the dictionary etc. Could you provide some more background? BTW the Java implementation of Python is now called Jython (and has been for some years!). -- http://mail.python.org/mailman/list

Re: Creating instances of untrusted new-style classes

2006-05-26 Thread greg
Michael Spencer wrote: > >>> class A(object): > ... > >>> b = object.__new__(A) Note that you'll need to be a bit cleverer if the class might be derived from some other built-in type: >>> class A(list): ... pass ... >>> b = object.__new__(A) Traceback (most recent call last): File "", li

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread sandip desale
Hi, We have some tools which are developed in Python and using python dictionaries. Now for some new requirments we are using Java and want to use the existing dictionaries as both the tools are executed on the same platform. So we are trying to use the existing dictionaries only using JPython

Re: genexp surprise (wart?)

2006-05-26 Thread Michele Simionato
Paul Rubin wrote: > I tried to code the Sieve of Erastosthenes with generators: > > def sieve_all(n = 100): > # yield all primes up to n > stream = iter(xrange(2, n)) > while True: > p = stream.next() > yield p > # filter out all multi

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Ravi Teja
> I have a python dictionary file. I want to create a map of that dictionary > and want to use the same in my Java Program. > Can anybody please tell me how to use the same python dictionary in Java as > well as in Python. Try a JSON parser for Java http://www.json.org/ http://www.json.org/jav

Re: Python Programming Books?

2006-05-26 Thread 3KWA
http://www.greenteapress.com/thinkpython/ How to think like a computer scientist is a great first read I think. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to clear up a List in python?

2006-05-26 Thread Fredrik Lundh
George Sakkis wrote: > I guess Fredrik's message was more along the lines of ``don't try to > "help" others after a week or two toying with the language because you > might be offering disservice, despite your good intentions; leave this > to more experienced users``. no matter what Doug Holton a

Re: John Bokma harassment

2006-05-26 Thread Robin Becker
Steve Holden wrote: .. > I too wrote to XL's hosting company pointing out that while he might be > an irritant he wasn't particularly abusive. Bokma, on the other hand, > can be. I don't like either of them much, but at least Xah Lee insults > everyone while Bokma appears to resort to ad hom

Re: Can any body help me

2006-05-26 Thread Fredrik Lundh
Sidd wrote: > 1.Given a test file containing lines of words such as (abc, abb, > abd,abb, etc), write a script that prints, in order of frequency, how > many times each word appears in the file. > > Use dictionary datastructure in python and simple if-else statement. > Its simple give it a try.

Re: hi,everyone. a problem with shelve Module

2006-05-26 Thread skip
>> i only write ten records like this: >>name sex age >> jimmale 22 >> tom male 23 >> lucy female 21 ... >> but i find the size of

Re: hi,everyone. a problem with shelve Module

2006-05-26 Thread Laszlo Nagy
[EMAIL PROTECTED] i'rta: > >> i only write ten records like this: > > >>name sex age > > >> jimmale 22 > >> tom male 23 > >> lucy female 21 >

Re: how to clear up a List in python?

2006-05-26 Thread vbgunz
Fredrik_Lundh = 'wah' I bet you enjoy stealing candy from babies and dunging on the little guy every chance you get. You're suppose to be a role model in this community? Your temper tantrum and unrelenting 'look at me look at me i'm bigger and better' machismo attitude is nothing more than a decoy

Re: how to clear up a List in python?

2006-05-26 Thread Georg Brandl
vbgunz wrote: > Fredrik_Lundh = 'wah' > > I bet you enjoy stealing candy from babies and dunging on the little > guy every chance you get. You're suppose to be a role model in this > community? Your temper tantrum and unrelenting 'look at me look at me > i'm bigger and better' machismo attitude is

Re: wincerapi

2006-05-26 Thread Henk van Asselt
Tim Williams wrote: > Does anyone have a copy of the wincerapi module.It appears not to > be in the win32 extensions anymore, and I've googled lots but not > found it available anywhere. > > Thanks > Well, This is something I have been struggling for a long time as well. I have been writing

urllib2 and HTTP 302

2006-05-26 Thread Laszlo Nagy
Hello, The code below uses urllib2 and build_opener. Having this code fragment, how can I return the redirection URL? I tried to get this information from the exception but I could not. Is it possible to read it from the openerdirector? Any suggestions? try: self

Re: genexp surprise (wart?)

2006-05-26 Thread Paul Rubin
"Paul Du Bois" <[EMAIL PROTECTED]> writes: > The second is that you don't like the late-binding behavior of > generator expressions. PEP 289 has this to say: > > > After much discussion, it was decided that the first (outermost) > > for-expression should be evaluated immediately and that the remai

Re: how to clear up a List in python?

2006-05-26 Thread Georg Brandl
vbgunz wrote: > Fredrik_Lundh = 'wah' > > I bet you enjoy stealing candy from babies and dunging on the little > guy every chance you get. You're suppose to be a role model in this > community? Your temper tantrum and unrelenting 'look at me look at me > i'm bigger and better' machismo attitude is

Re: Speed up this code?

2006-05-26 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I'm creating a program to calculate all primes numbers in a range of 0 > to n, where n is whatever the user wants it to be. I've worked out the > algorithm and it works perfectly and is pretty fast, but the one thing > seriously slowing down the program is the following c

Re: how to clear up a List in python?

2006-05-26 Thread Steve Holden
vbgunz wrote: >>I guess Fredrik's message was more along the lines of ``don't try to >>"help" others after a week or two toying with the language because you >>might be offering disservice, despite your good intentions; leave this >>to more experienced users``. The words might have been a bit harsh

Re: how to clear up a List in python?

2006-05-26 Thread vbgunz
> You perhaps shouldn't become so excited. Next time, if you're not sure of > the correctness of your solution, try to wait a bit before posting it, > and see if someone other comes up with the same thing you would have posted. George, if Frederik's first reply was replaced with yours chances are

Re: how to clear up a List in python?

2006-05-26 Thread Steve Holden
vbgunz wrote: >>You perhaps shouldn't become so excited. Next time, if you're not sure of >>the correctness of your solution, try to wait a bit before posting it, >>and see if someone other comes up with the same thing you would have posted. > > > George, if Frederik's first reply was replaced wi

Re: how to clear up a List in python?

2006-05-26 Thread vbgunz
Steve, I have no qualm with Fredrik over this '''if you don't know how to do things, you don't need to post.''' but this ''' if you know why this is about the dumbest way to do what you're doing, and you're posted this on purpose, you really need to grow up.'''. The problem was I did post it on pu

Re: getattr for modules not classes

2006-05-26 Thread Heiko Wundram
Am Mittwoch 24 Mai 2006 15:43 schrieb Piet van Oostrum: > > Heiko Wundram <[EMAIL PROTECTED]> (HW) wrote: > > > >HW> y.py > >HW> --- > >HW> from x import test > >HW> print test.one > >HW> print test.two > >HW> print test.three > >HW> --- > > Or even: > import x > x = x.test > print x.one > prin

Re: how to clear up a List in python?

2006-05-26 Thread chris brat
Cant we all just get along ? Sorry, couldn't resist. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to clear up a List in python?

2006-05-26 Thread vbgunz
I read the ten commandments. I enjoyed the link. I see my mistakes. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

WinPops

2006-05-26 Thread Hari Sekhon
Hi, Is there a way of sending winpops (Windows Pop-Up / Net Send messages) in python? Perhaps some library or something that I can use under both Windows and Linux? Hari -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Kent Johnson
sandip desale wrote: > Hi, > > We have some tools which are developed in Python and using python dictionaries. Now for some new requirments we are using Java and want to use the existing dictionaries as both the tools are executed on the same platform. So we are trying to use the existing diction

Re: list comprehensions put non-names into namespaces!

2006-05-26 Thread Diez B. Roggisch
Ben Cartwright schrieb: > [EMAIL PROTECTED] wrote: >> Lonnie> List comprehensions appear to store their temporary result in a >> Lonnie> variable named "_[1]" (or presumably "_[2]", "_[3]" etc for >> Lonnie> nested comprehensions) >> >> Known issue. Fixed in generator comprehensions. Dunn

Re: Can any body help me

2006-05-26 Thread bruno de chez modulix en face
1. read this: www.catb.org/~esr/faqs/smart-questions.html 2. do the Python tutorial 3. do your homework 4. when stuck, post your code here HTH -- http://mail.python.org/mailman/listinfo/python-list

Re: Can any body help me

2006-05-26 Thread Bruno Desthuilliers
satish a écrit : > how to write script for these > (snip homework specifications) - read this: http://www.catb.org/~esr/faqs/smart-questions.html - browse the Python documentation - do the tutorial if needed - open you favorite code editor - do your homework If you're stuck, then post your code

Re: __getattr__ and functions that don't exist

2006-05-26 Thread bruno de chez modulix en face
class Parrot(object): class _dummy(object): def __init__(self, obj, name): self.name = name self.obj = obj def __call__(self, *args, **kw): print "dummy %s for %s" % (self.name, self.obj) print "called with %s - %s" % (str(args),

Re: list comprehensions put non-names into namespaces!

2006-05-26 Thread Mel Wilson
[EMAIL PROTECTED] wrote: > Lonnie> List comprehensions appear to store their temporary result in a > Lonnie> variable named "_[1]" (or presumably "_[2]", "_[3]" etc for > Lonnie> nested comprehensions) > > Known issue. Fixed in generator comprehensions. Dunno about plans to fix > it

Re: how to clear up a List in python?

2006-05-26 Thread Luis Armendariz
vbgunz wrote: > Steve, I have no qualm with Fredrik over this '''if you don't know how > to do things, you don't need to post.''' but this ''' if you know why > this is about the dumbest way to do what you're doing, and you're > posted this on purpose, you really need to grow up.'''. Well, given t

Re: John Bokma harassment

2006-05-26 Thread Robert Sedlacek
In comp.lang.perl.misc Mitch <[EMAIL PROTECTED]> wrote > All that I snipped is your opinion, which is yours to do with as you > please. "I like it just the way it is." is *MY* opinion, so please > don't try to change it. I think I know my opinion best. Wrong. You don't like it how it is. Beca

Re: hi,everyone. a problem with shelve Module

2006-05-26 Thread softwindow
really in which case? -- http://mail.python.org/mailman/listinfo/python-list

Re: os listdir access denied when run as a service

2006-05-26 Thread Ian Parker
In message <[EMAIL PROTECTED]>, Thomas Thomas <[EMAIL PROTECTED]> writes >Hi All, > >I am trying to access a mapped network drive folder. everything works fine >normally. But when i run the application as service I am getting the error > >Traceback (most recent call last): > File "docBoxApp.py",

Re: Parsing python dictionary in Java using JPython

2006-05-26 Thread Ant
This will work fine in simple cases and if the dictionaries are passed around in repr() form. If they are being passed pickled in some way, or the values in the dictionary are anything other than strings, lists, dictionaries or combinations of these then you will need something like Jython. -- h

Python for my mum

2006-05-26 Thread carol . chisholm
Someone has give my 78 year old mother a tool for learning French vocabulary written in Python. She has a plain vanilla Windows XP system and does not know what a compiler is. What can I tell her to do: - forget the helpful friend, and use more traditional means to do her home work - go to this

Re: how to clear up a List in python?

2006-05-26 Thread vbgunz
> Well, given that you did post it on purpose and had no "intent to mess > anyone up over it", it is clear that the antecedent in Fredrik's > if-statement is not satisfied and therefore your mind should've skipped > the consequent statement when reading his response. Why get so upset > about someth

Re: Python for my mum

2006-05-26 Thread bruno de chez modulix en face
> Someone has give my 78 year old mother a tool for learning French > vocabulary written in Python. Is it the tool or the vocabulary that's written in Python ? > She has a plain vanilla Windows XP system and does not know what a > compiler is. One doesn't need to know what's a compiler is to us

Re: hi,everyone. a problem with shelve Module

2006-05-26 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, softwindow <[EMAIL PROTECTED]> wrote: [some context restored] >> Sometimes you add records but the size of the database does not >> change... :-) >really > >in which case? whenever the database is big enough to add them without it's having to grow :) -- Jim S

Re: Python for my mum

2006-05-26 Thread vbgunz
maybe you can tell your moms what to do and what binaries to download or maybe you can download them for her and either send it to her through email or put it on a disc for her... I understand the Windows XP installation binary is easy enough for anyone to get going. Just follow the prompts. Once

Re: John Bokma harassment

2006-05-26 Thread Chris Uppal
Fred Gilham wrote: > BTW, one time I tried a little social engineering to get rid of an > irrelevant cross-posted thread. I replied to the messages in the > thread (an irrelevant political thread posted in rec.audio.tubes) with > (somewhat) inflammatory replies but deleted my newsgroup from the >

OT: Quote ? [was: John Bokma harassment]

2006-05-26 Thread Chris Uppal
[apologies to the whole flaming crowd for sending this to the whole flaming crowd...] Geoffrey Summerhayes wrote: > After you kill Navarth, will it be nothing but gruff and deedle > with a little wobbly to fill in the chinks? Where does that come from ? It sounds like a quote, and Navarth is a

Re: dict literals vs dict(**kwds)

2006-05-26 Thread bruno de chez modulix en face
> Hm, as far as I know shadowing the builtins is discouraged. *accidentally* shadowing builtins is a common Python gotcha - that's why it's comon here to raise *warnings* about this. Explicitly and knowingly rebinding a builtin (or any other name FWIW) *with a compatible object* is something else

"Learning Python" 2nd ed. p479 error?

2006-05-26 Thread AbrahamLincolnIllinois
Hello all. On page 479, the 2nd edition of the "Learning Python" book, this code appears class Derived(Base): def __init__(self, arg, *args, **kw): self.__init__(self, *args, **kw) Surely self.__init__ should be Base.__init__ Everything else in the book has

Re: Accessing object parent properties

2006-05-26 Thread bruno de chez modulix en face
> Are you sure you don't want to use a child class for this? Composition/delegation introduce far less coupling than implementation inheritance. Inheritance abuse is in fact a well-known OO antipattern. Since Python makes delegation easy as pie, I don't see any reason to go for inheritence when it

Re: Accessing object parent properties

2006-05-26 Thread bruno de chez modulix en face
(answering to the op) Cloudthunder wrote: > How can I set up method delegation so that I can do the following: > A.run() > and have this call refer to the run() method within the boo instance? Also, > what if I have tons of functions like run() within the boo instance and I > want all them to be

Re: Can any body help me

2006-05-26 Thread Tim Chase
> 1.Given a test file containing lines of words such as (abc, abb, > abd,abb, etc), write a script that prints, in order of frequency, how > many times each word appears in the file. solution 1) search the list archives...within the last week, someone wanted to count unique lines in an input fil

Re: Speed up this code?

2006-05-26 Thread bearophileHUGS
If you are interested in such programs, you can take a look at this one too: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366178 It requires more memory, but it's quite fast. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: genexp surprise (wart?)

2006-05-26 Thread Mel Wilson
Paul Rubin wrote: > "Paul Du Bois" <[EMAIL PROTECTED]> writes: >> The second is that you don't like the late-binding behavior of >> generator expressions. PEP 289 has this to say: >> >>> After much discussion, it was decided that the first (outermost) >>> for-expression should be evaluated immediat

Re: Request for comments on python distributed technologies

2006-05-26 Thread [EMAIL PROTECTED]
Carl J. Van Arsdall wrote: > Hey everyone, another question for the list. In particular i'm looking > for comments on some of the distributed technologies supported in > python. Specifically, I'm looking at XML-RPC, RPyC, CORBA, and Twisted. > > Before you offer any comments let me talk about wh

Re: how to clear up a List in python?

2006-05-26 Thread Steve Holden
vbgunz wrote: > I read the ten commandments. I enjoyed the link. I see my mistakes. > Thank you. > A genuine pleasure. Welcome to comp.lang.python. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog

Re: Python for my mum

2006-05-26 Thread BartlebyScrivener
First be sure she needs to install Python, if so, try: 7 Minutes To Hello World http://www.richarddooling.com/index.php/category/geekophilia These instructions are for people on Windows XP who don't even know what a commandline is. They seem popular, based on the traffic they attract. Try them

Re: "Learning Python" 2nd ed. p479 error?

2006-05-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > On page 479, the 2nd edition of the "Learning Python" book, this code > appears > > class Derived(Base): > def __init__(self, arg, *args, **kw): > self.__init__(self, *args, **kw) > > Surely self.__init__ should be > > Base.__init__

Re: Use of lambda functions in OOP, any alternative?

2006-05-26 Thread Maric Michaud
Le Mercredi 24 Mai 2006 22:37, Scott David Daniels a écrit : >      class Base(object): >          def __init__(self, attr): >              self._attr = attr >          def getattr(self): >              return self._attr >          def attr(self): >              return self.getattr() >          att

Re: Can any body help me

2006-05-26 Thread gene tani
satish wrote: > how to write script for these > > 1.Given a test file containing lines of words such as (abc, abb, > abd,abb, etc), write a script that prints, in order of frequency, how > many times each word appears in the file. > > 2. > Write a script running in an endless loop that pings an IP

Re: Speed up this code?

2006-05-26 Thread Frank Millman
[EMAIL PROTECTED] wrote: > If you are interested in such programs, you can take a look at this one > too: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366178 > > It requires more memory, but it's quite fast. > > Bye, > bearophile I compared the speed of this one (A) with the speed of

Re: dict literals vs dict(**kwds)

2006-05-26 Thread George Sakkis
bruno de chez modulix en face wrote: > > and there's no compelling reason for dict(**kwds). > > Yes there is : this *is* the ordinary Python syntax - calling a type to > get an instance of it. The dict-litteral syntax is mostly syntactic > sugar. The thing is there are four (at least?) ways to g

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-26 Thread sturlamolden
Gonzalo Monzón wrote: > I use Python 2.4.3 (msvcrt71) and I succesfully installed the last > version of binutils, pyrex and MinGW, some weeks ago, using Julien Fiore > step-by-step guide, so "my" MinGW is linking with msvcrt71.dll, with the > default configuration. A successful build (compile an

RE: John Bokma harassment

2006-05-26 Thread Sander Steffann
From: John Bokma > dreamhost has made a decission, a right one IMO. And now you > ask people to harass them more? > > You really are just a pathetic little shit now aren't you? > Not even the balls nor the guts to fix the issue that you are. Using language like this clearly shows who has a commu

Re: a good explanation

2006-05-26 Thread [EMAIL PROTECTED]
Nick Craig-Wood wrote: > mik3 <[EMAIL PROTECTED]> wrote: > > So he has written his first program in python and i have roughly toook > > a glance at it and saw what he did.. i pointed out his "mistakes" but > > couldn't convince him otherwise. Anyway , i am going to show him your > > replies.. >

Trying to get FreeImagePy to work.

2006-05-26 Thread Iain King
I've installed ctypes and FreeImagePy. When I do this: >>> import FreeImagePy >>> f = FreeImagePy.Image() I get: find Traceback (most recent call last): File "", line 1, in ? File "C:\Python\Lib\site-packages\FreeImagePy\FreeImagePy.py", line 1952, in _ _init__ super(Image, self).__init_

Re: Python Programming Books?

2006-05-26 Thread John Salerno
Michael Tobis wrote: > Of the books that are out there, Learning Python and Dive Into Python > are best for the hobbyist as opposed to classroom setting, but my sense > is that both of them go a bit too fast for the typical beginner with no > formal training. I agree that Dive Into Python moves t

hide python window

2006-05-26 Thread Bell, Kevin
When I run a script, how can I make it run in the background? I don't want to see the command window because it runs all day. I'm on windows... -- http://mail.python.org/mailman/listinfo/python-list

Re: Can any body help me

2006-05-26 Thread John Salerno
Fredrik Lundh wrote: > Sidd wrote: > >> 1.Given a test file containing lines of words such as (abc, abb, >> abd,abb, etc), write a script that prints, in order of frequency, how >> many times each word appears in the file. >> >> Use dictionary datastructure in python and simple if-else statement.

Re: hide python window

2006-05-26 Thread Luis Armendariz
Bell, Kevin wrote: > When I run a script, how can I make it run in the background? I don't > want to see the command window because it runs all day. I'm on > windows... > > Hi Kevin, Rename your kevin_script.py to kevin_script.pyw (so that it runs with pythonw.exe instead of python.exe). -Lu

RE: hide python window

2006-05-26 Thread Tim Golden
[Bell, Kevin] | When I run a script, how can I make it run in the background? I don't | want to see the command window because it runs all day. I'm on | windows... Broadly, two options (depending on what "in the background" means): 1) Complex, but complete: run it as a service. See the example

Re: OLAP and pivot tables

2006-05-26 Thread Ben Stroud
George Sakkis wrote: >After a brief search, I didn't find any python package related to OLAP >and pivot tables. Did I miss anything ? To be more precise, I'm not so >interested in a full-blown OLAP server with an RDBMS backend, but >rather a pythonic API for constructing datacubes in memory, slici

Re: how to clear up a List in python?

2006-05-26 Thread [EMAIL PROTECTED]
The original post only mentions deleting the values in the list, not the list itself. Given that you want to keep the list and just ditch the values it contains I'd go with: list1 = [] -Linnorm -- http://mail.python.org/mailman/listinfo/python-list

Re: dict literals vs dict(**kwds)

2006-05-26 Thread Duncan Booth
George Sakkis wrote: > Perhaps you fail to understand that the given feature is > 1) redundant (see above). Yes, but a certain degree of redundancy in the language is inevitable, and when it exists (as in this case) to make people's life easier it may be a good thing. Obviously the tradeoff bet

Re: Trying to get FreeImagePy to work.

2006-05-26 Thread Michele Petrazzo
Iain King wrote: > I've installed ctypes and FreeImagePy. When I do this: > import FreeImagePy f = FreeImagePy.Image() > > I put a 'print self._name' in the ctypes __init__ file, just before > line 296 - it's printing out the 'find' just before the error. So, in > what specific way have I

Re: "Learning Python" 2nd ed. p479 error?

2006-05-26 Thread Mel Wilson
[EMAIL PROTECTED] wrote: > Hello all. > > On page 479, the 2nd edition of the "Learning Python" book, this code > appears > > class Derived(Base): > def __init__(self, arg, *args, **kw): > self.__init__(self, *args, **kw) > > Surely self.__init__ should be > >

Re: dict literals vs dict(**kwds)

2006-05-26 Thread George Sakkis
Duncan Booth wrote: > George Sakkis wrote: > > > 2) restricting in a more serious sense: the future addition of optional > > keyword arguments that affect the dict's behaviour. Google for "default > > dict" or "dictionary accumulator". > > There is nothing to stop dictionaries being created using

Re: a good explanation

2006-05-26 Thread Diez B. Roggisch
> Something that is being missed is the idea of changing conditions. A > for loop assumes known boundaries. > > def condition_test(): > # check socket status > # return true if socket good, false otherwise > > while condition_test(): ># do stuff > > allows the loopiing code to react to c

Re: Trying to get FreeImagePy to work.

2006-05-26 Thread Iain King
Michele Petrazzo wrote: > Iain King wrote: > > I've installed ctypes and FreeImagePy. When I do this: > > > import FreeImagePy f = FreeImagePy.Image() > > > > I put a 'print self._name' in the ctypes __init__ file, just before > > line 296 - it's printing out the 'find' just before the error

Re: Speed up this code?

2006-05-26 Thread Gregory Petrosyan
# Paul Rubin's version [EMAIL PROTECTED]:~$ python -mtimeit "import test2" "test2.primes(1000)" 100 loops, best of 3: 14.3 msec per loop # version from the Cookbook [EMAIL PROTECTED]:~$ python -mtimeit "import test1" "test1.primes(1000)" 1000 loops, best of 3: 528 usec per loop -- http://mail.py

hide python window, con'td

2006-05-26 Thread Bell, Kevin
Great! And now that it's hiding w/ .pyw, how would I kill it if I want? Just log off, or is there a better way? Kevin -- http://mail.python.org/mailman/listinfo/python-list

Running Python scripts under a different user

2006-05-26 Thread Bernard Lebel
Hello, I would like to know if there is a way to run a Python file under a different user account than the one logged in. Allow me to explain. There are a bunch of people here, they are "basic user", with limited permissions. Basically there are locations on the network where they can only read a

Re: hide python window, con'td

2006-05-26 Thread John Salerno
Bell, Kevin wrote: > Great! And now that it's hiding w/ .pyw, how would I kill it if I want? > Just log off, or is there a better way? > > Kevin > > Close it in the Task Manager? -- http://mail.python.org/mailman/listinfo/python-list

Re: Running Python scripts under a different user

2006-05-26 Thread Diez B. Roggisch
Bernard Lebel schrieb: > Hello, > > I would like to know if there is a way to run a Python file under a > different user account than the one logged in. Allow me to explain. > > There are a bunch of people here, they are "basic user", with limited > permissions. Basically there are locations on t

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-26 Thread Gonzalo Monzón
Hi, sturlamolden escribió: Gonzalo Monzón wrote: > > >>I use Python 2.4.3 (msvcrt71) and I succesfully installed the last >>version of binutils, pyrex and MinGW, some weeks ago, using Julien Fiore >>step-by-step guide, so "my" MinGW is linking with msvcrt71.dll, with the >>default configuratio

RE:RE: hide python window, cont'd

2006-05-26 Thread Bell, Kevin
Bell, Kevin wrote: > Great! And now that it's hiding w/ .pyw, how would I kill it if I want? > Just log off, or is there a better way? > > Kevin > > >>JOE WROTE: >>Close it in the Task Manager? I don't see it in the task manager. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to get FreeImagePy to work.

2006-05-26 Thread Michele Petrazzo
Iain King wrote: > Michele Petrazzo wrote: > > I downloaded and installed 0.9.9.3, and it now works. Thanks! > I advice you to don't use that ctypes version... Better is to use the newest one and update freeimagepy! > Iain > Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: How does a generator object refer to itself?

2006-05-26 Thread Russell
Michael wrote: > You don't need python 2.5 at all to do this. You do need to > have a token mutable first argument though, as you can see. Thank you. That's a pattern similar to one we're using, where a new object refers to the generator. The problem we're seeing is that it seems to fool the garba

Re: sybase open client 15_0

2006-05-26 Thread Eduardo Gonzalez-Solares
See: http://www.object-craft.com.au/pipermail/python-sybase/2006-May/000471.html Dan wrote: > I'm running SLES 9.3 on Tyan with 2 single core 64-bit Opteron & 8 GB of > memory and SWAP. > > OCS-15_0 > sybperl-2.18 > python 2.3.5 > > > > "Dan" <[EMAIL PROTECTED]> wrote in message > news:[EMA

Re: Running Python scripts under a different user

2006-05-26 Thread Laszlo Nagy
Hello Diez, Please see below. > And as you refrain form telling us which OS you are running under one > can only be very vague on what to suggest - UNIXish OSes have for > example the setguid-bit, sudo springs to mind and under certain desktops > there are ways to acquire root-settings (but y

Re: hide python window, cont'd

2006-05-26 Thread John Salerno
Bell, Kevin wrote: > Bell, Kevin wrote: >> Great! And now that it's hiding w/ .pyw, how would I kill it if I > want? >> Just log off, or is there a better way? >> >> Kevin >> >> > >>> JOE WROTE: >>> Close it in the Task Manager? > > > I don't see it in the task manager. > > You might have to

Re: How does a generator object refer to itself?

2006-05-26 Thread Russell
> Why don't you use a class ? Because we use this pattern for thousands of functions, and don't want thousands of new classes. Right now we use a single class that creates an instance for each such generator. I was hoping to find a way to get even more lightweight than that. :-) -- http://mail.p

RE: hide python window, cont'd

2006-05-26 Thread Tim Golden
[John Salerno] | | Bell, Kevin wrote: | > Bell, Kevin wrote: | >> Great! And now that it's hiding w/ .pyw, how would I kill it if I | > want? | >> Just log off, or is there a better way? | >> | >> Kevin | >> | >> | > | >>> JOE WROTE: | >>> Close it in the Task Manager? | > | > | > I don't see

Re: John Bokma harassment

2006-05-26 Thread Mumia W.
Robert Sedlacek wrote: > In comp.lang.perl.misc Mitch <[EMAIL PROTECTED]> wrote > >> All that I snipped is your opinion, which is yours to do with as you >> please. "I like it just the way it is." is *MY* opinion, so please >> don't try to change it. I think I know my opinion best. > > Wrong.

Re: dict literals vs dict(**kwds)

2006-05-26 Thread Bruno Desthuilliers
George Sakkis a écrit : > bruno de chez modulix en face wrote: > > >>>and there's no compelling reason for dict(**kwds). >> >>Yes there is : this *is* the ordinary Python syntax - calling a type to >>get an instance of it. The dict-litteral syntax is mostly syntactic >>sugar. > > > The thing i

Re: how to clear up a List in python?

2006-05-26 Thread Duncan Smith
[EMAIL PROTECTED] wrote: > The original post only mentions deleting the values in the list, not > the list itself. Given that you want to keep the list and just ditch > the values it contains I'd go with: > > list1 = [] > > -Linnorm > Which rebinds list1 to a new (empty) list. It doesn't clea

Re: OT: Quote ? [was: John Bokma harassment]

2006-05-26 Thread John Bokma
"Chris Uppal" <[EMAIL PROTECTED]> wrote: > [apologies to the whole flaming crowd for sending this to the whole > flaming crowd...] > > Geoffrey Summerhayes wrote: > >> After you kill Navarth, will it be nothing but gruff and deedle >> with a little wobbly to fill in the chinks? > > Where does t

Re: how to clear up a List in python?

2006-05-26 Thread Mel Wilson
[EMAIL PROTECTED] wrote: > The original post only mentions deleting the values in the list, not > the list itself. Given that you want to keep the list and just ditch > the values it contains I'd go with: > > list1 = [] Depends what you mean by "keep the list". Consider class C (object):

Tkinter canvas zooming (sortof)

2006-05-26 Thread Bob Greschke
I have a program that sucks in a list of equipment positions (Lats/Longs), opens a Toplevel frame with a canvas set to, for example, 700x480 pixels, and then does all of the calculations and plots the objects with 10-pixel wide ovals and rectangles. Now I want to zoom in (or out), but I don't w

PIL problem with biprocessor hardware

2006-05-26 Thread mardif
Hi guys, I've a problem, but very big! So, i have a python/PIL application that manipulate images ( rotate, crop, save, etc etc ). If this application work on a PC mono-processor, I don't have any problems. If this application work instead on a PC bi-processor, the process elaborates an image "cor

  1   2   >