Re: visual studio 2010 question

2010-09-19 Thread David Cournapeau
On Mon, Sep 20, 2010 at 3:08 PM, Ralf Haring wrote: > > After running into the error "Setup script exited with error: Unable > to find vcvarsall.bat" when trying to use easy_install / setuptools a > little digging showed that the MS compiler files in distutils only > support up to Studio 2008. Doe

Re: programming

2010-09-19 Thread Xavier Ho
On 20 September 2010 16:25, Jordan Blanton wrote: > its not specific terms that i dont understand. its general directions. but > when i dont understand one or two key points in a sentence, its hard to > understand what the directions are telling me to do. Is it possible for you to share the sen

Re: The trouble with "dynamic attributes".

2010-09-19 Thread Steven D'Aprano
On Sun, 19 Sep 2010 16:47:26 +1000, Lie Ryan wrote: > On 09/18/10 03:53, Ethan Furman wrote: >> Lie Ryan wrote: >> [snip] >>> And even dict-syntax is not perfect for accessing XML file, e.g.: >>> >>> >>> foo >>> bar >>> >>> >>> should a['b'] be 'foo' or 'bar'? >> >> Attribute style acce

[OT] Syntax highlighting [was Re: Too much code - slicing]

2010-09-19 Thread Steven D'Aprano
On Sun, 19 Sep 2010 07:36:11 +, Seebs wrote: > On 2010-09-19, Steven D'Aprano > wrote: >> I'm not entirely sure I agree with you here... you can't ignore syntax >> in order to understand the meaning of code. > > No, but the syntax should be invisible. When I read English, I don't > have to

[OT] Speed-reading [was Re: Too much code - slicing]

2010-09-19 Thread Steven D'Aprano
On Sun, 19 Sep 2010 10:29:10 -0400, AK wrote: > On 09/18/2010 11:28 PM, Steven D'Aprano wrote: [...] >> My wife can read scarily fast. It's very something to watch her reading >> pages as fast as she can turn them, and a few years ago she read the >> entire Harry Potter series (to date) in one aft

Re: SimpleHTTPServer, external CSS, and Google Chrome

2010-09-19 Thread Justin Ezequiel
LOL. twas http://bugs.python.org/issue839496 -- http://mail.python.org/mailman/listinfo/python-list

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Steven D'Aprano
On Mon, 20 Sep 2010 05:46:38 +, Tim Harig wrote: >> I'm not particularly convinced that these are *significant* complaints >> about URL-shorteners. But I will say, of the last couple hundred links >> I've followed from Usenet posts, precisely zero of them were through >> URL redirectors. If

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Seebs
On 2010-09-20, Tim Harig wrote: > 1. Don't bother to manually paste when you can use something like urlview > to lauch directly. I don't know that this would actually be better than what I currently do, which is grab text and middle-click in another window. > If you want this behavio

Re: programming

2010-09-19 Thread Xavier Ho
On 20 September 2010 15:46, Jordan Blanton wrote: > I am in a computer science class in which I am supposed to be creating a > program involving a sine wave and some other functions. I understand the > concept of the problem, but I don't understand any of the "lingo" being > used. The directions

visual studio 2010 question

2010-09-19 Thread Ralf Haring
After running into the error "Setup script exited with error: Unable to find vcvarsall.bat" when trying to use easy_install / setuptools a little digging showed that the MS compiler files in distutils only support up to Studio 2008. Does anyone know if there is a timetable for when Studio 2010 wil

Re: programming

2010-09-19 Thread geremy condra
On Sun, Sep 19, 2010 at 10:46 PM, Jordan Blanton wrote: > I am in a computer science class in which I am supposed to be creating a > program involving a sine wave and some other functions. I understand the > concept of the problem, but I don't understand any of the "lingo" being > used. The direct

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Tim Harig
On 2010-09-20, Seebs wrote: > On 2010-09-20, Tim Harig wrote: >> On 2010-09-20, Seebs wrote: >>> * No hint as to what site you'll be getting redirected to. > >> Tinyurl, in particular, allows you to preview the url if you choose to do >> so. Other URL shortning services have a similar feature.

programming

2010-09-19 Thread Jordan Blanton
I am in a computer science class in which I am supposed to be creating a program involving a sine wave and some other functions. I understand the concept of the problem, but I don't understand any of the "lingo" being used. The directions might as well be written in a different language. Is there a

Re: compiling python 3.1.2 with local readline fails to get readline - help!

2010-09-19 Thread gavino
On Sep 15, 6:41 pm, James Mills wrote: > On Thu, Sep 16, 2010 at 11:10 AM, gavino wrote: > > I am comiling 3.1.2. > > I am not root but a user. > > I compiled readline and it did not complain. > > gdb and zlib  and some other modules also were not found. > > Like I said earlier in my previous pos

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Seebs
On 2010-09-20, Tim Harig wrote: > On 2010-09-20, Seebs wrote: >> * No hint as to what site you'll be getting redirected to. > Tinyurl, in particular, allows you to preview the url if you choose to do > so. Other URL shortning services have a similar feature. I have no idea how. If I see a "ti

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-20, John Bokma wrote: > I didn't mean that there are spoilers in the first 70 pages, just that > to me the excercise would spoil the book, so, I wouldn't do it. I > consider a book like a meal, I wouldn't gobble down food, regurgitate > it, and eat it again at a slower pace. Books, movi

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Tim Harig
On 2010-09-20, Seebs wrote: > On 2010-09-20, Steven D'Aprano wrote: >> On Sun, 19 Sep 2010 06:16:49 -0700, Aahz wrote: >>> Please don't use tinyurl -- it's opaque and provides zero help to anyone >>> who might later want to look it up (and also no accessibility if tinyurl >>> ever goes down). At

Re: Too much code - slicing

2010-09-19 Thread John Bokma
AK writes: > On 09/19/2010 10:32 PM, John Bokma wrote: >> AK writes: >> >>> On 09/19/2010 07:18 PM, Gregory Ewing wrote: AK wrote: > Afaik the idea is that you can read a novel at the speed of half a page > a second or so and understand it to the same extent as people who'd rea

www.127760.blogspot.com

2010-09-19 Thread roshini begum
www.127760.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/19/2010 10:32 PM, John Bokma wrote: AK writes: On 09/19/2010 07:18 PM, Gregory Ewing wrote: AK wrote: Afaik the idea is that you can read a novel at the speed of half a page a second or so and understand it to the same extent as people who'd read at a normal rate. I've never underst

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Seebs
On 2010-09-20, Steven D'Aprano wrote: > On Sun, 19 Sep 2010 06:16:49 -0700, Aahz wrote: >> Please don't use tinyurl -- it's opaque and provides zero help to anyone >> who might later want to look it up (and also no accessibility if tinyurl >> ever goes down). At the very least, include the origin

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Steven D'Aprano
On Sun, 19 Sep 2010 06:16:49 -0700, Aahz wrote: > Please don't use tinyurl -- it's opaque and provides zero help to anyone > who might later want to look it up (and also no accessibility if tinyurl > ever goes down). At the very least, include the original URL for > reference. Do you have someth

Re: Python and unicode

2010-09-19 Thread Steven D'Aprano
On Mon, 20 Sep 2010 09:09:31 +1000, Ben Finney wrote: > Goran Novosel writes: > >> # vim: set encoding=utf-8 : > > This will help Vim, but won't help Python. It will actually -- the regex Python uses to detect encoding lines is documented, and Vim-style declarations are allowed as are Emacs

Re: SimpleHTTPServer, external CSS, and Google Chrome

2010-09-19 Thread Justin Ezequiel
On Sep 18, 2:54 am, MrJean1 wrote: > FWIW, > > There is a blue text on a red background in all 4 browsers Google > Chrome 6.0.472.59, Safari 5.0.1 (7533.17.8), FireFox 3.6.9 and IE > 6.0.2900.5512 with Python 2.7 serving that page on my Windows XP > SP 3 machine. > > /Jean > Hmm. Will downloa

Re: Too much code - slicing

2010-09-19 Thread Steven D'Aprano
On Mon, 20 Sep 2010 11:18:57 +1200, Gregory Ewing wrote: > AK wrote: > >> Afaik the idea is that you can read a novel at the speed of half a page >> a second or so and understand it to the same extent as people who'd >> read at a normal rate. > > I've never understood why anyone would *want* to

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Aahz
In article , Philip Semanchuk wrote: > >Some email systems still insert hard line breaks around the 72 or 80 >column mark and as a result long URLs get broken. I hope anyone on this >list would be able to surgically repair a broken URL, but I email plenty >of people who can't and tinyurl & frie

Re: C++ - Python API

2010-09-19 Thread Aahz
In article , Thomas Jollans wrote: >On Sunday 19 September 2010, it occurred to Aahz to exclaim: >> In article , >> Thomas Jollans wrote: >>>On Wednesday 01 September 2010, it occurred to Markus Kraus to exclaim: So the feature overview: >>> >>>First, the obligatory things you don't w

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-20, John Bokma wrote: > Heh, to me speed reading those 70 pages in a very short while, > concluding that it's a good book, and start over again would be quite > the spoiler. I rarely encounter substantive spoilers in the first 70 pages or so of a book. That said, I'm pretty much immun

Re: Python and unicode

2010-09-19 Thread Carl Banks
On Sep 19, 4:09 pm, Ben Finney wrote: > Goran Novosel writes: > > # vim: set encoding=utf-8 : > > This will help Vim, but won't help Python. Use the PEP 263 encoding > declaration http://www.python.org/dev/peps/pep-0263/> to let Python > know the encoding of the program source file. That's funny

Re: Too much code - slicing

2010-09-19 Thread John Bokma
AK writes: > On 09/19/2010 07:18 PM, Gregory Ewing wrote: >> AK wrote: >> >>> Afaik the idea is that you can read a novel at the speed of half a page >>> a second or so and understand it to the same extent as people who'd read >>> at a normal rate. >> >> I've never understood why anyone would *wa

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-20, alex23 wrote: > AK wrote: >> When I was reading The book of the new sun, though, I could stop and >> read a single sentence a few times over and reflect on it for a minute. > Totally understandable, Wolfe is a far, far greater writer than > Rowling :) Certainly true. On the othe

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Philip Semanchuk
On Sep 19, 2010, at 6:05 PM, Xavier Ho wrote: > On 20 September 2010 07:59, Ken Watford > >> wrote: > >> >> Not that I disagree with you, but you might find this helpful: >> http://tinyurl.com/preview.php >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > I don't think the O

Re: newbie: class and __dict__ variable.

2010-09-19 Thread Terry Reedy
On 9/19/2010 1:37 PM, mafeu...@gmail.com wrote: Hallo Group Members. From time to time I see in python code following notation that (as I believe) extends namespace of MyClass. No, it does not affect MyClass, just the instance dict. class MyClass: def __init__(self): self.__dic

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/19/2010 07:18 PM, Gregory Ewing wrote: AK wrote: Afaik the idea is that you can read a novel at the speed of half a page a second or so and understand it to the same extent as people who'd read at a normal rate. I've never understood why anyone would *want* to read a novel that fast, th

Re: Too much code - slicing

2010-09-19 Thread alex23
AK wrote: > When I was reading The book of the new sun, though, I could stop and > read a single sentence a few times over and reflect on it for a minute. Totally understandable, Wolfe is a far, far greater writer than Rowling :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Lawrence D'Oliveiro
In message , Aahz wrote: > Please don't use tinyurl -- it's opaque and provides zero help to anyone > who might later want to look it up (and also no accessibility if tinyurl > ever goes down). At the very least, include the original URL for > reference. +1 from someone who has seen URL-shorteni

Re: socket.error: [Errno 98] Address already in use

2010-09-19 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > However, some clients choose their own source ports. E.g. rlogin/rsh use > privileged (low-numbered) ports, and you can't get the kernel to choose a > random privileged port for you. But nobody uses rlogin/rsh any more, and who would attach any trustworthy meaning to

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, Gregory Ewing wrote: > AK wrote: >> Afaik the idea is that you can read a novel at the speed of half a page >> a second or so and understand it to the same extent as people who'd read >> at a normal rate. > I've never understood why anyone would *want* to read a > novel that fast,

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, MRAB wrote: > On 19/09/2010 22:32, Seebs wrote: >> On 2010-09-19, AK wrote: >>> Because that's what 'if' and 'else' mean. >> My point is, I don't want the order of the clauses in if/else to change. >> If it is sometimes "ifelse", then >> it should *ALWAYS WITHOUT EXCEPTION* be

Re: Too much code - slicing

2010-09-19 Thread Gregory Ewing
AK wrote: Afaik the idea is that you can read a novel at the speed of half a page a second or so and understand it to the same extent as people who'd read at a normal rate. I've never understood why anyone would *want* to read a novel that fast, though. For me at least, reading a novel is some

Re: Python and unicode

2010-09-19 Thread Ben Finney
Goran Novosel writes: > # vim: set encoding=utf-8 : This will help Vim, but won't help Python. Use the PEP 263 encoding declaration http://www.python.org/dev/peps/pep-0263/> to let Python know the encoding of the program source file. # -*- coding: utf-8 -*- You can use the bottom of the fi

Re: ctypes and buffers

2010-09-19 Thread Carl Banks
On Sep 19, 5:10 am, Thomas Jollans wrote: > On Sunday 19 September 2010, it occurred to Carl Banks to exclaim: > > I am creating a ctypes buffer from an existing non-ctypes object that > > supports buffer protocol using the following code: > > > from ctypes import * > > > PyObject_AsReadBuffer = p

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Xavier Ho
On 20 September 2010 07:59, Ken Watford > wrote: > > Not that I disagree with you, but you might find this helpful: > http://tinyurl.com/preview.php > -- > http://mail.python.org/mailman/listinfo/python-list > I don't think the OP wants a preview feature. The fact that you still have to go throu

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Ken Watford
On Sun, Sep 19, 2010 at 9:16 AM, Aahz wrote: > In article , > geremy condra   wrote: >>On Wed, Sep 1, 2010 at 4:35 PM, patrick mcnameeking >> wrote: >>> >>> I've been working with Python now for about a year using it primarily for >>> scripting in the Puredata graphical programming environment. I'

Re: Too much code - slicing

2010-09-19 Thread MRAB
On 19/09/2010 22:32, Seebs wrote: On 2010-09-19, AK wrote: Because that's what 'if' and 'else' mean. My point is, I don't want the order of the clauses in if/else to change. If it is sometimes "ifelse", then it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause, then f

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, AK wrote: > Because that's what 'if' and 'else' mean. My point is, I don't want the order of the clauses in if/else to change. If it is sometimes "if else ", then it should *ALWAYS WITHOUT EXCEPTION* be condition first, then true clause, then false clause. If it's sometimes "if

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/19/2010 02:21 PM, Seebs wrote: On 2010-09-19, AK wrote: On 09/19/2010 03:31 AM, Seebs wrote: Just like: if condition: foo else: bar The condition is the primary, the clauses are secondary to it. To me, the problem with C ternary is, why is tr

Re: Python and unicode

2010-09-19 Thread Martin v. Loewis
> One more thing, is there some mechanism to avoid writing all the time > 'something'.decode('utf-8')? Yes, use u'something' instead (i.e. put the letter u before the literal, to make it a unicode literal). Since Python 2.6, you can also put from __future__ import unicode_literals at the top of

Python and unicode

2010-09-19 Thread Goran Novosel
Hi everybody. I've played for few hours with encoding in py, but it's still somewhat confusing to me. So I've written a test file (encoded as utf-8). I've put everything I think is true in comment at the beginning of script. Could you check if it's correct (on side note, script does what I intende

Re: develop for Windows on GNU/Linux, using Python

2010-09-19 Thread J.O. Aho
Kev Dwyer wrote: > On Sun, 19 Sep 2010 12:55:43 -0500, Default User wrote: > >> Consider: >> >> Can someone do development of programs for use on Windows systems, but >> developed totally on a GNU/Linux system, using standard, contemporary 32 >> and / or 64-bit PC hardware? >> >> This would be for

Re: Making logging.getLogger() simpler

2010-09-19 Thread Vinay Sajip
On Sep 19, 7:52 pm, Vinay Sajip wrote: > If you are writing a library, you will typically: > 2. If you want to force your users (application developers) to add > handlers explicitly to their loggers, set your top-level logger's > propagate flag to False. Sorry, in the above text, where it says "t

Re: Making logging.getLogger() simpler

2010-09-19 Thread Vinay Sajip
On Sep 18, 5:35 pm, Lie Ryan wrote: > I was expecting this to work: > >   importlogging >   logger =logging.getLogger(__name__) >   logger.warn('this is a warning') > > instead it produced the error: > >   No handlers could be found for logger "__main__" > > However, if instead I do: > >   importl

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, AK wrote: > On 09/19/2010 03:31 AM, Seebs wrote: >> Just like: >> if condition: >> foo >> else: >> bar >> The condition is the primary, the clauses are secondary to it. > To me, the problem with C ternary is, why is true condition first and > false seco

Re: [DB-SIG] dbf files and compact indices

2010-09-19 Thread Ethan Furman
M.-A. Lemburg wrote: If you are working on Windows, you can install the MS MDAC package to get a hold of the MS FoxPro ODBC drivers. They are usually already installed in Vista and 7, in XP they comes with MS SQL Server and MS Office as well. mxODBC can then provide Python access on Windows, mxOD

Re: develop for Windows on GNU/Linux, using Python

2010-09-19 Thread Kev Dwyer
On Sun, 19 Sep 2010 12:55:43 -0500, Default User wrote: > Consider: > > Can someone do development of programs for use on Windows systems, but > developed totally on a GNU/Linux system, using standard, contemporary 32 > and / or 64-bit PC hardware? > > This would be for someone who can not or wi

http2https proxy

2010-09-19 Thread Seb
I'd like to open a ssl connection to a https server, done Create a socket and bind it to a local port, done Connect the two in such a way that everything read or written to the local port is actually read or written to the https server. In other words I want a http2https proxy. ideas? best re

develop for Windows on GNU/Linux, using Python

2010-09-19 Thread Default User
Consider: Can someone do development of programs for use on Windows systems, but developed totally on a GNU/Linux system, using standard, contemporary 32 and / or 64-bit PC hardware? This would be for someone who can not or will not use Windows, but wants to create software for those who do. Thi

newbie: class and __dict__ variable.

2010-09-19 Thread mafeusek
Hallo Group Members. From time to time I see in python code following notation that (as I believe) extends namespace of MyClass. class MyClass: def __init__(self): self.__dict__["maci"]=45 myCl2 = MyClass2() print myCl2.maci I am guessing that there must be some difference between t

Re: socket.error: [Errno 98] Address already in use

2010-09-19 Thread Nobody
On Sun, 19 Sep 2010 18:42:51 +1200, Lawrence D'Oliveiro wrote: That's why Stevens recommends that all TCP servers use the SO_REUSEADDR socket option. >>> >>> I don’t think I’ve ever used that. It seems to defeat a safety mechanism >>> which was put in for a reason. >> >> It was put in

Re: Making logging.getLogger() simpler

2010-09-19 Thread Kev Dwyer
On Sun, 19 Sep 2010 02:35:15 +1000, Lie Ryan wrote: > I was expecting this to work: > > import logging > logger = logging.getLogger(__name__) > logger.warn('this is a warning') > > instead it produced the error: > > No handlers could be found for logger "__main__" > > > However, if in

comp.lang.python

2010-09-19 Thread roshini begum
http://127760.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/19/2010 03:36 AM, Seebs wrote: On 2010-09-19, Steven D'Aprano wrote: I'm not entirely sure I agree with you here... you can't ignore syntax in order to understand the meaning of code. No, but the syntax should be invisible. When I read English, I don't have to think about nouns and ver

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/19/2010 03:31 AM, Seebs wrote: On 2010-09-19, Steven D'Aprano wrote: Define "unbalanced". I'm not sure that's the word I'd use. I'm not even sure what it would mean here. Putting aside the over-use of punctuation, The C syntax feels unbalanced to me. You have: condition IF true-cl

Re: Too much code - slicing

2010-09-19 Thread AK
On 09/18/2010 11:28 PM, Steven D'Aprano wrote: On Sat, 18 Sep 2010 21:58:58 -0400, AK wrote: I don't understand this. So far as I know, the phrase "speed reading" refers to various methods of reading much faster than most people read, and is real but not exceptionally interesting. Afaik the

Re: C++ - Python API

2010-09-19 Thread Thomas Jollans
On Sunday 19 September 2010, it occurred to Aahz to exclaim: > In article , > > Thomas Jollans wrote: > >On Wednesday 01 September 2010, it occurred to Markus Kraus to exclaim: > >> So the feature overview: > >First, the obligatory things you don't want to hear: Have you had > >a look at similar

Re: This Is International Don’t-Squawk-Like-A -Parrot Day

2010-09-19 Thread Philip Semanchuk
On Sep 19, 2010, at 7:37 AM, Tim Chase wrote: > On 09/18/10 23:46, Lawrence D'Oliveiro wrote: >> Do your bit to help stamp out parrocy. > > Did you send this by mistake? It looks like a parroty-error. I think it's a > bit off... What an wkward thing to say. Are you crackers? -- http://m

Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Aahz
In article , geremy condra wrote: >On Wed, Sep 1, 2010 at 4:35 PM, patrick mcnameeking > wrote: >> >> I've been working with Python now for about a year using it primarily for >> scripting in the Puredata graphical programming environment. I'm working on >> a project where I have been given a 100

Re: This Is International Don’t-Squawk-Like-A -Parrot Day

2010-09-19 Thread Aahz
In article , Tim Chase wrote: >On 09/18/10 23:46, Lawrence D'Oliveiro wrote: >> >> Do your bit to help stamp out parrocy. > >Did you send this by mistake? It looks like a parroty-error. I >think it's a bit off... Agh! -- Aahz (a...@pythoncraft.com) <*> http://www.python

Re: C++ - Python API

2010-09-19 Thread Aahz
In article , Thomas Jollans wrote: >On Wednesday 01 September 2010, it occurred to Markus Kraus to exclaim: >> >> So the feature overview: > >First, the obligatory things you don't want to hear: Have you had >a look at similar efforts? A while ago, Aahz posted something very >similar on this very

Re: ctypes and buffers

2010-09-19 Thread Thomas Jollans
On Sunday 19 September 2010, it occurred to Carl Banks to exclaim: > I am creating a ctypes buffer from an existing non-ctypes object that > supports buffer protocol using the following code: > > > from ctypes import * > > PyObject_AsReadBuffer = pythonapi.PyObject_AsReadBuffer > PyObject_AsRead

Re: This Is International Don’t-Squawk-Like-A -Parrot Day

2010-09-19 Thread Tim Chase
On 09/18/10 23:46, Lawrence D'Oliveiro wrote: Do your bit to help stamp out parrocy. Did you send this by mistake? It looks like a parroty-error. I think it's a bit off... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: [DB-SIG] dbf files and compact indices

2010-09-19 Thread M.-A. Lemburg
Ethan Furman wrote: > Carl Karsten wrote: >> On Sat, Sep 18, 2010 at 11:23 PM, Ethan Furman >> wrote: >>> Thanks for the suggestion, but I don't want to be tied to Foxpro, which >>> means I need to be able to parse these files directly. I have the dbf >>> files, now I need the idx and cdx files

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
On Sep 19, 12:20 pm, Lawrence D'Oliveiro wrote: > In message > , Alex > > Willmer wrote: > > # NB Constants are by convention ALL_CAPS > > SAYS_WHO? Says PEP 8: Constants Constants are usually declared on a module level and written in all capital letters with underscores separatin

Re: program organization question for web development with python

2010-09-19 Thread Lawrence D'Oliveiro
In message <6102316a-d6e6-4cf2-8a1b-ecc5d3247...@w15g2000pro.googlegroups.com>, Hans wrote: > print """%s""" % > (record[0],table_name,cursor_name,record1) I would recommend avoiding filename extensions in your URLs wherever possible. For executables, in particular, leaving out the “.py” or “.p

Re: Cross Compiling Python for ARM

2010-09-19 Thread Lawrence D'Oliveiro
In message <4c911670$0$41115$e4fe5...@news.xs4all.nl>, Hans Mulder wrote: > The most popular way to get the latter problem is to write the script > on a Windows box and then upload it to Unix box using FTP in binary > mode (or some other transport that doesn't adjust the line endings). I always t

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message <4c957412$0$3036$afc38...@news.optusnet.com.au>, fridge wrote: > digits=[zero,one,zero,one,zero,one,zero,one,zero,one] digits = [zero, one] * 5 > row_max=3 Defined but never used. > digit_i=int(inputted_digit[c]) > digit=digits[digit_i] > line+=digit[r] > line+=" " Too many

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message , Alex Willmer wrote: > # NB Constants are by convention ALL_CAPS SAYS_WHO? -- http://mail.python.org/mailman/listinfo/python-list

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
Your code works (assuming digits gets populated fully), but it's the absolute bare minimum that would. To be brutally honest it's: - unpythonic - you've not used the core features of Python at all, such as for loops over a sequence - poorly formatted - Please read the python style guide and follo

Re: Learning inheritance

2010-09-19 Thread Niklasro
On Sep 19, 8:12 am, Thomas Jollans wrote: > On 2010-09-19 09:22, Niklasro wrote:> util.py: > > url = os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"]) #declared > > as class variable(?) > > There is no class here, so this is no class variable, and you're not > inheriting anything. You're simp

Re: Learning inheritance

2010-09-19 Thread Thomas Jollans
On 2010-09-19 09:22, Niklasro wrote: > util.py: > url = os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"]) #declared > as class variable(?) > There is no class here, so this is no class variable, and you're not inheriting anything. You're simply using a module. > And viola just test if util

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, Steven D'Aprano wrote: > I'm not entirely sure I agree with you here... you can't ignore syntax in > order to understand the meaning of code. No, but the syntax should be invisible. When I read English, I don't have to think about nouns and verbs and such unless something is very

Re: Too much code - slicing

2010-09-19 Thread Seebs
On 2010-09-19, Steven D'Aprano wrote: > Define "unbalanced". I'm not sure that's the word I'd use. I'm not even sure what it would mean here. > Putting aside the over-use of punctuation, The C syntax feels unbalanced > to me. You have: > condition IF true-clause ELSE false-clause > so both c

Re: Plz comment on this code

2010-09-19 Thread Peter Otten
fridge wrote: > # bigdigits2.py > > import sys > > zero=["***", >"* *", >"***"] > one=["***", > " * ", > "***"] > digits=[zero,one,zero,one,zero,one,zero,one,zero,one] > > inputted_digit=sys.argv[1] > column_max=len(inputted_digit) > row_max=3 > > r=0 > while r<3: > line="" > c

Re: Learning inheritance

2010-09-19 Thread Niklasro
It works but I don't know whether it's formally inheritance or class variable. Before code was url = os.environ['HTTP_HOST'] if os.environ.get('HTTP_HOST') else os.environ['SERVER_NAME'] if url.find('niklas') > 0: and now the change saves me from repeating myself! util.py: url = os.envir

Re: Learning inheritance

2010-09-19 Thread Niklasro
On Sep 19, 2:31 am, alex23 wrote: > Niklasro wrote: > > I got 2 files main.py and i18n both with > > webapp request handlers which I would like access the variable. > > I'd probably use a module for this. Create a third file, called > something like shared.py, containing the line that bruno gave

Re: Learning inheritance

2010-09-19 Thread Niklasro
On Sep 18, 11:15 pm, Jorgen Grahn wrote: > On Sat, 2010-09-18, Niklasro wrote: > > Hi > > How can I make the visibility of a variable across many methods or > > files? To avoid repeating the same line eg     url = > > os.environ['HTTP_HOST'] if os.environ.get('HTTP_HOST') else > > os.environ['SERV

Re: compile Py2.6 on SL

2010-09-19 Thread Martin v. Loewis
Am 16.09.2010 17:34, schrieb moerchendiser2k3: > Hi, > > I have some trouble with Python on Snow Leopard (10.6.3). I compile > Python as a framework(for 32/64bit) without any problems. > But implementing the lib in my C app, I get the following error on > linking: > > Undefined symbols: > "_Py_