First  |  Prev |  Next  |  Last
Pages: 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
About the grammar
Dear all, I'm wondering why in Python's grammar, keyword arguments are specified as: argument: ... | test '=' test I would have expected something like argument: ... | NAME '=' test Indeed, I cannot imagine a case where the keyword is something else than an identifier. Moreover, in the Python l... 20 Apr 2010 15:48
Operations on sparse matrices
I am currently dealing with sparse matrices and have doubts on whether we can use 1.) dot (for matrix multiplication) and inv (inverse) operations of numpy on sparse matrices of CSR format. I initially constructed my sparse matrix using COO format and then converted it to CSR format now I want to know whether no... 23 Apr 2010 20:48
Python 2.6 SSL module: Fails on key file error, with Errno 336265225,without a key file.
I'm starting to convert from M2Crypto to Python 2.6's SSL module. So I tried a trivial test: import ssl import socket certs = "d:/projects/sitetruth/certificates/cacert.pem" sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ssk = ssl.wrap_socket(sk, certfile=certs, cert_reqs=ssl.CERT_NONE) ssk.connec... 20 Apr 2010 15:49
gnu readline licensing?
Python provides a GNU readline interface... since readline is a GPLv3 library, doesn't that make python subject to the GPL? I'm confused because I thought python had a more BSD style license. Also, I presume programs written with the readline interface would still be subject to GPL... might want to put a warning ... 20 Apr 2010 18:28
python glibc crypt() function
luca72 wrote: Hello i have to do this : glibc crypt() function, using salt $1$abcdefgh$ cryptPw = crypt(plainPw, "$1$abcdefgh$") I can do it in python, with package i need? Thanks import ctypes lib = ctypes.CDLL("libcrypt.so.1") ... 20 Apr 2010 14:29
Code redundancy
Alan Harris-Reid wrote: Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 prefix? B... 20 Apr 2010 14:29
UnicodeEncodeError during repr()
I'm getting a UnicodeEncodeError during a call to repr: Traceback (most recent call last): File "bug.py", line 142, in <module> element = parser.parse(INPUT) File "bug.py", line 136, in parse ps = Parser.Parse(open(filename,'r').read(), 1) File "bug.py", line 97, in end_item r = repr(... 20 Apr 2010 15:49
The ole Repetion != Concatination pitfall
Well I started learning Python last week, and in my first experiment I got caught when I changed: sieve = [ {1:True} for x in range(r)] to sieve = [{1:True}] * r I was expecting it to be equivalent to sieve = [{1:True},{1:True},...] but instead it's t = [{1:True}]; sieve = [t,t,...] Okay, I see this was ... 20 Apr 2010 15:48
Default paranmeter for packed values
Xavier Ho wrote: G'day Pythoneers, I ran into a strange problem today: why does Python not allow default paranmeters for packed arguments in a function def? def test(a = 1, b = (2, 3)): ... print a, b ... test() 1 (2, 3) def t(a, *b = (3, 4)): File "<inpu... 20 Apr 2010 15:48
Firefox: all I get is XML page source code
Wit's end on this. I have a script outputting a stream with: sys.stdout.buffer.write(("""\n<?xml version='1.0' encoding='utf-8'?> The script works normally in 2 browsers, but in Firefox all I see is source code. Also, running the script in iPhone from my server shows the same source code. Which is a little str... 18 Apr 2010 19:43
First  |  Prev |  Next  |  Last
Pages: 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152