Re: lazy evaluation of a variable

2012-06-17 Thread Terry Reedy
On 6/17/2012 5:35 PM, Gelonida N wrote: I'm having a module, which should lazily evaluate one of it's variables. If you literally mean a module object, that is not possible. On the other hand, it is easy to do with class instances, via the __getattr__ special method or via properties. At

Re: Academic citation of Python

2012-06-17 Thread Curt
On 2012-06-18, Ben Finney wrote: >> > >> > Actually it's "van Rossum, Guido", not "Rossum, Guido van". The >> > "van" is part of the family name, not a middle name. It's like "da >> > Vinci, Leonardo" or "von Sydow, Max". On one occasion Guido >> > complained that Americans always get his name wro

Re: How does python bytecode works?

2012-06-17 Thread Kushal Kumaran
On Mon, Jun 18, 2012 at 1:23 AM, Devin Jeanpierre wrote: > On Sun, Jun 17, 2012 at 5:54 AM, gmspro wrote: >> >> We know python is written in C. >> C is not portable. > > Badly written C is not portable. But C is probably the most portable > language on the planet, by virtue of basically every sys

Re: Academic citation of Python

2012-06-17 Thread Ben Finney
Curt writes: > On 2012-06-16, Christian Heimes wrote: > > > > Actually it's "van Rossum, Guido", not "Rossum, Guido van". The > > "van" is part of the family name, not a middle name. It's like "da > > Vinci, Leonardo" or "von Sydow, Max". On one occasion Guido > > complained that Americans alway

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Andrew Berg
On 6/17/2012 7:07 PM, Jon Clements wrote: > I'm reminded of: > > http://xkcd.com/936/ > http://xkcd.com/792/ > > There's also one where it's pointed out it's easier to brute force a > person who has the code, than brute force the computer. [but can't find > that one at the moment] http://xkcd.

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Jon Clements
On Sun, 17 Jun 2012 23:17:37 +, Steven D'Aprano wrote: > On Mon, 18 Jun 2012 08:41:57 +1000, Chris Angelico wrote: > >> On Mon, Jun 18, 2012 at 3:06 AM, Rafael Durán Castañeda >> wrote: >>> The language Python includes a SystemRandom class that obtains >>> cryptographic grade random bits fro

Re: How does python bytecode works?

2012-06-17 Thread Dan Stromberg
On Sun, Jun 17, 2012 at 2:54 AM, gmspro wrote: > We know python is written in C. > Yes, at least CPython is. Of course, java is written in C, as are many other languages. > C is not portable. > C gives you lots of rope to hang yourself with, but if you use C well, it's more portable than anyth

Re: lazy evaluation of a variable

2012-06-17 Thread Jose H. Martinez
Another option would be to refactor your function so that it is a generator expression using the yield keyword. On Sun, Jun 17, 2012 at 7:40 PM, Peter Otten <__pete...@web.de> wrote: > Gelonida N wrote: > > > I'm having a module, which should lazily evaluate one of it's variables. > > Meaning th

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Paul Rubin
Steven D'Aprano writes: >> /dev/urandom isn't actually cryptographically secure; it promises not to >> block, even if it has insufficient entropy. But in your instance... > > Correct. /dev/random is meant to be used for long-lasting > cryptographically-significant uses, such as keys. urandom is n

Re: lazy evaluation of a variable

2012-06-17 Thread Peter Otten
Gelonida N wrote: > I'm having a module, which should lazily evaluate one of it's variables. > Meaning that it is evaluated only if anybody tries to use this variable. > > At the moment I don't know how to do this and do therefore following: > > > ### mymodule.py ### > var = None > > d

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Steven D'Aprano
On Mon, 18 Jun 2012 08:41:57 +1000, Chris Angelico wrote: > On Mon, Jun 18, 2012 at 3:06 AM, Rafael Durán Castañeda > wrote: >> The language Python includes a SystemRandom class that obtains >> cryptographic grade random bits from /dev/urandom on a Unix-like >> system, including Linux and Mac OS

Re: lazy evaluation of a variable

2012-06-17 Thread Steven D'Aprano
On Mon, 18 Jun 2012 07:44:47 +1000, Cameron Simpson wrote: > On 17Jun2012 23:35, Gelonida N wrote: | I'm having > a module, which should lazily evaluate one of it's variables. | Meaning > that it is evaluated only if anybody tries to use this variable. > > If it were an object member you could u

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Chris Angelico
On Mon, Jun 18, 2012 at 3:06 AM, Rafael Durán Castañeda wrote: > The language Python includes a SystemRandom class that obtains cryptographic > grade random bits from /dev/urandom on a Unix-like system, including Linux > and Mac OS X, while on Windows it uses CryptGenRandom. /dev/urandom isn't ac

Re: lazy evaluation of a variable

2012-06-17 Thread Cameron Simpson
On 17Jun2012 23:35, Gelonida N wrote: | I'm having a module, which should lazily evaluate one of it's variables. | Meaning that it is evaluated only if anybody tries to use this variable. If it were an object member you could use a property. Does it need to be a module global? In related news, c

lazy evaluation of a variable

2012-06-17 Thread Gelonida N
Hi, I'm not sure whether what I ask for is impossible, but would know how others handle such situations. I'm having a module, which should lazily evaluate one of it's variables. Meaning that it is evaluated only if anybody tries to use this variable. At the moment I don't know how to do thi

Re: Threads vs subprocesses

2012-06-17 Thread Cameron Simpson
On 18Jun2012 00:17, John O'Hagan wrote: | On Sat, 16 Jun 2012 13:27:45 -0400 | Dennis Lee Bieber wrote: | > Not "after each event is read" but when a new event is | > generated/inserted. The list is not a FIFO where new events are added to | > the end, but more of a priority queue where the l

Cross-platform mobile application written in Python

2012-06-17 Thread Alex Susu
Hello. I would like to point you to a project that I worked on lately: iCam, a video surveillance cross-platform mobile application (Android, Symbian, iOS, WinCE) written in Python, which uploads normally media to YouTube and Picasa. The project can be found at http://code.google.com/p/icam-mob

Re: How does python bytecode works?

2012-06-17 Thread Devin Jeanpierre
On Sun, Jun 17, 2012 at 5:54 AM, gmspro wrote: > > We know python is written in C. > C is not portable. Badly written C is not portable. But C is probably the most portable language on the planet, by virtue of basically every system having a C compiler backend. The issue is that a lot of people

[ANNC] vbot-0.3

2012-06-17 Thread Lee Harr
vBot is a visual programming game.     Use a small set of command tiles to build a program.     The program must control the vBot and make it activate     every target using the limited command set. It is meant to be an easy environment for introducing     some programming concepts to beginning p

Re: How does python bytecode works?

2012-06-17 Thread Terry Reedy
On 6/17/2012 5:54 AM, gmspro wrote: We know python is written in C. Nope. The CPython Python interpreter is written in (as portable as possible) C. The Jython, IronPython, and PyPy Python interpreters are written in Jave, C#, and Python respectively. Each compiles Python to something differe

Re: How can i build python3 without optimization?

2012-06-17 Thread Kev Dwyer
gmspro wrote: > I tried this: > CFLAG=-g ./configure --prefix=/home/user/localdir > > But during debugging python i get: > > (gdb)next > (gdb)print variable > (gdb)$1 = > > What should i do? > How can i get the value of a variable instead of ? > > Thanks. Maybe try: http://docs.python.org/

Re: Is that safe to use ramdom.random() for key to encrypt?

2012-06-17 Thread Rafael Durán Castañeda
El 17/06/12 06:48, Chris Angelico escribió: On Sun, Jun 17, 2012 at 2:18 PM, Steven D'Aprano wrote: Safe from what? What is your threat model? Are you worried about your little sister reading your diary? Or the NSA discovering your plans to assassinate the President? Or something in between?

How can i build python3 without optimization?

2012-06-17 Thread gmspro
I tried this: CFLAG=-g ./configure --prefix=/home/user/localdir But during debugging python i get: (gdb)next (gdb)print variable (gdb)$1 = What should i do? How can i get the value of a variable instead of ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread jmfauth
On 17 juin, 15:48, Christian Heimes wrote: > Am 17.06.2012 14:11, schrieb jmfauth: > > > I noticed this at the 3.3.0a0 realease. > > > The main motivation for this came from this: > >http://bugs.python.org/issue13748 > > > PS I saw the dev-list message. > > > PS2 Opinion, if not really useful, con

Re: Pythonic cross-platform GUI desingers ?? la Interface Builder (Re: what gui designer is everyone using)

2012-06-17 Thread Chris Angelico
On Sun, Jun 17, 2012 at 7:01 PM, Chris Fox wrote: > On 17/06/2012 03:42, Chris Angelico wrote: >> I want to promote Linux as a replacement for Windows. But I do not >> see that Linux needs to be able to run Internet Explorer in order >> to do that. Maybe when people move to a replacement, they nee

Re: Academic citation of Python

2012-06-17 Thread Curt
On 2012-06-16, Christian Heimes wrote: > > Actually it's "van Rossum, Guido", not "Rossum, Guido van". The "van" is > part of the family name, not a middle name. It's like "da Vinci, > Leonardo" or "von Sydow, Max". On one occasion Guido complained that > Americans always get his name wrong. I've

Re: Threads vs subprocesses

2012-06-17 Thread John O'Hagan
On Sat, 16 Jun 2012 13:27:45 -0400 Dennis Lee Bieber wrote: > On Sat, 16 Jun 2012 20:01:12 +1000, John O'Hagan > declaimed the following in > gmane.comp.python.general: > > > > > That looks like a possible way to do all the streams in a single thread, > > although it works a little differently

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread Christian Heimes
Am 17.06.2012 14:11, schrieb jmfauth: > I noticed this at the 3.3.0a0 realease. > > The main motivation for this came from this: > http://bugs.python.org/issue13748 > > PS I saw the dev-list message. > > PS2 Opinion, if not really useful, consistency nver hurts. We are must likely drop the ur""

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread Steven D'Aprano
On Sun, 17 Jun 2012 05:11:25 -0700, jmfauth wrote: > PS2 Opinion, if not really useful, consistency nver hurts. If you're doing something useless or harmful, why would you want to do more of it for the sake of consistency? "Consistency" requires somebody to write the code in the first place, w

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread jmfauth
On 17 juin, 13:30, Christian Heimes wrote: > Am 16.06.2012 19:36, schrieb jmfauth: > > > Please consistency. > > Python 3.3 supports the ur"" syntax just as Python 2.x: > > $ ./python > Python 3.3.0a4+ (default:4c704dc97496, Jun 16 2012, 00:06:09) > [GCC 4.6.3] on linux > Type "help", "copyright",

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread Christian Heimes
Am 16.06.2012 19:36, schrieb jmfauth: > Please consistency. Python 3.3 supports the ur"" syntax just as Python 2.x: $ ./python Python 3.3.0a4+ (default:4c704dc97496, Jun 16 2012, 00:06:09) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ur"" '' [739

Re: How does python bytecode works?

2012-06-17 Thread Kev Dwyer
gmspro wrote: > We know python is written in C. > C is not portable. > So how does python work on a webserver like apache/httpd for a python > website? How does the intermediate language communicate with server > without compiling python code? Or how does python interpreted code work > with webser

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread Serhiy Storchaka
On 16.06.12 20:36, jmfauth wrote: u'a' 'a' ur'a' 'a' Please, never use u'' in new Python 3 code. This is only for compatibility with Python 2. And Python 2 does not support ru''. -- http://mail.python.org/mailman/listinfo/python-list

How does python bytecode works?

2012-06-17 Thread gmspro
We know python is written in C. C is not portable. So how does python work on a webserver like apache/httpd for a python website? How does the intermediate language communicate with server without compiling python code? Or how does python interpreted code work with webserver for python based webs

Re: Academic citation of Python

2012-06-17 Thread Stefan Behnel
Dennis Lee Bieber, 17.06.2012 02:46: > On Sat, 16 Jun 2012 20:25:29 -0400, Terry Reedy > declaimed the following in gmane.comp.python.general: > >> Thank you for the correction. I was going by an old book (1996) he >> co-wrote that just had 'Rossum' on the spine. I guess that must have >> been d

Re: Pythonic cross-platform GUI desingers ?? la Interface Builder (Re: what gui designer is everyone using)

2012-06-17 Thread Chris Fox
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/06/2012 03:42, Chris Angelico wrote: > On Fri, Jun 15, 2012 at 7:47 AM, Dietmar Schwertberger > wrote: >> The point is, that if you want to promote Python as replacement >> for e.g. VB, Labview etc., then an easy-to-use GUI builder is >> requi