RE: Can't Uninstall !

2018-02-13 Thread Pedro Crescencio
7;s good enough. Thanks -Message d'origine- De : Python-list [mailto:python-list-bounces+pedronac=gmail@python.org] De la part de Jerry Hill Envoyé : mardi 13 février 2018 19:01 À : python-list (General) Objet : Re: Can't Uninstall ! On Tue, Feb 13, 2018 at 10:30 AM, Pe

RE: Can't Uninstall !

2018-02-13 Thread Pedro Crescencio
février 2018 01:07 À : python-list@python.org Objet : Re: Can't Uninstall ! On 2018-02-12 11:54, Pedro Crescencio wrote: > Hello, > I tried to uninstall Python, but it is not possible. > > Even when message say it is uninstalled : > The software is still on applications menu: &g

RE: Can't Uninstall !

2018-02-12 Thread Pedro Crescencio
Atlassian. Best regards, Pedro -- https://mail.python.org/mailman/listinfo/python-list

what is happening in panda "where" clause

2017-09-22 Thread Exposito, Pedro (RIS-MDW)
mes); # apply "where" condition z = x[ (x['Age'] == 55) ] # prints row WHERE age == 55 print (z); What is happening in this statement: z = x[ (x['Age'] == 55) ] Thanks, Pedro Exposito The information containe

Can signal.alarm be safely cleared in python?

2016-11-17 Thread Pedro Franco de Carvalho
Assume a python program sets a handler function for the `signal.SIGALRM` signal, and then schedules an alarm in T seconds with `signal.alarm(T)`. Assume the program later cancels any scheduled alarm with `signal.alarm(0)`. Can the program safely assume that after the call to `signal.alarm(0)` com

Re: appending a line to a list based off of a string found in a previous list

2015-12-12 Thread Pedro Vincenty
On Saturday, December 12, 2015 at 4:48:46 PM UTC-5, Pedro Vincenty wrote: > Hello, I'm wondering how to append a line from a file onto a list(easy part) > provided that the line contains strings specific to a previous list I've > already made(hard part). I have this right

appending a line to a list based off of a string found in a previous list

2015-12-12 Thread Pedro Vincenty
Hello, I'm wondering how to append a line from a file onto a list(easy part) provided that the line contains strings specific to a previous list I've already made(hard part). I have this right now, for line in satellite_dataread: if any(i in line for i in list2): line= line.

Re: reading from a txt file

2015-11-26 Thread Pedro Vincenty
All were really helpful thanks a lot. Now I'm interested in identifying a particular index after being able to print out each word. Printing each word to the console I have : ['METEOSAT-7'] ['1', '24932U', '97049B', '15319.57839525', '.0058', '0-0', '0+0', '0', '9994'] ['2', '249

1-0.95

2014-07-01 Thread Pedro Izecksohn
pedro@microboard:~$ /usr/bin/python3 Python 3.3.2+ (default, Feb 28 2014, 00:52:16) [GCC 4.8.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1-0.95 0.050044 >>>    How to get 0.05 as r

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
- Original Message - > From: Gregory Ewing > To: python-list@python.org > Cc: > Sent: Thursday, June 12, 2014 8:38 AM > Subject: Re: Lines on a tkinter.Canvas > > Pedro Izecksohn wrote: >> The Canvas' method create_line turns on at least 2 pixels. B

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
- Original Message - > From: Gregory Ewing > To: python-list@python.org > Sent: Thursday, June 12, 2014 8:38 AM > Subject: Re: Lines on a tkinter.Canvas > > Pedro Izecksohn wrote: >> The Canvas' method create_line turns on at least 2 pixels. But I want

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
  As Peter Otten did not see the same result that I saw, I prepared an image that shows the result on my notebook: http://izecksohn.com/pedro/python/canvas/tk_window.xcf   For those that might not know: xcf is the Gimp's file format. - Original Message - > From: Peter Otten >

Lines on a tkinter.Canvas

2014-06-11 Thread Pedro Izecksohn
  The code available from: http://izecksohn.com/pedro/python/canvas/testing.py   draws 2 horizontal lines on a Canvas. Why the 2 lines differ on thickness and length?   The Canvas' method create_line turns on at least 2 pixels. But I want to turn on many single pixels on a Canvas. How sho

Proposal of an API to deal with fingerprints on Python

2014-05-29 Thread Pedro Izecksohn
  Today I wrote the following API. It was not implemented on C yet. Do you have any comment? Could you help me to implement it? http://www.izecksohn.com/pedro/python/fingerprint/fingerprint.001.py -- https://mail.python.org/mailman/listinfo/python-list

pickle.dump (obj, conn)

2014-03-13 Thread Pedro Izecksohn
  Shouldn't pickle.dump (obj, conn) raise an Exception if conn is a TCP connection that was closed by the remote host? -- https://mail.python.org/mailman/listinfo/python-list

Re: the Gravity of Python 2

2014-01-08 Thread Pedro Larroy
I think for new projects one should go with 3.x this is the right thing to do. If you require a module that's 2.x only it's easy enough to port it unless it depends on some monster like protobuf which doesn't have python3.x support Pedro. On Wed, Jan 8, 2014 at 3:30 PM, Mark

testing - do not reply

2013-11-15 Thread Pedro
-- https://mail.python.org/mailman/listinfo/python-list

Re: socket programming

2013-05-06 Thread Pedro
On Saturday, May 4, 2013 5:37:42 AM UTC-4, Irmen de Jong wrote: > On 4-5-2013 4:13, Pedro wrote: > SERVER: > > import socket # Import socket > module > > s = socket.socket() # Create a socket object > host = > socket.gethostname() # Get local machine name > port =

Re: socket programming

2013-05-03 Thread Pedro
On Friday, May 3, 2013 11:56:01 PM UTC-4, Chris Angelico wrote: > On Sat, May 4, 2013 at 1:37 PM, Pedro wrote: > > > On Friday, May 3, 2013 10:23:38 PM UTC-4, Chris Angelico wrote: > > >> The accept() call should block. It's not going to spin or anything. If >

Re: socket programming

2013-05-03 Thread Pedro
On Friday, May 3, 2013 10:23:38 PM UTC-4, Chris Angelico wrote: > On Sat, May 4, 2013 at 12:13 PM, Pedro wrote: > > > First - this code constantly loops around an open socket. Is there a way to > > use something like an interrupt so I don't have to loop constantly to

socket programming

2013-05-03 Thread Pedro
I'm writing a simple app that uses socket programming, I'm using the following from tutorialspoint as a framework but I'm having a couple of issues implementing it. First - this code constantly loops around an open socket. Is there a way to use something like an interrupt so I don't have to lo

Re: Imaging libraries in active development?

2012-12-02 Thread Luis Pedro Coelho
Alasdair McAndrew on Thu, 29 Nov 2012 wrote: > Probably the combinations of OpenCV, Scipy.ndimage and scikits-image > would cover pretty much all of my needs. Hi, All of those (+ mahotas, which is the package I wrote & imread which might be useful for microscopy file formats) will work on nu

Re: Python 2.6 and Sqlite3 - Slow

2012-08-28 Thread Pedro Larroy
Try incrementing the variable cursor.arraysize a lot. Pedro. On Tue, Aug 28, 2012 at 11:20 PM, Dennis Lee Bieber wrote: > On Tue, 28 Aug 2012 10:25:35 -0700 (PDT), bruceg113...@gmail.com > declaimed the following in gmane.comp.python.general: > >> >> Doesn't the last p

Re: protobuf + pypy

2012-08-24 Thread Pedro Larroy
_with pypy_ On Wed, Aug 22, 2012 at 12:16 AM, Mark Lawrence wrote: > On 21/08/2012 22:55, Pedro Larroy wrote: >> >> Hi >> >> Anyone knows if it's possible to use protobuffers with pypy? Seems >> there isn't much info on the web about this. >>

Re: Keep getting this in PyDev "TypeError: quiz() takes exactly 1 argument (0 given)"

2012-08-10 Thread Pedro Kroger
On Aug 10, 2012, at 3:52 PM, Chuck wrote: >if __name__ == '__main__': > >quiz() > > You need to instantiate your class: foo = ElementsQuiz() foo.quiz() Pedro - http://pedrokroger.net http://musicforgeeksandnerds.com -- http://mail.py

Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-31 Thread Pedro Kroger
ss simple example. After all, the whole point of pyknon is to be able to generate music programmatically using Python: http://kroger.github.com/pyknon/ > You could consider posting Pyknon to comp.music.midi ; > it's very low traffic, but some real gurus lurk there. Good idea, thanks

Re: docx/lxml

2012-07-31 Thread Pedro Kroger
thon packages while virtualenv creates an isolated Python environment For instance, I just installed docx and its dependencies with: pip install docx lxml datutils PIL And I did that inside a testing virtualenv, so I wouldn't mess up my Python setup. pip and virtualenv make it really easy

Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-30 Thread Pedro Kroger
On Jul 30, 2012, at 3:33 PM, Ethan Furman wrote: > Pedro Kroger wrote: >> Pyknon is a simple music library for Python hackers. > > Sounds cool. How is 'Pyknon' pronounced? I pronounce it similarly as google translate does: http://translate.google.com/#English|Engli

[ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-30 Thread Pedro Kroger
nmidi import Midi from pyknon.music import NoteSeq notes1 = NoteSeq("D4 F#8 A Bb4") midi = Midi(1, tempo=90) midi.seq_notes(notes1, track=0) midi.write("demo.mid") It's available on PyPI and its homepage is http://kroger.github.com/pyknon/ B

Re: Real time event accuracy

2012-05-09 Thread Pedro Kroger
want (it generates MIDI files) but it's a nice library and it may be a good starting point: http://code.google.com/p/midiutil/ Pedro -- http://pedrokroger.net http://musicforgeeksandnerds.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Real time event accuracy

2012-05-09 Thread Pedro Kroger
with pygame 1.9.0. python -m pygame.examples.midi --output (http://wiki.python.org/moin/PythonInMusic) Pedro -- http://pedrokroger.net http://musicforgeeksandnerds.com/ On May 9, 2012, at 1:33 PM, Toby wrote: > On 05/09/2012 09:13 AM, Dave Angel wrote: >> On 05/09/2012 11:52 AM

Re: set PYTHONPATH for a directory?

2012-05-04 Thread Pedro Larroy
Isn't virtualenv for this kind of scenario? Pedro. On Fri, May 4, 2012 at 3:46 PM, Dave Angel wrote: > On 05/04/2012 08:21 AM, Neal Becker wrote: >> I'm testing some software I'm building against an alternative version of a >> library.  So I have an alternative l

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Pedro Kroger
Have you tried to use the function list?: foo = (1,2,3) list(foo) Cheers, Pedro -- http://pedrokroger.net On May 1, 2012, at 5:18 PM, ksals wrote: > Please help a newbe. I have a string returned from an esygui > multchoicebox that looks like > this: ('ksals', '

Re: Software Engineer -

2012-03-13 Thread Pedro H. G. Souto
On 2012-03-13 12:44 PM, Paul Rudin wrote: Just out of interest why do people object to job adverts here? Seems harmless enough... Wannabe list admins... Or list admins with a need to proof themselves... Or none of the above. -- http://mail.python.org/mailman/listinfo/python-list

Re: text to html

2011-12-13 Thread Pedro Henrique Guedes Souto
On Tue, Dec 13, 2011 at 3:22 PM, prakash jp wrote: > > Hi All, > > Want to publish a log file as a web page, is there a parser to retain the > format of the text as is and then convert to html. Please provide the > relevant pointers Hey, You can use this: http://txt2tag

Re: whitespace cleanup

2011-12-06 Thread Pedro Henrique G. Souto
idy If you like to write your own script, or if what you want is similar, but not the same, the source code is a good place to start: http://lacusveris.com/PythonTidy/PythonTidy-1.20.python -- Att; Pedro Henrique G. Souto -- http://mail.python.org/mailman/listinfo/python-list

Re: whitespace cleanup

2011-12-06 Thread Pedro Henrique G. Souto
a Python script. > I looked up around but I can't find anything useful, any advice? You can use the strip() method: [http://docs.python.org/release/2.3/lib/module-string.html] While reading the file as strings, the strip() method rips out all of the extra whitespace. > Thanks, > A

Re: Install Python on Windows without Start Menu icons?

2011-12-03 Thread Pedro Henrique G. Souto
nt of view. If you just want to run python scripts in those machines (not developing in it), you can use something like py2exe [http://www.py2exe.org/]. It converts a python script to a standalone executable. Good luck! -- Att; Pedro Henrique G. Souto ╔═╗

Re: Complete beginner, any help appreciated :) - For Loops

2011-12-01 Thread Pedro Henrique G. Souto
) Thanks a lot. That means (in a free translation) "For each one of 'x' in 'y', do this" 'y' is a list, for example, then it means: "For each one of the elements of the list 'y' (the element on the current iteration is named 'x'), do t

Re: Total newbie question: Best practice

2011-11-30 Thread Pedro Henrique G. Souto
# blablabla if __name__ == '__main__': main() If the program is running directly, the variable __name__ will be '__main__', if not, __name__ will be the name of the module ('program', in this case). Att; Pedro -- http://mail.python.org/mailman/listinfo/python-list

monotonically increasing memory usage

2011-07-28 Thread Pedro Larroy
Hi pickling Just crossposting this from stackoverflow: http://stackoverflow.com/questions/6857006/python-monotonically-increasing-memory-usage-leak Any hints? Pedro. -- Pedro Larroy Tovar   |    http://pedro.larroy.com/ -- http://mail.python.org/mailman/listinfo/python-list

Print encoding problems in console

2011-07-15 Thread Pedro Abranches
ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128) So, python is not being able to detect the encoding of the output in a situation like that, in which the python script is called not directly but around ``. Why does happen? Is th

Help in language development

2010-11-16 Thread pedro igor sampaio avelino
Hello, my name Pedro Igor, I am a student and develop applications in python for 1 year. I enrolled in the group to contribute in developing this wonderful language that helps me both in day-to-day, but I'm going through some difficulties because they do not know where to start, can someone p

Re: NoSQL Movement?

2010-03-05 Thread Juan Pedro Bolivar Puente
On 04/03/10 19:52, ccc31807 wrote: > On Mar 4, 11:51 am, Juan Pedro Bolivar Puente > wrote: >> No, relations are data. > > This depends on your definition of 'data.' I would say that > relationships is information gleaned from the data. > >> "Data

Re: NoSQL Movement?

2010-03-04 Thread Juan Pedro Bolivar Puente
On 04/03/10 16:21, ccc31807 wrote: > On Mar 3, 4:55 pm, toby wrote: >>> where you have to store data and >> >> "relational data" > > Data is neither relational nor unrelational. Data is data. > Relationships are an artifact, something we impose on the data. > Relations are for human convenience,

Re: How to run python script in emacs

2009-12-22 Thread Pedro Insua
On Wed, Nov 25, 2009 at 09:38:54AM -0800, doug wrote: > > When I type C-c C-c my emacs window just hangs. If I use Task Manager > to kill cmdproxy I can get emacs back but of course interactivity with > Python is not accomplished. By the way, if I do C-c ! then I get a > functional python shell.

Convert points to polygon shapefile

2009-07-24 Thread Luis Pedro Almeida
Dear all, I would like to know how to convert a list of points into a polygon shapefile (esri). Thanks! Best regards, Luis Pedro Almeida -- http://mail.python.org/mailman/listinfo/python-list

Re: Improving interpreter startup speed

2008-10-26 Thread Pedro Borges
The scripts i need to run but be executed with no apparent delay specially when the text transforms are simple. On Oct 26, 2008, at 11:13 AM, James Mills wrote: On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: How are you getting those numbers? 330 μs is still pr

Improving interpreter startup speed

2008-10-25 Thread Pedro Borges
Hi guys, Is there a way to improve the interpreter startup speed? In my machine (cold startup) python takes 0.330 ms and ruby takes 0.047 ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to start. TIA -- http://mail.python.org/mailman/listinfo/python-list

Tkinter, toplevel and images

2008-08-22 Thread Pedro
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 = ['first.png', 'second.png'] ResultsWindow = Toplevel(master) Res

Re: Import a file to namespace

2008-03-20 Thread Pedro Machado Santa
t it now. :) It already works. I wasn't putting the module on my working dir. (I created the module testpackageaddon.py and I did the "override" on it, then imported it after the import testpackage on my working script.) Thanks. Pedro Machado Santa -- http://mail.python.org/mailman/listinfo/python-list

Import a file to namespace

2008-03-20 Thread Pedro Machado Santa
testpackage import testpackageaddon testpackage.testClass() #my hacked class defined on testpackageaddon.py And on testpackageaddon.py: import testpackage class testClass(): #... testpackage.testClass = testClass Any tips, ideas on how to do this? Many thanks. Pedro Machado Santa -- http://mail

Re: Help solving Python 2.5 crash: The instruction "0x7c168f1d" referenced memory at "0x00000001c

2006-11-08 Thread Pedro Rodrigues
me up also with other sorts of applications. This lead me to think that there might be some inconsistency in the Registry of Windows or some files that have been left behind after uninstall. I've tried to address these two possibilities but so far I did not succeed :(   pedro  On 11/8/06, Bugr

Help solving Python 2.5 crash: The instruction "0x7c168f1d" referenced memory at "0x00000001c" ...

2006-11-08 Thread Pedro Rodrigues
the I get the same problem :(   Has anyone every experienced such a thing? Suggestions on how to solve this?     greetings, pedro rodrigues -- http://mail.python.org/mailman/listinfo/python-list

Interested in a Python User Group in Porto/Portugal?

2006-09-20 Thread Pedro Lima
There is now a list to help put together such a group: http://groups.google.com/group/python-porto Regards, Pedro Lima PS. please forward this message to people you think that could be interested. -- http://mail.python.org/mailman/listinfo/python-list

Re: Two Classes In Two Files

2006-08-09 Thread Pedro Werneck
Java way... if you don't want to do it, put both classes in the same file. -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: __contains__ vs. __getitem__

2006-08-09 Thread Pedro Werneck
with a different behavior. It's better for you to override __contains__() too. -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: singleton decorator

2006-08-09 Thread Pedro Werneck
tom _init method for each one of them. You can use the subclass __new__, but that's definitely 'unpythonic'. -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Class attributes, instances and metaclass __getattribute__

2006-08-08 Thread Pedro Werneck
easonable thing to do, exactly for what you mentioned on your code... someone could easily break a lot of stuff doing it the wrong way, instead if not using __dict__. I mailed the list because someone else thought it might be a bug and I was in doubt... now it's clear it was the right thing to do. Regards, -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Class attributes, instances and metaclass __getattribute__

2006-08-08 Thread Pedro Werneck
;>> class C(object): ... __metaclass__ = M ... >>> C.y = 'bar' >>> C.x 'foo' >>> C.y 'bar' >>> o = C() >>> o.x ... AttributeError: 'C' object has no attribute 'x' >>> o.y 'bar' >>> So... both 'x' and 'y' are class attributes, but 'x' is a virtual attribute implemented with M.__getattr__. From the instance I have access to 'y' but not to 'x'. Regards, -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: singleton decorator

2006-08-07 Thread Pedro Werneck
>>> x is y True But __init__ will be called once for each time you call A, even if it's always the same instance returned. If this is a problem, you'll need another method to use for initialization and call it only once. -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Class attributes, instances and metaclass __getattribute__

2006-08-07 Thread Pedro Werneck
oid some problems with method and descriptors creation, since someone using metaclasses and custom __getattribute__ at the same time is asking for trouble, but... I googled for it and tried to find something on the list but, nothing. From the source it seems like a generic wrapper is used. What's the real case here ? Regards, -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

C++ to python with boost.python: Exposing virtual bool operator()(int )=0

2006-03-29 Thread Pedro
. Thank you very much in advance. :-D Pedro. //... // C++ code.. //... #include #define OPTION1 //#undef OPTION1 struct Base { virtual ~Base

Re: First script, please comment and advise

2006-03-09 Thread Pedro Graca
[EMAIL PROTECTED] wrote: > My version is similar to Just one: > > from random import shuffle > > def scramble_text(text): > """Return the words in input text string scrambled > except for the first and last letter.""" > def scramble_word(word): Nice. You can have functions inside funct

Re: First script, please comment and advise

2006-03-09 Thread Pedro Graca
[EMAIL PROTECTED] wrote: > Just: >> [previous post, hand inserted] >>> def scramble_text(text): >>> def scramble_word(word): >> >> Btw. I find the use of a nested function here completely bogus: you >> don't need the surrounding scope. > > I don't agree, nested functions are useful to better st

Re: First script, please comment and advise

2006-03-09 Thread Pedro Graca
Just wrote: > In article <[EMAIL PROTECTED]>, > Pedro Graca <[EMAIL PROTECTED]> wrote: > [snip: very un-pythonic code] > > def curious(text): > """ Return the words in input text scrambled except for the > first and last le

First script, please comment and advise

2006-03-09 Thread Pedro Graca
I'm sure this isn't very pythonic; comments and advice appreciated def curious(text): """ Return the words in input text scrambled except for the first and last letter. """ new_text = "" word = "" for ch in text: if ch in "abcdefghijklmnopqrstuvwxy

Re: Wrapping classes

2005-09-23 Thread Pedro Werneck
metaclass__ = LazyInit ... def __init__(self, x, y): ... print "init was called", x, y ... self.x = x ... self.y = y ... >>> o = Foo(1, None) >>> o <__main__.Foo object at 0x402cc96c> >>> o.x init was called 1

Re: Character Sequence Generation

2005-09-22 Thread Pedro Werneck
;n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] >>> [chr(x) for x in xrange(ord('d'), ord('p') + 1)] ['d', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'] >>> [chr(x) for x in xrange(ord('A'), ord('Z') + 1)] ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] etc... -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-19 Thread Pedro Werneck
is really just a documentation problem. Check the comments on the bug report here: http://sourceforge.net/tracker/index.php?func=detail&aid=1294232&group_id=5470&atid=105470 -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
taclass I set explicitly. I will change the bug report and add some of the suggested documentation. Thanks -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
and "explicit is better than implicit". If it's just a documentation issue, the first rule in search order is much more complex than documented. If I am completely wrong in all of this, maybe it's better stop wasting our time. :) Thank you -- Pedro Werneck http://sourceforge.net/tracker/index.php?func=detail&aid=1294232&group_id=5470&atid=105470 -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Pedro Werneck
must be a (non-strict) subclass of the metaclasses of all its bases >>> class C(B): __metaclass__ = M_A ... >>> C.__metaclass__ >>> C.__class__ > You are free to post the bug report and look at the opinions of the > developers. I posted a few hours ago. Thank you. -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-17 Thread Pedro Werneck
.net/tracker/index.php?func=detail&aid=1294232&group_id=5470&atid=105470 -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-17 Thread Pedro Werneck
class conflict error. But with M_A, the error is ignored, probably because PyType_IsSubtype is returning 1 for M_A being a subtype of M_B and the winner and metatype are exchanged later, so we end with M_B as C's real type. > I suggest you to file a documentation bug. Unfortunately the basic > d

Re: Possible bug in "metaclass resolution order" ?

2005-09-17 Thread Pedro Werneck
7:47) [GCC 3.3.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class M_A(type): pass ... >>> class A: __metaclass__ = M_A ... >>> class B(A): __metaclass__ = type ... >>> B.__class__ >>> B.__metaclass__ Regards, -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Possible bug in "metaclass resolution order" ?

2005-09-16 Thread Pedro Werneck
_class__ to M_B! >>> class C(B): __metaclass__ = type ... >>> C.__metaclass__ >>> C.__class__ >>> type(C) Since the explicit __metaclass__ attribute has priority over parent classes, a case like this is an error and should raise an exception like the metaclass conflict, right ? Regards, -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Supporting << and >> operators in C extension type

2005-07-27 Thread Pedro Werneck
aryfunc)Pin_and, /*nb_and*/ (binaryfunc)Pin_xor, /*nb_xor*/ (binaryfunc)Pin_or, /*nb_or*/ 0, /*nb_coerce*/ ... }; Thanks for any help... -- Pedro Werneck -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble converting hex to decimal?

2005-02-05 Thread Pedro Werneck
Hi The problem is that '\x00' is a escape sequence... Try something like this: >>> x = '\x00' >>> int(repr(x)[3:-1], 16) 0 >>> x = '\x15' >>> int(repr(x)[3:-1], 16) 21 >>> On Sat, 05 Feb 2005 06:51:32 -0700 Earl Eiland <[EMAIL PROTECTED]> wrote: > I'm trying to process the IP packet lengt

Re: is this sort method the same as the one in python 2.4

2005-01-30 Thread Pedro Werneck
What about this ? # if sys.version_info >= (2,4): def sorted(iterable, *args, **kwds): seq = list(iterable) seq.sort(*args, **kwds) return seq # It worked against the TestSorted in lib/test/test_builtins.py On Sun, 30 Jan 2005 08:30:17 +0100 "Fredrik Lundh" <[EM

Re: how do i create such a thing?

2005-01-30 Thread Pedro Werneck
Hi, If you need direct access to some atribute, use object.__getattribute__. >>> class DefaultAttr(object): ... def __init__(self, default): ... self.default = default ... def __getattribute__(self, name): ... try: ... value = object.__getattribute__(self, na

Re: type() takes one or *three* arguments!?

2005-01-30 Thread Pedro Werneck
Hi, Up to Python 2.2, type() was just a function to return an object type. >From 2.2 on, type have this behavior when called with only one argument and is used to create a new type when called with 3 arguments. >From http://www.python.org/2.2/descrintro.html : "The signature of type() requires

Re: tkinter socket client ?

2005-01-27 Thread Pedro Werneck
On Tue, 25 Jan 2005 13:44:32 + Martin Franklin <[EMAIL PROTECTED]> wrote: > > thanks for this info - I had to abandon the createfilehandler() method > > as it is not supported in windows and the GUI "might" be used there at > > some time ... Take a look here: http://www.pythonbrasil.com.br/m

Re: Tuple slices

2005-01-24 Thread Pedro Werneck
On Mon, 24 Jan 2005 18:45:46 +0100 "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > Why does slicing a tuple returns a new tuple instead of a view of > > the existing one, given that tuples are immutable ? > > really? Well... seems like this case (slicing the whole tuple

Re: Tuple slices

2005-01-24 Thread Pedro Werneck
On Mon, 24 Jan 2005 18:45:46 +0100 "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > Why does slicing a tuple returns a new tuple instead of a view of > > the existing one, given that tuples are immutable ? > > really? Well... seems like this case is optimized to return th

Re: TCP server

2005-01-24 Thread Pedro Werneck
A quick example for you: ### import SocketServer class EchoRequestHandler(SocketServer.BaseRequestHandler): def setup(self): print self.client_address, 'connected!' self.request.send('hi ' + str(self.client_address) + '\n') def handle(self): while 1:

Re: Asynchronous event handling...?

2005-01-24 Thread Pedro Werneck
Hi, Maybe something like this... from Tkinter import * import itertools class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() self.createWidgets() def createWidgets(self): self.stop = Button(self,text='Emerge

Re: TypeError error on tkinter.createfilehandler dummy example

2005-01-21 Thread Pedro Werneck
can send it to you in pvt, if you want. Pedro Werneck On Fri, 21 Jan 2005 10:27:20 +0100 David <[EMAIL PROTECTED]> wrote: > Hi, > > I'm getting the following error: > > > Traceback (most recent call last): > File "..\kk.py", line 37,