Re: Sorting by item_in_another_list

2006-10-25 Thread Paul Rubin
ZeD <[EMAIL PROTECTED]> writes: > > desired_result = B + sorted(x for x in A if x not in B) > this. is. cool. Actually it's better to use a set if B is large: B2 = set(B) desired_result = B + sorted(x for x in A if x not in B2) That avoids a linear search through B for each element of A. -

Re: ZODB for inverted index?

2006-10-25 Thread Gabriel Genellina
At Wednesday 25/10/2006 03:54, [EMAIL PROTECTED] wrote: anyway can someone help me on how to "rewrite" and "reload" a class instance when using ZODB ? What do you mean? -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus

Re: Sorting by item_in_another_list

2006-10-25 Thread Fredrik Lundh
Paul Rubin wrote: >> for example: >> >> A = [0,1,2,3,4,5,6,7,8,9,10] >> B = [2,3,7,8] >> >> desired_result = [2,3,7,8,0,1,4,5,6,9,10] > > How about: > > desired_result = B + sorted(x for x in A if x not in B) assuming that "keep the existing order" means what it says, you might as well repla

Re: Sorting by item_in_another_list

2006-10-25 Thread Paul Rubin
Fredrik Lundh <[EMAIL PROTECTED]> writes: > > desired_result = B + sorted(x for x in A if x not in B) > assuming that "keep the existing order" means what it says, you might > as well replace "sorted" with a list comprehension. Hmm. I didn't read it that way, but yeah, if that's what the OP mea

Re: win32com problem

2006-10-25 Thread cfriedalek
Gabriel Genellina wrote: > Run it on the debugger step by step, and inspect all the intermediate objects. > Synergy.StudyDoc might be a function, by example, so you should add > another pair of (). > This is not obvious looking at the VB code. (Sorry, tied up this arvo so I could respond to your

Re: Tkinter question

2006-10-25 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Eric Brunel wrote: > > > But Hendrik's solution is better, since it avoids the use of lambda, which > > is often difficult to understand. > > storing the button reference in a variable doesn't help if you want to use the > same callback for multiple b

Re: question: script to input data into a webpage and then retrievethe result?

2006-10-25 Thread mxywp
Thank you, Christoph! I used twill to get my data. And Titus is really helpful in helping me learn how to use it. Thank Paul, Haiyun and Dennis for your comments! Actually it turned out that the authentication code on that web page is kind of a joke. I finally found out that you could still sub

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > David Boddie wrote: > >>> commercial deployment is expensive; free deployment must be GPL; >> >> Opinions differ on the first one of these. > > even if you define "expensive" as "costs more money than the others" ? Even if you consider that the huge time saving you get o

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >> Also, the Tkinter API is far less elegant than the others. > > huh? create object, display object, create object, display object. sure > looks like plain old Python to me... Let's see : .pack(side = "left") fred = Button(self, fg = "red", bg =

Re: python GUIs comparison (want)

2006-10-25 Thread Fredrik Lundh
Christophe wrote: commercial deployment is expensive; free deployment must be GPL; >>> >>> Opinions differ on the first one of these. >> even if you define "expensive" as "costs more money than the others" ? > > Even if you consider that the huge time saving you get out of using Qt > is wo

python html 2 image (png)

2006-10-25 Thread baur79
hi everyone how can i render html page to png image ex: http://www.website.com/index.html -> index.png thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

Re: python GUIs comparison (want)

2006-10-25 Thread Fredrik Lundh
Christophe wrote: >>> Also, the Tkinter API is far less elegant than the others. >> huh? create object, display object, create object, display object. sure >> looks like plain old Python to me... > > Let's see : > > .pack(side = "left") > > fred = Button(self, fg = "red", bg = "blue") > fred[

Re: python html 2 image (png)

2006-10-25 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > how can i render html page to png image > ex: > > http://www.website.com/index.html -> index.png what tools are you using to do that today? -- http://mail.python.org/mailman/listinfo/python-list

Re: Ctypes Error: Why can't it find the DLL.

2006-10-25 Thread Jon Clements
Mudcat wrote: > So then I use the find_library function, and it finds it: > > >>> find_library('arapi51.dll') > 'C:\\WINNT\\system32\\arapi51.dll' > Notice it's escaped the '\' character. > At that point I try to use the LoadLibrary function, but it still can't > find it: > > >>> windll.LoadLi

dict problem

2006-10-25 Thread Alistair King
Hi, ive been trying to update a dictionary containing a molecular formula, but seem to be getting this error: Traceback (most recent call last): File "DS1excessH2O.py", line 242, in ? updateDS1v(FCas, C, XDS) NameError: name 'C' is not defined dictionary is: DS1v = {'C': 6, 'H': 10, 'O

problem with fft periodogram

2006-10-25 Thread aitor69gonzalez
Hello, I am ploting a fft periodogram of my data using a script (found in internet: http://linuxgazette.net/115/andreasen.html ) that gave me good results before. There should be a periodicity of >160 in the data as can be seen by eye. However, this script now says that there is periodicity of ~9.

Re: Change on file

2006-10-25 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Tuesday 24 October 2006 20:22, Alan Franzoni wrote: > it could put the system under severe workload. Thank you for the enlightment :-) In my case it's meant to check a couple of files, but no more tha

Re: Handling emails

2006-10-25 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Tuesday 24 October 2006 03:07, Gerard Flanagan wrote: > The 'PopClient' class here might help you: I got a look rather later. Let me say that is impressively pythonic :-) On the other hand I've to go

Re: return same type of object

2006-10-25 Thread Bruno Desthuilliers
Steve Holden wrote: > Bruno Desthuilliers wrote: >> David Isaac a écrit : > [...] >> >>> But Steve suggests going with the latter. >> >> >> That's what I'd do too a priori. >> > Believe it or not, I wasn't at the priory when I wrote that. Steve, if it's a pun, I'm afraid I just don't get it... >

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > Also, the Tkinter API is far less elegant than the others. >>> huh? create object, display object, create object, display object. >>> sure looks like plain old Python to me... >> >> Let's see : >> >> .pack(side = "left") >> fred = Button(se

Re: dict problem

2006-10-25 Thread Roberto Bonvallet
Alistair King wrote: > Hi, > > ive been trying to update a dictionary containing a molecular formula, but > seem to be getting this error: > > > Traceback (most recent call last): > File "DS1excessH2O.py", line 242, in ? >updateDS1v(FCas, C, XDS) > NameError: name 'C' is not defined > > d

Re: Unicode support in python

2006-10-25 Thread sonald
Fredrik Lundh wrote: > > what does the word "validate" mean here? > Let me explain our module. We receive text files (with comma separated values, as per some predefined format) from a third party. for example account file comes as "abc.acc" {.acc is the extension for account file as per our code}

Re: Visibility against an unknown background

2006-10-25 Thread Sergei Organov
"Filip Salomonsson" <[EMAIL PROTECTED]> writes: > On 10/24/06, Sergei Organov <[EMAIL PROTECTED]> wrote: >> I'd be very upset to see, say, 5-6 highly intersecting >> scientific plots on the same picture drawn using the >> "marching ants" approach. > > I'd be a bit upset to see scientific plots *on

Re: dict problem

2006-10-25 Thread Roberto Bonvallet
Roberto Bonvallet wrote: > Alistair King wrote: >> DS1v = {'C': 6, 'H': 10, 'O': 5} > > Try DS1v['C'] instead of DS1v[C]. > updateDS1v(FCas, C, XDS) > updateDS1v(FHas, H, XDS) > updateDS1v(FOas, O, XDS) > updateDS1v(FNas, N, XDS) > updateDS1v(FSas, S, XDS) > updateDS1v(FClas, Cl, XDS) > updateDS1

Re: Looking for assignement operator

2006-10-25 Thread Bruno Desthuilliers
Tommi wrote: > Bruno Desthuilliers wrote: > (about Traits) > >> How could it help ? > > To me they just looked a bit alike: > > --- op's example --- > a = MyInt(10) > # Here i need to overwrite the assignement operator > a = 12 > > --- traits' example --- > moe = Child() > # NOTIFICATION in act

Re: Unicode support in python

2006-10-25 Thread sonald
HI Can u please tell me if there is any package or class that I can import for internationalization, or unicode support? This module is just a small part of our application, and we are not really supposed to alter the code. We do not have nobody here to help us with python here. and are supposed t

Re: dict problem

2006-10-25 Thread Peter Otten
Alistair King wrote: > Hi, > > ive been trying to update a dictionary containing a molecular formula, but > seem to be getting this error: > > > Traceback (most recent call last): > File "DS1excessH2O.py", line 242, in ? > updateDS1v(FCas, C, XDS) > NameError: name 'C' is not defined > >

Re: dict problem

2006-10-25 Thread Jon Clements
Alistair King wrote: > Hi, > > ive been trying to update a dictionary containing a molecular formula, but > seem to be getting this error: > > > Traceback (most recent call last): > File "DS1excessH2O.py", line 242, in ? > updateDS1v(FCas, C, XDS) > NameError: name 'C' is not defined > > d

Re: Visibility against an unknown background

2006-10-25 Thread Sergei Organov
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Sergei Organov wrote: > [...] >> Where "most cases" depends on application. I'd be very upset to see, >> say, 5-6 highly intersecting scientific plots on the same picture drawn >> using the "marching ants" approach. > > but the mostly random colors you ge

Re: Change on file

2006-10-25 Thread Ben Finney
Fulvio <[EMAIL PROTECTED]> writes: > *** > Your mail has been scanned by InterScan MSS. > *** Fulvio, something between your fingers and the Python mailing list is causing this to appear at on *every* message you send to this list. Please do whatever you n

Re: Sending Dictionary via Network

2006-10-25 Thread Frithiof Andreas Jensen
> "mumebuhi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The simplejson module is really cool and simple to use. This is great! JUST what I need for some configuration files!! Thanks for the link (die, configparse, dieee). -- http://mail.python.org/mailman/listinfo/python-lis

unsigned 32 bit arithmetic type?

2006-10-25 Thread Robin Becker
Hi, just trying to avoid wheel reinvention. I have need of an unsigned 32 bit arithmetic type to carry out a checksum operation and wondered if anyone had already defined such a beast. Our current code works with 32 bit cpu's, but is failing with 64 bit comparisons; it's clearly wrong as we are

dict problem

2006-10-25 Thread Alistair King
Jon Clements wrote: > > Alistair King wrote: > > > > > >> >> Hi, >> >> >> >> ive been trying to update a dictionary containing a molecular formula, >> >> but seem to be getting this error: >> >> >> >> >> >> Traceback (most recent call last): >> >> File "DS1excessH2O.py", line 242, in ? >>

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Travis E. Oliphant
Robin Becker wrote: > Hi, just trying to avoid wheel reinvention. I have need of an unsigned 32 bit > arithmetic type to carry out a checksum operation and wondered if anyone had > already defined such a beast. > > Our current code works with 32 bit cpu's, but is failing with 64 bit > compariso

pygtk and threading

2006-10-25 Thread kingcrowbar . list
Hello Everyone I have been playing a little with pyGTK and threading to come up with simple alert dialog which plays a sound in the background. The need for threading came when in the first version i made, the gui would freeze after clicking the close button until pygame finished playing the soun

Re: dict problem

2006-10-25 Thread Jon Clements
Alistair King wrote: > Jon Clements wrote: > > > > Alistair King wrote: > > > > > > > > > >> >> Hi, > >> >> > >> >> ive been trying to update a dictionary containing a molecular formula, > >> >> but seem to be getting this error: > >> >> > >> >> > >> >> Traceback (most recent call last): > >> >>

Re: problem with fft periodogram

2006-10-25 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: > Hello, > > I am ploting a fft periodogram of my data using a script (found in > internet: http://linuxgazette.net/115/andreasen.html ) that gave me > good results before. There should be a periodicity of >160 in the data > as can be seen by eye. However, this script now

Re: Attempting to parse free-form ANSI text.

2006-10-25 Thread Frederic Rentsch
Dennis Lee Bieber wrote: > On Mon, 23 Oct 2006 20:34:20 +0100, Steve Holden <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >> Don't give up, attach it as a file! >> >> > Which might be acceptable on a mailing list, but might be > problematic on a "text" newsg

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Robin Becker
Travis E. Oliphant wrote: > Robin Becker wrote: > NumPy defines an array and an array scalar for all signed and unsigned > integers defined in C. > > import numpy as nx > type(nx.array([1,2,3],dtype=nx.uint32)[0]) > > great, but do we have a pure python version? -- Robin Becker --

web-based SSH

2006-10-25 Thread Astan Chee
Hi, I was looking for a web-based SSH client (something like www.port42.com..but for some reason it doesnt work..can anyone verify this)..does anyone know any other alternative to other websites that offer this? If you're gonna scream 'security!security!' well, its for testing purposes and the box

Re:

2006-10-25 Thread Michael S
Thanks Gabriel. I think I'll try calling my module from a separate thread as calling wxPython or even Python code from C would be a bit complicated. My extension calls simple functions, but the issue was that the files I operate on are huge in size and Python was taking a long time and/or choking.

Re: web-based SSH

2006-10-25 Thread Christoph Haas
On Wednesday 25 October 2006 11:59, Astan Chee wrote: > I was looking for a web-based SSH client (something like > www.port42.com..but for some reason it doesnt work..can anyone verify > this)..does anyone know any other alternative to other websites that > offer this? If you're gonna scream 'secur

Re: using mmap on large (> 2 Gig) files

2006-10-25 Thread Martin v. Löwis
sturlamolden schrieb: > 2. The OS may be stupid. Mapping a large file may be a major slowdown > simply because the memory mapping is implemented suboptimally inside > the OS. For example it may try to load and synchronise huge portions of > the file that you don't need. Can you give an example of

Re: [wxPython-users] Re:

2006-10-25 Thread Michael S
If I create a threading.Thread derived class, and run the wxPython code in the main thread; using a lock, will I be able to suspend the Thread, even though it will run the C code, which is essentially a while loop looping through millions of lines of a text file? Thanks in advance. Michael --- Jo

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Martin v. Löwis
Robin Becker schrieb: > Hi, just trying to avoid wheel reinvention. I have need of an unsigned > 32 bit arithmetic type to carry out a checksum operation and wondered if > anyone had already defined such a beast. > > Our current code works with 32 bit cpu's, but is failing with 64 bit > comparison

Re: mean ans std dev of an array?

2006-10-25 Thread Frederic Rentsch
SpreadTooThin wrote: > import array > a = array.array('f', [1,2,3]) > > print a.mean() > print a.std_dev() > > Is there a way to calculate the mean and standard deviation on array > data? > > Do I need to import it into a Numeric Array to do this? > > I quickly fish this out of my functions tool

Re: [0T] Re: Simple python + html + from --> to python script

2006-10-25 Thread Bruno Desthuilliers
Bruno Desthuilliers wrote: (snip) > (snip) > Also, the "button" tag doesn't require a end tag. oops ! Sorry, your syntax was ok - button elements actually requires the end tag. my bad :( -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMA

Re: Handling emails

2006-10-25 Thread Gerard Flanagan
Fulvio wrote: > On Tuesday 24 October 2006 03:07, Gerard Flanagan wrote: > > The 'PopClient' class here might help you: > > I got a look rather later. Let me say that is impressively pythonic :-) I don't know if everyone would agree with you, but thanks! Have you looked at the email.utils module

Re: Ctypes Error: Why can't it find the DLL.

2006-10-25 Thread Chetan
"Jon Clements" <[EMAIL PROTECTED]> writes: > Mudcat wrote: > > > > So then I use the find_library function, and it finds it: > > > > >>> find_library('arapi51.dll') > > 'C:\\WINNT\\system32\\arapi51.dll' > > > > Notice it's escaped the '\' character. > > > At that point I try to use the LoadLi

Re: dict problem

2006-10-25 Thread Ben Finney
"Jon Clements" <[EMAIL PROTECTED]> writes: > We're still in the dark as to what you're trying to do, try > describing something like: "for each element there is an associated > 'F' value. For each element in an existing molecule I wish to change > the number of 'whatever' to be 'whatever' + my 'F'

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Robin Becker
Martin v. Löwis wrote: > Robin Becker schrieb: >> Hi, just trying to avoid wheel reinvention. I have need of an unsigned >> 32 bit arithmetic type to carry out a checksum operation and wondered if >> anyone had already defined such a beast. >> >> Our current code works with 32 bit cpu's, but is fai

Re: dict problem

2006-10-25 Thread Alistair King
Ben Finney wrote: > "Jon Clements" <[EMAIL PROTECTED]> writes: > > >> We're still in the dark as to what you're trying to do, try >> describing something like: "for each element there is an associated >> 'F' value. For each element in an existing molecule I wish to change >> the number of 'whate

Re: python html 2 image (png)

2006-10-25 Thread baur79
> what tools are you using to do that today? where are many of EXE programs but i need python solution for adding it to my automate program under lunix Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > how can i render html page to png image > > ex: > > > > http://www.website.com/index.html

Re: python GUIs comparison (want)

2006-10-25 Thread David Boddie
Fredrik Lundh wrote: > Christophe wrote: > > Even if you consider that the huge time saving you get out of using Qt > > is worth more than what you pay to acquire a licence? > > then it sounds like a combination between "it's a silver bullet!" and > "commercial software is better than free softwar

Re: Sending Dictionary via Network

2006-10-25 Thread Leif K-Brooks
Frithiof Andreas Jensen wrote: >> "mumebuhi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> The simplejson module is really cool and simple to use. This is great! > > JUST what I need for some configuration files!! > Thanks for the link (die, configparse, dieee). I would person

Re: can't open word document after string replacements

2006-10-25 Thread Duncan Booth
Frederic Rentsch <[EMAIL PROTECTED]> wrote: > DOC files contain housekeeping info which becomes inconsistent if you > change text. Possibly you can exchange stuff of equal length but that > wouldn't serve your purpose. RTF files let you do substitutions and they > save a lot of space too. But I

Re: numbers to string

2006-10-25 Thread David Isaac
Robert Kern wrote: >>> from numpy import * >>> y = [116, 114, 121, 32, 116, 104, 105, 115] >>> a = array(y, dtype=uint8) >>> z = a.tostring() >>> z 'try this' Very nice! Thanks also to Paul and Travis! Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

To remove some lines from a file

2006-10-25 Thread umut . tabak
Dear all, I am quite new to python. I would like to remove two lines from a file. The file starts with some comments, the comment sign is $. The file structure is $ $ $ $ $ $ $ . . . . $ line1 line 2 $ $ . . . $ actual commands I would like to delete those two lines at the very beginning of the

Re: To remove some lines from a file

2006-10-25 Thread Jerry
Very inelegant, but you get the idea: counter = 0 f = open("test.txt") for line in f.readlines(): if line[0] != "$" and counter < 2: counter += 1 continue else: print line, -- Jerry -- http://mail.python.org/mailman/listinfo/python-list

Re: python GUIs comparison (want)

2006-10-25 Thread rdsteph
Paul Boddie wrote: """The figures behind the scenes are quite enlightening for that particular page. If you (or community experiences) don't agree with the rankings (wxPython apparently even easier to learn than PythonCard and Tinder, a bunch of Gtk-based toolkits having more or less "full" Linux

Re: To remove some lines from a file

2006-10-25 Thread umut . tabak
Thanks, I have learnt sth from the library BTW. Regards On Oct 25, 3:32 pm, "Jerry" <[EMAIL PROTECTED]> wrote: > Very inelegant, but you get the idea: > > counter = 0 > > f = open("test.txt") > for line in f.readlines(): > if line[0] != "$" and counter < 2: > counter += 1 > co

Re: dict problem

2006-10-25 Thread Ben Finney
Alistair King <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > Even better, work on a minimal program to do nothing but reproduce > > the unexpected behaviour. If you get to such a program and still > > don't understand, then post it here so others can run it > > themselves and explain. > ive c

Re: Want to reduce steps of an operation with dictionaries

2006-10-25 Thread pretoriano_2001
James: Your solution works for me, many, many thanks for your help and many thanks for the time, teaching and reflections I received from all the guys that participated in this thread. James Stroud wrote: > [EMAIL PROTECTED] wrote: > > Hello: > > I have next dictionaries: > > a={'a':0, 'b':1, 'c'

Re: Sending Dictionary via Network

2006-10-25 Thread Chris Mellon
On 24 Oct 2006 16:56:43 -0700, Simon Forman <[EMAIL PROTECTED]> wrote: > > mumebuhi wrote: > > Thank you very much for the reply. > > > > Can pickle work directly with socket? The way I am doing right now is > > to pickle the object to a file then send the file content through the > > socket. > > P

Re: Want to reduce steps of an operation with dictionaries

2006-10-25 Thread pretoriano_2001
Mike: Many thanks for your solution. It looks really nice. Mike Erickson wrote: > * [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > > Hello: > > I have next dictionaries: > > a={'a':0, 'b':1, 'c':2, 'd':3} > > b={'a':0, 'c':1, 'd':2, 'e':3} > > I want to put in a new dictionary named c all the ke

255 argument limit?

2006-10-25 Thread Michael Yanowitz
Hello: It appears that there is a 255 argument limit in Python 2.4.3? >>> packed_data = struct.pack("260i", 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 ,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, 47,4 8,49,50,1,1,1,1,1,1,1,1,1,60,1,2,3,4,5,6,7,8,9,7

starship.python.net status update

2006-10-25 Thread T. Bryan
We are now ready to start re-enabling user accounts on starship.python.net. If you had an account on the machine, then you should have received an e-mail about it already. If you didn't, you should send e-mail to webmaster. If you did, expect it to take at least 24 hours for your account to be

Re: To remove some lines from a file

2006-10-25 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Dear all, > > I am quite new to python. I would like to remove two lines from a file. The canonical way to do so (at least for text files - which is the case here) is : open the source file in read mode open a tmp file in write mode for each line in source file: if

py and Dabo class in chi

2006-10-25 Thread Carl K
I am organizing 3 python events in Chicago: 2 free, one cheap. 1st is really just an extended VFP users group meeting featuring Ed Leafe, one of the Dabo developers. I am getting a larger room to accommodate the python group too. The meeting is Nov 14 5:30pm in the loop: (not sure yet where,

batteries included

2006-10-25 Thread marc . wyburn
Could someone confirm that modules like socket don't use libraries/ dlls on a particular OS, they are completly self contained. Thanks, Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending Dictionary via Network

2006-10-25 Thread Lawrence Oluyede
Chris Mellon <[EMAIL PROTECTED]> wrote: > I would recommend against using pickle if you're going to push it over > a network - there are signifigant dangers in unpickling anything > untrusted. I confirm: http://jcalderone.livejournal.com/15864.html -- Lawrence - http://www.oluyede.org/blog http:

Re: Save/Store whole class (or another object) in a file

2006-10-25 Thread alexLIGO
Hi, Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > thanks for the reply,but unfortunately this does not work with the type > > of classes I am dealing with. When trying to pickle the class I get the > > following error: > > > > File "/usr/lib/python2.4/copy_reg.py", line 76, in _reduce_ex

Re: To remove some lines from a file

2006-10-25 Thread Sebastian Busch
[EMAIL PROTECTED] wrote: > ... I would like to remove two lines from a file. > ... I am quite new myself -- but wouldn't grep -v do that easier (and perhaps faster)? Greetings, Sebastian. -- http://mail.python.org/mailman/listinfo/python-list

Re: batteries included

2006-10-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Could someone confirm that modules like socket don't use libraries/ > dlls on a particular OS, they are completly self contained. They might need DLLs, but if so they ship with the distribution. Diez -- http://mail.python.org/mailman/listinfo/python-list

class method question

2006-10-25 Thread Sylvain Ferriol
hello can you explain why python does not see difference between instance method and class method, having the same name example >>> class toto(object): ... def f(self): ... print('instance method') ... @classmethod ... def f(cls): ... print('class method') ...

Re: python GUIs comparison (want)

2006-10-25 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > > Well, I don't know what I was thinking, exactly, when I rated > PythonCard's ease of use...so I went back and changed it to rate it a > lot higher. The ratings in this script were done a long time ago now > and I need to re-do them, and add some new categories to rate a

Re: 255 argument limit?

2006-10-25 Thread Fredrik Lundh
Michael Yanowitz wrote: >It appears that there is a 255 argument limit in Python 2.4.3? > packed_data = struct.pack("260i", /... snip .../) ouch. if you need to pass large amounts of data to struct.pack (or any other function), use a sequence: import struct data = range(100) pa

Python's CRT licensing on Windows

2006-10-25 Thread sturlamolden
On Windows, the standard Python 2.4 distro is compiled with Microsoft Visual C++ 2003 and is shipped with msvcr71.dll as a part of the binary installer. That is ok, as those who has a license for Microsoft Visual C++ 2003 is allowed to redistribute msvcr71.dll. Without a license for Microsoft Visu

Re: class method question

2006-10-25 Thread Fredrik Lundh
Sylvain Ferriol wrote: > can you explain why python does not see difference between instance > method and class method, having the same name You're trying to put two objects with the same name in the same namespace. > example > >>> class toto(object): > ... def f(self): > ... p

Re: python GUIs comparison (want)

2006-10-25 Thread Fredrik Lundh
Paul Boddie wrote: > seem to have moved very far, despite Fredrik's efforts: what happened > to Tkinter 3000 or was that a codename for something else? the first Tk3K project solved 95% of the problems (*) I had with Tkinter: http://effbot.org/zone/wck.htm (especially when combined with Op

Re: [wxPython-users] Re:

2006-10-25 Thread Josiah Carlson
Michael S <[EMAIL PROTECTED]> wrote: > If I create a threading.Thread derived class, and run > the wxPython code in the main thread; using a lock, > will I be able to suspend the Thread, even though it > will run the C code, which is essentially a while loop > looping through millions of lines of

Re: python GUIs comparison (want)

2006-10-25 Thread BartlebyScrivener
Well, I am woefully unqualified to speak to the general state of Python gui frameworks, but I am in a similar situation as the OP, i.e., a beginner looking to TRY some easy gui programming in Python. Not being a computer science person, just an amateur scripter, I tend to learn best from lots of e

Re: Python's CRT licensing on Windows <-- FUD

2006-10-25 Thread Fredrik Lundh
sturlamolden wrote: > On Windows, the standard Python 2.4 distro is compiled with Microsoft > Visual C++ 2003 and is shipped with msvcr71.dll as a part of the binary > installer. That is ok, as those who has a license for Microsoft Visual > C++ 2003 is allowed to redistribute msvcr71.dll. With

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Paul Rubin
Robin Becker <[EMAIL PROTECTED]> writes: > > type(nx.array([1,2,3],dtype=nx.uint32)[0]) > > > > great, but do we have a pure python version? array.array('L', [1,2,3]) -- http://mail.python.org/mailman/listinfo/python-list

Re: web-based SSH

2006-10-25 Thread Paul Rubin
Astan Chee <[EMAIL PROTECTED]> writes: > I was looking for a web-based SSH client (something like > www.port42.com..but for some reason it doesnt work..can anyone verify http://www.google.com/search?q=ssh+applet -- http://mail.python.org/mailman/listinfo/python-list

Re: class method question

2006-10-25 Thread Bruno Desthuilliers
Sylvain Ferriol wrote: > hello > can you explain why python does not see difference between instance > method and class method, having the same name Because class namespaces are dicts, and you can't have duplicate keys in dicts. It's totally unrelated to class/instance method distinction (try with

Re: Sorting by item_in_another_list

2006-10-25 Thread J. Clifford Dyer
ZeD wrote: > Paul Rubin wrote: > >>> A = [0,1,2,3,4,5,6,7,8,9,10] >>> B = [2,3,7,8] >>> >>> desired_result = [2,3,7,8,0,1,4,5,6,9,10] >> How about: >> >> desired_result = B + sorted(x for x in A if x not in B) > > this. is. cool. > Cool, yes, but I'm not entirely sure it does what the OP want

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Robin Becker
Paul Rubin wrote: > Robin Becker <[EMAIL PROTECTED]> writes: >>> type(nx.array([1,2,3],dtype=nx.uint32)[0]) >>> >> great, but do we have a pure python version? > > array.array('L', [1,2,3]) yes that works if @L is unsigned 32 bit. I guess >L is always 4 bytes. Part of my confusion comes from not

Re: To remove some lines from a file

2006-10-25 Thread Steve Holden
Sebastian Busch wrote: > [EMAIL PROTECTED] wrote: > >>... I would like to remove two lines from a file. >>... > > > I am quite new myself -- but wouldn't grep -v do that easier (and > perhaps faster)? > Kindly show how to use grep to solve this problem: Remove the first two lines that don't

Printing file with printer dialog

2006-10-25 Thread Marco Bonifazi
Hello! I have a file (in my situation it is a Postscript file or a Pdf file, but it isn't important). I must send this file to a printer, using Python, and I need to select the printer to which I want send this file. Then I would use a Dialog Window. I use PyGtk on Windows (but if I can open a d

Re: web-based SSH

2006-10-25 Thread Dieter Deyke
Paul Rubin writes: > Astan Chee <[EMAIL PROTECTED]> writes: >> I was looking for a web-based SSH client (something like >> www.port42.com..but for some reason it doesnt work..can anyone verify > > http://www.google.com/search?q=ssh+applet http://www.appgate.com/products

Re: Python's CRT licensing on Windows <-- FUD

2006-10-25 Thread sturlamolden
Fredrik Lundh wrote: I am not intentionally posting FUD. >"As long as you're using a standard Python build, you don't need to >buy VC7 to [legally redistribute the C runtime]. The python.org team >use a properly licensed VC7 to build Python, which turns Python into >"licensee sof

Re: Current stackdepth outside PyEval_EvalFrameEx

2006-10-25 Thread Fabiano Sidler
On Tuesday 24 October 2006 17:05, Neil Cerutti wrote: > Perhaps the inspect module will help? See 3.11.4 The Interpreter > Stack. No, sorry if I didn't eplain it well enough. I meant the object stack of the current frame, not the frame stack. In my function, I wanted to return the list of objects

Re: Simple python + html + from --> to python script

2006-10-25 Thread J. Clifford Dyer
Good point. I forget sometimes, because that's how I learned, but I came in with some background in other scripting languages, so I guess I knew what I was looking for. Thanks. Cliff flit wrote: > Sorry but for a totally newbie the lib doccumentation doesnt help.. > The target audience for th

Re: Python's CRT licensing on Windows <-- FUD

2006-10-25 Thread manuelg
sturlamolden wrote: > I certainly don't understand the EULA, and thus I cannot make sure that > I lawyer understands it either. But I can certainly find a lawyer that > charges an hour and pretends to understand it. I am sure buying a > copy of VC7 is a lot cheaper. When you buy that copy of

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Martin v. Löwis
Robin Becker schrieb: > def add32(x, y): > "Calculate (x + y) modulo 2**32" > return ((x&0xL)+(y&0xL)) & 0xL That's redundant; it is sufficient to write return (x+y) & 0x > def calcChecksum(data): > """Calculates TTF-style

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Martin v. Löwis
Robin Becker schrieb: > Of course the actual semantics is dependent on what C unsigned > arithmetic does so we're relying on that being the same everywhere. Assuming that ULONG has the same width on all systems, the outcome is actually mandated by the C standard: unsigned arithmetic is defined to

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread sturlamolden
Robin Becker wrote: > > > ULONG CalcTableChecksum(ULONG *Table, ULONG Length) > > { > > ULONG Sum = 0L; > > ULONG *Endptr = Table+((Length+3) & ~3) / sizeof(ULONG); > > > > while (Table < EndPtr) > > Sum += *Table++; > > return Sum; > > } Is this what you want? import numpy def CalcTableChec

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread sturlamolden
Robin Becker wrote: > > ULONG CalcTableChecksum(ULONG *Table, ULONG Length) > > { > > ULONG Sum = 0L; > > ULONG *Endptr = Table+((Length+3) & ~3) / sizeof(ULONG); > > > > while (Table < EndPtr) > > Sum += *Table++; > > return Sum; > > } Is this what you want? import numpy def CalcTableCheck

Re: python html 2 image (png)

2006-10-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: >> what tools are you using to do that today? > > where are many of EXE programs > but i need python solution for adding it to my automate program under > lunix Whatever lunix is, under linux, a popular free OS you could e.g. use PyKDE and let Qt render a KHTML-compone

  1   2   3   >