Re: Can any body help me

2006-05-25 Thread Sidd
1.Given a test file containing lines of words such as (abc, abb, abd,abb, etc), write a script that prints, in order of frequency, how many times each word appears in the file. Use dictionary datastructure in python and simple if-else statement. Its simple give it a try. -- http://mail.python.or

Re: genexp surprise (wart?)

2006-05-25 Thread Paul Rubin
Paul Rubin writes: > Yeah, it's just counterintuitive is all. I guess the natural way to > express this would have been with tail recursion instead of a while > loop. FWIW, here's a listcomp version: def s2(n=100): stream = range(2,n) while stream:

Re: genexp surprise (wart?)

2006-05-25 Thread Paul Du Bois
The generator is in its own scope. For proof, try accessing q outside the generator. There are two possibilities. The first is that you don't know what closures are and are complaining that python has them. That would be amusingly ironic, but I'm guessing you do know (if you don't, google "make_ad

Re: genexp surprise (wart?)

2006-05-25 Thread Paul Rubin
"Ben Cartwright" <[EMAIL PROTECTED]> writes: > You do realize that you're creating a new level of generator nesting > with each iteration of the while loop, right? You will quickly hit the > maximum recursion limit. Try generating the first 1000 primes. Yes, I know about the generator nesting, t

Re: can't figure out error: module has no attribute...

2006-05-25 Thread Tim Roberts
"Chris_147" <[EMAIL PROTECTED]> wrote: >Thanks for the reply. > >you are indeed right, they were included from different places. >from C:\Python24\Lib and D:\mydir > >But the strange thing is: >anywhere on C: the file from C:\Python24\Lib was included. >in D:\mydir the one from that directory >BUT

Can any body help me

2006-05-25 Thread satish
how to write script for these 1.Given a test file containing lines of words such as (abc, abb, abd,abb, etc), write a script that prints, in order of frequency, how many times each word appears in the file. 2. Write a script running in an endless loop that pings an IP (specified on the command li

Re: genexp surprise (wart?)

2006-05-25 Thread Ben Cartwright
Paul Rubin wrote: > I tried to code the Sieve of Erastosthenes with generators: > > def sieve_all(n = 100): > # yield all primes up to n > stream = iter(xrange(2, n)) > while True: > p = stream.next() > yield p > # filter out all multi

Re: IronPython 1.0 Beta 7 Released

2006-05-25 Thread Ravi Teja
> Can you recommend a book or a link for a person learning Python on > Windows who does not yet know C# or .NET? Since Python is cross-platform, any Python book will do. If you need to do MS Windows specific programming (COM and OLE automation, Windows Services etc), you can use Mark Hammond's "Py

Re: IronPython 1.0 Beta 7 Released

2006-05-25 Thread Ravi Teja
> > Also, IronPython cannot access CPython libraries. So it cannot be used > > as a drop-in replacement for CPython in most non-trivial apps. Python > > for .NET however allows you to both use both CPython and .NET > > libraries. > > It will be able to access the standard libraries, as long as they

Re: Creating instances of untrusted new-style classes

2006-05-25 Thread Devan L
Michael Spencer wrote: > Devan L wrote: > > Is there any safe way to create an instance of an untrusted class > > without consulting the class in any way? With old-style classes, I can > > recreate an instance from another one without worrying about malicious > > code (ignoring, for now, malicious

Re: Creating instances of untrusted new-style classes

2006-05-25 Thread Michael Spencer
Devan L wrote: > Is there any safe way to create an instance of an untrusted class > without consulting the class in any way? With old-style classes, I can > recreate an instance from another one without worrying about malicious > code (ignoring, for now, malicious code involving attribute access)

Re: Creating instances of untrusted new-style classes

2006-05-25 Thread Devan L
Ben Finney wrote: > "Devan L" <[EMAIL PROTECTED]> writes: > > > Is there any safe way to create an instance of an untrusted class > > Why are you instantiating classes you don't trust? > > > without consulting the class in any way? > If you don't "consult the class", how can the instance be created

genexp surprise (wart?)

2006-05-25 Thread Paul Rubin
I tried to code the Sieve of Erastosthenes with generators: def sieve_all(n = 100): # yield all primes up to n stream = iter(xrange(2, n)) while True: p = stream.next() yield p # filter out all multiples of p from stream s

Re: Creating instances of untrusted new-style classes

2006-05-25 Thread Ben Finney
"Devan L" <[EMAIL PROTECTED]> writes: > Is there any safe way to create an instance of an untrusted class Why are you instantiating classes you don't trust? > without consulting the class in any way? If you don't "consult the class", how can the instance be created properly? -- \ "It's

monkeypatching NamedTemporaryFile

2006-05-25 Thread Jason Lunz
Is there a better way to do this? def QuietNamedTemporaryFile(**kwargs): ''' Return a NamedTemporaryFile that doesn't complain when its file has already been unlinked at __del__ time. ''' tf = tempfile.NamedTemporaryFile(**kwargs) def quiet_del(): try:

Re: Array?

2006-05-25 Thread George Sakkis
Dr. Pastor wrote: > I need a row of 127 bytes that I will use as a > circular buffer. Into the bytes (at unspecified times) > a mark (0 After some time the "buffer" will contain the last 127 marks > and a pointer will point the next "usable" byte. > What would be the Pythonic way to do the above?

OT: Navarth (was Re: John Bokma harassment)

2006-05-25 Thread John Bokma
"Geoffrey Summerhayes" <[EMAIL PROTECTED]> wrote: > > "John Bokma" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Geoffrey Summerhayes" <[EMAIL PROTECTED]> wrote: >> >>> After you kill Navarth, will it be nothing but gruff and deedle >>> with a little wobbly to fill in the chi

Re: how to clear up a List in python?

2006-05-25 Thread vbgunz
> I guess Fredrik's message was more along the lines of ``don't try to > "help" others after a week or two toying with the language because you > might be offering disservice, despite your good intentions; leave this > to more experienced users``. The words might have been a bit harsher > but that'

Re: __getattr__ and functions that don't exist

2006-05-25 Thread Ben Cartwright
Erik Johnson wrote: > Thanks for your reply, Nick. My first thought was "Ahhh, now I see. That's > slick!", but after playing with this a bit... > > >>> class Foo: > ... def __getattr__(self, attr): > ... def intercepted(*args): > ... print "%s%s" % (attr, args) > ...

Array?

2006-05-25 Thread Dr. Pastor
I need a row of 127 bytes that I will use as a circular buffer. Into the bytes (at unspecified times) a mark (0http://mail.python.org/mailman/listinfo/python-list

OLAP and pivot tables

2006-05-25 Thread George Sakkis
After a brief search, I didn't find any python package related to OLAP and pivot tables. Did I miss anything ? To be more precise, I'm not so interested in a full-blown OLAP server with an RDBMS backend, but rather a pythonic API for constructing datacubes in memory, slicing and dicing them, drilli

Re: Speed up this code?

2006-05-25 Thread aomighty
I got it working using difference() and sets, thanks all! 100,000 takes about 3 times the time of 10,000, which is what my math buddies told me I should be getting, rather than an exponential increase :). Thanks, all! -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-25 Thread Dražen Gemić
Kay Schluehr wrote: > Sounds like me. In rare moments I believe that I'm not alone on usenet > but there are other people as well. I wanted to go to the doctor > because I believed I had a multiple personality but than I discovered > that the doctor was me too. That's bad, because all of you must

Re: John Bokma harassment

2006-05-25 Thread Geoffrey Summerhayes
"John Bokma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Geoffrey Summerhayes" <[EMAIL PROTECTED]> wrote: > >> After you kill Navarth, will it be nothing but gruff and deedle >> with a little wobbly to fill in the chinks? > > Comparing Navarth with Xah is a huge insult to Jack V

Re: __getattr__ and functions that don't exist

2006-05-25 Thread George Sakkis
Erik Johnson wrote: > Thanks for your reply, Nick. My first thought was "Ahhh, now I see. That's > slick!", but after playing with this a bit... > > >>> class Foo: > ... def __getattr__(self, attr): > ... def intercepted(*args): > ... print "%s%s" % (attr, args) > ...

Re: Speed up this code?

2006-05-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Does anybody know a faster way to do this? (finding the difference all > items in list a that are not in list b)? >>> a = [3, 7, 16, 1, 2, 19, 13, 4, 0, 8]# random.sample(range(20),10) >>> b = [15, 11, 7, 2, 0, 3, 9, 1, 12, 16] # similar >>> sorted(set

Re: Python Programming Books?

2006-05-25 Thread BartlebyScrivener
>> "Learning to Program" by Alan Gauld >> (http://www.freenetpages.co.uk/hp/alan.gauld/) The best by far, for a n00b, in my opinion. -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed up this code?

2006-05-25 Thread Tim Chase
> def rmlist(original, deletions): >return [i for i in original if i not in deletions] > > original will be a list of odd numbers and deletions will be numbers > that are not prime, thus this code will return all items in original > that are not in deletions. For n > 100,000 or so, the program

Re: Speed up this code?

2006-05-25 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > I'm creating a program to calculate all primes numbers in a range of 0 > to n, where n is whatever the user wants it to be. I've worked out the > algorithm and it works perfectly and is pretty fast, but the one thing > seriously slowing down the program is the following c

Speed up this code?

2006-05-25 Thread aomighty
I'm creating a program to calculate all primes numbers in a range of 0 to n, where n is whatever the user wants it to be. I've worked out the algorithm and it works perfectly and is pretty fast, but the one thing seriously slowing down the program is the following code: def rmlist(original, deleti

Creating instances of untrusted new-style classes

2006-05-25 Thread Devan L
Is there any safe way to create an instance of an untrusted class without consulting the class in any way? With old-style classes, I can recreate an instance from another one without worrying about malicious code (ignoring, for now, malicious code involving attribute access) as shown below. >>> im

Re: Python Programming Books?

2006-05-25 Thread John Bokma
"Luis M. González" <[EMAIL PROTECTED]> wrote: > Free online resources for learning Python: > > To get started, I strongly suggest Josh Cogliati's "Non-Programmers > Tutorial for Python" ( http://honors.montana.edu/~jjc/easytut/easytut/ > ). > I learned programming with this little tutorial, which

Re: Use of lambda functions in OOP, any alternative?

2006-05-25 Thread Pablo
Oh! Thanx! Great! this is what i was looking for! :) Scott David Daniels ha escrito: > Pablo wrote: > > > Second solution: This is what i want, but... > > > > class Base(object): > > def __init__(self, attr): > > self._attr = attr > > def getattr(self): > > return self._at

Re: how to clear up a List in python?

2006-05-25 Thread George Sakkis
vbgunz wrote: > I will not try and stop helping others because you don't like my > answers. I found a perfectly good way how not to do something that > wasn't exactly wrong anyway. if you can take another persons honest > attempt to help someone and twist it into something it is not, I can > only

Re: __getattr__ and functions that don't exist

2006-05-25 Thread Erik Johnson
Thanks for your reply, Nick. My first thought was "Ahhh, now I see. That's slick!", but after playing with this a bit... >>> class Foo: ... def __getattr__(self, attr): ... def intercepted(*args): ... print "%s%s" % (attr, args) ... return intercepted ... >>> f =

Re: Anyone compiling Python 2.3 on an SCO OpenServer 5 box?

2006-05-25 Thread Mike Kent
I need to compile Python on OpenServer 5 because I need to 'freeze' our Python app, and running 'freeze' requires a working, compilable source installation of Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehensions put non-names into namespaces!

2006-05-25 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > Lonnie> List comprehensions appear to store their temporary result in a > Lonnie> variable named "_[1]" (or presumably "_[2]", "_[3]" etc for > Lonnie> nested comprehensions) > > Known issue. Fixed in generator comprehensions. Dunno about plans to fix > it in li

Re: Anyone compiling Python 2.3 on an SCO OpenServer 5 box?

2006-05-25 Thread Aurelio Martin
Mike Kent wrote: > If anyone is successfully compiling Pyton 2.3 on an SCO OpenServer 5 > box, I'd appreciate hearing from you on how you managed to do it. So > far, I'm unable to get a python that doesn't coredump. > Hey, I remember trying to compile Python 1.5 on an SCO OpenServer 5 box back

Re: how to clear up a List in python?

2006-05-25 Thread vbgunz
I will not try and stop helping others because you don't like my answers. I found a perfectly good way how not to do something that wasn't exactly wrong anyway. if you can take another persons honest attempt to help someone and twist it into something it is not, I can only suggest you look in the

Re: Python Programming Books?

2006-05-25 Thread Luis M. González
Free online resources for learning Python: To get started, I strongly suggest Josh Cogliati's "Non-Programmers Tutorial for Python" ( http://honors.montana.edu/~jjc/easytut/easytut/ ). I learned programming with this little tutorial, which is a very good introduction. After that, you could check

Your message to slug awaits moderator approval

2006-05-25 Thread slug-bounces
Your mail to 'slug' with the subject Stolen document Is being held until the list moderator can review it for approval. The reason it is being held: SpamAssassin identified this message as possible spam (score 5.3) Either the message will get posted to the list, or you will receive not

Survey on open-source software for the desktop

2006-05-25 Thread Sender
I just submit the questionnaire to Digg, you can digg for it here: http://digg.com/software/Survey_on_open-source_software_for_the_desktop And if you want to fill out the questionnaire, here it is: http://freeonlinesurveys.com/rendersurvey.asp?sid=iegzi2sbv9j9g8h195091 Thanks for your contribut

Re: how to clear up a List in python?

2006-05-25 Thread Fredrik Lundh
vbgunz wrote: >> if you don't know how to do things, you don't need to post. > > If this was the case who then would post any questions? you didn't post a question, you provided a ludicrously bad solution in response to a simple question. that's not a good way to promote Python. -- http://

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-25 Thread Jim Lewis
Thanks but now another problem :-( Examples in books show importing a global so why does below give: AttributeError: 'module' object has no attribute 'globalvar' primes.pyx: from run import globalvar def prime(int kmax): result = [run.globalvar] ... run.py: from primes import prime globalvar =

Re: [ANNOUNCE] Thirty-second release of PythonCAD now available

2006-05-25 Thread ziggy
In article <[EMAIL PROTECTED]>, "Art Haas" <[EMAIL PROTECTED]> wrote: > Hi. > > I'm pleased to announce the thirty-second development release of PythonCAD, > a CAD package for open-source software users. As the name implies, > PythonCAD is written entirely in Python. The goal of this project is

Re: Secure Pickle-like module

2006-05-25 Thread jiba
> There are a couple factual inaccuracies on the site that I'd like to clear up > first: > Trivial benchmarks put cerealizer and banana/jelly on the same level as far > as performance goes: > $ python -m timeit -s 'from cereal import dumps; L = ["Hello", " ", ("w", > "o", "r", "l", "d", ".")]' '

Re: Go "help" the perl list instead Fredrik Lundh

2006-05-25 Thread Mirco Wahab
Thus spoke D H (on 2006-05-25 23:12): > Fredrik Lundh wrote: >> if you don't know how to do things, you don't need to post. > > He already posted ... Based on your Text, you can (in Perl, of course ;-) extract the Goedel-Number sequence (prime number sequence) of it: use Acme::Goedelize;

Re: __getattr__ and functions that don't exist

2006-05-25 Thread Nick Smallbone
Erik Johnson wrote: > Maybe I just don't know the right special function, but what I am wanting to > do is write something akin to a __getattr__ function so that when you try to > call an object method that doesn't exist, it get's intercepted *along with > it's argument*, in the same manner as __ge

Re: how to clear up a List in python?

2006-05-25 Thread vbgunz
> if you don't know how to do things, you don't need to post. > if you know why this is about the dumbest way to do what you're doing, > and you're posted this on purpose, you really need to grow up. If this was the case who then would post any questions? I not only made my post with the best of i

__getattr__ and functions that don't exist

2006-05-25 Thread Erik Johnson
Maybe I just don't know the right special function, but what I am wanting to do is write something akin to a __getattr__ function so that when you try to call an object method that doesn't exist, it get's intercepted *along with it's argument*, in the same manner as __getattr__ intercepts attribut

how to open password protected PDF's in Python

2006-05-25 Thread sonicpulse
Hello, I made a program that iterates through all the pdf's in a folder and opens them and prints them. However, all of these pdf's are password protected, so I have to manually type in the password many times. Is there any way to open a password-protected PDF with the password entered through py

Re: Problem with itertools.groupby.

2006-05-25 Thread Fredrik Lundh
> itertools only looks for changes to the key value (the one returned by > operator.itemgetter(0) in your case); it doesn't sort the list for you. > > this should work: > >for k, g in itertools.groupby(sorted(vals), operator.itemgetter(0)): > print k, [i for i in g] footnote: to turn

Re: John Bokma harassment

2006-05-25 Thread Fred Gilham
Dale King <"DaleWKing [at]gmail [dot] com"> writes: > Therefore you do not have the "right" to do what you want with > Usenet. You have a responsibility to use Usenet in a way that benefits > the group as a whole (e.g. asking interesting questions that educate > others). ...or at least, in a way

Re: Problem with itertools.groupby.

2006-05-25 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > What am I doing wrong here? > import operator import itertools vals = [(1, 11), (2, 12), (3, 13), (4, 14), (5, 15), > ... (1, 16), (2, 17), (3, 18), (4, 19), (5, 20)] for k, g in itertools.groupby(iter(vals), operator.itemgetter(0)): > ... p

Re: Multi-dimensional list initialization trouble

2006-05-25 Thread trebucket
An expression like this creates a list of integers: >>> [0] * 2 [0, 0] But an expression like this creates list of references to the list named `foo': >>> foo = [0, 0] >>> baz = [foo] * 2 [foo, foo] So, setting baz[0][0] = 1, is really setting foo[0] = 1. There is only one instance of foo, but y

Re: Multi-dimensional list initialization trouble

2006-05-25 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Hello I found this very strange; is it a bug, is it a "feature", am I > being naughty or what? the repeat operator (*) creates a new list with references to the same inner objects, so you end up with a list containing multiple references to the same list. also see:

Re: Multi-dimensional list initialization trouble

2006-05-25 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Hello I found this very strange; is it a bug, is it a "feature", am I > being naughty or what? > foo = [[0, 0], [0, 0]] baz = [ [0]*2 ] * 2 >... > Why on earth does foo and baz behave differently?? This is a frequently made mistake. try also: >>> bumble = [[0

Re: Go "help" the perl list instead Fredrik Lundh

2006-05-25 Thread A. Sinan Unur
D H <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > You obviously ignored that and invented some argument that he > posted with malicious intentions. That better describes most of > your thousands of annoying posts. I don't know what describes what you did. What is the point of bringing

Re: Problem with itertools.groupby.

2006-05-25 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > What am I doing wrong here? > import operator import itertools vals = [(1, 11), (2, 12), (3, 13), (4, 14), (5, 15), > ... (1, 16), (2, 17), (3, 18), (4, 19), (5, 20)] for k, g in itertools.groupby(iter(vals), operator.itemgetter(0)): > ... pr

Multi-dimensional list initialization trouble

2006-05-25 Thread jonkje
Hello I found this very strange; is it a bug, is it a "feature", am I being naughty or what? >>> foo = [[0, 0], [0, 0]] >>> baz = [ [0]*2 ] * 2 >>> foo [[0, 0], [0, 0]] >>> baz [[0, 0], [0, 0]] >>> foo[0][0]=1 >>> baz[0][0]=1 >>> foo [[1, 0], [0, 0]] >>> baz [[1, 0], [1, 0]] Why on earth does foo

Re: Python Programming Books?

2006-05-25 Thread Michael Tobis
I am not happy with any of the Python-as-a-First-Language books out there. My vague inclination to write one has not yet formed into a firm intention, but it's close. Of the books that are out there, Learning Python and Dive Into Python are best for the hobbyist as opposed to classroom setting, bu

[ANNOUNCE] Thirty-second release of PythonCAD now available

2006-05-25 Thread Art Haas
Hi. I'm pleased to announce the thirty-second development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually excee

Go "help" the perl list instead Fredrik Lundh

2006-05-25 Thread D H
Fredrik Lundh wrote: > vbgunz wrote: > >>> I have new a list , when it hava large number of values, I wonna to >>> delete all the values in it,how to do? >> >> something like this will probably help. >> >> x = [1,2,3,4,5,6,7,8,9] >> y = x >> >> list([x.pop() for z in xrange(len(x))]) >> >> print x

Re: regex/lambda black magic

2006-05-25 Thread John Machin
On 26/05/2006 4:33 AM, Andrew Robert wrote: > Hi Everyone, > > > Thanks for all of your patience on this. > > I finally got it to work. > > > Here is the completed test code showing what is going on. Consider doing what you should have done at the start: state what you are trying to achieve.

Problem with itertools.groupby.

2006-05-25 Thread trebucket
What am I doing wrong here? >>> import operator >>> import itertools >>> vals = [(1, 11), (2, 12), (3, 13), (4, 14), (5, 15), ... (1, 16), (2, 17), (3, 18), (4, 19), (5, 20)] >>> for k, g in itertools.groupby(iter(vals), operator.itemgetter(0)): ... print k, [i for i in g] ... 1 [(1, 11)]

Re: John Bokma harassment

2006-05-25 Thread Steve Holden
Robert Boyd wrote: > On 24 May 2006 08:29:57 -0700, Rune Strand <[EMAIL PROTECTED]> wrote: > > >>I can just declare my support. Reading Mr. Bokmas comments below [*] >>certainly makes my suport stronger. >> > > > I sent an email in support of Xah, which I wouldn't have bothered to > do had I no

Re: Secure Pickle-like module

2006-05-25 Thread Jean-Paul Calderone
On 25 May 2006 13:22:21 -0700, [EMAIL PROTECTED] wrote: >Hi all, > >I'm currently working on a secure Pickle-like module, Cerealizer, >http://home.gna.org/oomadness/en/cerealizer/index.html >Cerealizer has a pickle-like interface (load, dump, __getstate__, >__setstate__,...), however it requires to

Re: John Bokma harassment

2006-05-25 Thread Dale King
Xah Lee wrote: > I'm sorry to trouble everyone. But as you might know, due to my > controversial writings and style, recently John Bokma lobbied people to > complaint to my web hosting provider. After exchanging a few emails, my > web hosting provider sent me a 30-day account cancellation notice la

Secure Pickle-like module

2006-05-25 Thread jiba
Hi all, I'm currently working on a secure Pickle-like module, Cerealizer, http://home.gna.org/oomadness/en/cerealizer/index.html Cerealizer has a pickle-like interface (load, dump, __getstate__, __setstate__,...), however it requires to register the class you want to "cerealize", by calling cereal

Re: how to "normalize" indentation sources

2006-05-25 Thread John Machin
On 26/05/2006 2:38 AM, John Salerno wrote: [snip] > > So the line below the last line of the file isn't actually considered an > empty line, even though you can move the cursor to it in a text editor? That line doesn't exist in a file *until* you (a) type something into the editor and (b) save

Re: list comprehensions put non-names into namespaces!

2006-05-25 Thread skip
Lonnie> List comprehensions appear to store their temporary result in a Lonnie> variable named "_[1]" (or presumably "_[2]", "_[3]" etc for Lonnie> nested comprehensions) Known issue. Fixed in generator comprehensions. Dunno about plans to fix it in list comprehensions. I believe a

Re: how to clear up a List in python?

2006-05-25 Thread Fredrik Lundh
vbgunz wrote: >> I have new a list , when it hava large number of values, I wonna to >> delete all the values in it,how to do? > > something like this will probably help. > > x = [1,2,3,4,5,6,7,8,9] > y = x > > list([x.pop() for z in xrange(len(x))]) > > print x, y # [] [] if you don't know

Re: Telnet linebreaks

2006-05-25 Thread Jean-Paul Calderone
>>On 5/24/06, Patrick M. Nielsen <[EMAIL PROTECTED] > wrote: >> > >> > Hey guys. >> > >> > I have begun playing with the Simple MUD server example from the >> > Stackless website >> > ( http://www.stackless.com/Members/rmtew/code/mud.py ) >> > and it's all good so far, however, I've come to notice

Re: John Bokma harassment

2006-05-25 Thread John Bokma
"Geoffrey Summerhayes" <[EMAIL PROTECTED]> wrote: > After you kill Navarth, will it be nothing but gruff and deedle > with a little wobbly to fill in the chinks? Comparing Navarth with Xah is a huge insult to Jack Vance. You should be ashamed of yourself for even thinking about it, let alone wri

Re: Request for comments on python distributed technologies

2006-05-25 Thread skip
Piet> Python Web services developer: Messaging technologies compared Piet> http://www.ibm.com/developerworks/library/ws-pyth9/ Note a couple things. One, the article is four years old. You can't assume the various technologies have remained static since then. Two, the authors apparentl

Re: regex/lambda black magic

2006-05-25 Thread Andrew Robert
Hi Everyone, Thanks for all of your patience on this. I finally got it to work. Here is the completed test code showing what is going on. Not cleaned up yet but it works for proof-of-concept purposes. #!/usr/bin/python import re,base64 # Evaluate captured character as hex def ret_hex(va

Re: John Bokma harassment

2006-05-25 Thread Geoffrey Summerhayes
"John Bokma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dra¾en Gemiæ <[EMAIL PROTECTED]> wrote: > >> There is a person on USENET, particularly in hr. hierarchy that >> posts under three different accounts. Sometimes he argues with >> himself, and sometimes event supports himsel

Distutils -- specifying compiled output name

2006-05-25 Thread jeremito
I am using distutils to comiple/install a c extension created with SWIG. However I need to be able to specify the output filename from gcc. I tried doing this with the "extra_compile_args" and "extra_link_args" by setting them equal to "-o MyOutputName.so" but that didn't work. Can someone show

Re: sybase open client 15_0

2006-05-25 Thread Dan
I'm running SLES 9.3 on Tyan with 2 single core 64-bit Opteron & 8 GB of memory and SWAP. OCS-15_0 sybperl-2.18 python 2.3.5 "Dan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have compiled and installed sybase-.037 , the module to add sybase to >python. However, when I tr

Re: Python Programming Books?

2006-05-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Rony Steelandt <[EMAIL PROTECTED]> wrote: > >1.Python for Dummies > Maruch Stef;Maruch Aahz - Hungry Minds Inc,U.S. - 408 pages - 08 2006 Possibly September if we get behind, but since Neal Norwitz is trying to accelerate the release of 2.5, that's not too likely.

sybase open client 15_0

2006-05-25 Thread Dan
I have compiled and installed sybase-.037 , the module to add sybase to python. However, when I try to use it I get Import error: /usr/local/lib/python2.3/site-packages/sybasect.so undefined symbol: cs_dt_info I've seen some posts on the internet with other people having this issue. But nothi

Re: IronPython 1.0 Beta 7 Released

2006-05-25 Thread Luis M. González
Ravi Teja wrote: > Also, IronPython cannot access CPython libraries. So it cannot be used > as a drop-in replacement for CPython in most non-trivial apps. Python > for .NET however allows you to both use both CPython and .NET > libraries. It will be able to access the standard libraries, as long a

Re: NEWB: how to convert a string to dict (dictionary)

2006-05-25 Thread Aahz
In article <[EMAIL PROTECTED]>, manstey <[EMAIL PROTECTED]> wrote: > >Thanks. I didn't know eval could do that. But why do many posts say >they want a solution that doesn't use eval? Because it is a security risk! eval("os.system('rm -rf /')") -- Aahz ([EMAIL PROTECTED]) <*> h

Re: John Bokma harassment

2006-05-25 Thread John Bokma
Dra¾en Gemiæ <[EMAIL PROTECTED]> wrote: > There is a person on USENET, particularly in hr. hierarchy that > posts under three different accounts. Sometimes he argues with > himself, and sometimes event supports himself :-) > > Maybe we have the similar case here. Wouldn't amaze me if some of the

Anyone compiling Python 2.3 on an SCO OpenServer 5 box?

2006-05-25 Thread Mike Kent
If anyone is successfully compiling Pyton 2.3 on an SCO OpenServer 5 box, I'd appreciate hearing from you on how you managed to do it. So far, I'm unable to get a python that doesn't coredump. -- http://mail.python.org/mailman/listinfo/python-list

list comprehensions put non-names into namespaces!

2006-05-25 Thread Lonnie Princehouse
List comprehensions appear to store their temporary result in a variable named "_[1]" (or presumably "_[2]", "_[3]" etc for nested comprehensions) In other words, there are variables being put into the namespace with illegal names (names can't contain brackets). Can't someone come up with a bette

Re: "No handlers could be found for logger xxx" ?

2006-05-25 Thread Vinay Sajip
robert wrote: > some packages like paramiko use the logging. I get this messages: > "No handlers could be found for logger xxx" on stderr > > Why is un-initialized logging allowed to chatter at all? You could invoke logging.basicConfig with a level of CRITICAL. This will generally filter out logg

Re: Modify one character in a string

2006-05-25 Thread Paul Rubin
Larry Bates <[EMAIL PROTECTED]> writes: > IMHO the most elegant method is something like: > > def switchchar(srcstring, position, character): > b=list(srcstring) > b[2]=character > return ''.join(b) If the strings or large or you're doing it a lot, the array module is likely more effi

Re: access to TimesTen using python

2006-05-25 Thread Larry Bates
gunsupancar wrote: > is there any module to access > TimesTen in-memory database using python? > I didn't find native one, but TimesTen has ODBC interface that you could use. http://www.compwisdom.com/topics/ODBC -- http://mail.python.org/mailman/listinfo/python-list

Re: script vs inneractive

2006-05-25 Thread Robert Kern
Dennis Lee Bieber wrote: > If that "return 1" is the last line in the program, at the most it > will be treated as a return code to the OS signaling that the program > succeeded or failed. I'm not really sure how Python handles a return > from main program. It's a syntax error. -- Robert K

Re: logging

2006-05-25 Thread Vinay Sajip
Baurzhan Ismagulov wrote: > Thanks for the idea! I think this should work for the example I sent. > However, I have more than one module, and I want to log only l01. How > can I do that? > I don't know what your logger hierarchy looks like: you could perhaps log to child loggers of l01 ("l01.XXX

Re: Modify one character in a string

2006-05-25 Thread Larry Bates
mp wrote: > X-No-Archive > How do I go about modifying one character in a string elegantly? > In other words, I want a function that will change '' to 'aaza', > given the index 2 of the character in the string. > > Also, how do I do this when dealing with a file ; which file mode > should I us

Re: regex/lambda black magic

2006-05-25 Thread Max Erickson
Andrew Robert <[EMAIL PROTECTED]> wrote: > import re,base64 > > # Evaluate captured character as hex > def ret_hex(value): > return base64.b16encode(value) > > def ret_ascii(value): > return base64.b16decode(value) > Note that you can just do this: from base64 import b16encode,b16dec

Re: script vs inneractive

2006-05-25 Thread vbgunz
the interactive shell will immediatly show the result of an expression without you having to explicitly print the result. In all text editor, you will have to print the result if you wish to see it. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to clear up a List in python?

2006-05-25 Thread vbgunz
> No, he'll have 100 items in the slice... 300, 301,... 399 that's 100 items. you're right, sorry. [300:400] would return 100 items but the item at index 400 would not return. I suggested if he wanted it to try [300:401] as the last slice index is excluded from the return. Thanks for that :) --

Re: os listdir access denied when run as a service

2006-05-25 Thread Larry Bates
Thomas Thomas wrote: > Hi All, > > I am trying to access a mapped network drive folder. everything works fine > normally. But when i run the application as service I am getting the error > > Traceback (most recent call last): > File "docBoxApp.py", line 129, in ? > File "core\PollFiles.pyc",

Re: Web frameworks and credit cards

2006-05-25 Thread Larry Bates
TrustCommerce (www.trustcommerce.com) has an easy to use Python interface (they other interfaces as well) that I've used on a large Zope project recently. -Larry Bates Ed Leafe wrote: > I may have an opportunity to develop an online ordering system for a > client, and will have the ability to

Re: regex/lambda black magic

2006-05-25 Thread Andrew Robert
Max Erickson wrote: > Try getting rid of the lamba, it might make things clearer and it > simplifies debugging. Something like(this is just a sketch): > > > max > Yeah.. trying to keep everything on one line is becoming something of a problem. To make this easier, I followed something from

Re: how to "normalize" indentation sources

2006-05-25 Thread John Salerno
Tim Peters wrote: > [John Machin, quoting reindent.py docs] >>> remove empty lines at the end of files. Also ensure the last line ends >>> with a newline. > > [John Salerno] >> don't those two things conflict with one another? > > No. This is the repr of a file with (3) empty lines at the end:

Re: Telnet linebreaks

2006-05-25 Thread Patrick M. Nielsen
*bump* :)On 5/24/06, Patrick M. Nielsen <[EMAIL PROTECTED]> wrote: Oh, and, apologies for the "inpythonic" nature of this issue.On 5/24/06, Patrick M. Nielsen <[EMAIL PROTECTED] > wrote:Hey guys.I have begun playing with the Simple MUD server example from the Stackless website ( http://www.stackle

  1   2   >