ANN: Albow 2.0

2008-10-05 Thread greg
ALBOW - A Little Bit of Widgetry for PyGame Version 2.0 is now available. This version incorporates substantial additions and improvements. New widgets include TabPanel, TableView, CheckBox, RadioButton and an enhanced set of TextField-based controls.

ANN: M2Crypto 0.19

2008-10-05 Thread Heikki Toivonen
I am happy to announce the M2Crypto 0.19 release! M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and

sftp problem!

2008-10-05 Thread sa6113
I want to use sftp from paramiko to copy a file from a windows machine to a Linux in the network, I use this code : host = LinuxComputerName (or its Ip) port = 22 transport = paramiko.Transport((host, port)) password = LinuxComputerPassword username = LinuxComputerUserName

Re: Tuple parameter unpacking in 3.x

2008-10-05 Thread Martin Geisler
Steven D'Aprano [EMAIL PROTECTED] writes: On Sat, 04 Oct 2008 17:07:14 +0200, Martin Geisler wrote: A somewhat related question: do I pay a performance penalty when I let a function define an inner function like this: def foo(): def bar() ... bar() compared to

Re: del and sets proposal

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: Would it really be confusing if sets used the same interface as dicts use? I don't think so. What else could del aset[x] mean other than delete element x? Yes, but x in what sense? In dicts it's a key, in sets, shouldn't it also be a key

Re: Python 2.6, GUI not working on vista?

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Michel Claveau - NoSpam SVP ; merci wrote: Another way is to de-activate UAC. Please don't be stupid! -- http://mail.python.org/mailman/listinfo/python-list

Re: lint for Python?

2008-10-05 Thread Miki
Hello, In module one, I have a function: def foo( host, userid, password ):      pass In module two, I call that function: foo( userid, password) lint doesn't find that error and it won't be caught until it's called while the program is running. pychecker does find these kind of

Re: Tuple parameter unpacking in 3.x

2008-10-05 Thread Duncan Booth
Martin Geisler [EMAIL PROTECTED] wrote: Letting the callbacks take several arguments would definitely be the nicest syntax, but I'm unfortunately restricted by the Twisted framework: there all functions in a callback chain return one result which is passed to the next callback as the first

Re: Problem: neither urllib2.quote nor urllib.quote encode the unicode strings arguments

2008-10-05 Thread Miki
Hello, things like urllib.quote(uпиво Müller ) fail with error message: type 'exceptions.KeyError': u'\u043f' Similarly with urllib2. Anyone got a hint?? I need it to form the URI containing non-ascii chars . n = uпиво Müller print urllib.quote(n.encode(utf-8)) -

Re: problem with sockets code

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Daniel wrote: while data: ... data = self.rfile.readline().strip() Interpreting a random string value as a Boolean is a bad idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: sftp problem!

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], sa6113 wrote: host = LinuxComputerName (or its Ip) port = 22 and after runing this code I get this error: socket.error: (10061, 'Connection refused') Did you try sftp LinuxComputerName just to confirm it's got a listener on port 22? --

paramiko.SSHException : No existing session ???

2008-10-05 Thread sa6113
I use this code : hostname = 192.168.1.4 username = test port = 22 password = '123456' # now connect try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect_ex((hostname, port)) except Exception, e: print 'Connect failed: ' + str(e) traceback.print_exc()

Re: sftp problem!

2008-10-05 Thread sa6113
what do you mean? Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], sa6113 wrote: host = LinuxComputerName (or its Ip) port = 22 and after runing this code I get this error: socket.error: (10061, 'Connection refused') Did you try sftp LinuxComputerName just to

2to3 refactoring [was Re: Tuple parameter unpacking in 3.x]

2008-10-05 Thread Steven D'Aprano
PEP 3113 offers the following recommendation for refactoring tuple arguments: def fxn((a, (b, c))): pass will be translated into: def fxn(a_b_c): (a, (b, c)) = a_b_c pass and similar renaming for lambdas. http://www.python.org/dev/peps/pep-3113/ I'd like to suggest that this

paramiko.SSHException : No existing session ???

2008-10-05 Thread sa6113
I use this code : hostname = 192.168.1.4 username = test port = 22 password = '123456' # now connect try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect_ex((hostname, port)) except Exception, e: print 'Connect failed: ' + str(e) traceback.print_exc()

Re: Tuple parameter unpacking in 3.x

2008-10-05 Thread Martin Geisler
Steven D'Aprano [EMAIL PROTECTED] writes: On Sat, 04 Oct 2008 22:57:23 +0200, Martin Geisler wrote: Here's another alternative. Compare: x = (2, 3) (lambda (a,b): a*b)(x) 6 with this: (lambda a,b: a*b)(*x) 6 Letting the callbacks take several arguments would definitely be the nicest

Re: code critique requested - just 60 lines

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Terrence Brannon wrote: On Oct 2, 11:56 am, [EMAIL PROTECTED] wrote: Terrence Brannon, I suggest you to shorten a lot some of those very long lines. yes, I wanted to, but was not sure how to continue a line on the next line in Python. Did you check the

Top 10 Things To Look For In A Web Host

2008-10-05 Thread so . sexy . hot69
Top 10 Things To Look For In A Web Host http://hosting-top10.blogspot.com/2008/07/top-10-things-to-look-for-in-web-host.html 5 Tips To Choose A Domain Name For An Internet Business http://hosting-top10.blogspot.com/2008/07/5-tips-to-choose-domain-name-for.html Domain Name Registration -

Re: del and sets proposal

2008-10-05 Thread Steven D'Aprano
On Sun, 05 Oct 2008 22:11:38 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: Would it really be confusing if sets used the same interface as dicts use? I don't think so. What else could del aset[x] mean other than delete element x? Yes, but x in

Re: problem with sockets code

2008-10-05 Thread Roy Smith
In article [EMAIL PROTECTED], Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Daniel wrote: while data: ... data = self.rfile.readline().strip() Interpreting a random string value as a Boolean is a bad idea. Why? --

Re: 2to3 refactoring [was Re: Tuple parameter unpacking in 3.x]

2008-10-05 Thread Aaron Castironpi Brady
Steven D'Aprano wrote: PEP 3113 offers the following recommendation for refactoring tuple arguments: def fxn((a, (b, c))): pass will be translated into: def fxn(a_b_c): (a, (b, c)) = a_b_c pass and similar renaming for lambdas. http://www.python.org/dev/peps/pep-3113/ I'd

Re: lint for Python?

2008-10-05 Thread Pat
Miki wrote: Hello, In module one, I have a function: def foo( host, userid, password ): pass In module two, I call that function: foo( userid, password) lint doesn't find that error and it won't be caught until it's called while the program is running. pychecker does find these kind

newbie: decorator

2008-10-05 Thread TK
Hi, I need an understandable Decorator-Example? Who can help? Thanks. o-o Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: lint for Python?

2008-10-05 Thread Aaron Castironpi Brady
Pat wrote: I've been searching for a good multi-module lint checker for Python and I haven't found one yet. Pylint does a decent job at checking for errors only within a single module. Here's one of my problems. I have two modules. In module one, I have a function: def foo( host, userid,

Re: lint for Python?

2008-10-05 Thread Aaron Castironpi Brady
Pat wrote: I've been searching for a good multi-module lint checker for Python and I haven't found one yet. Pylint does a decent job at checking for errors only within a single module. Here's one of my problems. I have two modules. In module one, I have a function: def foo( host, userid,

Re: lint for Python?

2008-10-05 Thread Aaron Castironpi Brady
Pat wrote: I've been searching for a good multi-module lint checker for Python and I haven't found one yet. Pylint does a decent job at checking for errors only within a single module. Here's one of my problems. I have two modules. In module one, I have a function: def foo( host, userid,

Re: newbie: decorator

2008-10-05 Thread Duncan Booth
TK [EMAIL PROTECTED] wrote: Hi, I need an understandable Decorator-Example? Who can help? Thanks. Google? Try typing into the search box: python decorator -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to3 refactoring [was Re: Tuple parameter unpacking in 3.x]

2008-10-05 Thread Peter Otten
Steven D'Aprano wrote: PEP 3113 offers the following recommendation for refactoring tuple arguments: def fxn((a, (b, c))): pass will be translated into: def fxn(a_b_c): (a, (b, c)) = a_b_c pass and similar renaming for lambdas.

how to get the thighest bit position in big integers?

2008-10-05 Thread mmgarvey
Hi, I'm using python to develop some proof-of-concept code for a cryptographic application. My code makes extended use of python's native bignum capabilities. In many cryptographic applications there is the need for a function 'get_highest_bit_num' that returns the position number of the highest

Re: Python 2.6, GUI not working on vista?

2008-10-05 Thread Thorsten Kampe
* Lawrence D'Oliveiro (Sun, 05 Oct 2008 22:13:46 +1300) In message [EMAIL PROTECTED], Michel Claveau - NoSpam SVP ; merci wrote: Another way is to de-activate UAC. Please don't be stupid! He's not stupid. Disabling UAC is the recommended way to get rid of these problems. Thorsten --

Re: Tuple parameter unpacking in 3.x

2008-10-05 Thread Terry Reedy
Martin Geisler wrote: Steven D'Aprano [EMAIL PROTECTED] writes: From reading the PEP-3113 I got the impression that the author thought that this feature was unused and didn't matter. And that there were good alternatives, and that there were technical reasons why maintaining the feature in

Re: del and sets proposal

2008-10-05 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Sat, 04 Oct 2008 18:36:28 +0200, Bruno Desthuilliers wrote: Yes I know that sets have a remove method (like lists), but since dictionaries don't have a remove method, shouldn't sets behave like more like dictionaries and less like lists? IMHO del for sets is quite

Re: del and sets proposal

2008-10-05 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Sun, 05 Oct 2008 22:11:38 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: Would it really be confusing if sets used the same interface as dicts use? I don't think so. What else could del aset[x] mean other than delete

Re: newbie: decorator

2008-10-05 Thread Bruno Desthuilliers
TK a écrit : Hi, I need an understandable Decorator-Example? Who can help? Thanks. What don't you understand in decorators ? -- http://mail.python.org/mailman/listinfo/python-list

The difference sports gambling online sport book

2008-10-05 Thread shiva
webpage - http;//elemotor.blogspot.com/ The difference sports gambling online sport book The difference sports gambling online sport book no doubt partly sports gambling online sport book to the fact sports gambling online sport book our first glimpses sports gambling online sport book of

Re: One class per file?

2008-10-05 Thread Bruno Desthuilliers
greg a écrit : Bruno Desthuilliers wrote: Nope. But IIRC, one-class-per-file helps saving on compile/link time. A problem we don't have with dynamic languages !-) That's mostly true. Although I've noticed that if I have a very large .py file, it can take a noticeable number of moments to

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Gary Herron
[EMAIL PROTECTED] wrote: Hi, I'm using python to develop some proof-of-concept code for a cryptographic application. My code makes extended use of python's native bignum capabilities. In many cryptographic applications there is the need for a function 'get_highest_bit_num' that returns the

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Duncan Booth
[EMAIL PROTECTED] wrote: My question to the group: Does anyone know of a non-hackish way to determine the required bit position in python? I know that my two ideas can be combined to get something working. But is there a *better* way, that isn't that hackish? How about using the hex

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: I'm using python to develop some proof-of-concept code for a cryptographic application. My code makes extended use of python's native bignum capabilities. In many cryptographic applications there is the need for a function 'get_highest_bit_num' that returns the position

PyOpenGL double-buffered hardware surface

2008-10-05 Thread Clay Hobbs
How do I create a double-buffered hardware surface with PyOpenGL? I knew how to once, but forgot. --Ratfink -- http://mail.python.org/mailman/listinfo/python-list

gdbm threadsafeness

2008-10-05 Thread Eric S. Johansson
how thread safe is the gdbm module? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Hi, I'm using python to develop some proof-of-concept code for a cryptographic application. My code makes extended use of python's native bignum capabilities. In many cryptographic applications there is the need for a function 'get_highest_bit_num' that returns the

CALL FOR PAPERS: International Journal of Imaging

2008-10-05 Thread [EMAIL PROTECTED]
- (Apologies for cross-posting) International Journal of Imaging (IJI) http://www.ceser.res.in/iji.html ISSN 0974-0627 We would appreciate if you could

Re: PyOpenGL double-buffered hardware surface

2008-10-05 Thread Mike C. Fletcher
Clay Hobbs wrote: How do I create a double-buffered hardware surface with PyOpenGL? I knew how to once, but forgot. Depends on your GUI library, most of them have a flag-set that you pass to the initializer of the OpenGL-holding widget. If you're using Pygame, see Pygame's display

Python 2.6: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default implementation of '__lt__',

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Aaron Castironpi Brady
Duncan Booth wrote: [EMAIL PROTECTED] wrote: My question to the group: Does anyone know of a non-hackish way to determine the required bit position in python? I know that my two ideas can be combined to get something working. But is there a *better* way, that isn't that hackish? How about

Python 2.6 / 3.0: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default implementation of '__lt__',

Re: Python 2.6: Determining if a method is inherited

2008-10-05 Thread Valentino Volonghi aka Dialtone
Fuzzyman [EMAIL PROTECTED] wrote: So how do I tell if the X.__lt__ is inherited from object? I can look I don't have python 2.6 installed so I can't try but what I think could work is: class Foo(object): ... def hello(self): ... pass ... class Bla(Foo): ... def hello(self):

Re: del and sets proposal

2008-10-05 Thread Aaron Castironpi Brady
Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Sat, 04 Oct 2008 18:36:28 +0200, Bruno Desthuilliers wrote: Lists are the odd one out, because del alist[x] is used to remove the element at position x, rather than removing an element x. Nope. It's perfectly consistent with dicts,

Re: Python 2.6: Determining if a method is inherited

2008-10-05 Thread Aaron Castironpi Brady
Fuzzyman wrote: Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default

Python 2.6 / 3.0: Determining if a method is inherited (Fixed)

2008-10-05 Thread Fuzzyman
Hello all, Sorry - my messages aren't showing up via google groups, so I'm kind of posting on faith... Anyway, I solved my problem (I think)... import sys if sys.version_info[0] == 3: def _has_method(cls, name): for B in cls.__mro__: if B is object:

Simple GUI design in Python

2008-10-05 Thread xkenneth
All, I've posted some slides on my blog (xkenneth.blogspot.com) detailing some simple ways to describe GUI apps in python. Please let me know what you think. Regards, Kenneth Miller -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Duncan Booth
Aaron \Castironpi\ Brady [EMAIL PROTECTED] wrote: OFFSET = dict((%x%i, int(c)) for i,c in enumerate(5433)) def get_highest_bit_num(r): s = %x%r return len(s) * 4 - OFFSET[s[0]] You can replace the dict if it's faster. OFFSET= tuple( int(x) for x in 5433

Problem with lower() for unicode strings in russian

2008-10-05 Thread Alexey Moskvin
Hi! I have a set of strings (all letters are capitalized) at utf-8, russian language. I need to lower it, but my_string.lower(). Doesn't work. See sample script: # -*- coding: utf-8 -*- [skip] s1 = self.title s2 = self.title.lower() print s1 == s2 returns true. I have no problems with lower() for

Re: Inheritance but only partly?

2008-10-05 Thread George Sakkis
On Oct 3, 11:56 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 03 Oct 2008 03:32:52 -0700, Michele Simionato wrote: IMO, if you have methods that you want to use in different classes, this is hint that you are in need of generic functions. See this blog post for an

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Diez B. Roggisch
Alexey Moskvin schrieb: Hi! I have a set of strings (all letters are capitalized) at utf-8, russian language. I need to lower it, but my_string.lower(). Doesn't work. See sample script: # -*- coding: utf-8 -*- [skip] s1 = self.title s2 = self.title.lower() print s1 == s2 returns true. I have no

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Martin v. Löwis
I have a set of strings (all letters are capitalized) at utf-8, That's the problem. If these are really utf-8 encoded byte strings, then .lower likely won't work. It uses the C library's tolower API, which works on a byte level, i.e. can't work for multi-byte encodings. What you need to do is

Re: Python 2.6: Determining if a method is inherited

2008-10-05 Thread Fuzzyman
On Oct 5, 8:15 pm, [EMAIL PROTECTED] (Valentino Volonghi aka Dialtone) wrote: Fuzzyman [EMAIL PROTECTED] wrote: So how do I tell if the X.__lt__ is inherited from object? I can look I don't have python 2.6 installed so I can't try but what I think could work is: class Foo(object): ...  

Re: Simple GUI design in Python

2008-10-05 Thread Stef Mientki
xkenneth wrote: All, I've posted some slides on my blog (xkenneth.blogspot.com) detailing some simple ways to describe GUI apps in python. Please let me know what you think. Did you look at the pdf file, to me a lot of information is missing :-( cheers, Stef Mientki Regards, Kenneth

Buy carisoprodol online

2008-10-05 Thread eqweqwe
buy cheap carisoprodol online . . . Enough to seek Carisoprodol! You've already found the best site where you can purchase Carisoprodol for lowest price! To order Carisoprodol without prescription visit link below! http://med247.us/?p=Carisoprodol

Buy Soma online

2008-10-05 Thread sjmacdonaldjail
buy cheap soma online . . . Enough to seek Soma! You've already found the best site where you can purchase Soma for lowest price! To order Soma without prescription visit link below! http://med247.us/?p=soma . . . . . . . .

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Terry Reedy
Scott David Daniels wrote: Since floating point has to identify the position of the highest bit, you can use that hardware to quickly get to the highest bit. IEEE has the mantissa .5 = mantissa 1., but some other floating point formats treated the mantissa in different ranges. This should

Re: Python 2.6: Determining if a method is inherited

2008-10-05 Thread Terry Reedy
Fuzzyman wrote: Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default

Buy cheap levitra

2008-10-05 Thread lpyeagertutu
buy cheap levitra . . . Enough to seek Levitra! You've already found the best site where you can purchase Levitra for lowest price! To order Levitra without prescription visit link below! http://med247.us/?p=levitra . . . .

Re: del and sets proposal

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: On Sun, 05 Oct 2008 22:11:38 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: Would it really be confusing if sets used the same interface as dicts use? I don't think so. What else could del

Re: Python is slow?

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Terry Reedy wrote: greg wrote: Steven D'Aprano wrote: We agree that the restriction is artificial, and I think irrational I think it's irrational for another reason, too -- it's actually vacuous. There's nothing to prevent you creating a set of patches

Re: Python is slow?

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], José Matos wrote: The gnuplot license is a free software according to FSF ... Not listed as one http://www.fsf.org/licensing/licenses/index_html/view?searchterm=license. -- http://mail.python.org/mailman/listinfo/python-list

Buy propecia cheap

2008-10-05 Thread oneillbknut
buy propecia canada cheap . . . Enough to seek Propecia! You've already found the best site where you can purchase Propecia for lowest price! To order Propecia without prescription visit link below! http://med247.us/?p=buy+propecia

Re: Python is slow?

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Ben Finney wrote: Note that I consider a work free even if it fails to grant “the right to distribute misrepresentations of the author's words”, because that act is an exercise of undue power over another person, and so falls outside the limit imposed by the

Buy fioricet online

2008-10-05 Thread ihcircekirkpatrick
buy fioricet . . . Enough to seek Fioricet! You've already found the best site where you can purchase Fioricet for lowest price! To order Fioricet without prescription visit link below! http://med247.us/?p=fioricet . . . . .

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Scott David Daniels
Terry Reedy wrote: ... Your point, that taking floor(log2(x)) is redundant, is a good catch. However, you should have added 'untested' ;-). When value has more significant bits than the fp mantissa can hold, this expression can be 1 off (but no more, I assume). The following correction

Places that are hiring in my area

2008-10-05 Thread woodsonturtletw
. . . Enough to seek places that are hiring! You've already found the best site! Visit link below! http://med247.us/?p=job+hiring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I was thankful

Re: ABCs - infix syntax for isinstance() ?

2008-10-05 Thread bborcic
Bruno Desthuilliers dixit : Boris Borcic a écrit : Given the ABC innovation, maybe an infix syntax for isinstance() would be good. Possibilities : - stealing is away from object identity. As a motivation, true use cases for testing object identity are rare; x is None is a *very*

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Rich Healey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aaron Castironpi Brady wrote: Duncan Booth wrote: [EMAIL PROTECTED] wrote: My question to the group: Does anyone know of a non-hackish way to determine the required bit position in python? I know that my two ideas can be combined to get

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Aaron Castironpi Brady
On Oct 5, 2:12 pm, Aaron \Castironpi\ Brady [EMAIL PROTECTED] wrote: Duncan Booth wrote: [EMAIL PROTECTED] wrote: OFFSET = dict((%x%i, int(c)) for i,c in enumerate(5433)) def get_highest_bit_num(r): s = %x%r return len(s) * 4 - OFFSET[s[0]] OFFSET= tuple( int(x) for

Re: how to get the thighest bit position in big integers?

2008-10-05 Thread Aaron Castironpi Brady
On Oct 5, 7:02 pm, Rich Healey [EMAIL PROTECTED] wrote: P.S.  Back home, this sort of 'nitpicking' would be judged unconstructive.  Worth pointing out, or not worth saying? P.S.S.  'Thighest' bit?  I thought the spam filters would catch that. That should be P.P.S. PS: This is also

When Python should not be used?

2008-10-05 Thread Andrea Francia
The right tool depends on the current problem. While some python users prefer to talk about when Python is the right tool I think that it is more instructive to know when it is not. Please, could you let me know what do you think about that? Thanks -- Andrea Francia

'int' object is not iterable iterating over a dict

2008-10-05 Thread mmiikkee13
a_list = range(37) list_as_dict = dict(zip(range(len(a_list)), [str(i) for i in a_list])) for k, v in list_as_dict: ... print k, v ... Traceback (most recent call last): File stdin, line 1, in module TypeError: 'int' object is not iterable What 'int' object is this referring to? I'm

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-05 Thread MRAB
Fuzzyman wrote: Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'): However - in Python 2.6 object has grown a default

Re: 'int' object is not iterable iterating over a dict

2008-10-05 Thread Alex_Gaynor
On Oct 5, 8:11 pm, mmiikkee13 [EMAIL PROTECTED] wrote: a_list = range(37) list_as_dict = dict(zip(range(len(a_list)), [str(i) for i in a_list])) for k, v in list_as_dict: ...     print k, v ... Traceback (most recent call last):   File stdin, line 1, in module TypeError: 'int' object

Re: When Python should not be used?

2008-10-05 Thread bborcic
On 6 oct, 02:08, Andrea Francia [EMAIL PROTECTED] HERE.ohoihihoihoih.TO-HERE.gmx.it wrote: While some python users prefer to talk about when Python is the right tool I think that it is more instructive to know when it is not. Python is not the right tool when you know what the right tool is,

EARN 1000$ IN EVERY MONTH

2008-10-05 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. click on the blog and get more information to choose yours job. the blog url is: http://earnmonthlyincome.blogspot.com/ goodluck -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 / 3.0: Determining if a method is inherited

2008-10-05 Thread Aaron Castironpi Brady
On Oct 5, 7:13 pm, MRAB [EMAIL PROTECTED] wrote: Fuzzyman wrote: Hello all, I may well be being dumb (it has happened before), but I'm struggling to fix some code breakage with Python 2.6. I have some code that looks for the '__lt__' method on a class: if hasattr(clr, '__lt__'):

Re: When Python should not be used?

2008-10-05 Thread Aaron Castironpi Brady
On Oct 5, 7:08 pm, Andrea Francia [EMAIL PROTECTED] HERE.ohoihihoihoih.TO-HERE.gmx.it wrote: The right tool depends on the current problem. While some python users prefer to talk about when Python is the right tool I think that it is more instructive to know when it is not. Please, could you

Re: lint for Python?

2008-10-05 Thread Aaron Castironpi Brady
On Oct 5, 8:53 am, Pat [EMAIL PROTECTED] wrote: Miki wrote: Hello, In module one, I have a function: def foo( host, userid, password ):      pass In module two, I call that function: foo( userid, password) lint doesn't find that error and it won't be caught until it's called

Pr. Euler 18, recursion problem

2008-10-05 Thread process
I am trying to solve project euler problem 18 with brute force(I will move on to a better solution after I have done that for problem 67). http://projecteuler.net/index.php?section=problemsid=18 However I can't get the recursive function right. I always have to use return right? Unless I am

Re: sftp problem!

2008-10-05 Thread Mike Hjorleifsson
here is a snippet that works, you need to replace the default data or create a database etc.. and the fields to store it you also need to generate and share your public key to the receiving server to avoid password prompt # Standard library imports import os import sys import time import

Re: paramiko.SSHException : No existing session ???

2008-10-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], sa6113 wrote: print doing authentication ... - the result is : ... donig authentication Interesting that these two don't match up. When you're supposed to copy and paste, you should copy and paste, not type it in. --

If an OS was to be written in Python, how'w it look?

2008-10-05 Thread process
If an OS was to be written in Python and the hardware optimized for it, what changes would be made to the hardware to accomodate Python strenghs and weaknesses? Some tagged architecture like in Lisp machines? http://en.wikipedia.org/wiki/Tagged_architecture What else? --

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Alexey Moskvin
Martin, thanks for fast reply, now anything is ok! On Oct 6, 1:30 am, Martin v. Löwis [EMAIL PROTECTED] wrote: I have a set of strings (all letters are capitalized) at utf-8, That's the problem. If these are really utf-8 encoded byte strings, then .lower likely won't work. It uses the C

ANN: M2Crypto 0.19

2008-10-05 Thread Heikki Toivonen
I am happy to announce the M2Crypto 0.19 release! M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and

Re: newbie: decorator

2008-10-05 Thread Michele Simionato
On Oct 5, 4:27 pm, TK [EMAIL PROTECTED] wrote: Hi, I need an understandable Decorator-Example? Who can help? Thanks. o-o Thomas You may want to look at my decorator module, which has plenty of examples, some simple, some less simple:

XML-Stylesheet

2008-10-05 Thread mini.walia
Hi, I want to insert xml-stylesheet type..into a xml file after xml-version through java How to insert it in between a .xsd document. Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this

In Python 2.6, bytes is str

2008-10-05 Thread Bryan Olson
Python 3 has the 'bytes' type, which the string type I've long wanted in various languages. Among other advantages, it is immutable, and therefore bytes objects can be dict keys. There's a mutable version too, called bytearray. In Python 2.6, the name 'bytes' is defined, and bound to str.

Re: garbage collector and slowdown (guillaume weymeskirch)

2008-10-05 Thread guillaume weymeskirch
Thanks ! No more slowdown in python 2.6, both on gentoo and winxp systems. I love python so much so I can live with that until I will upgrade to the 2.6 version. -- http://mail.python.org/mailman/listinfo/python-list

Re: paramiko.SSHException : No existing session ???

2008-10-05 Thread sa6113
My problem is in password authentication. Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], sa6113 wrote: print doing authentication ... - the result is : ... donig authentication Interesting that these two don't match up. When you're supposed to copy

[issue3909] Building PDF documentation from tex files

2008-10-05 Thread Winfried Plappert
Winfried Plappert [EMAIL PROTECTED] added the comment: I have rerun the making of the PDFs with the make command. Everything looks fine now. I did not realize that pdflatex is called multiple times during the process of PDF creation. %.pdf: %.tex pdflatex '$' pdflatex '$'

[issue4038] py3k error in distutils file_copy exception handlers

2008-10-05 Thread Mark Hammond
Mark Hammond [EMAIL PROTECTED] added the comment: r66806 on the py3k branch. -- assignee: - mhammond resolution: accepted - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4038

[issue1322] platform.dist() has unpredictable result under Linux

2008-10-05 Thread Matthias Klose
Matthias Klose [EMAIL PROTECTED] added the comment: /etc/lsb-release is not yet specified by the lsb. See https://lists.linux-foundation.org/pipermail/lsb-discuss/2008-March/004842.html https://lists.linux-foundation.org/pipermail/lsb-discuss/2008-March/004843.html

[issue4017] IDLE 2.6 broken on OSX (Leopard)

2008-10-05 Thread Miki Tebeka
Changes by Miki Tebeka [EMAIL PROTECTED]: -- nosy: +tebeka ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4017 ___ ___ Python-bugs-list mailing list

  1   2   >