Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: If all you need is on-off - why can't you just use a switch? Because I want to control the on-off the device using a computer and write software for it (which I am confident I can do if I had references to how the wrappers to said interface). Cheers Astan.

Re: Securing a database

2009-01-22 Thread Diez B. Roggisch
kt83...@gmail.com schrieb: My company provides some services online, which now they are planning to make it offline and sell to customers who can use it in their networks. One of our major moneywinners is some data which is stored in a database. Now, this data inside the database was obtained af

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread msrachel . e
On Jan 22, 5:54 pm, Paul Rubin wrote: > Giovanni Bajo writes: > > * I'm not a native speaker, but why use the word "Counter"? > > I agree with this, the new functionality is welcome but I think > the traditional term "multiset" or "bag" would have been better. The t

Re: USB in python

2009-01-22 Thread Diez B. Roggisch
Astan Chee schrieb: Diez B. Roggisch wrote: Others suggested the parallel port. It is the natural choice for such things, with two caveats: - it is legacy, and thus often not available on modern hardware, especially on mobile ones. So if you want it be prepared to additionally buy a usb2pa

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread msrachel . e
On Jan 22, 5:41 pm, Giovanni Bajo wrote: > * I find it *very* confusing c.items() vs c.elements(). Items and > elements are synonymous (again, in my understanding of English). Would have used the term "items" but that term has a different meaning in the context of dictionaries where "items" means

Re: Adding a field to a 'foreign' object from the outside

2009-01-22 Thread Diez B. Roggisch
atleta schrieb: Hi, I'm working with a callback API (a DBus one) and I'd need to store some state between the calls somewhere. I know that it's possible to extend an object with fields after creation, so I could just store my data in the session object that is passed in with every callback. Ho

Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: Others suggested the parallel port. It is the natural choice for such things, with two caveats: - it is legacy, and thus often not available on modern hardware, especially on mobile ones. So if you want it be prepared to additionally buy a usb2parallel-adapter. -

Re: The First Law Of comp.lang.python Dynamics

2009-01-22 Thread Philip Semanchuk
On Jan 23, 2009, at 12:39 AM, Kay Schluehr wrote: Whatever sufficiently sophisticated topic was the initially discussed it ends all up in a request for removing reference counting and the GIL. Is this a variant of Godwin's Law for Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-22 Thread Diez B. Roggisch
Astan Chee schrieb: Diez B. Roggisch wrote: Astan Chee wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whate

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Carl Banks
On Jan 22, 10:15 pm, Paul Rubin wrote: > Carl Banks writes: > > 3. If you are going to use the low-level API on a mutable object, or > > are going to access the object structure directly, you need to acquire > > the object's mutex. Macros such as Py_LOCK(), Py_LOCK2(

Re: Printed Documentation

2009-01-22 Thread dr.floob
On Jan 8, 9:48 am, "Tim Arnold" wrote: > "floob" wrote in message > > news:0af87074-6d9c-41a8-98ec-501f6f37b...@s1g2000prg.googlegroups.com... > > > > >I have been searching for a way to print the official Python > > documentation into some kind of book (for my own uses).  I don't > > really care

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Paul Rubin
Carl Banks writes: > 3. If you are going to use the low-level API on a mutable object, or > are going to access the object structure directly, you need to acquire > the object's mutex. Macros such as Py_LOCK(), Py_LOCK2(), Py_UNLOCK() > would be provided. You mean every time you access a list or

free download - breve 2.7.2 : a 3D Simulation Environment for Multi-Agent Simulations and Artificial Life

2009-01-22 Thread Nick
www.filecub.com What is breve? breve is a free, open-source software package which makes it easy to build 3D simulations of multi-agent systems and artificial life. Using Python, or using a simple scripting language called steve, you can define the behaviors of agents in a 3D world and observe how

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Carl Banks
On Jan 22, 9:38 pm, Rhamphoryncus wrote: > On Jan 22, 9:38 pm, Carl Banks wrote: > > > > > On Jan 22, 6:00 am, a...@pythoncraft.com (Aahz) wrote: > > > > In article <7xd4ele060@ruckus.brouhaha.com>, > > > Paul Rubin   wrote: > > > > >alex23 writes: > > > > >> He

Re: USB in python

2009-01-22 Thread Brian Allen Vanderburg II
astan.c...@al.com.au wrote: Hi, Thanks for all the responses but I forgot to mention that I have very little hardware understanding (at least in english) and the device itself it very simple and only needs about 5V power to be active. The problem here is that I want to control when the device

Re: The First Law Of comp.lang.python Dynamics

2009-01-22 Thread Chris Rebert
On Thu, Jan 22, 2009 at 9:39 PM, Kay Schluehr wrote: > Whatever sufficiently sophisticated topic was the initially discussed > it ends all up in a request for removing reference counting and the > GIL. +1 QOTW - Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.pytho

The First Law Of comp.lang.python Dynamics

2009-01-22 Thread Kay Schluehr
Whatever sufficiently sophisticated topic was the initially discussed it ends all up in a request for removing reference counting and the GIL. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Rhamphoryncus
On Jan 22, 9:38 pm, Carl Banks wrote: > On Jan 22, 6:00 am, a...@pythoncraft.com (Aahz) wrote: > > > > > In article <7xd4ele060@ruckus.brouhaha.com>, > > Paul Rubin   wrote: > > > >alex23 writes: > > > >> Here's an article by Guido talking about the last attempt

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread James Mills
On Fri, Jan 23, 2009 at 3:22 PM, Russ P. wrote: (...) > My understanding is that the vast majority of Python software is > provided as open source. Hence, I am a bit confused by all the talk > about the need for freedom and openness in Python. If data hiding were > enforced, and you need access t

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Russ P.
On Jan 21, 4:04 am, Bruno Desthuilliers wrote: > Russ P. a écrit : > (snip) > > > Your mistake for being a moron. But it seems to happen regularly, > > doesn't it. How much more of my time are you going to waste, loser? > > Calling people names is certainly not the best way to defend your > opinio

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: > CPython's "primitive" storage management has a lot to do with the > simplicity of interfacing CPython with external libraries. Any solution > that proposes to get rid of the GIL needs to address that. This, I don't understand. Other languages like Lisp and J

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Rhamphoryncus
On Jan 22, 7:48 pm, Terry Reedy wrote: > Steven D'Aprano wrote: > > > Here's a thought experiment for you. You've suggested that the values > > returned by cmp() are allowed to change "at whim". Okay, let's do it: > > make a patch that changes cmp() to return -17, 0 or 53, and promise to > > suppo

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Russ P.
On Jan 22, 6:30 pm, Steven D'Aprano wrote: > On Thu, 22 Jan 2009 19:10:05 +, Mark Wooding wrote: > > Steven D'Aprano writes: > > >> On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: > >>> Steven D'Aprano a écrit : > But if you have free access to attributes, then *everything

Re: Logging help

2009-01-22 Thread koranthala
On Jan 22, 10:25 pm, Vinay Sajip wrote: > On Jan 22, 3:40 pm,koranthala wrote: > > > Thank you very much Vinay. You have been extremely helpful. > > This was my first design - but then I found that log system was taking > > up quite a huge chunk of the memory. > > That is why I went to rotating fi

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Carl Banks
On Jan 22, 6:00 am, a...@pythoncraft.com (Aahz) wrote: > In article <7xd4ele060@ruckus.brouhaha.com>, > Paul Rubin   wrote: > > >alex23 writes: > > >> Here's an article by Guido talking about the last attempt to remove > >> the GIL and the performance issues that

Re: does exec ignore the locals parameter?

2009-01-22 Thread Ned Deily
In article , Benjamin wrote: > On Jan 22, 6:45 pm, cburns wrote: > > In the code below, bar() seems to work, foo() seems broken. > > > > % python -V > > Python 2.6.1 > > > > % cat exec1.py > > > > def foo(i) : > >         exec "i = i + 1" in locals(), globals() > >         print "i=%d" % i > >

Re: USB in python

2009-01-22 Thread Grant Edwards
On 2009-01-23, Astan Chee wrote: > Thanks for all the responses but I forgot to mention that I have very > little hardware understanding (at least in english) and the device > itself it very simple and only needs about 5V power to be active. The > problem here is that I want to control when th

Re: Adding a field to a 'foreign' object from the outside

2009-01-22 Thread James Mills
On Fri, Jan 23, 2009 at 1:19 PM, atleta wrote: > I'm working with a callback API (a DBus one) and I'd need to store > some state between the calls somewhere. I know that it's possible to > extend an object with fields after creation, so I could just store my > data in the session object that is pa

Re: Python Style Guide Questions - Contd.

2009-01-22 Thread Aahz
In article <6tk9qqfbav8...@mid.uni-berlin.de>, Marc 'BlackJack' Rintsch wrote: > >PEP8 doesn't mention constants at all. Not true anymore. ;-) -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ Weinberg's Second Law: If builders built buildings the way programm

Re: Relax Syntax for Augmented Arithmetic?

2009-01-22 Thread Aahz
In article <87hc3un1vn.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: > > * Python augmented-assignment (`+=', for example) is inconsistent. >Depending on what type of object the left-hand side evaluates to, it >may /either/ mutate that object, /or/ assign a new value to the >

Re: What is intvar?

2009-01-22 Thread r
here is a good explanation of control vars: http://infohost.nmt.edu/tcc/help/pubs/tkinter/control-variables.html Here are 3 great Tkinter refernces in order: http://infohost.nmt.edu/tcc/help/pubs/tkinter/ http://effbot.org/tkinterbook/ http://www.pythonware.com/library/tkinter/introduction/ -- htt

Adding a field to a 'foreign' object from the outside

2009-01-22 Thread atleta
Hi, I'm working with a callback API (a DBus one) and I'd need to store some state between the calls somewhere. I know that it's possible to extend an object with fields after creation, so I could just store my data in the session object that is passed in with every callback. However it stinks fr

Re: pep 8 constants

2009-01-22 Thread Benjamin Peterson
Benjamin Kaplan case.edu> writes: > > > On Thu, Jan 22, 2009 at 1:16 AM, Aahz pythoncraft.com> wrote:In article python.org>, > Brendan Miller catphive.net> wrote:>>PEP 8 doesn't mention anything about using all caps to indicate a constant.Now it does!  Seehttp://www.python.org/dev/peps/pep-0

Re: Python 2.4 vs 2.5 - Unicode error

2009-01-22 Thread Gaurav Veda
On Jan 21, 7:08 pm, John Machin wrote: > > To replace non-ASCII characters in a UTF-8-encoded string by spaces: > | >>> u8 = ' and 25\xc2\xb0F' > | >>> u = u8.decode('utf8') > | >>> ''.join([chr(ord(c)) if c <= u'\x7f' else ' ' for c in u]) > | ' and 25 F' Thanks John for your reply. This is what

Re: A java hobbyist programmer learning python

2009-01-22 Thread Aahz
In article <7xy6x9nzwd@ruckus.brouhaha.com>, Paul Rubin wrote: >Chris Rebert writes: >>attribution deleted by Paul Rubin: >>> >>> class Calculator(): ... >> >> Delete the 3 Java-ish accessor methods; good Python style just uses >> the attributes directly (i.e. s

Re: what gives with

2009-01-22 Thread Benjamin Peterson
Darren Dale gmail.com> writes: > Judging from http://bugs.python.org/issue2400 , this issue > was fixed back in May 2008, but it is still present with python-2.5.4, > which was released in December. Why wont python-2.5 allow this kind of > import? Allowing that would be a new feature which is dis

Re: pep 8 constants

2009-01-22 Thread Steve Holden
Brian Allen Vanderburg II wrote: > bock...@virgilio.it wrote: >> Constants would be a nice addition in python, sure enough. >> But I'm not sure that this can be done without a run-time check every >> time >> the constant is used, and python is already slow enough. Maybe a check >> that is disabled

Re: Dictionary : items()

2009-01-22 Thread Benjamin
On Jan 22, 2:53 am, Paul Rubin wrote: > Steven D'Aprano writes: > > That is better written as: > > l = sorted(abcd.items(), key=lambda x:(x[1].lower(), x[0])) > > In Python 2.x, I prefer the style > >   l = sorted(abcd.iteritems(), key=lambda (k,v): (v.lower(), k)) >

Re: What is intvar?

2009-01-22 Thread Rhodri James
On Fri, 23 Jan 2009 02:38:32 -, W. eWatson wrote: I'm looking at someone's code in which invar() is used fairly often. Apparently, it's a Tkinter method. Here's a use: def body(self,master): self.title("Display Settings") self.colorVar = IntVar() Radiobu

Re: does exec ignore the locals parameter?

2009-01-22 Thread Benjamin
On Jan 22, 6:45 pm, cburns wrote: > In the code below, bar() seems to work, foo() seems broken. > > % python -V > Python 2.6.1 > > % cat exec1.py > > def foo(i) : >         exec "i = i + 1" in locals(), globals() >         print "i=%d" % i > > def bar(j) : >         exec "j = j + 1" >         prin

what gives with "'import *' not allowed with 'from .'"?

2009-01-22 Thread Darren Dale
I know the use of "from foo import *" is discouraged, but I'm writing a package that I hope others may want to integrate as a subpackage of their own projects, I know what I'm doing, and I want to use the "from .bar import *" syntax internally. It works fine with python-2.6, but with python-2.5 I g

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Terry Reedy
Steven D'Aprano wrote: Here's a thought experiment for you. You've suggested that the values returned by cmp() are allowed to change "at whim". Okay, let's do it: make a patch that changes cmp() to return -17, 0 or 53, and promise to support it for at least three years. Try to get it accepted

Re: What is intvar?

2009-01-22 Thread Chris Rebert
On Thu, Jan 22, 2009 at 6:38 PM, W. eWatson wrote: > I'm looking at someone's code in which invar() is used fairly often. > Apparently, it's a Tkinter method. Here's a use: >def body(self,master): >self.title("Display Settings") > >self.colorVar = IntVar() >Radiobutton(

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Terry Reedy
Chris Rebert wrote: On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo wrote: On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote: The collections module in Python 2.7 and Python 3.1 has gotten a new Counter class that works like bags and multisets in other languages. I've adapted it for

Spring Python 1.0.0 (RC1) is released

2009-01-22 Thread Goldfish
Spring Python takes the concepts implemented by the Java-based Spring Framework, and applies them to Python. This provides a powerful library of functionality to help you get back to writing the code that makes you money. It includes features like data access, transaction management, remoting, secu

What is intvar?

2009-01-22 Thread W. eWatson
I'm looking at someone's code in which invar() is used fairly often. Apparently, it's a Tkinter method. Here's a use: def body(self,master): self.title("Display Settings") self.colorVar = IntVar() Radiobutton( master, text="Gray Scale", value=1, v

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Thu, 22 Jan 2009 19:10:05 +, Mark Wooding wrote: > Steven D'Aprano writes: > >> On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: >>> Steven D'Aprano a écrit : But if you have free access to attributes, then *everything* is interface. >>> >>> Nope. >> >> How could a

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Benjamin Kaplan
> Hi Raymond, > > * I'm not a native speaker, but why use the word "Counter"? A "counter" > to my ear sounds like a number that is increased each time an event > occurs; the website counter, eg, comes to mind. I can understanda its > meaning probably stretches to "an object that counts", but I real

Re: A different kind of interface

2009-01-22 Thread bearophileHUGS
Marc 'BlackJack' Rintsch: > +IBQ- seems to be the way your newsreader displays the dashes that where > in Ben's posting.  I see "em dash" characters there: I see, thank you. I never finish to see all the weird things of the Web (through google groups). Bye, bearophile -- http://mail.python.org/ma

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Paul Rubin
Giovanni Bajo writes: > * I'm not a native speaker, but why use the word "Counter"? I agree with this, the new functionality is welcome but I think the traditional term "multiset" or "bag" would have been better. -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-22 Thread Astan Chee
Diez B. Roggisch wrote: Astan Chee wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the power pin is

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Chris Rebert
On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo wrote: > On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote: > >> The collections module in Python 2.7 and Python 3.1 has gotten a new >> Counter class that works like bags and multisets in other languages. >> >> I've adapted it for Python2.5

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Giovanni Bajo
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote: > The collections module in Python 2.7 and Python 3.1 has gotten a new > Counter class that works like bags and multisets in other languages. > > I've adapted it for Python2.5/2.6 so people can start using it right > away: > http://do

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Paul Rubin
Scott David Daniels writes: > Having once been a more type-A, I labored for a couple of years trying > to build a restricted language that provably terminated for work on an > object-oriented database research. I finally gave it up as a bad idea, > because, in practice, we don't care if a loop wi

Re: Formal specification and proof (was : Does Python really follow its philosophy of "Readability counts"?)

2009-01-22 Thread Paul Rubin
James Mills writes: > Ricardo's point is very well put and Safety Critical systems > that specify requirements, tangible and quantifiable requirements > are what makes a system safe and gives assurance - not the language > or the platform os the os or the environment. But it is characteristics o

does exec ignore the locals parameter?

2009-01-22 Thread cburns
In the code below, bar() seems to work, foo() seems broken. % python -V Python 2.6.1 % cat exec1.py def foo(i) : exec "i = i + 1" in locals(), globals() print "i=%d" % i def bar(j) : exec "j = j + 1" print "j=%d" % j foo(0) bar(0) % python exec1.py i=0 j=1 Wh

Re: unzip array of arrays?

2009-01-22 Thread Rhodri James
On Thu, 22 Jan 2009 22:04:15 -, Tobiah wrote: Although it's trivial to program, I wondered whether there was a builtin or particularly concise way to express this idea: a = [(1, 2), (3, 4), (5, 6)] field[a, 2] [2, 4, 6] where field() is some made up function. If field() already exists

Re: Find all available Tkinter cursor names?

2009-01-22 Thread r
Thanks Kevin, These are exactly the ones i already knew about. I was hoping there where more, shucks!. I wonder how i could go about making my own cursors and adding them to Tkinter? Have any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: A different kind of interface

2009-01-22 Thread Marc 'BlackJack' Rintsch
On Thu, 22 Jan 2009 04:17:57 -0800, bearophileHUGS wrote: > Ben Finney: > >> Many of us solve this by using a single full-featured programmer's >> editor that allows invoking a program +IBQ- written in any of *dozens >> or hundreds* of different languages +IBQ- from within the editor. > > I don'

Re: Find all available Tkinter cursor names?

2009-01-22 Thread Kevin Walzer
r wrote: Anybody know how to find all the available Tkinter cursor icon names, or where the icons are stored? like "paintbrush" "pencil" etc... http://www.tcl.tk/man/tcl8.4/TkCmd/cursors.htm -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/py

Re: Formal specification and proof (was : Does Python really follow its philosophy of "Readability counts"?)

2009-01-22 Thread James Mills
On Thu, Jan 22, 2009 at 8:42 PM, Ricardo Aráoz wrote: (...) > What I've seen engineers do when they need extra safety is to put in place > independently developed and operated redundant systems, at least three, and > the system will do whatever two of the independent systems agree on. So I > gues

To: Julian Snitow

2009-01-22 Thread SabbySF
I got this from a website and have no idea if you will get this. Since you are in charge of Anime at Boskone 46, do you know when the schedule will be published on line.For the last two years the Anime schedule was not published on line and that meant I could not do research on anime that I wa

Re: ossaudiodev problem: sawtooth noise

2009-01-22 Thread Gabriel Genellina
En Mon, 19 Jan 2009 21:57:04 -0200, Peter Pearson escribió: The following code uses ossaudiodev to read 1000 values from my sound card at a rate of 12,000 samples per second: When I select a sample rate that is not a power of 2 times 3000 samples/second, a strong and very regular sawtooth is

Re: unzip array of arrays?

2009-01-22 Thread Robert Kern
Unknown wrote: On 2009-01-22, Tobiah wrote: Although it's trivial to program, I wondered whether there was a builtin or particularly concise way to express this idea: a = [(1, 2), (3, 4), (5, 6)] field[a, 2] [2, 4, 6] where field() is some made up function. The above example is a great ap

Re: Start Python at client side from web app

2009-01-22 Thread Paul Rubin
"Diez B. Roggisch" writes: > Before posting, I tried a jQuery-ajax-call inside Firebug from some > random site to google. It bailed out with a security execption. You should be able to get around the security policy with XUL in Firefox, or with an ActiveX control in MSIE. In the Netscape Navigat

Re: Idea to support public/private.

2009-01-22 Thread Brian Allen Vanderburg II
There was a small error in setprivate/getprivate: import sys import inspect def get_private_codes(class_): codes = [] for i in class_.__dict__: value = class_.__dict__[i] if inspect.isfunction(value): codes.append(value.func_code) return codes def get_protect

Find all available Tkinter cursor names?

2009-01-22 Thread r
Anybody know how to find all the available Tkinter cursor icon names, or where the icons are stored? like "paintbrush" "pencil" etc... -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.getmtime on windows, error: 206 - path or extension too long

2009-01-22 Thread Gabriel Genellina
En Wed, 21 Jan 2009 08:50:53 -0200, mynthon escribió: I have very long path on windows and i get error when try to get modification time. So i tried do chdir path and then get file. It now gives me error that file doesn't exists [...] it works for other files so i suppose it is not my fault.

Re: unzip array of arrays?

2009-01-22 Thread Grant Edwards
On 2009-01-22, Tobiah wrote: > Although it's trivial to program, I wondered whether > there was a builtin or particularly concise way to > express this idea: > >> a = [(1, 2), (3, 4), (5, 6)] >> field[a, 2] > [2, 4, 6] > > where field() is some made up function. The above example is a great appli

Re: unzip array of arrays?

2009-01-22 Thread Chris Rebert
On Thu, Jan 22, 2009 at 2:04 PM, Tobiah wrote: > Although it's trivial to program, I wondered whether > there was a builtin or particularly concise way to > express this idea: > >> a = [(1, 2), (3, 4), (5, 6)] >> field[a, 2] > [2, 4, 6] > > where field() is some made up function. Python 2.6 (r26:

Idea to support public/private.

2009-01-22 Thread Brian Allen Vanderburg II
Okay so I don't really care about public/private but I was watching the lists (Does python follow its idea of readability or something like that) and I thought of a 'possible' way to add this support to the language. I have implemented a class which allows creating both a private as well as a

unzip array of arrays?

2009-01-22 Thread Tobiah
Although it's trivial to program, I wondered whether there was a builtin or particularly concise way to express this idea: > a = [(1, 2), (3, 4), (5, 6)] > field[a, 2] [2, 4, 6] where field() is some made up function. Thanks, Toby -- http://mail.python.org/mailman/listinfo/python-list

Re: One Bug of Python 3.0

2009-01-22 Thread Gabriel Genellina
En Fri, 16 Jan 2009 01:56:23 -0200, escribiste en el grupo gmane.comp.python.general I met a bug of CGIXMLRPCRequestHandler in Python3.0. Because of the bug, couldn't use RPC in Apache CGI. You should file a bug report at http://bugs.python.org -- Gabriel Genellina -- http://mail.python.

Re: Start Python at client side from web app

2009-01-22 Thread Rob Williscroft
Diez B. Roggisch wrote in news:6ts0dnfc9s0...@mid.uni-berlin.de in comp.lang.python: > Rob Williscroft schrieb: >> Diez B. Roggisch wrote in news:6tpo16fbacf...@mid.uni-berlin.de in >> comp.lang.python: >> 2) create a localhost web server, for the client side manipulation. Then have y

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Ricardo Aráoz
Paul Rubin wrote: > Mark Wooding writes: > >> Some people (let's call them `type A programmers') have decided that >> they want to be assisted with writing correct programs... >> Other people (`type B programmers') don't like having their (apparently? >> possibly?) correct programs rejected

Re: Mechanize hanging

2009-01-22 Thread Gabriel Genellina
En Wed, 21 Jan 2009 23:21:06 -0200, K-Dawg escribió: I am trying to use mechanize to connect and log into Yahoo! Here is my code: #c:\Python25\python import re import urllib import urllib2 import mechanize print "print1" br = mechanize.Browser() br.set_handle_robots(False) br.open("https://l

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Luis Zarrabeitia
On Thursday 22 January 2009 08:32:51 am Steven D'Aprano wrote: > And now I have accidentally broken the spam() method, due to a name clash. True, that's bad. I wish that were 'fixed'. > Besides, double-underscore names are a PITA to work with: Isn't that example the point of having self.__privat

Re: Start Python at client side from web app

2009-01-22 Thread Rob Williscroft
Thomas Guettler wrote in news:6tr453fca5h...@mid.individual.net in comp.lang.python: > Diez B. Roggisch schrieb: >> >>> 2) create a localhost web server, for the client side manipulation. >>> Then have your remote webserver render a form that posts via >>> javavscript to the localhost webserver.

Re: Executing previous stack frame

2009-01-22 Thread sturlamolden
On Jan 22, 8:47 pm, Jeff McNeil wrote: > What are you trying to accomplish? On Jan 22, 8:47 pm, Jeff McNeil wrote: > What are you trying to accomplish? While it's possible to do, I can't > believe it's going to be very safe. I am trying to implement a completely new concurrency abstraction

Re: pep 8 constants

2009-01-22 Thread Brian Allen Vanderburg II
bock...@virgilio.it wrote: Constants would be a nice addition in python, sure enough. But I'm not sure that this can be done without a run-time check every time the constant is used, and python is already slow enough. Maybe a check that is disabled when running with optimizing flags ? But I'm su

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Mark Wooding
Bruno Desthuilliers writes: > Paul Rubin a écrit : >> I'd say that Python's FP characteristics are an important part of its >> expressiveness. > > Indeed - but they do not make Python a functional language[1]. Python is > based on objects, not on functions, I'd have a good go at defining a func

Re: USB in python

2009-01-22 Thread Brian Allen Vanderburg II
astan.c...@al.com.au wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the power pin is getting). Now I

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
> That should just be Python2.6. Fixed. Now runs of Python 2.5 as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Scott David Daniels
Tim Rowe wrote: Btw, the correctness of a program (on a turing-complete language) cannot be statically proven. Ask Turing about it. For the most safety critical of programmes, for which static proof is required, restrictions are placed on the use of the language that effectively mean that it is

Re: Dealing with large memory under linux or How to Build 64bit Python

2009-01-22 Thread Martin v. Löwis
> I've got an Ubuntu (2.6.27-9-server SMP i686 GNU/Linux) setup with > 6GB RAM running python 2.5. I'm running a simulation program that is > breaking as soon as it hits ~3GB RAM even though I have plenty of RAM > free. I'm guessing that it's because my python is only 32-bit? If you do use a 32-b

Dealing with large memory under linux or How to Build 64bit Python

2009-01-22 Thread proteus...@gmail.com
I've got an Ubuntu (2.6.27-9-server SMP i686 GNU/Linux) setup with 6GB RAM running python 2.5. I'm running a simulation program that is breaking as soon as it hits ~3GB RAM even though I have plenty of RAM free. I'm guessing that it's because my python is only 32-bit? Appreciate any pointers on h

Re: Executing previous stack frame

2009-01-22 Thread Jeff McNeil
On Jan 22, 9:49 am, sturlamolden wrote: > frame = sys._getframe().f_back is the previous stack frame. Is there > any way to execute (with exec or eval) frame.f_code beginning from > frame.f_lasti or frame.f_lineno? > > I am trying to spawn a thread that is initialized with the code and > state of

Re: Start Python at client side from web app

2009-01-22 Thread Diez B. Roggisch
Rob Williscroft schrieb: Diez B. Roggisch wrote in news:6tpo16fbacf...@mid.uni-berlin.de in comp.lang.python: 2) create a localhost web server, for the client side manipulation. Then have your remote webserver render a form that posts via javavscript to the localhost webserver. The localhost

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Mark Wooding
Steven D'Aprano writes: > On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: >> Steven D'Aprano a écrit : >>> But if you have free access to attributes, then *everything* is >>> interface. >> >> Nope. > > How could anyone fail to be convinced by an argument that detailed and > carefu

Re: A different kind of interface

2009-01-22 Thread bearophileHUGS
Eduardo O. Padoan: > You are almost *describing* reinteract: - Thank you for the link and the software, I have not tried it yet, but from the screencast it looks quite nice. - I am glad that there are people that don't think that Emacs is (despite being good) the alpha and omega of editing. There'

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
> I've adapted it for Python2.5/2.6 so people can start using it right > away: That should just be Python2.6. -- http://mail.python.org/mailman/listinfo/python-list

Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
The collections module in Python 2.7 and Python 3.1 has gotten a new Counter class that works like bags and multisets in other languages. I've adapted it for Python2.5/2.6 so people can start using it right away: http://docs.python.org/dev/library/collections.html#counter-objects Here's a link

Re: Logging help

2009-01-22 Thread Vinay Sajip
On Jan 22, 3:40 pm, koranthala wrote: > Thank you very much Vinay. You have been extremely helpful. > This was my first design - but then I found that log system was taking > up quite a huge chunk of the memory. > That is why I went to rotating file handler. Using just plain FileHandler takes up

Re: what's the point of rpython?

2009-01-22 Thread Ross Ridge
Ross Ridge writes: > The same cache coherency mechanism that prevents ordinary "unlocked" > instructions from simulanteously modifying the same cache line on > two different processors also provides the guarantee with "locked" > instructions. There's no additional hardware locks involved, and no

Re: A different kind of interface

2009-01-22 Thread Terry Reedy
Steve Holden wrote: Doug Morse wrote: On Thu, 22 Jan 2009 08:13:49 -0800 (PST), Vic Kelson wrote: How about IDLE? It's a nice tool for the Python programmer. I've tried lots of IDEs, but when it comes down to it, on small-to-medium jobs I am be very productive indeed using IDLE... Since I

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Thu, 22 Jan 2009 10:33:26 +0100, Bruno Desthuilliers wrote: >> >>> Steven D'Aprano a écrit : On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote: > Russ P. a écrit : > (sni

Re: pep 8 constants

2009-01-22 Thread Terry Reedy
Benjamin Kaplan wrote: On Thu, Jan 22, 2009 at 1:16 AM, Aahz > wrote: In article mailto:mailman.7174.1231915778.3487.python-l...@python.org>>, Brendan Miller mailto:catph...@catphive.net>> wrote: > >PEP 8 doesn't mention anything about using all

Re: Python Style Question

2009-01-22 Thread Terry Reedy
Steve Holden wrote: K-Dawg wrote: I am trying to become more pythonic as I learn python and get my mind around it instead of other languages I have used. I have an app that has a series of classes for objects it uses. From a style perspective, which should be done: Different py file for each

Re: A different kind of interface

2009-01-22 Thread Eduardo O. Padoan
On Thu, Jan 22, 2009 at 7:10 AM, wrote: > I use the Python shell daily, plus of course normal editors to edit > python scripts. They both are very useful for different purposes. But > the default interactive shell isn't much handy if you want to modify > the past code to run it again, or you want

Re: A different kind of interface

2009-01-22 Thread Steve Holden
Doug Morse wrote: > On Thu, 22 Jan 2009 08:13:49 -0800 (PST), Vic Kelson > wrote: >> >> How about IDLE? It's a nice tool for the Python programmer. I've tried >> lots of IDEs, but when it comes down to it, on small-to-medium jobs I >> am be very productive indeed using IDLE... >> >> --v > >

  1   2   >