FREE Tutorials on HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript, SAP - ABAP

2008-05-24 Thread Dhanabal
FREE Tutorials on HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript, SAP - ABAP visit ebooks.univdatabase.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Another Question

2008-05-24 Thread Gandalf
On May 23, 10:47 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 23, 1:44 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > you've been very helpful but still i have only one problem. I wont the > > window not to be close after clicking the X button. > > I wont the program to stay on the toolbar >

Re: Python is slow

2008-05-24 Thread Patrick Mullen
Judging python's speed by how fast websites go is not going to work very well. There are many things that can bog down the "speed" of loading a web site, especially if you are judging speed by how long a page takes to load. torontolife.com is loading extremely slow for me also. So is wikipedia. M

Re: Python is slow

2008-05-24 Thread Paolo Victor
I love it when a troll tries to make his/hers/its point with a vague, biased assumption: "I mean, it's not that slow - wait, I guess it's slower, because I... I think so! Yeah! It's slow! At least it feels like it..." It's all about choosing the right tool. If you think Python doesn't suit your n

Python, Daemons and D-Bus

2008-05-24 Thread PurpleServerMonkey
Seeking feedback from group members on a design I'm looking at using in a project. I've created an XML-RPC server and a number of Daemons, the idea is that the XML-RPC server gets a request from a user interface of some sort and then sends data to the Daemon processes to do work. Daemons will also

Re: Storing objects in relational database

2008-05-24 Thread Ville M. Vainio
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I don't know if you'd label it 'elegant', but as far as I'm > concerned, storing serialized objects as blobs in a relational > database is mostly non-sense. If I use a relational database, it's > because it is a *relational* database. If you want

Re: Unhandled exceptions checking

2008-05-24 Thread David
On Sat, May 24, 2008 at 3:31 AM, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > Does somebody know existent tool for checking unhandled exceptions? > Like in Java when method throws exception but in code using this > method, try...catch is missed. May be something like PyChecker? > Python is too dynam

image scaling in cairo, python

2008-05-24 Thread _wolf
[also posted to: [EMAIL PROTECTED] hi all, i've heard cairo has become the image scling library for firefox3. is that true? wonderful, i want to do that in python. there's a python interface for cairo, right? i've used it before to do simple vector stuff. seems to work. however, i haven't been ab

SQLite import fails sometimes ?

2008-05-24 Thread Stef Mientki
hello, The import statement "import sqlite3" gives the error given below. In simple programs, the import statement (sometimes) succeed, and I can indeed access the database. So I guess there is some conflict with another part of my program, but as the program is rather large (and dynamic) it's no

Partial download with ftplib and retrbinary

2008-05-24 Thread fepeacock
I am breaking/interrupting my connection with the ftp server at present when doing a partial download of a file. I have a callback with retrbinary that raises an exception and ends the download. The problem is that the server is not notified and hangs. I cannot send any further commands and need to

Re: Storing objects in relational database

2008-05-24 Thread Piotr Chamera
[EMAIL PROTECTED] pisze: I don't know if you'd label it 'elegant', but as far as I'm concerned, storing serialized objects as blobs in a relational database is mostly non-sense. If I use a relational database, it's because it is a *relational* database. If you want an OODB, then we have the ZODB,

Re: Python is slow

2008-05-24 Thread Carl Banks
On May 24, 1:56 am, cm_gui <[EMAIL PROTECTED]> wrote: > i'm not trying to 'troll' here. Maybe you're not trying, but you're succeeding. If you want to criticize be constructive about it, otherwise get out. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite import fails sometimes ?

2008-05-24 Thread John Machin
Stef Mientki wrote: hello, The import statement "import sqlite3" gives the error given below. In simple programs, the import statement (sometimes) succeed, and I can indeed access the database. So I guess there is some conflict with another part of my program, but as the program is rather large

Re: Assignment and comparison in one statement

2008-05-24 Thread Johannes Bauer
Carl Banks schrieb: p = myfunction() if p: print p (I recommend doing it this way in C, too.) This is okay for if-clauses, but sucks for while-loops: while (fgets(buf, sizeof(buf), f)) { printf("%s\n", buf); } is much shorter than char *tmp; tmp = fgets(buf, sizeof(buf), f); wh

Re: Python is slow

2008-05-24 Thread David C. Ullrich
On Fri, 23 May 2008 14:00:33 -0700 (PDT), "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >On 23 mai, 10:42, "inhahe" <[EMAIL PROTECTED]> wrote: >> "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in >> messagenews:[EMAIL PROTECTED] >> >> > Brad a écrit : >> >> cm_gui wrote: >> >>> Python is slow.

Re: Assignment and comparison in one statement

2008-05-24 Thread Johannes Bauer
George Sakkis schrieb: However, this "assignment and comparison" is not working. What's the "Python way" of doing this kind of thing? The most obvious and readable of course: use two statements, as one should do regardless of the language, instead of resorting to error- prone hacks. As I sai

Re: Assignment and comparison in one statement

2008-05-24 Thread Johannes Bauer
TheSaint schrieb: On 06:59, sabato 24 maggio 2008 Johannes Bauer wrote: However, this "assignment and comparison" is not working. What's the "Python way" of doing this kind of thing? If you want speak a language that isn't understood mostly you'll face unexpected risults. When you got started

Re: Relationship between GUI and logic?

2008-05-24 Thread David C. Ullrich
On 23 May 2008 18:23:04 +0100 (BST), Matthew Woodcraft <[EMAIL PROTECTED]> wrote: >John Salerno <[EMAIL PROTECTED]> wrote: >> Basically, the question is this: can you write the logic behind a >> program (whether it be a game, an email client, a text editor, etc.) >> without having any idea of h

Re: WXpython Question

2008-05-24 Thread David C. Ullrich
On Fri, 23 May 2008 06:40:13 -0700 (PDT), Gandalf <[EMAIL PROTECTED]> wrote: >On May 23, 3:29 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: >> On May 23, 8:24 am, Gandalf <[EMAIL PROTECTED]> wrote: >> >> > I try to reach a specific wx StaticText element's text and to change >> > it by clicking on a

Re: Assignment and comparison in one statement

2008-05-24 Thread Marc 'BlackJack' Rintsch
On Sat, 24 May 2008 13:12:13 +0200, Johannes Bauer wrote: > Carl Banks schrieb: > >> p = myfunction() >> if p: >> print p >> >> (I recommend doing it this way in C, too.) > > This is okay for if-clauses, but sucks for while-loops: > > while (fgets(buf, sizeof(buf), f)) { > printf("%s

Re: Assignment and comparison in one statement

2008-05-24 Thread Marc 'BlackJack' Rintsch
On Sat, 24 May 2008 13:13:08 +0200, Johannes Bauer wrote: > George Sakkis schrieb: > >>> However, this "assignment and comparison" is not working. What's the >>> "Python way" of doing this kind of thing? >> >> The most obvious and readable of course: use two statements, as one >> should do regar

Re: php vs python

2008-05-24 Thread Arnaud Delobelle
Michael Fesser <[EMAIL PROTECTED]> writes: > you don't like PHP, that's perfectly OK. But you should accept that > it's only a tool and just as good as the one who uses it. For me and > many others it's a quite good language, we're able to write clean and > efficient code with it in a rather short

Re: problem with import / namespace

2008-05-24 Thread ohad frand
Hi Laszlo Thanks for your reply but it stil didnt work: i opened python shell, changed active directory to \\one and imported tmp1. now the correct file is loaded. now i deleted tmp1 i dir os.chdir(\\two) and imported tmp1 again. now the incorrect file is loaded (the same one as before). i did one

Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Mathieu Prevot
Hi I import subprocess and use Popen, but PIPE is not defined. I used 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's always the same. What am I missing ? Thanks Mathieu -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite import fails sometimes ?

2008-05-24 Thread Stef Mientki
John Machin wrote: Stef Mientki wrote: hello, The import statement "import sqlite3" gives the error given below. In simple programs, the import statement (sometimes) succeed, and I can indeed access the database. So I guess there is some conflict with another part of my program, but as the prog

Re: Assignment and comparison in one statement

2008-05-24 Thread Jarek Zgoda
Johannes Bauer pisze: > I'm just starting with Python and am extremely unexperienced with it so > far. Having a strong C/C++ background, I wish to do something like > > if (q = getchar()) { > printf("%d\n", q); > } > > or translated to Python: > > if (p = myfunction()): > print p > > H

Re: Reloading function obtained via 'from xxx import yyy'

2008-05-24 Thread Benjamin Kaplan
On Fri, May 23, 2008 at 3:40 PM, Joel Koltner <[EMAIL PROTECTED]> wrote: > How do I get Python to correctly re-load this function definition? > > In test.py: > > def testFunc(): >print 'My testFunc!' > > I execute... > > >>> from test import testFunc > >>> testFunc() > My testFunc! > > Fine...

Code correctness, and testing strategies

2008-05-24 Thread David
Hi list. What strategies do you use to ensure correctness of new code? Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do you ensure that the code will work correctly in the future? Short version: For (1) I thoroughly (manually)

Re: HTMLParser error

2008-05-24 Thread jjbutler88
On May 22, 8:20 pm, alex23 <[EMAIL PROTECTED]> wrote: > On May 23, 5:06 am, [EMAIL PROTECTED] wrote: > > > Nope, this is my first experience with object oriented programming, > > only been learning python for a few weeks but it seemed simple enough > > to inspire me to be a bit ambitious. If you co

Re: Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Diez B. Roggisch
Mathieu Prevot schrieb: Hi I import subprocess and use Popen, but PIPE is not defined. I used 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's always the same. What am I missing ? Without showing code, it's hard to know. A guess is: if you use import subprocess then us

Re: Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Jack Yu
On Sat, 24 May 2008 14:09:07 +0200,Mathieu Prevot wrote: > Hi > > I import subprocess and use Popen, but PIPE is not defined. I used > 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's > always the same. What am I missing ? > > Thanks > Mathieu Try subprocess.PIPE. -- http:

Re: Popen: NameError: name 'PIPE' is not defined

2008-05-24 Thread Mathieu Prevot
2008/5/24 Diez B. Roggisch <[EMAIL PROTECTED]>: > Mathieu Prevot schrieb: >> >> Hi >> >> I import subprocess and use Popen, but PIPE is not defined. I used >> 2.5.1, 2.5.2, Python 2.6a3+ (trunk:63576, May 24 2008, 12:13:40), it's >> always the same. What am I missing ? > > Without showing code, it'

Re: Python is slow

2008-05-24 Thread Ivan Illarionov
On Fri, 23 May 2008 22:56:57 -0700, cm_gui wrote: > i am not comparing Python with C or C++ which are of course compiled > languages. > > if there is any consolation to Python lovers here, Python is still > faster than Microsoft ASP/ASPX. > > i'm not trying to 'troll' here. it's not just me. m

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, John Roth <[EMAIL PROTECTED]> wrote: > > Does the following patch has a chance of being introduced in the > > standard python distribution? > > I certainly hope not! I think you're being overly negative here. Antoon went to the trouble to read the sources and

PIPE stderr

2008-05-24 Thread Mathieu Prevot
Hi again, I don't have the same ouptput between 1) and 2) ... what's happening ? 1) wget http://www.youtube.com/v/A8bwZf3vXjg -O /dev/null 2> file 2) k = Popen (["wget", "http://www.youtube.com/v/A8bwZf3vXjg";, "-O", "/dev/null"], stderr=PIPE) print k.stderr In the case 2) I got: open file '',

Re: unittest: Calling tests in liner number order

2008-05-24 Thread André
On May 24, 10:12 am, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > John Roth <[EMAIL PROTECTED]> wrote: > > > > Does the following patch has a chance of being introduced in the > > > standard python distribution? > > > I certainly hope not! > > I think you're being ove

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Fuzzyman
On May 23, 10:36 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Some time ago I asked whether is would be possible that unittest would > perform the test in order of appearence in the file. > > The answers seemed to be negative. Since I really would like this > behaviour I took the trouble of looki

need some help in serving static files inside a wsgi apps

2008-05-24 Thread Tool69
Hi, Until now, I was running my own static site with Python, but I'm in need of dynamism. After reading some cgi tutorials, I saw Joe Gregorio's old article "Why so many Python web frameworks?" about wsgi apps [http:// bitworking.org/news/Why_so_many_Python_web_frameworks] and have a question abo

Re: Code correctness, and testing strategies

2008-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, David <[EMAIL PROTECTED]> wrote: > Hi list. > > What strategies do you use to ensure correctness of new code? > > Specifically, if you've just written 100 new lines of Python code, then: > > 1) How do you test the new code? > 2) How do you ensure that the code w

Re: SQLite import fails sometimes ?

2008-05-24 Thread John Machin
Stef Mientki wrote: I don't know if this matters, but I also use sqlite3 from other than Python programs. You have an instance of sqlite3.dll in P:\Python\DLLs for use with Python, and (I guess) you have another instance of sqlite3.dll somewhere else, for use "from other than Python programs

Re: Unhandled exceptions checking

2008-05-24 Thread Scott David Daniels
Yosifov Pavel wrote: Does somebody know existent tool for checking unhandled exceptions? Like in Java when method throws exception but in code using this method, try...catch is missed. May be something like PyChecker? I've seen this a number of places. Apparently there are a number of programm

Why does python not have a mechanism for data hiding?

2008-05-24 Thread Sh4wn
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python a

Re: C-like assignment expression?

2008-05-24 Thread Paul McGuire
On May 21, 4:38 am, [EMAIL PROTECTED] wrote: > Hello, > > I have an if-elif chain in which I'd like to match a string against > several regular expressions. Also I'd like to use the match groups > within the respective elif... block. The C-like idiom that I would > like to use is this: > > if (matc

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Fuzzyman <[EMAIL PROTECTED]> wrote: > Also, like others, I have had wonderful experiences of trying to track > down test failures that depend on the order that tests run in. Having > interdependencies between tests is a recipe for madness... I agree that tests sh

Re: Code correctness, and testing strategies

2008-05-24 Thread Ben Finney
David <[EMAIL PROTECTED]> writes: > What strategies do you use to ensure correctness of new code? Behaviour Driven Development http://behaviour-driven.org/>. * Start with an automated unit test suite that passes. * Describe, as formally or informally as you like, but *not* in code, the new or

Scipy+SQLite crashes... , was: Re: SQLite import fails sometimes ?

2008-05-24 Thread Stef Mientki
John Machin wrote: Stef Mientki wrote: I don't know if this matters, but I also use sqlite3 from other than Python programs. You have an instance of sqlite3.dll in P:\Python\DLLs for use with Python, and (I guess) you have another instance of sqlite3.dll somewhere else, for use "from other

Re: C-like assignment expression?

2008-05-24 Thread Paul McGuire
This version is a bit better, since it follows the convention that '<<' should return self. class TestValue(object): """Class to support assignment and test in single operation""" def __init__(self,v=None): self.value = v """Add support for quasi-assignment syntax using '<<' i

About events

2008-05-24 Thread Gandalf
As i said before I work with the WX library on a windows XP operation system. Now i wont to create an application which ran at the background and wait till the user double click on a text word OF any other python or none python application which ran on the desktop, and when this event append i w

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Ben Finney
Sh4wn <[EMAIL PROTECTED]> writes: > first, python is one of my fav languages, and i'll definitely keep > developing with it. But, there's 1 one thing what I -really- miss: > data hiding. I know member vars are private when you prefix them with > 2 underscores, but I hate prefixing my vars, I'd rat

Re: Assignment and comparison in one statement

2008-05-24 Thread Paul McGuire
On May 24, 6:12 am, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Carl Banks schrieb: > > > p = myfunction() > > if p: > >     print p > > > (I recommend doing it this way in C, too.) > > This is okay for if-clauses, but sucks for while-loops: > > while (fgets(buf, sizeof(buf), f)) { >         printf

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > If you want the users of your code to know that an attribute should > not be used as a public API for the code, use the convention of > naming the attribute with a single leading underscore. This is a > string signal that the attribute is part of the implem

raising an exception when multiple inheritance involves same base

2008-05-24 Thread Michael Hines
Hello, I have a class factory that supports single inheritance but it is an error if the base appears twice. e.g class Foo(hclass(h.Vector), hclass(h.List)): should raise an exception since h.Vector and h.List are really the same extension class, HocObject. So far I have only been able to do this

Re: Python is slow

2008-05-24 Thread Eric Wertman
> if python is such a good programming/scripting language, why can't they > build a faster interpreter/compiler engine? and beat php and zend. > to the python team, rebuild your interpreter! while this is just a boring troll.. it does bring me to a more interesting point... it would be cool if the

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Fuzzyman
On May 24, 2:44 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > Also, like others, I have had wonderful experiences of trying to track > > down test failures that depend on the order that tests run in. Having > > interdepende

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Fuzzyman
On May 24, 2:58 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Sh4wn <[EMAIL PROTECTED]> writes: > > first, python is one of my fav languages, and i'll definitely keep > > developing with it. But, there's 1 one thing what I -really- miss: > > data hiding. I know member vars are private when you prefix

Re: need some help in serving static files inside a wsgi apps

2008-05-24 Thread Diez B. Roggisch
Tool69 schrieb: Hi, Until now, I was running my own static site with Python, but I'm in need of dynamism. After reading some cgi tutorials, I saw Joe Gregorio's old article "Why so many Python web frameworks?" about wsgi apps [http:// bitworking.org/news/Why_so_many_Python_web_frameworks] and h

Re: Code correctness, and testing strategies

2008-05-24 Thread Scott David Daniels
David wrote: Specifically, if you've just written 100 new lines of Python code, then: 1) How do you test the new code? 2) How do you ensure that the code will work correctly in the future? Short version: For (1) I thoroughly (manually) test code as I write it, before checking in to version cont

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Eric Wertman
>I can't relate to anyone that want to oppose a change that would give >more freedom to a programmer. While in general I agree with this.. I think in the case of python part of it's base philosophy seems to be a tendency to encourage a single way of doing things, and create a path of least resista

Re: need some help in serving static files inside a wsgi apps

2008-05-24 Thread kib
Diez B. Roggisch a écrit : Tool69 schrieb: Hi, Until now, I was running my own static site with Python, but I'm in need of dynamism. After reading some cgi tutorials, I saw Joe Gregorio's old article "Why so many Python web frameworks?" about wsgi apps [http:// bitworking.org/news/Why_so_many_

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Fuzzyman <[EMAIL PROTECTED]> wrote: > Whilst I understand your point, I think the danger is that you end up > with hidden dependencies on the test order - which you're not aware of > and that the tests never expose. Well, yes. But, this is no worse than the curr

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Fuzzyman <[EMAIL PROTECTED]> wrote: > The 'we told you not to use that' approach, when applied to paying > customers doesn't really work... all they see is that you broke their > spreadsheet code by changing your API. I hear what you're saying, friend, and I feel

Re: raising an exception when multiple inheritance involves same base

2008-05-24 Thread Arnaud Delobelle
Michael Hines <[EMAIL PROTECTED]> writes: > Hello, > I have a class factory that supports single inheritance but it is > an error if the base appears twice. e.g > class Foo(hclass(h.Vector), hclass(h.List)): > should raise an exception since h.Vector and h.List are really the same > extension clas

Re: Code correctness, and testing strategies

2008-05-24 Thread David
> I work in small increments, writing one test at a time, then some code, > then another test, then some more code, etc. In fact, I take this to what > many people might call an extreme. Thanks for the replies. I've read about the TDD (and similar) approaches. Maybe I need to try it and get used

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Ville M. Vainio
Fuzzyman <[EMAIL PROTECTED]> writes: > The 'we told you not to use that' approach, when applied to paying > customers doesn't really work... all they see is that you broke > their spreadsheet code by changing your API. And the customer point of view is quite reasonable - they have a job to do, a

ero magazines

2008-05-24 Thread yura
http://ero-mag.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignment and comparison in one statement

2008-05-24 Thread Grant Edwards
On 2008-05-23, Johannes Bauer <[EMAIL PROTECTED]> wrote: > I'm just starting with Python and am extremely unexperienced with it so > far. Having a strong C/C++ background, I wish to do something like > > if (q = getchar()) { > printf("%d\n", q); > } > > or translated to Python: > > if (p =

Re: Code correctness, and testing strategies

2008-05-24 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, David <[EMAIL PROTECTED]> wrote: >> I work in small increments, writing one test at a time, then some code, >> then another test, then some more code, etc. In fact, I take this to what >> many people might call an extreme. > >Thanks for the replies. > >I've read ab

Re: Partial download with ftplib and retrbinary

2008-05-24 Thread MRAB
On May 24, 11:53 am, [EMAIL PROTECTED] wrote: > I am breaking/interrupting my connection with the ftp server at > present when doing a partial download of a file. I have a callback > with retrbinary that raises an exception and ends the download. The > problem is that the server is not notified and

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Fuzzyman
On May 24, 4:56 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Fuzzyman <[EMAIL PROTECTED]> writes: > > The 'we told you not to use that' approach, when applied to paying > > customers doesn't really work... all they see is that you broke > > their spreadsheet code by changing your API. > > And t

Re: unittest: Calling tests in liner number order

2008-05-24 Thread Fuzzyman
On May 24, 3:57 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > >  Fuzzyman <[EMAIL PROTECTED]> wrote: > > Whilst I understand your point, I think the danger is that you end up > > with hidden dependencies on the test order - which you're not aware of > > and that the

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread bearophileHUGS
Ben Finney: >In Python, the philosophy "we're all consenting adults here" applies.< Michael Foord: > They will use whatever they find, whether it is the best way to > achieve a goal or not. Once they start using it they will expect us to > maintain it - and us telling them it wasn't intended to be

Re: need some help in serving static files inside a wsgi apps

2008-05-24 Thread Diez B. Roggisch
kib schrieb: Diez B. Roggisch a écrit : Tool69 schrieb: Hi, Until now, I was running my own static site with Python, but I'm in need of dynamism. After reading some cgi tutorials, I saw Joe Gregorio's old article "Why so many Python web frameworks?" about wsgi apps [http:// bitworking.org/new

Re: Code correctness, and testing strategies

2008-05-24 Thread Duncan Booth
David <[EMAIL PROTECTED]> wrote: > Problem 2: Slows down prototyping > > In order to get a new system working, it's nice to be able to throw > together a set of modules quickly, and if that doesn't work, scrap it > and try something else. There's a rule (forget where) that your first > system wi

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Fuzzyman
On May 24, 6:18 pm, [EMAIL PROTECTED] wrote: > Ben Finney: > > >In Python, the philosophy "we're all consenting adults here" applies.< > > Michael Foord: > > > They will use whatever they find, whether it is the best way to > > achieve a goal or not. Once they start using it they will expect us to

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Sh4wn
On 24 mei, 15:58, Ben Finney <[EMAIL PROTECTED]> wrote: > Sh4wn <[EMAIL PROTECTED]> writes: > > first, python is one of my fav languages, and i'll definitely keep > > developing with it. But, there's 1 one thing what I -really- miss: > > data hiding. I know member vars are private when you prefix t

Re: csv iterator question

2008-05-24 Thread David Jackson
Thanks, Ethan. that was a great solution. i just tested it. On Fri, May 23, 2008 at 7:08 PM, Ethan Furman <[EMAIL PROTECTED]> wrote: > davidj411 wrote: > > When you save an open file to a variable, you can re-use that variable >> for membership checking. >> it does not seem to be that way with

Re: Relationship between GUI and logic?

2008-05-24 Thread Matthew Woodcraft
David C. Ullrich <[EMAIL PROTECTED]> wrote: > Matthew Woodcraft <[EMAIL PROTECTED]> wrote: >> For example, if you were writing the 'logic' for a chess program you >> might choose a way of modelling the board that can't represent a >> position with more than one black king. And then when you got ro

for some reason the actual tries figure is not right

2008-05-24 Thread garywood
can someone explain why the tries displays the wrong number thanks orginally i started off with tries = 0 but it was off by 2 # Word Jumble # # The computer picks a random word # The player has to guess the original word can give hint import random tries = 1 # create a sequence of words to

Re: Code correctness, and testing strategies

2008-05-24 Thread David
Hi again list. > > As you come up with the corner case, write a test for it and leave the > implementation > for later. The hard part of coding is always defining your problem. Once it is > defined (by a test) the solution is just a matter of tidy work. > Is it considered to be cheating if you m

Re: need some help in serving static files inside a wsgi apps

2008-05-24 Thread Sebastian 'lunar' Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Diez B. Roggisch <[EMAIL PROTECTED]> ] >> I finally managed to work with static files with a little hack, but it's >> ugly because I'm reading each static file per request. > > How else should that work? Apache does that the same way. I guess, Apac

Re: Scipy+SQLite crashes... , was: Re: SQLite import fails sometimes ?

2008-05-24 Thread Stef Mientki
hello, through the scipy group I found a solution (no explanation yet), import sqlite3 from scipy import * solves the problem. cheers, Stef Stef Mientki wrote: John Machin wrote: Stef Mientki wrote: I don't know if this matters, but I also use sqlite3 from other than Python programs.

Re: Python, Daemons and D-Bus

2008-05-24 Thread Sebastian 'lunar' Wiesner
[ PurpleServerMonkey <[EMAIL PROTECTED]> ] > Would you use D-Bus or a more traditional IPC method such as sockets? > Although D-Bus is relatively new it looks interesting, just not sure > it would work well in this kind of project. DBus is not really intended for private communication between pro

Re: Overloading __getitem__

2008-05-24 Thread Gabriel Genellina
En Thu, 22 May 2008 20:38:39 -0300, Andreas Matthias <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] wrote: > >> actually i ddin't think about the fact that you're overloading dict, which >> can already take multiple values in getitem > > Oh, I didn't know that. I totally misinterpreted the err

Re: persistent deque version 4

2008-05-24 Thread Gabriel Genellina
En Thu, 22 May 2008 12:20:56 -0300, inhahe <[EMAIL PROTECTED]> escribió: > I thought about the fact that a decorator is merely syntactic sugar, so it > shouldn't have any closure magic that I can't make myself, and I realized > that I could have done it the following way: > > def makefunc(func): >

Re: Code correctness, and testing strategies

2008-05-24 Thread David
>> In order to get a new system working, it's nice to be able to throw >> together a set of modules quickly, and if that doesn't work, scrap it >> and try something else. There's a rule (forget where) that your first >> system will always be a prototype, regardless of intent. > > That's fine. It's

Re: Code correctness, and testing strategies

2008-05-24 Thread D'Arcy J.M. Cain
On Sat, 24 May 2008 17:51:23 +0200 David <[EMAIL PROTECTED]> wrote: > Basically, with TDD you write the tests first, then the code which > passes/fails the tests as appropriate. However, as you're writing the > code you will also think of a lot of corner cases you should also > handle. The natural

Re: Code correctness, and testing strategies

2008-05-24 Thread Patrick Mullen
I can see both sides of this argument, and I think TDD is great in some cases and not so great in others. I have used it before, but don't use it often, as the programs I write are very difficult to automatically test. (Games, which many of the bugs have to do with whether an optimization produces

Re: Code correctness, and testing strategies

2008-05-24 Thread D'Arcy J.M. Cain
On Sat, 24 May 2008 21:14:36 +0200 David <[EMAIL PROTECTED]> wrote: > Is it considered to be cheating if you make a test case which always > fails with a "TODO: Make a proper test case" message? Yes. It's better to have the daily reminder that some code needs to be finished. > While it is possib

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Benjamin Kaplan
On Sat, May 24, 2008 at 10:14 AM, Fuzzyman <[EMAIL PROTECTED]> wrote: > On May 24, 2:58 pm, Ben Finney <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > > wrote: > > Sh4wn <[EMAIL PROTECTED]> writes: > > > first, python is one of my fav languages, and i'll definitely keep > > > developing with it. But, th

Re: Code correctness, and testing strategies

2008-05-24 Thread Duncan Booth
David <[EMAIL PROTECTED]> wrote: > So, at what point do you start writing unit tests? Do you decide: > "Version 1 I am going to definitely throw away and not put it into > production, but version 2 will definitely go into production, so I > will start it with TDD?". If you are going to prototype

Newbie Question: How to use a .pth file on a Macintosh

2008-05-24 Thread Robbie
Hello All, Hopefully this is an easy question: I'd like to use a .pth file on my Macintosh so that I can easily import modules that I've created in my own working directory. I've created a file called Robbie.pth. It includes a single line: /Robbie/PythonWork I can't seem to figure out where

Re: Code correctness, and testing strategies

2008-05-24 Thread Casey McGinty
> Seriously, 10 hours of testing for code developed in 10 hours? What > > kind of environment do you write code for? This may be practical for > > large companies with hordes of full-time testing & QA staff, but not > > for small companies with just a handful of developers (and where you > > need t

Re: Code correctness, and testing strategies

2008-05-24 Thread Roy Smith
David <[EMAIL PROTECTED]> wrote: > Problem 1: You can only code against tests Yup. That's the flavor of Kool-Aide being served at a convenient TDD outlet near you. > Basically, with TDD you write the tests first, then the code which > passes/fails the tests as appropriate. However, as you're wr

Re: Code correctness, and testing strategies

2008-05-24 Thread Roy Smith
David <[EMAIL PROTECTED]> wrote: > While it is possible to describe all problems in docs, it can be very > hard to write actual test code. > > For example: sanity tests. Functions can have tests for situations > that can never occur, or are very hard to reproduce. How do you unit > test for those

Re: Why does python not have a mechanism for data hiding?

2008-05-24 Thread Paddy
On May 24, 3:14 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On May 24, 2:58 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > Sh4wn <[EMAIL PROTECTED]> writes: > > > first, python is one of my fav languages, and i'll definitely keep > > > developing with it. But, there's 1 one thing what I -really- m

Re: module import problem

2008-05-24 Thread Sebastian 'lunar' Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ Milos Prudek <[EMAIL PROTECTED]> ] > If I cd into /usr/share/python-support/python-gnupginterface and launch > Python I can "import GnuPGInterface". But when I run > DistUpgradeFetcherCore.py in that folder it always fails with No module > named Gnu

module import problem

2008-05-24 Thread Milos Prudek
I have a Kubuntu upgrade script that fails to run: File "/tmp/kde-root//DistUpgradeFetcherCore.py", line 34, in import GnuPGInterface ImportError No module named GnuPGInterface I got a folder /usr/share/python-support/python-gnupginterface with a "GnuPGInterface.py" but no __init__.py. In pyt

Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread zxo102
Hi, how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to "\xED\x6F\x3C\x01" in python coding? When I take 'ED6F3C01' as a string and insert '\x' into it, I just got the error information : invalid \x escape. Thanks. ouyang -- http://mail.python.org/mailman/listinfo/python-list

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread Sebastian 'lunar' Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ zxo102 <[EMAIL PROTECTED]> ] >how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to > "\xED\x6F\x3C\x01" in python coding? > When I take 'ED6F3C01' as a string and insert '\x' into it, I just got > the error information : invalid \x es

Re: for some reason the actual tries figure is not right

2008-05-24 Thread Gabriel Genellina
En Sat, 24 May 2008 15:32:56 -0300, garywood <[EMAIL PROTECTED]> escribió: > can someone explain why the tries displays the wrong number > thanks > orginally i started off with tries = 0 but it was off by 2 How would you count that if you were playing the game "for real"? I'd say that you start

  1   2   >