Re: Soemthing wrong w/ urllib module or something.

2007-09-05 Thread Lamonte Harris
Anyone got an answer for this? On 9/3/07, Lamonte Harris <[EMAIL PROTECTED]> wrote: > > Yeah I can browse it like normal. For some reason though my News System > that worked like a charm just stopped working also. Is there any > alternatives that I could try to use to POST to a PHP script? > > O

Re: PythonAlley.com

2007-09-05 Thread dkeeney
The Python community would benefit from a moderated web-forum along the lines of perlmonks.org. The Python community online now seems to have two major segments, the c.l.p newsgroup (here), and a large selection of blogs. C.l.p is unmoderated and often hostile. The bloggers self-moderate reason

Module for mod_python

2007-09-05 Thread rieh25
I've been thinking about a module (actually I have it partially implemented in Zope), that would do the following things: - Read the structure of a MySql database (fill a dictionary with it) In order to: - Quickly create detail/filter/update forms given a table name (without specifying the fiel

Re: So what exactly is a complex number?

2007-09-05 Thread Bjoern Schliessmann
Grzegorz S?odkowicz wrote: > In fact, a proper vector in physics has 4 features: point of > application, magnitude, direction and sense. No -- a vector has the properties "magnitude" and direction. Although not everything that has magnitude and direction is a vector. It's very unusual to have a

Re: PythonAlley.com

2007-09-05 Thread Danyelle Gragsone
Hey, I would tool around other python sites.. look for anything you would like to see or maybe improve on. Danyelle -- http://mail.python.org/mailman/listinfo/python-list

python-spidermonkey

2007-09-05 Thread zowtar
Guys, I am using slackware... js-spidermonkey 1.5 compiled - OK, Pyrex installed, but python-spidermonkey don't build... Screenshot: http://img406.imageshack.us/img406/562/testebp5.png what is the problem? zowtar -- http://mail.python.org/mailman/listinfo/python-list

Re: So what exactly is a complex number?

2007-09-05 Thread Bjoern Schliessmann
Grzegorz S?odkowicz wrote: > I believe vectors can only be added if they have the same point of > application. That may be true in physical observations, but doesn't make "point of application" a vector property. If you had it as property, you could never say that in a force field the force was e

Re: Soemthing wrong w/ urllib module or something.

2007-09-05 Thread Daniel Larsson
Are you using http proxying when you browse to the server? Have you tried to do $ curl http://DOMAINHERE/ If that works, connecting with a plain socket should work too. Otherwise, I believe urllib has support for a proxying server, check the docs. On 9/5/07, Lamonte Harris <[EMAIL PROTECTED]> wr

Re: python-spidermonkey

2007-09-05 Thread Diez B. Roggisch
zowtar schrieb: > Guys, I am using slackware... js-spidermonkey 1.5 compiled - OK, Pyrex > installed, but python-spidermonkey don't build... > > Screenshot: http://img406.imageshack.us/img406/562/testebp5.png > > what is the problem? google dead today? http://article.gmane.org/gmane.comp.python

Re: PythonAlley.com

2007-09-05 Thread Francesco Guerrieri
On 9/5/07, dkeeney <[EMAIL PROTECTED]> wrote: > > > The Python community would benefit from a moderated web-forum along > the lines of > perlmonks.org. > > The Python community online now seems to have two major segments, the > c.l.p newsgroup (here), > and a large selection of blogs. C.l.p is unm

Re: python-spidermonkey

2007-09-05 Thread zowtar
Diez B. Roggisch escreveu: > zowtar schrieb: > > Guys, I am using slackware... js-spidermonkey 1.5 compiled - OK, Pyrex > > installed, but python-spidermonkey don't build... > > > > Screenshot: http://img406.imageshack.us/img406/562/testebp5.png > > > > what is the problem? > > google dead today?

Re: PythonAlley.com

2007-09-05 Thread Diez B. Roggisch
dkeeney schrieb: > The Python community would benefit from a moderated web-forum along > the lines of > perlmonks.org. > > The Python community online now seems to have two major segments, the > c.l.p newsgroup (here), > and a large selection of blogs. C.l.p is unmoderated and often > hostile. T

Re: Looping through File Question

2007-09-05 Thread Thomas Nelson
> > > On Sep 5, 8:58 pm, planetmatt <[EMAIL PROTECTED]> wrote: > > > > > I am a Python beginner. I am trying to loop through a CSV file which > > > > I can do. What I want to change though is for the loop to start at > > > > row 2 in the file thus excluding column headers. The DictReader object

Re: Text processing and file creation

2007-09-05 Thread kyosohma
On Sep 5, 11:57 am, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > I would use a counter in a for loop using the readline method to > > iterate over the 20,000 line file. > > file objects are iterables themselves, so there's no need to do that > by using a method. Very true! Darn it!

Re: PythonAlley.com

2007-09-05 Thread Bruno Desthuilliers
dkeeney a écrit : (snip) > The Python community online now seems to have two major segments, the > c.l.p newsgroup (here), > and a large selection of blogs. C.l.p is unmoderated and often > hostile. (snip) > A moderated forum that gives recognition to the experienced and > tolerance to newbies wo

Re: concise code (beginner)

2007-09-05 Thread James Stroud
bambam wrote: > I have about 30 pages (10 * 3 pages each) of code like this > (following). Can anyone suggest a more compact way to > code the exception handling? If there is an exception, I need > to continue the loop, and continue the list. > > Steve. > > --- > f

Re: Text processing and file creation

2007-09-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > I have a text source file of about 20.000 lines. >>From this file, I like to write the first 5 lines to a new file. Close > that file, grab the next 5 lines write these to a new file... grabbing > 5 lines and creating new files until processing of all 20.000 lines is > do

Re: ZSI sample and issues with the WSDL

2007-09-05 Thread rieh25
I'm not sure I know enough to help you, but who knows, maybe this could be of help. I think that technology is more complicated (or ureliable) than it should. Possibly the best thing to do is not to depend upon already built wsdl facilities, but instead work with a basic webservice routine, and wo

Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Kenneth McDonald
The reading I've done so far on Python 3 (alpha announcement, meta-PEP, some other PEPs) is generally encouraging, but there doesn't seem to be much on cleaning up the syntax, which has become uglier over time as features have been added on to an original syntax that wasn't designed to support

StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
-- Forwarded message -- From: dimitri pater <[EMAIL PROTECTED]> Date: Sep 5, 2007 9:13 PM Subject: Re: StringIO MySQL data blob Image problem To: Tim Golden <[EMAIL PROTECTED]> > Well, I'm mystified. Not by your results: that exactly what I > expected to get, but because you're do

Re: concise code (beginner)

2007-09-05 Thread Karthik Gurusamy
On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote: > bambam wrote: > > I have about 30 pages (10 * 3 pages each) of code like this > > (following). Can anyone suggest a more compact way to > > code the exception handling? If there is an exception, I need > > to continue the loop, and conti

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Terry Reedy
"Kenneth McDonald" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The reading I've done so far on Python 3 (alpha announcement, meta-PEP, | some other PEPs) is generally encouraging, but there doesn't seem to be | much on cleaning up the syntax, I believe that the syntax changes i

How to do python and RESTful

2007-09-05 Thread MarkyMarc
Hi all, I want to make a web service application in python and keywords are RESTful, python and nice urls(urls mapped to python objects). I don't want a big framework but a nice small one, that can just do the things I want. I have be looking at quixote, but is this uptodate? "plain" mod_python,

Re: concise code (beginner)

2007-09-05 Thread Daniel Larsson
On 9/5/07, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote: > > bambam wrote: > > > I have about 30 pages (10 * 3 pages each) of code like this > > > (following). Can anyone suggest a more compact way to > > > code the exception handling? I

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hi! > The reading I've done so far on Python 3 (alpha announcement, meta-PEP, > some other PEPs) is generally encouraging, but there doesn't seem to be > much on cleaning up the syntax, which has become uglier over time as > features have been added on to an original syntax that wasn't designed >

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Torsten Bronger
Hallöchen! Ferenczi Viktor writes: > [...] > > Class decorators allows clean implementation of properties. > Detailed description: http://www.python.org/dev/peps/pep-3129/ > Lets use a hypothetic library providing properties, for example: > > from property_support import hasProperties, Property >

Re: Text processing and file creation

2007-09-05 Thread Paddy
On Sep 5, 5:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a text source file of about 20.000 lines.>From this file, I like to > write the first 5 lines to a new file. Close > > that file, grab the next 5 lines write these to a new file... grabbing > 5 lines and creating new files

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Kay Schluehr
On Sep 5, 9:59 pm, Ferenczi Viktor <[EMAIL PROTECTED]> wrote: > Class decorators allows clean implementation of properties. > Detailed description:http://www.python.org/dev/peps/pep-3129/ > Lets use a hypothetic library providing properties, for example: > > from property_support import hasPropert

Re: concise code (beginner)

2007-09-05 Thread James Stroud
Karthik Gurusamy wrote: > On Sep 5, 11:17 am, James Stroud <[EMAIL PROTECTED]> wrote: >> >> for i in xrange(number_of_reads): >>for dev in devs: >> try: >>_reader = getattr(dev, 'read%d' % i) >>_reader() >> except Exception, e: >>print e >>devs.remove(

Re: concise code (beginner)

2007-09-05 Thread Francesco Guerrieri
On 9/5/07, James Stroud <[EMAIL PROTECTED]> wrote: > > > Another way is to make a copy of devs, if devs is short, which makes my > > When I process something of that genre (e.g. files) I prefer not to lose trace of what's happened by removing the "bad items". Instead I prefer to flag or otherwise

SSL Issue

2007-09-05 Thread Jurian Botha
Sorry if this is a real dumb question, but I'm totally stumped. I'm trying to connect to a https url in order to do some xml-rpc method calls, but I'm getting the following error: Error Type: sslerror Error Value: (6, 'TLS/SSL connection has been closed') What could be causing this error, any c

Re: FCGI app reloading on every request

2007-09-05 Thread Michael Ströder
John Nagle wrote: > >Tried putting this in the .htaccess file: > > > SetHandler fcgid-script > Options ExecCGI > allow from all > > > > ErrorDocument 403 "File type not supported." > > > Even with that, a ".foo" file gets executed as a CGI script, > and so does a ".fcgi" file. It's

Re: FCGI app reloading on every request

2007-09-05 Thread Michael Ströder
John Nagle wrote: >This is running on a dedicated server at APlus.net, > running Red Hat Fedora Core 6, Python 2.5, and managed with Plesk 8.2. > I just turned on fcgid from the Plesk control panel ("Physical hosting > setup page for domain", checked "FastCGI"), and enabled the standard > FCGI

Re: Text processing and file creation

2007-09-05 Thread [EMAIL PROTECTED]
On Sep 5, 1:28 pm, Paddy <[EMAIL PROTECTED]> wrote: > On Sep 5, 5:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > I have a text source file of about 20.000 lines.>From this file, I like to > > write the first 5 lines to a new file. Close > > > that file, grab the next 5 lines write t

Re: StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
Hi, the following code works when inserting images in reportlab tables: (result4 is a query result) a=0 for i in result4: cfoto = StringIO() cfoto.write(result4[a][9].tostring()) dfoto = cfoto.getvalue() fileFoto = open(str(a)+'temp.jpg','wb')

Re: StringIO MySQL data blob Image problem

2007-09-05 Thread dimitri pater
ah, sorry a+=1 should be after 'Do stuff here' of course... On 9/5/07, dimitri pater <[EMAIL PROTECTED]> wrote: > Hi, > the following code works when inserting images in reportlab tables: > > (result4 is a query result) > a=0 > for i in result4: >cfoto = StringIO() >cfoto

Re: Text processing and file creation

2007-09-05 Thread Arnaud Delobelle
On Sep 5, 5:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a text source file of about 20.000 lines.>From this file, I like to > write the first 5 lines to a new file. Close > > that file, grab the next 5 lines write these to a new file... grabbing > 5 lines and creating new files

Re: Registering a python function in C

2007-09-05 Thread [EMAIL PROTECTED]
On Sep 3, 7:11 pm, fernando <[EMAIL PROTECTED]> wrote: > > Is Maya a different python build than what is contained at python.org? > > If so, I suggest you get your C program to work with the latest python > > build > > from python.org. Then see if you can get it to work with the Maya > > version.

Re: Wanted: safe codec for filenames

2007-09-05 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > I'd like to map general unicode strings to safe filename. I tried > punycode but it is case-sensitive, which Windows is not. Thus, > "Hallo" and "hallo" are mapped to "Hallo-" and "hallo-", however, > I need uppercase Latin letters being encoded, too, and th

Need help with strange segfault

2007-09-05 Thread Mitko Haralanov
I am attempting to get a working wrapper around the TransactionSet class from the rpm module but I am getting unexplained segfaults in /usr/bin/python. The reason why I am working on a wrapper is that I want to have a single RPM abstraction module which is thread-safe and does not tie up the RPM d

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hello, > > from property_support import hasProperties, Property > > > > @hasProperties > > class Sphere(object): > > def setRadius(self, value): > > ... some setter implementation ... > > radius=Property(default=1.0, set=setRadius, type=(int, float)) > > color=Property(default=

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
Hello, > > from property_support import hasProperties, Property > > > > @hasProperties > > class Sphere(object): > >     def setRadius(self, value): > >         ... some setter implementation ... > >     radius=Property(default=1.0, set=setRadius, type=(int, float)) > >     color=Property(default=

Re: Module for mod_python

2007-09-05 Thread rieh25
Is it such a bad idea that it doesn't deserve a reply? rieh25 wrote: > > I've been thinking about a module (actually I have it partially > implemented in Zope), that would do the following things: > > - Read the structure of a MySql database (fill a dictionary with it) > > In order to: > > -

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Torsten Bronger
Hallöchen! Ferenczi Viktor writes: > [...] > > Properties are very useful, since ordinary attribute access can be > transparently replaced with properties if the developer needs to > add code when it's set or needs to calculate it's value whenever > it is read. I totally agree. I like to use pr

RE: creating really big lists

2007-09-05 Thread Delaney, Timothy (Tim)
Hrvoje Niksic wrote: > Dr Mephesto <[EMAIL PROTECTED]> writes: > >> I would like to create a pretty big list of lists; a list 3,000,000 >> long, each entry containing 5 empty lists. My application will >> append data each of the 5 sublists, so they will be of varying >> lengths (so no arrays!).

Re: Sort of an odd way to debug...

2007-09-05 Thread Gabriel Genellina
En Wed, 05 Sep 2007 02:15:52 -0300, Alex Martelli <[EMAIL PROTECTED]> escribi�: > xkenneth <[EMAIL PROTECTED]> wrote: >... >> What I'd like to do, is define a base class. This base class would >> have a function, that gets called every time another function is >> called (regardless of whether

Re: Text processing and file creation

2007-09-05 Thread Steve Holden
Arnaud Delobelle wrote: [...] > from my_useful_functions import new_file, write_first_5_lines, > done_processing_file, grab_next_5_lines, another_new_file, write_these > > in_f = open('myfile') > out_f = new_file() > write_first_5_lines(in_f, out_f) # write first 5 lines > close(out_f) > while not

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Steve Holden
Ferenczi Viktor wrote: > Hello, > >>> from property_support import hasProperties, Property >>> >>> @hasProperties >>> class Sphere(object): >>> def setRadius(self, value): >>> ... some setter implementation ... >>> radius=Property(default=1.0, set=setRadius, type=(int, float)) >>>

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
> > AFAIK there is no such a thing as "intentionally ugly" in the Python > > language. I've never read this sentence before in manuals, tutorials, > > etc. > > Perhaps not, but ... > > http://mail.python.org/pipermail/python-dev/2005-September/056846.html > WOW, thats true! :-D (AFAIK these cre

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
> > Properties are very useful, since ordinary attribute access can be > > transparently replaced with properties if the developer needs to > > add code when it's set or needs to calculate it's value whenever > > it is read. > > I totally agree. I like to use properties. However, Python already >

Re: python exec behaves inconsistent with respect to module imports

2007-09-05 Thread Gabriel Genellina
En Wed, 05 Sep 2007 11:45:11 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: > Thank you for the explanation > > It seems that python behaves different for variables created in the > toplevel namespace, versus deeper namespaces. Yes. Older Python versions had only two scopes: local and g

Re: Module for mod_python

2007-09-05 Thread Graham Dumpleton
On Sep 6, 9:32 am, rieh25 <[EMAIL PROTECTED]> wrote: > Is it such a bad idea that it doesn't deserve a reply? You only posted the question six hours ago. Maybe the people who might want to comment are asleep. BTW, have you done an analysis of the various existing database object relational mapper

Re: How to do python and RESTful

2007-09-05 Thread Adonis Vargas
MarkyMarc wrote: > Hi all, > > I want to make a web service application in python and keywords are > RESTful, python and nice urls(urls mapped to python objects). > > I don't want a big framework but a nice small one, that can just do > the things I want. > > I have be looking at quixote, but is

Re: Text processing and file creation

2007-09-05 Thread Ginger
file reading latency is mainly caused by large reading frequency, so reduction of the frequency of file reading may be way to solved your problem. u may specify an read bytes count for python file object's read() method, some large value(like 65536) can be specified due to ur memory usage, and u

Re: So what exactly is a complex number?

2007-09-05 Thread Gabriel Genellina
En Wed, 05 Sep 2007 06:45:29 -0300, Grzegorz Słodkowicz <[EMAIL PROTECTED]> escribi�: > I believe vectors can only be added if they have the same point of > application. The result is then applied to the same point. You are talking about "forces", not "vectors" in general. Using the "point of

Re: Module for mod_python

2007-09-05 Thread rieh25
Thanks for your response. Actually I have looked at some of them, although not in great detail and haven't actually installed them. I do have to do some more investigating, but I think I can say something right now. The one thing I think I have to offer in terms of originality is the idea of keepi

Re: ??????urllib post????????????

2007-09-05 Thread O.R.Senthil Kumaran
If possible, please post your query in ASCII. -- Senthil * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-09-05 05:03:33]: > www.mmmppp333.com??http://ishare.iask.sina.com.cn/cgi-bin/ > fileid.cgi?fileid=844050 > ??post fileid=844050 > > postfileid=844050?

Re: Wanted: safe codec for filenames

2007-09-05 Thread Gabriel Genellina
En Wed, 05 Sep 2007 19:20:45 -0300, Torsten Bronger <[EMAIL PROTECTED]> escribi�: > Torsten Bronger writes: > >> I'd like to map general unicode strings to safe filename. I tried >> punycode but it is case-sensitive, which Windows is not. Thus, >> "Hallo" and "hallo" are mapped to "Hallo-" and

Give List to Format String - How To

2007-09-05 Thread [EMAIL PROTECTED]
I might just be being dumb tonight, but why doesn't this work: >>> '%s aaa %s aa %s' % ['test' for i in range(3)] Traceback (most recent call last): File "", line 1, in ? TypeError: not enough arguments for format string (I'm in Python 2.4 if that matters) Thanks, Greg -- http://mail.python

Re: Give List to Format String - How To

2007-09-05 Thread [EMAIL PROTECTED]
On Sep 5, 10:47 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I might just be being dumb tonight, but why doesn't this work: > > >>> '%s aaa %s aa %s' % ['test' for i in range(3)] > > Traceback (most recent call last): > File "", line 1, in ? > TypeError: not enough arguments for format st

Re: Give List to Format String - How To

2007-09-05 Thread Carsten Haese
On Thu, 2007-09-06 at 02:47 +, [EMAIL PROTECTED] wrote: > I might just be being dumb tonight, but why doesn't this work: > > >>> '%s aaa %s aa %s' % ['test' for i in range(3)] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: not enough arguments for format string To

Re: Give List to Format String - How To

2007-09-05 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I might just be being dumb tonight, but why doesn't this work: Congratulations for finding the answer quickly, and thank you for letting us know the answer. In future, if you want to ask "why doesn't this work", please show us all three of: the e

Re: Python is overtaking Perl

2007-09-05 Thread digz
On Sep 4, 1:53 pm, "OKB (not okblacke)" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Sep 4, 8:35 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >> On Tue, 04 Sep 2007 00:32:23 -, Ben <[EMAIL PROTECTED]> > >> wrote: > >> >Here are the statistics from Google Trends: > > >> >http

Re: ??????urllib post????????????

2007-09-05 Thread Eric Abrahamsen
It's in Chinese, so ASCII is no go. If anyone's interested in answering his question (he's trying to download a linked file using the post method from urllib tools, not something I know about) I can translate it, and pass the answer back to him once there's some kind of consensus. E On S

Your message to Reflex-dev awaits moderator approval

2007-09-05 Thread reflex-dev-bounces
Your mail to 'Reflex-dev' with the subject Test Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of the moderator's

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Alan Isaac
Torsten Bronger wrote: > I like to use properties. However, Python already > has properties. Their syntax is quite nice in my opinion, and > rather explicit, too. Yes. > Their only flaw is that they are not > "virtual" (in C++ speak). In other words, you can't pass a "self" > parameter to t

GREAT VIDEO! >> http://www.tbn.org/films/videos/To_Hell_And_Back.ram << Just click link to view the free video.......... May 22, 2005 7:37:11 pm

2007-09-05 Thread Allen Bryant
Allen and jessica Bryant24-- Sent from my T-Mobile Sidekick® -- http://mail.python.org/mailman/listinfo/python-list

Using wild character

2007-09-05 Thread Sreeraj
hi, I am a beginner in Python. I wish to know how can i filter a list of strings using wild characters.ie Lets say i have list countries = ["india","africa","atlanta","artica","nigeria"]. I need only the list of string starting with 'a'. thank you Sreeraj -- http://mail.python.org/mailman/li

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Torsten Bronger
Hallöchen! Alan Isaac writes: > Torsten Bronger wrote: > > [...] > >> Their only flaw is that they are not "virtual" (in C++ speak). >> In other words, you can't pass a "self" parameter to them. > > http://www.kylev.com/2004/10/13/fun-with-python-properties/ Thanks, I knew the possibility of us

Re: Does shuffle() produce uniform result ?

2007-09-05 Thread Steven D'Aprano
On Tue, 04 Sep 2007 22:01:47 -0700, Paul Rubin wrote: > OK. /dev/random vs /dev/urandom is a perennial topic in sci.crypt and > there are endless long threads about it there, so I tried to give you > the short version, but will give a somewhat longer version here. Thank you. Your points are take

Re: Using wild character

2007-09-05 Thread Amit Khemka
On 9/6/07, Sreeraj <[EMAIL PROTECTED]> wrote: > hi, > > I am a beginner in Python. I wish to know how can i filter a list of > strings using wild characters.ie > Lets say i have list countries = > ["india","africa","atlanta","artica","nigeria"]. I need only the list > of string starting with 'a'.

Re: Using wild character

2007-09-05 Thread [EMAIL PROTECTED]
i hope this may help you. countries = ["india","africa","atlanta","artica","nigeria"] filtered = filter(lambda item: item.startswith('a'), l) -- http://mail.python.org/mailman/listinfo/python-list

Re: concise code (beginner)

2007-09-05 Thread bambam
First, thank you. All of the suggestions match what we want to do much better than what we are doing. We have a script, written in python, which is doing testing. But the python script doesn't look anything like the test script, because the python script is written in python, and the test script i

Re: creating really big lists

2007-09-05 Thread Dr Mephesto
On 6 Sep., 01:34, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: > > Dr Mephesto <[EMAIL PROTECTED]> writes: > > >> I would like to create a pretty big list of lists; a list 3,000,000 > >> long, each entry containing 5 empty lists. My application will > >> append data ea

Re: Using wild character

2007-09-05 Thread [EMAIL PROTECTED]
i will this may help you. countries = ["india","africa","atlanta","artica","nigeria"] filter(lambda country: country.startswith('a'), countries) -- http://mail.python.org/mailman/listinfo/python-list

Re: Text processing and file creation

2007-09-05 Thread Arnaud Delobelle
On Sep 6, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle wrote: [...] > > print "all done!" # All done > > print "Now there are 4000 files in this directory..." > > > Python 3.0 - ready (I've used open() instead of file()) > > bzzt! > > Python 3.0a1 (py3k:57844, Aug 31

Re: Using wild character

2007-09-05 Thread TheFlyingDutchman
On Sep 5, 10:00 pm, Sreeraj <[EMAIL PROTECTED]> wrote: > hi, > > I am a beginner in Python. I wish to know how can i filter a list of > strings using wild characters.ie > Lets say i have list countries = > ["india","africa","atlanta","artica","nigeria"]. I need only the list > of string starting w

Re: Wanted: safe codec for filenames

2007-09-05 Thread Torsten Bronger
Hallöchen! Gabriel Genellina writes: > En Wed, 05 Sep 2007 19:20:45 -0300, Torsten Bronger > <[EMAIL PROTECTED]> escribi�: > >> Torsten Bronger writes: >> >>> I'd like to map general unicode strings to safe filename. I >>> tried punycode but it is case-sensitive, which Windows is not. >>> [...]

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Steven D'Aprano
On Thu, 06 Sep 2007 03:31:43 +, Alan Isaac wrote: >> Their only flaw is that they are not >> "virtual" (in C++ speak). In other words, you can't pass a "self" >> parameter to them. > > http://www.kylev.com/2004/10/13/fun-with-python-properties/ I'm not 100% sure I get what problem that pie

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Torsten Bronger
Hallöchen! Steven D'Aprano writes: > On Thu, 06 Sep 2007 03:31:43 +, Alan Isaac wrote: > >>> Their only flaw is that they are not "virtual" (in C++ speak). >>> In other words, you can't pass a "self" parameter to them. >> >> http://www.kylev.com/2004/10/13/fun-with-python-properties/ > > > I

<    1   2