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

2008-06-03 Thread Antoon Pardon
On 2008-06-03, Lie <[EMAIL PROTECTED]> wrote: > > Python has an extremely good design because the BDFL doesn't just > listen to everyone and create a product that tries to please > everybody, no, he listens to those that have good ideas and tells the > stupid ideas to go away and he applies a subje

Re: Help need with subprocess communicate

2008-06-03 Thread rdabane
On Jun 3, 11:23 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 3 Jun 2008 18:04:40 -0700 (PDT), [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > > > Hi Daniel, > > Thanks for your reply.. > > I've done exactly as you suggested...but I'm still having problem with >

Re: How to perform a nonblocking read from a process

2008-06-03 Thread rdabane
On Jun 3, 7:53 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On Jun 4, 3:20 am, [EMAIL PROTECTED] wrote: > > > It seems that stdout.readline() is a blocking read and it just gets > > stuck their.. > > How to fix this .. > > Threads are the simplest remedy for blocking i/o. > Threads are the simp

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

2008-06-03 Thread Ben Finney
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > On Wed, 04 Jun 2008 13:50:42 +1000, Ben Finney wrote: > > > It seems you [alex23] have a different idea of what unit testing > > is for from me. > > For me it's about finding bugs where documentation and > implementation disagree. Where "do

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

2008-06-03 Thread Marc 'BlackJack' Rintsch
On Wed, 04 Jun 2008 13:50:42 +1000, Ben Finney wrote: > alex23 <[EMAIL PROTECTED]> writes: > >> So the basic answers I'm seeing that "do just fine" are: >> >> 1. Don't test private functions. >> 2. Add functionality _to_ the private functions for testing. >> 3. Change the interface for the purpo

Re: Books for programmers

2008-06-03 Thread Paul Rubin
V <[EMAIL PROTECTED]> writes: > I think that I'm interested in a more advance book, ideally one that > talk of the Python gotchas, traps, pitfall, idioms, performance, > stile, and so on. I may have missed it but I haven't seen Python in a Nutshell mentioned in this thread. -- http://mail.pytho

Re: Q about object identity

2008-06-03 Thread Marc 'BlackJack' Rintsch
On Tue, 03 Jun 2008 23:08:46 +0200, Christian Heimes wrote: > [EMAIL PROTECTED] schrieb: >> Hello, >> >> I am testing object identity. >> >> If I do it from the interpreter, I get strange results. >> > print [] is [] >> False >> > print id([]), id([]) >> 3083942700 3083942700 >> >> >

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

2008-06-03 Thread Russ P.
On Jun 3, 8:50 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > alex23 <[EMAIL PROTECTED]> writes: > > So the basic answers I'm seeing that "do just fine" are: > > > 1. Don't test private functions. > > 2. Add functionality _to_ the private functions for testing. > > 3. Change the interface for the purp

Re: python blogs

2008-06-03 Thread pythonblogs
On Jun 2, 7:43 pm, Benjamin <[EMAIL PROTECTED]> wrote: > On Jun 2, 1:49 pm, [EMAIL PROTECTED] wrote: > > > Hello! > > > It seems likePythonblogsare gaining popularity. It seems to me that > > they play a crucial role in promotingPythonas a language. > > Do you agree with that? > > > Just a few days

Supply, Cheap Dior Burberry Chanel Fendi Sunglasses & Sandals

2008-06-03 Thread cheapforwholesale555
Discount Coach Sandals, Dior Sandals, Prada Sandals, Chanel Sandals, Versace Sandals, Crocs Sandals, LV Sandals, ( G U C C I ) Sandals, Women's Sandals Men's Slippers From China Brand Sunglasses Wholesale: Discount, Prada Sunglasses Discount, D&G Sunglasses Discount, Fendi Sunglasses Discoun

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

2008-06-03 Thread Ben Finney
alex23 <[EMAIL PROTECTED]> writes: > So the basic answers I'm seeing that "do just fine" are: > > 1. Don't test private functions. > 2. Add functionality _to_ the private functions for testing. > 3. Change the interface for the purpose of testing. > > All of which seem exceptionally inefficient

Re: can python do some kernel stuff?

2008-06-03 Thread sturlamolden
On Jun 4, 12:41 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > the kernel itself, *is* kernel coding. And as wonderful as Python is, > it is *not* for kernel coding. Not in its present form, no, it would take some porting. But aside from that, is there any reason one could not embed a python inte

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-03 Thread Gabriel Genellina
En Tue, 03 Jun 2008 17:11:06 -0300, Matthew Wilson <[EMAIL PROTECTED]> escribió: I used defaultdict.fromkeys to make a new defaultdict instance, but I was surprised by behavior: >>> b = defaultdict.fromkeys(['x', 'y'], list) >>> b defaultdict(None, {'y': , 'x': }) >>> b['x']

Re: can python do some kernel stuff?

2008-06-03 Thread Ethan Furman
Andrew Lee wrote: Diez B. Roggisch wrote: Andrew Lee schrieb: Diez B. Roggisch wrote: What has that todo with kernel programming? You can use e.g. pygame to get keystrokes. Or under linux, read (if you are root) the keyboard input file - I've done that to support several keyboards attach

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-03 Thread Gabriel Genellina
En Tue, 03 Jun 2008 17:18:59 -0300, Chris <[EMAIL PROTECTED]> escribió: On Jun 3, 10:11 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: I used defaultdict.fromkeys to make a new defaultdict instance, but I was surprised by behavior:     >>> b = defaultdict.fromkeys(['x', 'y'], list)     >>> b

Re: How to perform a nonblocking read from a process

2008-06-03 Thread sturlamolden
On Jun 4, 3:20 am, [EMAIL PROTECTED] wrote: > It seems that stdout.readline() is a blocking read and it just gets > stuck their.. > How to fix this .. Threads are the simplest remedy for blocking i/o. -- http://mail.python.org/mailman/listinfo/python-list

Re: Different execution time in python code between embedded or standalone

2008-06-03 Thread Gabriel Genellina
En Tue, 03 Jun 2008 16:58:12 -0300, Pau Freixes <[EMAIL PROTECTED]> escribió: Hi list, First Hello to all, this is my and hope not end message to the list :P This last months I have been writting a program in c like to mod_python for embedding python language, it's a middleware for dispat

Re: getting an HTTP Error 500 on a form post

2008-06-03 Thread iBlaine
problem solved...changes to the python code were not necessary -- http://mail.python.org/mailman/listinfo/python-list

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

2008-06-03 Thread alex23
On Jun 4, 4:29 am, "Russ P." <[EMAIL PROTECTED]> wrote: > If you think that private data and methods should not be allowed > because they complicate unit testing, then I suggest you take a look > at how unit testing is done is C++, Java, and Ada. They seem to do > just fine. Nice to put the burden

How to make py2.5 distutil to use VC2005?

2008-06-03 Thread 甜瓜
Howdy, This problem have puzzled me for a long time. I usually use python2.5 in Windows, while VC2005 is installed. However python25.lib is compiled by VC2003. When I use disutil to build some C extensions, it complaints that there is no VC2003. Well, IMO, the format of binary files generat

Re: a python phpmyadmin like program

2008-06-03 Thread alex23
On Jun 4, 12:12 pm, Gandalf <[EMAIL PROTECTED]> wrote: > mmm, for windows... ? Do we have to do this dance every single time you ask a question? Your time (and ours) would be better invested in your learning how to search for things via Google. -- http://mail.python.org/mailman/listinfo/python-li

Re: a python phpmyadmin like program

2008-06-03 Thread Gandalf
On Jun 3, 11:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Gandalf schrieb: > > > is their any graphic program for handling sqlite like phpmyadmin or > > access in python? > > rekall? > > Diez mmm, for windows... ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling some isolated iso-8859-1 characters

2008-06-03 Thread Justin Ezequiel
On Jun 4, 2:38 am, Daniel Mahoney <[EMAIL PROTECTED]> wrote: > I'm working on an app that's processing Usenet messages. I'm making a > connection to my NNTP feed and grabbing the headers for the groups I'm > interested in, saving the info to disk, and doing some post-processing. > I'm finding a few

Re: Handling some isolated iso-8859-1 characters

2008-06-03 Thread Gabriel Genellina
En Tue, 03 Jun 2008 15:38:09 -0300, Daniel Mahoney <[EMAIL PROTECTED]> escribió: I'm working on an app that's processing Usenet messages. I'm making a connection to my NNTP feed and grabbing the headers for the groups I'm interested in, saving the info to disk, and doing some post-processing.

ANN: equivalence 0.2

2008-06-03 Thread George Sakkis
Equivalence v0.2 has been released. Also the project is now hosted at http://code.google.com/p/pyquivalence/ (the name 'equivalence' was already taken but the module is still called equivalence). Changes === - The internals were largely rewritten, but the API remained effectively intact. - A n

Re: Import, site packages, my modules, Windows vs. Linux

2008-06-03 Thread Ben Finney
John Ladasky <[EMAIL PROTECTED]> writes: > I want to know what is the *recommended* way to integrate my own > personal modules with Python. Thanks! You want the 'distutils' documentation http://www.python.org/doc/lib/module-distutils> and the documents that it references, which will lead you to

Re: printf in python

2008-06-03 Thread Gabriel Genellina
En Tue, 03 Jun 2008 10:28:57 -0300, gianluca <[EMAIL PROTECTED]> escribió: > > On Mon, 2 Jun 2008 00:32:33 -0700 (PDT), gianluca <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > > Hy, I've a problem with may python library generated with swig from C > > > code. I wor

How to perform a nonblocking read from a process

2008-06-03 Thread rdabane
Hi, I'm trying to perform following operation from inside the python script 1. Open a shell ( start a process ) 2. Send command1 to the process 3. Get output from the process 4. Send command2 to the process 5. Get output from the process .. Following is sample code : from subprocess import *

Re: Help need with subprocess communicate

2008-06-03 Thread rdabane
On Jun 3, 5:42 pm, Daniel Klein <[EMAIL PROTECTED]> wrote: > On Tue, 3 Jun 2008 14:04:10 -0700 (PDT), [EMAIL PROTECTED] wrote: > >I'm trying to perform following type of operation from inside a python > >script. > >1. Open an application shell (basically a tcl ) > >2. Run some commands on that shel

Import, site packages, my modules, Windows vs. Linux

2008-06-03 Thread John Ladasky
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. I have copies of these files in the same directory as the main program I happen to be working on at the ti

Re: Help need with subprocess communicate

2008-06-03 Thread Daniel Klein
On Tue, 3 Jun 2008 14:04:10 -0700 (PDT), [EMAIL PROTECTED] wrote: >I'm trying to perform following type of operation from inside a python >script. >1. Open an application shell (basically a tcl ) >2. Run some commands on that shell and get outputs from each command >3. Close the shell > >I could d

Re: "Faster" I/O in a script

2008-06-03 Thread Michael Torrie
kalakouentin wrote: > I use python in order to analyze my data which are in a text form. The > script is fairly simple. It reads a line form the input file, computes > what it must compute and then write it it to a buffer/list. When the > whole reading file is processed (essential all lines) then t

getting an HTTP Error 500 on a form post

2008-06-03 Thread iBlaine
I'm hoping someone here can answer my problem - I'm getting a 500 error when I run this code. What it should do is setup cookies, log in, then post a file to a form. The problem is it throws an exception at ClientCookie.urlopen(form.click()). The webserver hosting the form is fine, the python lo

Re: Ideas for master's thesis

2008-06-03 Thread MRAB
On Jun 3, 10:22 pm, Larry Bugbee <[EMAIL PROTECTED]> wrote: > > I would like to do something with this language, yet > > I don't know if there are any needs/science fields, that could be used > > as a basis for a thesis. > > Personally, I'd like to see *optional* data typing added to Python > perha

Re: parser recommendation

2008-06-03 Thread rurpy
On Jun 3, 2:55 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > I haven't given up on pyparsing, although I'm now heavily leaning > towards PLY as an end solution since lex and yacc parsing is available > on other platforms as well. Keep in mind that PLY's "compatibility" with YACC is functiona

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-03 Thread MRAB
On Jun 3, 9:11 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I used defaultdict.fromkeys to make a new defaultdict instance, but I > was surprised by behavior: > > >>> b = defaultdict.fromkeys(['x', 'y'], list) > > >>> b > defaultdict(None, {'y': , 'x': }) > > >>> b['x'] > >

Re: Ideas for master's thesis

2008-06-03 Thread Edward Bugbee
On Jun 3, 2008, at 2:35 PM, Andrii V. Mishkovskyi wrote: 2008/6/4 Larry Bugbee <[EMAIL PROTECTED]>: I would like to do something with this language, yet I don't know if there are any needs/science fields, that could be used as a basis for a thesis. Personally, I'd like to see *optional* d

Re: Keep a script running in the background

2008-06-03 Thread Guillermo
These are the basic requirements: Script A must keep a dictionary in memory constantly and script B must be able to access and update this dictionary at any time. Script B will start and end several times, but script A would ideally keep running until it's explicitly shut down. I have the feelin

Re: Constructor re-initialization issue

2008-06-03 Thread pythonreptile
On Jun 3, 12:59 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote: > > > > > Hello all, > > > I have come across this issue in Python and I cannot quite understand > > what is going on. > > > class Param(): > > def __init__(self, data={}, condition=False)

Re: Picking apart strings

2008-06-03 Thread Russ P.
On Jun 3, 11:44 am, tmallen <[EMAIL PROTECTED]> wrote: > Is there a way to pick apart this text without resorting to regular > expressions? > > p { > color: black; > > } > > p -> element > color -> property > black -> value Sure. data = txt.strip("}").split("{") element = data[0].strip() it

Re: Constructor re-initialization issue

2008-06-03 Thread Michael Mabin
Changing the default for data to None and creating a new dict inside your function might handle this. But I don't know what it is you want. It never even occurred to me that this behavior might be desired in the first place. class Param(object): def __init__(self,data=None,condition=False):

Re: Constructor re-initialization issue

2008-06-03 Thread George Sakkis
On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote: > Hello all, > > I have come across this issue in Python and I cannot quite understand > what is going on. > > class Param(): > def __init__(self, data={}, condition=False): > if condition: > data['class']="Advanced" > pri

Re: Constructor re-initialization issue

2008-06-03 Thread Mike Kent
On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote: > Hello all, > > I have come across this issue in Python and I cannot quite understand > what is going on. > > class Param(): > def __init__(self, data={}, condition=False): > if condition: > data['class']="Advanced" > prin

Re: Continuous Timer

2008-06-03 Thread Robert Dailey
I just need a repeating timer, I could care less about microsecond accuracies. On Tue, Jun 3, 2008 at 11:19 AM, John Nagle <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > >> En Fri, 30 May 2008 22:50:13 -0300, Robert Dailey <[EMAIL PROTECTED]> >> escribió: >> >> Reading through the Pytho

Constructor re-initialization issue

2008-06-03 Thread pythonreptile
Hello all, I have come across this issue in Python and I cannot quite understand what is going on. class Param(): def __init__(self, data={}, condition=False): if condition: data['class']="Advanced" print data In the previous example, I expect the variable data to

Re: a python phpmyadmin like program

2008-06-03 Thread Diez B. Roggisch
Gandalf schrieb: is their any graphic program for handling sqlite like phpmyadmin or access in python? rekall? Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Keep a script running in the background

2008-06-03 Thread Tobiah
> I need a script to keep running in the background after it's loaded > some data. It will make this data available to the main program in the > form of a dictionary, but I don't want to reload the calculated data > every time the user needs it via the main program. If it were me, I'd go with a d

Re: Ideas for master's thesis

2008-06-03 Thread Andrii V. Mishkovskyi
2008/6/4 Larry Bugbee <[EMAIL PROTECTED]>: >> I would like to do something with this language, yet >> I don't know if there are any needs/science fields, that could be used >> as a basis for a thesis. > > Personally, I'd like to see *optional* data typing added to Python > perhaps along the lines o

Re: Q about object identity

2008-06-03 Thread vronskij
On 3. Jún, 23:08 h., Christian Heimes <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > Hello, > > > I am testing object identity. > > > If I do it from the interpreter, I get strange results. > > print [] is [] > > False > > print id([]), id([]) > > 3083942700 3083942700 > >

Re: How to increase the depth of the python traceback?

2008-06-03 Thread Peter Otten
Milton wrote: > How to increase the depth of the python traceback? > > I have some code that gets an exception deep in the python logging > module and the traceback produced does not go back far enough to show > my own code. How can the traceback limit be controlled in Python 2.5. > > The docs i

Re: Ideas for master's thesis

2008-06-03 Thread Larry Bugbee
> I would like to do something with this language, yet > I don't know if there are any needs/science fields, that could be used > as a basis for a thesis. Personally, I'd like to see *optional* data typing added to Python perhaps along the lines of what was done in Pyrex. You declare the data typ

How to increase the depth of the python traceback?

2008-06-03 Thread Milton
How to increase the depth of the python traceback? I have some code that gets an exception deep in the python logging module and the traceback produced does not go back far enough to show my own code. How can the traceback limit be controlled in Python 2.5. The docs indicate that there is an attr

Re: Webpy vs Django?

2008-06-03 Thread cirfu
wow now i have django running. now i see... -- http://mail.python.org/mailman/listinfo/python-list

Re: Books for programmers

2008-06-03 Thread vasudevram
On Jun 3, 6:42 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Jun 3, 5:45 am, V <[EMAIL PROTECTED]> wrote: > > > Hi Matt, > > > and thank you very much for your answer. > > > > Hm, depends of course, how good your programming skills are in the > > > languages you knwo already, but I rely on the

Re: Q about object identity

2008-06-03 Thread Christian Heimes
[EMAIL PROTECTED] schrieb: > Hello, > > I am testing object identity. > > If I do it from the interpreter, I get strange results. > print [] is [] > False > print id([]), id([]) > 3083942700 3083942700 > > > > Why is that? Isn't this an error? No, it's not an error. You are gettin

Help need with subprocess communicate

2008-06-03 Thread rdabane
I'm trying to perform following type of operation from inside a python script. 1. Open an application shell (basically a tcl ) 2. Run some commands on that shell and get outputs from each command 3. Close the shell I could do it using communicate if I concatenate all my commands ( separated by new

help needed in subprocess communicate

2008-06-03 Thread rdabane
I'm trying to perform following type of operation from inside a python script. 1. Open an application shell (basically a tcl ) 2. Run some commands on that shell and get outputs from each command 3. Close the shell I could do it using communicate if I concatenate all my commands ( separated by ne

Q about object identity

2008-06-03 Thread vronskij
Hello, I am testing object identity. If I do it from the interpreter, I get strange results. >>> print [] is [] False >>> print id([]), id([]) 3083942700 3083942700 Why is that? Isn't this an error? If I test it in a script, all is OK. #!/usr/bin/python a = [] b = [] print a == b print

Re: parser recommendation

2008-06-03 Thread Filipe Fernandes
> On Jun 3, 12:34 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: >> On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: >> But I do have more questions... when reading the ply.py header (in >> 2.5) I found the following paragraph... >> >> # The current implementation is only

Re: parser recommendation

2008-06-03 Thread Paul McGuire
On Jun 3, 12:34 pm, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: > But I do have more questions... when reading the ply.py header (in > 2.5) I found the following paragraph... > > # The current implementation is only somewh

Re: New variable?

2008-06-03 Thread Chris
On Jun 3, 9:34 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 3:16 PM, tmallen <[EMAIL PROTECTED]> wrote: > > On Jun 3, 3:03 pm, Chris <[EMAIL PROTECTED]> wrote: > >> On Jun 3, 8:40 pm, tmallen <[EMAIL PROTECTED]> wrote: > > >> > What's the proper way to instantiate a new varia

Re: Creating object in function doesn't seem to create a new object.

2008-06-03 Thread Matimus
> I thought that when I wrote fc1 = FlightCondition() in the function it > would create a new FlightCondition object which would be passed back > every time. > Instead it seems to re-reference the old version and continue to add > to it. That is exactly what is happening. You have created a class

RE: New variable?

2008-06-03 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of tmallen > Sent: Tuesday, June 03, 2008 2:41 PM > To: python-list@python.org > Subject: New variable? > > What's the proper way to instantiate a new variable? x = ""? I've always used X

Re: defaultdict.fromkeys returns a surprising defaultdict

2008-06-03 Thread Chris
On Jun 3, 10:11 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I used defaultdict.fromkeys to make a new defaultdict instance, but I > was surprised by behavior: > >     >>> b = defaultdict.fromkeys(['x', 'y'], list) > >     >>> b >     defaultdict(None, {'y': , 'x': }) > >     >>> b['x'] >     >

defaultdict.fromkeys returns a surprising defaultdict

2008-06-03 Thread Matthew Wilson
I used defaultdict.fromkeys to make a new defaultdict instance, but I was surprised by behavior: >>> b = defaultdict.fromkeys(['x', 'y'], list) >>> b defaultdict(None, {'y': , 'x': }) >>> b['x'] >>> b['z'] -

Re: Picking apart strings

2008-06-03 Thread jay graves
On Jun 3, 1:44 pm, tmallen <[EMAIL PROTECTED]> wrote: > Is there a way to pick apart this text without resorting to regular > expressions? > > p { > color: black; > > } > > p -> element > color -> property > black -> value http://code.google.com/p/cssutils/ -- http://mail.python.org/mailman/l

Re: Merging ordered lists

2008-06-03 Thread etal
On Jun 3, 1:22 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > Yes :) > > Seriously, you are using O(n) containers and O(n) lookup where mine uses > O(1). For short lists it doesn't matter, but as the list length grows the > difference gets huge: > > $ cat unique.py > def unique(items): >     u =

Different execution time in python code between embedded or standalone

2008-06-03 Thread Pau Freixes
Hi list, First Hello to all, this is my and hope not end message to the list :P This last months I have been writting a program in c like to mod_python for embedding python language, it's a middleware for dispatch and execute python batch programs into several nodes. Now I'm writing some python

Re: New variable?

2008-06-03 Thread Dan Upton
On Tue, Jun 3, 2008 at 3:16 PM, tmallen <[EMAIL PROTECTED]> wrote: > On Jun 3, 3:03 pm, Chris <[EMAIL PROTECTED]> wrote: >> On Jun 3, 8:40 pm, tmallen <[EMAIL PROTECTED]> wrote: >> >> > What's the proper way to instantiate a new variable? x = ""? >> >> You don't need to pre-declare your variables.

Creating object in function doesn't seem to create a new object.

2008-06-03 Thread Paul Childs
Hi folks, I'll start off with the code I wrote... (ActivePython 2.4 on Windows XP SP2) --- class FlightCondition(object): lsf = [0,'Low Speed Flare'] vto = [0,'Vertical Take-Off'] def get_flight_condition(flight_data): fc1 = FlightCondition() for ro

Re: New variable?

2008-06-03 Thread tmallen
On Jun 3, 3:03 pm, Chris <[EMAIL PROTECTED]> wrote: > On Jun 3, 8:40 pm, tmallen <[EMAIL PROTECTED]> wrote: > > > What's the proper way to instantiate a new variable? x = ""? > > You don't need to pre-declare your variables. Just assign them as you > need them and they will take the correct type.

Re: New variable?

2008-06-03 Thread Chris
On Jun 3, 8:40 pm, tmallen <[EMAIL PROTECTED]> wrote: > What's the proper way to instantiate a new variable? x = ""? You don't need to pre-declare your variables. Just assign them as you need them and they will take the correct type. -- http://mail.python.org/mailman/listinfo/python-list

Shed Skin (restricted) Python-to-C++ Compiler 0.0.28

2008-06-03 Thread srepmub
Hi all, I have just released Shed Skin 0.0.28, with the following changes. Thanks to those mentioned for helping out! - basic 'socket' support (Michael Elkins) - support for os.{popen3, popen4} under UNIX (Jaroslaw Tworek) - support for time.strptime under Windows (David Marek) - options for chan

a python phpmyadmin like program

2008-06-03 Thread Gandalf
is their any graphic program for handling sqlite like phpmyadmin or access in python? thanks -- http://mail.python.org/mailman/listinfo/python-list

Picking apart strings

2008-06-03 Thread tmallen
Is there a way to pick apart this text without resorting to regular expressions? p { color: black; } p -> element color -> property black -> value -- http://mail.python.org/mailman/listinfo/python-list

New variable?

2008-06-03 Thread tmallen
What's the proper way to instantiate a new variable? x = ""? -- http://mail.python.org/mailman/listinfo/python-list

Handling some isolated iso-8859-1 characters

2008-06-03 Thread Daniel Mahoney
I'm working on an app that's processing Usenet messages. I'm making a connection to my NNTP feed and grabbing the headers for the groups I'm interested in, saving the info to disk, and doing some post-processing. I'm finding a few bizarre characters and I'm not sure how to handle them pythonically.

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

2008-06-03 Thread Russ P.
On Jun 3, 11:02 am, Richard Levasseur <[EMAIL PROTECTED]> wrote: > On Jun 3, 3:07 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > > > > > On Mon, Jun 2, 2008 at 10:50 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > >> You are not realiz

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

2008-06-03 Thread Russ P.
On Jun 3, 4:21 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 3, 1:42 am, "Russ P." <[EMAIL PROTECTED]> wrote: > > > On Jun 2, 10:23 pm, alex23 <[EMAIL PROTECTED]> wrote: > > > > Then again, I have no issue with the current convention and personally > > > find the idea of adding a "private"

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

2008-06-03 Thread sturlamolden
On Jun 2, 12:40 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > I think you completed missed the point. > > This is just a proof of concept thing. In a real example there would > of course no Set en Get methods but just methods that in the course > of their execution would access or update the hidd

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

2008-06-03 Thread Richard Levasseur
On Jun 3, 3:07 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 2, 2008 at 10:50 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > >> You are not realizing that only useful(**) thing about data hiding is > >> that some code has acc

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

2008-06-03 Thread sturlamolden
On May 24, 3:41 pm, Sh4wn <[EMAIL PROTECTED]> wrote: > 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 prefixi

Re: parser recommendation

2008-06-03 Thread Kay Schluehr
On 3 Jun., 19:34, "Filipe Fernandes" <[EMAIL PROTECTED]> wrote: > # The current implementation is only somewhat object-oriented. The > # LR parser itself is defined in terms of an object (which allows multiple > # parsers to co-exist). However, most of the variables used during table > # construc

Re: need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-03 Thread Ivan Velev
> I've tried this with Python 2.3 and 2.4 on Red Hat Enterprise Linux 4 > and can't reproduce the problem, even with other TZ values such as Thanks for the quick reply. Can you please let me know what value do you receive during your tests ? As far as I can see, Python timezone API is just a wr

Re: Merging ordered lists

2008-06-03 Thread etal
On Jun 2, 11:08 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > If the inputs were not sorted, then I don't think you have a precise > idea of what it means to merge them while preserving order.   For > example if the inputs are XYZPDQ and bYlmPz, then what does a merged > sequence look like

Re: parser recommendation

2008-06-03 Thread Filipe Fernandes
On Tue, Jun 3, 2008 at 10:41 AM, Paul McGuire <[EMAIL PROTECTED]> wrote: > If you learn both, you may find that pyparsing is a good way to > quickly prototype a particular parsing problem, which you can then > convert to PLY for performance if necessary. The pyparsing prototype > will be an effici

Data Structures - Getting started..

2008-06-03 Thread rh0dium
Hi all, I have a primitive data structure which looks like this. cells = [{'name': 'AND2X1', 'pins': [{'direction': 'input', 'name': 'A', 'type': 'signal'}, {'direction': 'input', 'name': 'B', 'type': 'signal'}, {'direction': 'output', '

Re: Keep a script running in the background

2008-06-03 Thread subeen
On Jun 3, 10:07 pm, Guillermo <[EMAIL PROTECTED]> wrote: > Hi, > > I need a script to keep running in the background after it's loaded > some data. It will make this data available to the main program in the > form of a dictionary, but I don't want to reload the calculated data > every time the use

Re: Webpy vs Django?

2008-06-03 Thread [EMAIL PROTECTED]
> i played with webpy a bit and it is easy to get going with. but django > seems like once you have it all up and running it will be easier. > just that the barrier of entry is much higher. I can't comment on webpy, but yes, Django has a bit more of a learning curve in some areas, less in others.

Re: Keep a script running in the background

2008-06-03 Thread Bjoern Schliessmann
Guillermo wrote: > I need a script to keep running in the background after it's > loaded some data. It will make this data available to the main > program in the form of a dictionary, but I don't want to reload > the calculated data every time the user needs it via the main > program. > > I won't

Re: Keep a script running in the background

2008-06-03 Thread Daniel Fetchinson
> I need a script to keep running in the background after it's loaded > some data. It will make this data available to the main program in the > form of a dictionary, but I don't want to reload the calculated data > every time the user needs it via the main program. > > I won't be working with an U

Re: ctypes, function pointers and a lot of trouble

2008-06-03 Thread Matt
The docs say CFUNCTYPE(restype, *argtypes), so: cstreamopen = CFUNCTYPE(c_uint, c_ushort, c_uint) is saying that the result type is c_uint, not void. I think you need: cstreamopen = CFUNCTYPE(None, c_uint, c_ushort, c_uint) instead. Hm, thanks, now I can access my data in the functions and

Re: Importing xlrd

2008-06-03 Thread Chanman
On Jun 2, 5:48 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 3, 8:23 am, Chanman <[EMAIL PROTECTED]> wrote: > > > This is probably a simple question to most of you, but here goes. > > I've downloaded the xlrd (version 0.6.1) module and placed in in the > > site-packages folder. Now, when I w

Re: trinity school defender

2008-06-03 Thread Paul McGuire
On Jun 3, 10:26 am, Dino Dragovic <[EMAIL PROTECTED]> wrote: > u gorenavedenom flajeru u 8. redu: > > "postoji više od 60.000 virusa i drugih štetnih programa " > > samo virusa ima nekoliko stotina tisuca, zajedno sa potencijalno stetim > aplikacijama i ostalim malicioznim kodom brojka ide preko mi

Re: Easy install / setuptools

2008-06-03 Thread John Nagle
Gabriel Genellina wrote: En Thu, 29 May 2008 06:29:00 -0300, <[EMAIL PROTECTED]> escribió: I'm trying to figure out the "best" way to distribute my own python packages. Well... don't use an egg in the first place :) "easy install" usually isn't. It tends to do the wrong thing, then le

Keep a script running in the background

2008-06-03 Thread Guillermo
Hi, I need a script to keep running in the background after it's loaded some data. It will make this data available to the main program in the form of a dictionary, but I don't want to reload the calculated data every time the user needs it via the main program. I won't be working with an UI, ho

Re: Continuous Timer

2008-06-03 Thread John Nagle
Gabriel Genellina wrote: En Fri, 30 May 2008 22:50:13 -0300, Robert Dailey <[EMAIL PROTECTED]> escribió: Reading through the Python 2.5 docs, I'm seeing a Timer class in the threading module, however I cannot find a timer object that will continuously call a function of my choice every am

Re: ThreadPoolingMixIn

2008-06-03 Thread pavel . uvarov
On Jun 3, 1:19 am, [EMAIL PROTECTED] wrote: > On Jun 2, 12:41 pm, [EMAIL PROTECTED] wrote: > > > > > On Jun 2, 7:15 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > > > Here are benchmarks for FreeBSD 6.2, amd64 > > > packet_size x y > > 0499.57 1114.54 > >10

trinity school defender

2008-06-03 Thread Dino Dragovic
u gorenavedenom flajeru u 8. redu: "postoji više od 60.000 virusa i drugih štetnih programa " samo virusa ima nekoliko stotina tisuca, zajedno sa potencijalno stetim aplikacijama i ostalim malicioznim kodom brojka ide preko milion -- http://mail.python.org/mailman/listinfo/python-list

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

2008-06-03 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 2, 6:41 am, Carl Banks <[EMAIL PROTECTED]> wrote: You are not realizing that only useful(**) thing about data hiding is that some code has access to the data, other code does not. If you "hide" data equally from everyone it's just a useless spelling change. I think y

  1   2   >