pydoc errors

2010-02-24 Thread john maclean
python version is 2.6.2 does any one else have this issue? Seen a few closed tickets for various Linux Distros but it is obvoiusly still my problem. help> modules Please wait a moment while I gather a list of all available modules... dm.c: 1640: not running as root returning empty list ** (.:8

Re: Creating variables from dicts

2010-02-24 Thread Gregory Ewing
Luis M. González wrote: I still don't understand why is it a bad idea in the case of globals(). This is the only way I know to define variables programatically in the top-level namespace, without having to do it manually one by one. The point is that creating variables whose names are computed

Re: while loop with the condition used in the body

2010-02-24 Thread Gregory Ewing
Ulrich Eckhardt wrote: so why not: while as : ... and also: if as : ... This sort of thing has been suggested repeatedly in the past, and it's always been rejected. That's not likely to change. Look up the past threads for the reasons why. -- Greg -- http://mail.python.or

Re: scope of generators, class variables, resulting in global na

2010-02-24 Thread Arnaud Delobelle
dontspamleo writes: > @Arnaud: I tried to find your earlier post -- googled "Arnaud lambda" > -- but couldn't. I remembered after posting that I sent this to python-ideas. Here is the first message in the thread: http://mail.python.org/pipermail/python-ideas/2007-December/001260.html In this t

Re: When will Java go mainstream like Python?

2010-02-24 Thread sjdevn...@yahoo.com
On Feb 24, 8:05 pm, Lawrence D'Oliveiro wrote: > In message , Wanja Gayk wrote: > > > Reference counting is about the worst technique for garbage collection. > > It avoids the need for garbage collection. That's like saying that driving a VW Beetle avoids the need for an automobile. Reference co

Regular expression issue

2010-02-24 Thread Ashok Prabhu
Hi, The following is a sample of my problem. I get input from user and store it in variable 'b'. I want to match the user input with the contents of another variable 'a'. However I m not able to get the exact match. Could someone help? >>> print a c c+ >>> b 'c+' >>> re.search(b,a).group() 'c'

Re: Executable problem - correction

2010-02-24 Thread Gib Bogle
Sean DiZazzo wrote: On Feb 24, 9:22 pm, Gib Bogle wrote: The program doesn't fail with the write error on the other XP machine, it actually fails to execute at all, complaining about the configuration information. Therefore I'm seeing different behaviour on three XP machines: Box 1 (SP2): run

Re: Use eval() safely?

2010-02-24 Thread Gregory Ewing
Steven D'Aprano wrote: Not that I don't believe you (I do!) but could you demonstrate for the record? I posted a demonstration of this earlier in this thread. The key thing is the __subclasses__() method of a class. You can start with any object, work your way up the base class chain to object

Re: Executable problem - correction

2010-02-24 Thread Sean DiZazzo
On Feb 24, 9:22 pm, Gib Bogle wrote: > The program doesn't fail with the write error on the other XP machine, it > actually fails to execute at all, complaining about the configuration > information.  Therefore I'm seeing different behaviour on three XP machines: > > Box 1 (SP2): runs OK > Box 2 (

Re: parametrizing a sqlite query

2010-02-24 Thread Sebastian Bassi
On Wed, Feb 24, 2010 at 3:41 PM, Dennis Lee Bieber wrote: >        No there isn't... The problem is that you need to put the wildcards > into the parameter instead of the placeholder. Thank you, it works now. Best, SB -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between (Verify) Python and win7?

2010-02-24 Thread Tim Roberts
"W. eWatson" wrote: >Maybe someone could verify my result? > >open file >read file line >print line >close file > >data 1234 > >Execute it in a folder > >Create another folder and copy the program to it. >put in a new data file as > >data 4567 > >Execute the copied program >Does it give >data1234

Re: Executable problem - correction

2010-02-24 Thread Gib Bogle
The program doesn't fail with the write error on the other XP machine, it actually fails to execute at all, complaining about the configuration information. Therefore I'm seeing different behaviour on three XP machines: Box 1 (SP2): runs OK Box 2 (SP3): fails to start Box 3 (SP3): starts up, a

Re: Docstrings considered too complicated

2010-02-24 Thread Jack Diederich
On Wed, Feb 24, 2010 at 4:54 PM, Jonathan Gardner wrote: > On Wed, Feb 24, 2010 at 12:23 PM, Andreas Waldenburger > wrote: >> >> Now my question is this: How do I kill these people without the >> authorities thinking they didn't deserve it? >> > > kill -9 seems to work for me. kill -1 -1 Back i

Re: Executable problem - socket?

2010-02-24 Thread Gib Bogle
MRAB wrote: Gib Bogle wrote: Hi, My student has been developing a GUI (using PyQt and PyQwt) that runs a model written in Fortran and built as a DLL. She has to present on this work tomorrow. She makes an executable version of the Python code with py2exe, and the executable runs fine on her

Re: Spam from gmail

2010-02-24 Thread Steve Holden
Steven D'Aprano wrote: > On Thu, 25 Feb 2010 11:39:08 +1100, Ben Finney wrote: > >> Spam is better defined as unsolicited bulk messaging. Whether it's >> commercial in nature is irrelevant. The content is relevant only in that >> it's unsolicited by the vast majority of its many recipients. > > N

Re: Executable problem - socket?

2010-02-24 Thread MRAB
Gib Bogle wrote: Hi, My student has been developing a GUI (using PyQt and PyQwt) that runs a model written in Fortran and built as a DLL. She has to present on this work tomorrow. She makes an executable version of the Python code with py2exe, and the executable runs fine on her Vista laptop

Executable problem - socket?

2010-02-24 Thread Gib Bogle
Hi, My student has been developing a GUI (using PyQt and PyQwt) that runs a model written in Fortran and built as a DLL. She has to present on this work tomorrow. She makes an executable version of the Python code with py2exe, and the executable runs fine on her Vista laptop and my XP machine

Re: Docstrings considered too complicated

2010-02-24 Thread Roy Smith
In article , Steven D'Aprano wrote: > # Function that does stuff > def doStuff(): > while not wise(up): > yield scorn > > > which means the biggest problem is that they had the perfect opportunity > to create a useful docstring and instead f***ed it up by turning it into > a usel

Re: Easter Eggs

2010-02-24 Thread Gabriel Genellina
En Tue, 09 Feb 2010 20:40:50 -0300, Alf P. Steinbach escribió: I know 3 Python Easter Eggs, from __future__ import braces import this help( "antigravity" ) Are there more? Also try: import antigravity -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

PAPER PRESENTATIONS AND SEMIMAR TOPICS.

2010-02-24 Thread hot girl
PAPER PRESENTATIONS AND SEMIMAR TOPICS. CHECK OUR VAST PAPER PRESENTATIONS AND SEMIMAR TOPICS INCLUDING PROJECTS FOR FREE AT http://presentationsandseminars.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Spam from gmail

2010-02-24 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 25 Feb 2010 11:39:08 +1100, Ben Finney wrote: > > > Spam is better defined as unsolicited bulk messaging. Whether it's > > commercial in nature is irrelevant. The content is relevant only in > > that it's unsolicited by the vast majority of its many recipients. >

Re: Is this secure?

2010-02-24 Thread Paul Rubin
mk writes: > Anyway, the passwords for authorized users will be copied and pasted > from email into in the application GUI which will remember it for > them, so they will not have to remember and type them in. It occurs to me that you don't even need to mess with letters in that case: passwo

Re: When will Java go mainstream like Python?

2010-02-24 Thread Ben Finney
Lawrence D'Oliveiro writes: > [Reference counting] avoids the need for garbage collection. It means > I can write things like > > contents = open(filename, "r").read() > > and know the file object will be immediately closed after its contents > are returned. Not quite; it means you know that

Re: Spam from gmail

2010-02-24 Thread Steven D'Aprano
On Thu, 25 Feb 2010 11:39:08 +1100, Ben Finney wrote: > Spam is better defined as unsolicited bulk messaging. Whether it's > commercial in nature is irrelevant. The content is relevant only in that > it's unsolicited by the vast majority of its many recipients. Not quite. I've read tens of thous

Re: How to monitor memory usage within Python? (Linux)

2010-02-24 Thread MrJean1
For Linux only /Jean On Feb 24, 2:35 pm, kj wrote: > Is there some standard module for getting info about the process's > memory usage, in a Linux/Unix system? > > (I want to avoid hacks that involve, e.g., scraping ps's output.) > > Thanks! > > ~K

Re: Trouble with ftplib uploading to an FTP server

2010-02-24 Thread Sky Larking
On Feb 24, 3:56 pm, MRAB wrote: > Sky Larking wrote: > > This bit of code is designed to get the external IP address and > > hostname of a client , write it locally to a file, then upload to an > > FTP server. It works locally( one can see the IP number and hostname > > with a time stamp in /Users

Re: Is this secure?

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 18:23:17 +0100, mk wrote: > Anyway, the passwords for authorized users will be copied and pasted > from email into in the application GUI which will remember it for them, > so they will not have to remember and type them in. So to break your application's security model, all s

Re: Use eval() safely?

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 10:11:25 +0100, Dieter Maurer wrote: > Using functionality introduced with the class/type homogenization, it is > quite easy to get access to the "file" type (even when "__builtins__" is > disabled). Having "file", arbitrary files can be read, written, > destroyed... Not that

Re: When will Java go mainstream like Python?

2010-02-24 Thread Lawrence D'Oliveiro
In message , Wanja Gayk wrote: > Reference counting is about the worst technique for garbage collection. It avoids the need for garbage collection. It means I can write things like contents = open(filename, "r").read() and know the file object will be immediately closed after its contents a

Re: Creating variables from dicts

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 02:58:38 -0800, Luis M. González wrote: > I wonder why updating locals(), not from within a function, works (at > least in my interactive session). Because if you're in the global scope, locals() returns globals(), which is a real namespace and modifying it works. Inside a f

Re: Spam from gmail

2010-02-24 Thread Aahz
In article <874ol65ep8@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> In article <87sk8r5v2f@benfinney.id.au>, >> Ben Finney wrote: >>> >>>Spam is spam, not by who authors or posts it, but by its distribution >>>(to many people, e.g. via a forum like this on

Re: Spam from gmail

2010-02-24 Thread Robert Kern
On 2010-02-24 18:39 PM, Ben Finney wrote: Steve Holden writes: Spam is, at least from my point of view, UCE: unsolicited commercial e-mail. So anything that isn't commercial (like those "send these to ten of your friends" emails) isn't spam (but it might just as well be). That excludes thing

Re: compiling python question

2010-02-24 Thread Mag Gam
sorry for the vague answer. Its Linux. The configure build does not say anything actually. This is for SAGE. I managed to have it pick it up by compiling/installing tcl and tk and then recompile python On Wed, Feb 24, 2010 at 4:50 PM, Diez B. Roggisch wrote: > Am 24.02.10 03:00, schrieb Mag Ga

Re: What's the word on using """ to comment-out?

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 18:18:27 +, kj wrote: > I think I remember, early in my learning of Python, coming across the > commandment "THOU SHALT NOT USE TRIPLE-QUOTES TO COMMENT-OUT LINES OF > CODE", or something to that effect. But now I can't find it! > > Is my memory playing me a trick? > > A

Re: Spam from gmail

2010-02-24 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: > In article <87sk8r5v2f@benfinney.id.au>, > Ben Finney wrote: > >Spam is spam, not by who authors or posts it, but by its distribution > >(to many people, e.g. via a forum like this one) and its content > >(off-topic and unsolicited). […] > Moreover, by

Re: Spam from gmail

2010-02-24 Thread Ben Finney
Steve Holden writes: > Spam is, at least from my point of view, UCE: unsolicited commercial > e-mail. So anything that isn't commercial (like those "send these to > ten of your friends" emails) isn't spam (but it might just as well > be). That excludes things like the religious screeds, or any o

Re: Docstrings considered too complicated

2010-02-24 Thread Steven D'Aprano
On Wed, 24 Feb 2010 21:23:03 +0100, Andreas Waldenburger wrote: > Hi all, > > a company that works with my company writes a lot of of their code in > Python (lucky jerks). I've seen their code and it basically looks like > this: > > """Function that does stuff""" > def doStuff(): > while not

Re: Executing Python code on another computer

2010-02-24 Thread Aahz
In article , SiWi wrote: > >So I wondered if it was possible to send the Python code I'm developing >on the netbook to the workstation pc via wlan, let the script execute >on the workstation pc and write the output back on the netbook. > >Is there any possibilty to achieve that goal? Fabric migh

Re: Docstrings considered too complicated

2010-02-24 Thread John Posner
On 2/24/2010 4:54 PM, Jonathan Gardner wrote: On Wed, Feb 24, 2010 at 12:23 PM, Andreas Waldenburger wrote: Hi all, a company that works with my company writes a lot of of their code in Python (lucky jerks). I've seen their code and it basically looks like this: """Function that does stuff""

Re: Spam from gmail

2010-02-24 Thread Robert Kern
On 2010-02-24 17:01 PM, Aahz wrote: In article, Steve Holden wrote: Spam is, at least from my point of view, UCE: unsolicited commercial e-mail. So anything that isn't commercial (like those "send these to ten of your friends" emails) isn't spam (but it might just as well be). That's roughl

Re: Spam from gmail

2010-02-24 Thread Steve Holden
Neil Hodgson wrote: > Steve Holden: > >> Spam is, at least from my point of view, UCE: unsolicited commercial >> e-mail. > >Spam is more commonly defined as UBE (Unsolicited Bulk Email) of > which UCE is a large subset. Its just as much spam if its pushing a > political party or charity even

Re: Creating variables from dicts

2010-02-24 Thread Rhodri James
On Wed, 24 Feb 2010 13:41:08 -, Luis M. González wrote: This is the only way I know to define variables programatically in the top-level namespace, without having to do it manually one by one. We see requests for this a lot, and the response that's frequently missed amongst all the te

first website developed on new innovative shopping model

2010-02-24 Thread soniyaa 1111
http://www.shoppingreps.com?SourceId=1259 is the first website developed on new innovative shopping model. Group bargaining through social networking targeted towards volume discounts. It has presented a suitable platform to reflect this novel shopping idea. This concept and methodology is new to t

Re: How to make an empty generator?

2010-02-24 Thread Aahz
In article , Michael Rudolf wrote: >Am 24.02.2010 23:58, schrieb Aahz: >> >> (abbreviated "gen iter" or "geniter"). > >lol I don't know why, but this sounds like a sex toy to me ;) And I thought only smutty Americans would have that twitch. -- Aahz (a...@pythoncraft.com) <*>

Re: Upgrading Py2exe App

2010-02-24 Thread Ryan Kelly
On Wed, 2010-02-24 at 15:05 -0800, Aahz wrote: > In article , > Ryan Kelly wrote: > > > >Yes. The idea of having a "bootstrapping exe" is that actual > >application code can be swapped out without having to overwrite the > >executable file. As long as you don't change python versions, this > >a

Re: Spam from gmail

2010-02-24 Thread Neil Hodgson
Steve Holden: > Spam is, at least from my point of view, UCE: unsolicited commercial > e-mail. Spam is more commonly defined as UBE (Unsolicited Bulk Email) of which UCE is a large subset. Its just as much spam if its pushing a political party or charity even though there may be no commercial

Re: How to make an empty generator?

2010-02-24 Thread Michael Rudolf
Am 24.02.2010 23:58, schrieb Aahz: (abbreviated "gen iter" or "geniter"). lol I don't know why, but this sounds like a sex toy to me ;) Regards, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Signature-based Function Overloading in Python

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 12:42, schrieb Michael Rudolf: First: Thanks for all the replies so far, they really helped me. Am 24.02.2010 11:28, schrieb Jean-Michel Pichavant: >>> def a(x=None): if x is None: pass else: pass This is the way to do it python, and it has its advantages: 1 docstring, 1 way do do

Re: Upgrading Py2exe App

2010-02-24 Thread Aahz
In article , Ryan Kelly wrote: > >Yes. The idea of having a "bootstrapping exe" is that actual >application code can be swapped out without having to overwrite the >executable file. As long as you don't change python versions, this >allows updates to be safe against system crashes, even on plat

Re: Spam from gmail

2010-02-24 Thread Aahz
In article <87sk8r5v2f@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> >> Joan Miller is a regular poster; this is off-topic, but it's not spam. > >Non sequitur. Spam is spam, not by who authors or posts it, but by its >distribution (to many people, e.g. via a foru

Re: Spam from gmail

2010-02-24 Thread Aahz
In article , Steve Holden wrote: >Aahz wrote: >> In article <87sk8r5v2f@benfinney.id.au>, >> Ben Finney wrote: >>> a...@pythoncraft.com (Aahz) writes: Joan Miller is a regular poster; this is off-topic, but it's not spam. >>> >>> Non sequitur. Spam is spam, not by who authors or p

Re: How to make an empty generator?

2010-02-24 Thread Aahz
In article , Terry Reedy wrote: > >Confusing generators and generator functions is, well, confusing. >For future reference, and clarity of communication in Pythonland, > >generator function: function that produces a generator when called; if >python coded, its body contains 'yield'. > >generator

Re: How to monitor memory usage within Python? (Linux)

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 23:35, schrieb kj: Is there some standard module for getting info about the process's memory usage, in a Linux/Unix system? (I want to avoid hacks that involve, e.g., scraping ps's output.) http://code.google.com/p/pympler/ Diez -- http://mail.python.org/mailman/listinfo/python-li

ANN: Pyrex 0.9.8.6

2010-02-24 Thread Greg Ewing
Pyrex 0.9.8.6 is now available: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ Numerous bug fixes and a few improvements. See the CHANGES page on the web site for details. What is Pyrex? -- Pyrex is a language for writing Python extension modules. It lets you freely m

Re: What's the word on using """ to comment-out?

2010-02-24 Thread CM
> After all, from what I've seen since then, the practice of > triple-quote-commenting (or TQC, pardon the TCA) is in fact quite > common. > > Is TQC OK after all? > > If not, what's the case against it? I have no sense of how approved it is, and don't have a strong opinion on it, but I would thin

Re: scope of generators, class variables, resulting in global na

2010-02-24 Thread dontspamleo
Hi Folks, Thanks everyone for the great contributions! I understand this better now. The distinction between a shorthand for a function definition and a shorthand for a loop iteration is crucial. Also: thanks for pointing out the even the list comprehension doesn't work in py3. That was incredibl

How to monitor memory usage within Python? (Linux)

2010-02-24 Thread kj
Is there some standard module for getting info about the process's memory usage, in a Linux/Unix system? (I want to avoid hacks that involve, e.g., scraping ps's output.) Thanks! ~K -- http://mail.python.org/mailman/listinfo/python-list

Re: Files required for porting python

2010-02-24 Thread Gib Bogle
KIRAN wrote: "I see lot of code with several files." I had to laugh at this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem creating executable, with PyQwt

2010-02-24 Thread Gib Bogle
David Boddie wrote: On Tuesday 23 February 2010 05:32, Gib Bogle wrote: David Boddie wrote: I have previously referred people with py2exe/PyQt issues to this page on the PyQt Wiki: http://www.py2exe.org/index.cgi/Py2exeAndPyQt If you can somehow convince py2exe to include the QtSvg module

Re: Spam from gmail

2010-02-24 Thread Arnaud Delobelle
a...@pythoncraft.com (Aahz) writes: > In article <87sk8r5v2f@benfinney.id.au>, > Ben Finney wrote: >>a...@pythoncraft.com (Aahz) writes: >>> >>> Joan Miller is a regular poster; this is off-topic, but it's not spam. >> >>Non sequitur. Spam is spam, not by who authors or posts it, but by its

Re: compiling python question

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 03:00, schrieb Mag Gam: I am trying to compile python with Tk bindings. Do I need to do anything special for python to detect and enable Tk? What OS? What does the configure/build process say? Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Docstrings considered too complicated

2010-02-24 Thread Jonathan Gardner
On Wed, Feb 24, 2010 at 12:23 PM, Andreas Waldenburger wrote: > Hi all, > > a company that works with my company writes a lot of of their code in > Python (lucky jerks). I've seen their code and it basically looks like > this: > > """Function that does stuff""" > def doStuff(): >    while not wise

Re: python dowload

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 00:08, schrieb monkeys paw: On 2/23/2010 3:17 PM, Tim Chase wrote: monkeys paw wrote: I used the following code to download a PDF file, but the file was invalid after running the code, is there problem with the write operation? import urllib2 url = 'http://www.whirlpoolwaterheaters

Re: Why tarfile.TarFile.gzopen is not in the online documentation?

2010-02-24 Thread Terry Reedy
On 2/24/2010 5:14 AM, Lars Gustäbel wrote: On Wed, Feb 24, 2010 at 09:37:19AM +0100, Baptiste Lepilleur wrote: I stumbled uppon this and find it somewhat odd: some class methods of TarFile and TarInfo do not appears in either the online documentation or search while they have a doc string: http

Re: Help with lambda

2010-02-24 Thread News123
Jonathan Gardner wrote: > On Feb 18, 4:28 am, lallous wrote: >> f = [lambda x: x ** n for n in xrange(2, 5)] > > This is (pretty much) what the above code does. > f = [] n = 2 f.append(lambda x: x**n) n = 3 f.append(lambda x: x**n) n = 4 f.append(lambda x: x**n

Re: Is this secure?

2010-02-24 Thread Michael Rudolf
Am 24.02.2010 21:06, schrieb mk: I just posted a comparison with calculating std deviations for various methods - using os.urandom, SystemRandom.choice with seeding and without seeding. I saw them They all seem to have slightly different distributions. No they don't. Just run those tests a

Re: Spam from gmail

2010-02-24 Thread Steve Holden
Aahz wrote: > In article <87sk8r5v2f@benfinney.id.au>, > Ben Finney wrote: >> a...@pythoncraft.com (Aahz) writes: >>> Joan Miller is a regular poster; this is off-topic, but it's not spam. >> Non sequitur. Spam is spam, not by who authors or posts it, but by its >> distribution (to many peopl

Re: Trouble with ftplib uploading to an FTP server

2010-02-24 Thread MRAB
Sky Larking wrote: This bit of code is designed to get the external IP address and hostname of a client , write it locally to a file, then upload to an FTP server. It works locally( one can see the IP number and hostname with a time stamp in /Users/admin/Documents) , but when the file is opened o

Re: When will Java go mainstream like Python?

2010-02-24 Thread Wanja Gayk
Am 24.02.2010, 00:22 Uhr, schrieb Lawrence D'Oliveiro : Java - The JVM code been hacked to death by Sun engineers (optimised) Python - The PVM code has seen speed-ups in Unladen or via Pyrex.. ad-infinitum but nowhere as near to JVM Python is still faster, though. In synthetic microbenchma

Docstrings considered too complicated

2010-02-24 Thread Andreas Waldenburger
Hi all, a company that works with my company writes a lot of of their code in Python (lucky jerks). I've seen their code and it basically looks like this: """Function that does stuff""" def doStuff(): while not wise(up): yield scorn Now my question is this: How do I kill these people

Re: Is this secure?

2010-02-24 Thread Paul Rubin
mk writes: > def rand_str_custom(n): > s = os.urandom(n) > return ''.join([chr(ord('a') + ord(x) % 26) for x in s if ord(x) < 234]) Note that simply throws away some of the chars. You have to replace them, not throw them away. > rand_str_SystemRandom_seeding > mean 3845.15384615 std dev

Re: Artificial Neural Networks recommendation

2010-02-24 Thread Andrew Davison
On Feb 24, 1:49 pm, Gereon Kaiping wrote: > - - PyNN (just a builder, requires external simulator) > –http://neuralensemble.org/trac/PyNN/ > - - Con-x (part of pyro) –http://pyrorobotics.org/?page=Conx > - - PyNeurGen (includes genetic algorithms) –http://pyneurgen.sourceforge.net/ > - - ffnet (o

Re: Is this secure?

2010-02-24 Thread Robert Kern
On 2010-02-24 14:02 PM, mk wrote: It would appear that SystemRandom().choice is indeed best (in terms of how much the counts stray from mean in std devs), but only after seeding it with os.urandom. Calling random.seed() does not affect SystemRandom() whatsoever. You are getting perfectly acce

Trouble with ftplib uploading to an FTP server

2010-02-24 Thread Sky Larking
This bit of code is designed to get the external IP address and hostname of a client , write it locally to a file, then upload to an FTP server. It works locally( one can see the IP number and hostname with a time stamp in /Users/admin/Documents) , but when the file is opened on the server after it

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 20:30, Michael Rudolf wrote: The reason is 256 % 26 != 0 256 mod 26 equals 22, thus your code is hitting a-v about 10% (256/26 is approx. 10) more often than w-z. writing secure code is hard... So true. That's why one should stick to standard libs when it comes to crypto or secu

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 20:19, Robert Kern wrote: On 2010-02-24 13:09 PM, mk wrote: On 2010-02-24 20:01, Robert Kern wrote: I will repeat my advice to just use random.SystemRandom.choice() instead of trying to interpret the bytes from /dev/urandom directly. Oh I hear you -- for production use I would (

Re: Is this secure?

2010-02-24 Thread Michael Rudolf
Am 24.02.2010 19:35, schrieb mk: On 2010-02-24 18:56, Michael Rudolf wrote: The reason is 256 % 26 != 0 256 mod 26 equals 22, thus your code is hitting a-v about 10% (256/26 is approx. 10) more often than w-z. writing secure code is hard... So true. That's why one should stick to standard l

Re: Is this secure?

2010-02-24 Thread Paul Rubin
mk writes: > So I have little in the way of limitations of password length ...> > The main application will access the data using HTTP (probably), so > the main point is that an attacker is not able to guess passwords > using brute force. If it's HTTP instead of HTTPS and you're sending the passw

Re: Is this secure?

2010-02-24 Thread Robert Kern
On 2010-02-24 13:16 PM, mk wrote: On 2010-02-24 20:01, Robert Kern wrote: I will repeat my advice to just use random.SystemRandom.choice() instead of trying to interpret the bytes from /dev/urandom directly. Out of curiosity: def gen_rand_string(length): prng = random.SystemRandom() chars = [

Re: What's the word on using """ to comment-out?

2010-02-24 Thread Aahz
In article , kj wrote: > >I think I remember, early in my learning of Python, coming across the >commandment "THOU SHALT NOT USE TRIPLE-QUOTES TO COMMENT-OUT LINES OF >CODE", or something to that effect. But now I can't find it! > >Is my memory playing me a trick? Possibly. I certainly do that

Re: Spam from gmail

2010-02-24 Thread Aahz
In article <87sk8r5v2f@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> >> Joan Miller is a regular poster; this is off-topic, but it's not spam. > >Non sequitur. Spam is spam, not by who authors or posts it, but by its >distribution (to many people, e.g. via a foru

Re: Is this secure?

2010-02-24 Thread Paul Rubin
Robert Kern writes: > I will repeat my advice to just use random.SystemRandom.choice() > instead of trying to interpret the bytes from /dev/urandom directly. SystemRandom is something pretty new so I wasn't aware of it. But yeah, if I were thinking more clearly I would have suggested os.urandom

Re: Is this secure?

2010-02-24 Thread Robert Kern
On 2010-02-24 13:09 PM, mk wrote: On 2010-02-24 20:01, Robert Kern wrote: I will repeat my advice to just use random.SystemRandom.choice() instead of trying to interpret the bytes from /dev/urandom directly. Oh I hear you -- for production use I would (will) certainly consider this. However, n

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 20:01, Robert Kern wrote: I will repeat my advice to just use random.SystemRandom.choice() instead of trying to interpret the bytes from /dev/urandom directly. Out of curiosity: def gen_rand_string(length): prng = random.SystemRandom() chars = [] for i in range(length

Re: What's the word on using """ to comment-out?

2010-02-24 Thread mk
Get a decent editor, like PyScripter, and press Ctrl-' (toggle comment). Regards, mk -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 20:01, Robert Kern wrote: I will repeat my advice to just use random.SystemRandom.choice() instead of trying to interpret the bytes from /dev/urandom directly. Oh I hear you -- for production use I would (will) certainly consider this. However, now I'm interested in the problem i

Re: What's the word on using """ to comment-out?

2010-02-24 Thread rantingrick
On Feb 24, 12:18 pm, kj wrote: > I think I remember, early in my learning of Python, coming across > the commandment "THOU SHALT NOT USE TRIPLE-QUOTES TO COMMENT-OUT > LINES OF CODE", or something to that effect.  But now I can't find > it! Your going to get many opinions on this subject but my s

Re: Is this secure?

2010-02-24 Thread Robert Kern
On 2010-02-24 12:35 PM, mk wrote: While with this: def gen_rand_word(n): with open('/dev/urandom') as f: return ''.join([chr(ord('a') + ord(x) % 26) for x in f.read(n) if ord(x) < 235]) a 3852 ... 1. I'm systematically getting 'a' outlier: have no idea why for now. 2. This is somewhat bett

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 18:56, Michael Rudolf wrote: The reason is 256 % 26 != 0 256 mod 26 equals 22, thus your code is hitting a-v about 10% (256/26 is approx. 10) more often than w-z. writing secure code is hard... I'm going to switch to PHP: Python world wouldn't lose much, but PHP would gain a lo

Re: Noob raw_input question

2010-02-24 Thread Abigail
Thank You -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob raw_input question

2010-02-24 Thread Steve Holden
Abigail wrote: > Yesterday I downloaded and installed Python 3.1 and working through some > examples but I have hit a problem > a = raw_input("Enter a number" ) > Traceback (most recent call last): > File "", line 1, in > a = raw_input("Enter a number" ) > NameError: name 'raw_input'

Re: Noob raw_input question

2010-02-24 Thread John Posner
On 2/24/2010 12:39 PM, Abigail wrote: Yesterday I downloaded and installed Python 3.1 and working through some examples but I have hit a problem a = raw_input("Enter a number" ) Traceback (most recent call last): File "", line 1, in a = raw_input("Enter a number" ) NameError: name 'raw

Re: Noob raw_input question

2010-02-24 Thread Robert Kern
On 2010-02-24 11:39 AM, Abigail wrote: Yesterday I downloaded and installed Python 3.1 and working through some examples but I have hit a problem a = raw_input("Enter a number" ) Traceback (most recent call last): File "", line 1, in a = raw_input("Enter a number" ) NameError: name 'ra

What's the word on using """ to comment-out?

2010-02-24 Thread kj
I think I remember, early in my learning of Python, coming across the commandment "THOU SHALT NOT USE TRIPLE-QUOTES TO COMMENT-OUT LINES OF CODE", or something to that effect. But now I can't find it! Is my memory playing me a trick? After all, from what I've seen since then, the practice of

Re: Noob raw_input question

2010-02-24 Thread Chris Rebert
On Wed, Feb 24, 2010 at 9:39 AM, Abigail wrote: > Yesterday I downloaded and installed Python 3.1 and working through some > examples but I have hit a problem > a = raw_input("Enter a number" ) > Traceback (most recent call last): >  File "", line 1, in >    a = raw_input("Enter a number" )

Re: parametrizing a sqlite query

2010-02-24 Thread Diez B. Roggisch
Am 24.02.10 18:07, schrieb Sebastian Bassi: c.execute("SELECT bin FROM bins WHERE qtl LIKE '%:keys%'",{'keys':keywords}) This query returns empty. When it is executed, keywords = 'harvest'. To check it, I do it on the command line and it works as expected: sqlite> SELECT bin FROM bins WHERE qt

Re: Is this secure?

2010-02-24 Thread mk
On 2010-02-24 18:59, Steve Holden wrote: Aw shucks when will I learn to do the stuff in 3 lines well instead of 20, poorly. :-/ When you've got as much experience as Paul? And how much experience does Paul have? (this is mostly not a facile question) For my part, my more serious effort (o

Noob raw_input question

2010-02-24 Thread Abigail
Yesterday I downloaded and installed Python 3.1 and working through some examples but I have hit a problem >>> a = raw_input("Enter a number" ) Traceback (most recent call last): File "", line 1, in a = raw_input("Enter a number" ) NameError: name 'raw_input' is not defined>>>a = raw_input

Re: Is this secure?

2010-02-24 Thread Michael Rudolf
Am 24.02.2010 18:23, schrieb mk: Even then I'm not getting completely uniform distribution for some reason: d 39411 l 39376 f 39288 a 39275 s 39225 r 39172 p 39159 t 39073 k 39071 u 39064 e 39005 o 39005 n 38995 j 38993 h 38975 q 38958 c 38938 b 38906 g 38894 i 38847 m 38819 v 38712 z 35321 y 352

Re: Is this secure?

2010-02-24 Thread Steve Holden
mk wrote: > On 2010-02-24 03:50, Paul Rubin wrote: >> The stuff about converting 4 random bytes to a decimal string and then >> peeling off 2 digits at a time is pretty awful, and notice that since >> 2**32 is 4294967296, in the cases where you get 10 digits, the first >> 2-digit pair is never high

  1   2   >