cross-compile PIL

2006-05-16 Thread NicolasP
Hello, I need to compile PIL (python imaging library) package for an ARM based linux system. Does anyone can tell me how to do this ? Thanks Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: A Unicode problem -HELP

2006-05-16 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > 1. Here is my input data file, line 2: > gn1:1,1.2 R")$I73YT R")[EMAIL PROTECTED] Your program is reading this using the 'utf-8' encoding. When it does so, all the characters you show above will be read in happily as you see them (so long as you view them w

Re: A Unicode problem -HELP

2006-05-16 Thread Tim Roberts
"manstey" <[EMAIL PROTECTED]> wrote: > >I have done more reading on unicode and then tried my code in IDLE >rather than WING IDE, and discovered that it works fine in IDLE, so I >think WING has a problem with unicode. Rather, its output defaults to ASCII. >So, assuming I now work in IDLE, all I w

Re: A Unicode problem -HELP

2006-05-16 Thread Martin v. Löwis
manstey wrote: > a=str(word_info + parse + gloss).encode('utf-8') > a=a[1:len(a)-1] > > Is this clearer? Indeed. The problem is your usage of str() to "render" the output. As word_info+parse+gloss is a list (or is it a tuple?), str() will already produc

Re: assignment in a for loop

2006-05-16 Thread Ben Finney
"MackS" <[EMAIL PROTECTED]> writes: > Thank you for your reply. A pleasure to help. > > What's preventing the use of list comprehensions? > > > > new_list = [x+1 for x in old_list] > > Suppose I want to do anything as trivial as modify the values of the > list members _and_ print their new

Re: python vs perl lines of code

2006-05-16 Thread Edward Elliott
Ala Qumsieh wrote: > Btw, do you include space chars that go toward indentating Python code > in your count? If not, you should since they are required. Not so for > Perl. All chars are counted on lines which are counted. The perl and python versions use the same amount and type of indentation,

Re: A Unicode problem -HELP

2006-05-16 Thread manstey
OK, I apologise for not being clearer. 1. Here is my input data file, line 2: gn1:1,1.2 R")$I73YT R")[EMAIL PROTECTED] 2. Here is my output data file, line 2: u'gn', u'1', u'1', u'1', u'2', u'-', u'R")$I73YT', u'R")$IYT', u'R")$IYT', u'@', u'ncfsa', u'nc', '', '', '', u'f', u's', u'a', '', '', ''

Re: assignment in a for loop

2006-05-16 Thread MackS
Thank you for your reply. > > 1) Is what I wrote above (minimally) correct? > > Correct for what? You can tell if it's *syntactically* correct by > simply running it. > > As for any other "correct", define that. Does it do what you want it > to do? I was referring to my attempted explanation, no

Re: python vs perl lines of code

2006-05-16 Thread Edward Elliott
Charles DeRykus wrote: > This subject thread may be of great interest but I think an language > advocacy mailing list would be a better forum. Fair enough, but advocacy isn't at all what I'm after. Anecdotes are fine, after all what is data but a collection of anecdotes? :) Seriously, anecdot

Re: assignment in a for loop

2006-05-16 Thread Ben Finney
"MackS" <[EMAIL PROTECTED]> writes: [MackS, please don't top-post.] > Suppose I want to do modify all arguments which are passed to a > function. Do I need to use a list comprehension such as > > def f(arg1,arg2,arg3): > > arg1,arg2,arg3 = [i+1 for i in (arg1,arg2,arg3)] > ... > > Th

Re: A Unicode problem -HELP

2006-05-16 Thread Martin v. Löwis
manstey wrote: > input_file = open(input_file_loc, 'r') > output_file = open(output_file_loc, 'w') > for line in input_file: > output_file.write(str(word_info + parse + gloss)) # = three > functions that return tuples > > (u'F', u'\u0254') are two of the many unicode tuple elements returned

Re: assignment in a for loop

2006-05-16 Thread Ben Finney
"MackS" <[EMAIL PROTECTED]> writes: > >>> l = [1,2] > >>> for i in l: > ... i = i + 1 > ... > >>> l > [1, 2] > > I understand (I think!) that this is due to the fact that in Python > what looks like "assignment" really is binding a name to an > object. The result is that inside the loop I am

Re: python vs perl lines of code

2006-05-16 Thread Ala Qumsieh
Edward Elliott wrote: > John Bokma wrote: >> >>Without seeing the actual code this is quite meaningless. > > > Evaluating my experiences yes, relating your own no. Well, quality of code is directly related to its author. Without knowing the author personally, or at least seeing the code, your a

Re: Time to bundle PythonWin

2006-05-16 Thread Martin v. Löwis
Dave Benjamin wrote: > Sure. I wasn't proposing that this be done behind Mark's back. I wasn't > even proposing a fork; rather, just two installers bundled into one. The > user, upon running the .msi file, would simply be asked if they'd like > PythonWin also. PythonWin could be automatically combi

Re: python vs perl lines of code

2006-05-16 Thread Charles DeRykus
Edward Elliott wrote: > John Bokma wrote: > >> Edward Elliott <[EMAIL PROTECTED]> wrote: >> >>> This is just anecdotal, but I still find it interesting. Take it for >>> what it's worth. I'm interested in hearing others' perspectives, just >>> please don't turn this into a pissing contest. >> Wit

Re: A better way of making subsclassing of built-in types stick for attributes?

2006-05-16 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Is there a better way to make the subclassing of built-in types > stick? They stick. Your new classes are available until you get rid of them. > The goal is to have the the fields of a class behave like strings > with extra methods attached. That

Re: assignment in a for loop

2006-05-16 Thread MackS
Sorry, my previous post probably was not very good at explaining _why_ I want to do this. Suppose I want to do modify all arguments which are passed to a function. Do I need to use a list comprehension such as def f(arg1,arg2,arg3): arg1,arg2,arg3 = [i+1 for i in (arg1,arg2,arg3)] ...

Re: Creating an Active Desktop Window

2006-05-16 Thread Roger Upole
rodmc wrote: > Hi, > > Does anyone know how I can create an Active Desktop window from within > a Python script? It would also be good to know how to refresh that > window and nothing else. > > At present I have an application which writes to a file which is read > by the Active Desktop (embeded I

Re: A Unicode problem -HELP

2006-05-16 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > I'm a newbie at python, so I don't really understand how your answer > solves my unicode problem. Since your replies fail to give any context of the existing discussion, I could only go by the content of what you'd written in that message. I didn't see a pr

assignment in a for loop

2006-05-16 Thread MackS
Hello everyone Consider the following >>> l = [1,2] >>> for i in l: ... i = i + 1 ... >>> l [1, 2] I understand (I think!) that this is due to the fact that in Python what looks like "assignment" really is binding a name to an object. The result is that inside the loop I am creating an objec

Re: build now requires Python exist before the build starts

2006-05-16 Thread [EMAIL PROTECTED]
Toon Knapen wrote: > I'm trying to build the svn-trunk version of python on a Solaris box. > However I do not have a python installed yet and apparantly the build of > python requires a python to be accessible (as also annotated in the > Makefile generated during the ./configure). How can I solve t

Re: common practice for creating utility functions?

2006-05-16 Thread BartlebyScrivener
Hey, thanks. I got the writing thing down: http://dooling.com Now I'm trying to pick up the programming part. Thanks for links. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: pythoncom and IDispatch

2006-05-16 Thread Roger Upole
"fraca7" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. I got a little problem while using pythoncom to automate IE; for some > reason, changing the 'selectedIndex' on an > instance of IHTMLSelectElement doesn't fire the 'onchange' event (I guess > this is a bug in mshtml)

Re: A Unicode problem -HELP

2006-05-16 Thread manstey
I'm a newbie at python, so I don't really understand how your answer solves my unicode problem. I have done more reading on unicode and then tried my code in IDLE rather than WING IDE, and discovered that it works fine in IDLE, so I think WING has a problem with unicode. For example, in WING this

A better way of making subsclassing of built-in types stick for attributes?

2006-05-16 Thread [EMAIL PROTECTED]
Is there a better way to make the subclassing of built-in types stick? The goal is to have the the fields of a class behave like strings with extra methods attached. That is, I want the fact that the fields are not strings to be invisible to the client programmers. But I always want the extras to

Re: help with this simple DB script

2006-05-16 Thread John Salerno
John Salerno wrote: > Ok, before I contact my server host, I figured I should make sure I'm > not just making a Python mistake. I get an Internal Server Error with > this script: Ok, got some help from Dennis Bieber and he solved it. I was using number(), which is a SQL but not a MySQL command.

Re: help with this simple DB script

2006-05-16 Thread John Salerno
BartlebyScrivener wrote: > Are you able to connect to the DB using MySQL administrator? > Yes, through my hosting control panel. That's how I created the DB, but I want to try to do everything else with mysqldb. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help System For Python Applications

2006-05-16 Thread BartlebyScrivener
At the commandline, run: pydoc -g In the interpreter: help("modulename") or help () for interactive. Are you on Windows? Using ActivePython? Or the Python.org download? rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Is the only way to connect Python and Lua through a C interface?

2006-05-16 Thread Pierre Rouleau
Casey Hawthorne wrote: > Is the only way to connect Python and Lua through a C interface? Take a look at Lunatic Python (http://labix.org/lunatic-python) -- Pierre Rouleau -- http://mail.python.org/mailman/listinfo/python-list

Re: [silly] Does the python mascot have a name ?

2006-05-16 Thread Edward Elliott
Carl J. Van Arsdall wrote: > Well, we could call the perl camel Joe but I don't know if the perlcores > (read: hardcore PERL users) would be down for that ;) Hmmm. Perl is like smoking, it feels great and gives you cancer. Yes, there's definitely potential here. ;) -- Edward Elliott UC Berkel

Re: using target words from arrays in regex, pythons version of perls 'map'

2006-05-16 Thread Edward Elliott
John Machin wrote: > Would you believe "steps 3 & 4"? How about "two pops and a pass?" Quick! Lower the cone of silence! -- Edward Elliott UC Berkeley School of Law (Boalt Hall) complangpython at eddeye dot net -- http://mail.python.org/mailman/listinfo/python-list

Re: help with a function

2006-05-16 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Lance Hoffmeyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hey all, > > > > I'm new to python. I keep getting an error when running this. > > I'm sure there is an easy fix but I can't figure it ou

Re: common practice for creating utility functions?

2006-05-16 Thread Edward Elliott
Bruno Desthuilliers wrote: > Then it would be better to just alias it: > > # def convert_quote(quote): > # return make_code(quote) > convert_quote = make_code The former makes sense if you're planning to do more with the calling function later. > About the "fine to do" part, remember that

Re: help with this simple DB script

2006-05-16 Thread John Salerno
[EMAIL PROTECTED] wrote: > This is probably causing a problem: > !#/usr/bin/python > > It should be "#!", not "!#". Ugh! So stupid! Thanks for correcting that, but it wasn't the only problem. > If that doesnt' work, add this line at the top of your script, to check > that the script is begin exe

Re: common practice for creating utility functions?

2006-05-16 Thread Edward Elliott
BartlebyScrivener wrote: > QOTW > > "Programming is not just creating strings of instructions for a > computer to execute. It's also 'literary' in that you are trying to > communicate a program structure to other humans reading the code." Paul > Rubin I take it you've never heard of Donald Knut

Re: A Unicode problem -HELP

2006-05-16 Thread Ben Finney
"manstey" <[EMAIL PROTECTED]> writes: > input_file = open(input_file_loc, 'r') > output_file = open(output_file_loc, 'w') > for line in input_file: > output_file.write(str(word_info + parse + gloss)) # = three functions > that return tuples If you mean that 'word_info', 'parse' and 'gloss'

Re: help with a function

2006-05-16 Thread Paul McGuire
"Lance Hoffmeyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey all, > > I'm new to python. I keep getting an error when running this. > I'm sure there is an easy fix but I can't figure it out. > What am I doing wrong? How do I fix it? > > def even_odd_round(num): > if(round

Re: help with a function

2006-05-16 Thread Ben Finney
Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > def even_odd_round(num): > if(round(num,2) + .5 == int(round(num,2)) + 1): >if(int(num,0) % 2):#an odd number > rounded_num = round(num,2) + .1 >else: #an even n

Re: A Unicode problem -HELP

2006-05-16 Thread manstey
Hi Martin, HEre is how I write: input_file = open(input_file_loc, 'r') output_file = open(output_file_loc, 'w') for line in input_file: output_file.write(str(word_info + parse + gloss)) # = three functions that return tuples (u'F', u'\u0254') are two of the many unicode tuple elements retu

Re: constucting a lookup table

2006-05-16 Thread mhodkin
Larry Bates wrote: > [EMAIL PROTECTED] wrote: > > I'm new to Python and want to contruct a "lookup table" which would be > > similar to a spreadsheet in that a value is read along the first > > column, then along the top row, and the intersection of the two gives a > > value that is hard-coded, i.

help with a function

2006-05-16 Thread Lance Hoffmeyer
Hey all, I'm new to python. I keep getting an error when running this. I'm sure there is an easy fix but I can't figure it out. What am I doing wrong? How do I fix it? def even_odd_round(num): if(round(num,2) + .5 == int(round(num,2)) + 1): if(int(num,0) % 2):

Re: do/while structure needed

2006-05-16 Thread Edward Elliott
Dennis Lee Bieber wrote: > Would you put the condition at the top of the loop -- and confuse > those people who believe the exit condition should appear at the point > the exit activates? Confusion is not the issue. You can put the condition smack dab in the middle of the loop, as long as the lo

Re: help with this simple DB script

2006-05-16 Thread trebucket
This is probably causing a problem: !#/usr/bin/python It should be "#!", not "!#". If that doesnt' work, add this line at the top of your script, to check that the script is begin executed: print "Content-Type: text/html\n\n" print "Hello, World!" If you still get an Internal Server Error put t

Re: any plans to make pprint() a builtin?

2006-05-16 Thread Edward Elliott
Ant wrote: > Longer, messy, and what's the actual point? Wouldn't: > > import pprint as pp > pp.pprint(x) > > be better, standard *and* shorter? why not just: from pprint import pprint pprint (x) No need to modify the interpreter when you can pollute the global namespace yourself just as easi

Re: help with this simple DB script

2006-05-16 Thread John Machin
Please learn to provide needed information when asking questions. 1. What does "run it directly with my URL" mean?? 2. Show the traceback that you got. -- http://mail.python.org/mailman/listinfo/python-list

Re: help with this simple DB script

2006-05-16 Thread BartlebyScrivener
Are you able to connect to the DB using MySQL administrator? -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs perl lines of code

2006-05-16 Thread Edward Elliott
John Bokma wrote: > Edward Elliott <[EMAIL PROTECTED]> wrote: > >> This is just anecdotal, but I still find it interesting. Take it for >> what it's worth. I'm interested in hearing others' perspectives, just >> please don't turn this into a pissing contest. > > Without seeing the actual code

Re: python vs perl lines of code

2006-05-16 Thread John Bokma
Edward Elliott <[EMAIL PROTECTED]> wrote: > This is just anecdotal, but I still find it interesting. Take it for > what it's worth. I'm interested in hearing others' perspectives, just > please don't turn this into a pissing contest. Without seeing the actual code this is quite meaningless. -

python vs perl lines of code

2006-05-16 Thread Edward Elliott
This is just anecdotal, but I still find it interesting. Take it for what it's worth. I'm interested in hearing others' perspectives, just please don't turn this into a pissing contest. I'm in the process of converting some old perl programs to python. These programs use some network code and d

help with this simple DB script

2006-05-16 Thread John Salerno
Ok, before I contact my server host, I figured I should make sure I'm not just making a Python mistake. I get an Internal Server Error with this script: !#/usr/bin/python import MySQLdb db = MySQLdb.connect(host='xxx', user='xxx', passwd='xxx',

Is the only way to connect Python and Lua through a C interface?

2006-05-16 Thread Casey Hawthorne
Is the only way to connect Python and Lua through a C interface? -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: advice modifying re library to support more than 100 named captures.

2006-05-16 Thread Tim Peters
[Richard Meraz] > We need to capture more than 99 named groups using python regular > expressions. > ... > its clear why the language designers have decided on this limitation. For > our system, however, it is essential that we be able to capture an arbitrary > number of groups. > > Could anyone o

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread skip
bob> If you have the same number of entries as buckets, and you have a bob> good hash function, then if you have n buckets your longest chain bob> should have length around ln(n). The average length of a nonempty bob> bucket would be somewhere around 1 1/2. Yes, and it achieves t

Re: Unable to extract Python source code using Windows

2006-05-16 Thread John Machin
Elric02 wrote: """ I'm currently trying to get access to the Python source code, however whenever I try to extract the files using the latest version of WinZip (version 10) I get the following error "error reading however after processing 0 entries """ I've managed to reproduce this behaviour: 1.

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread skip
Roy> If you're getting long hash chains, you're either using a bad hash Roy> function, or your table isn't big enough. Sure. The original poster said something about 10 million keys I think. Unless the key distribution is amazingly fortuitous and the number of unique values is small, the

advice modifying re library to support more than 100 named captures.

2006-05-16 Thread Richard Meraz
Dear group members,We need to capture more than 99 named groups using python regular expressions.  From the docs and from this thread ( http://groups.google.com/group/comp.lang.python/browse_thread/thread/a39a91b4bf8e3df4/2ad4a7e01b60215d?lnk=st&q=python+regular+_expression_+group+limit&rnum=3#2ad4

Re: calling upper() on a string, not working?

2006-05-16 Thread Paul Rubin
John Salerno <[EMAIL PROTECTED]> writes: > Now, I know the actual upper() function works, but I can't understand > if there's a problem with *when* it's being called, or what's being > done with it to get the second result above. You are translating "original" which still has lower case letters:

Re: Using python for a CAD program

2006-05-16 Thread Ben Finney
baalbek <[EMAIL PROTECTED]> writes: > If you really want to revolutionize the CAD business, PLEASE don't > base your CAD system on a file based system (ala Autocad). > > CAD systems available today (Autocad, Archicad, Architectural > Desktop, etc) have one huge flaw: they don't store data to a SQ

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Aaron Gray
I was once a religous tabber until working on multiple source code sources, now I am a religious spacer :) My 2bits worth, Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to extract Python source code using Windows

2006-05-16 Thread John Machin
Elric02 wrote: """ I tried downloading for different archives, (different versions of Python) I can't believe they are all garbled. But they all don't work with WinZip. """ I can't believe that they're all garbled either. The likelihood of that is small. Further, the probablility that all-pervas

Python and GLSL

2006-05-16 Thread Simon Bunker
Hi I was wondering if there is a Python module for running GLSL (OpenGL shader language) in OpenGL through Python. I think that Cg is available through PyCg - most likely using PyGame for the OpenGL. Has anyone done this with GLSL shaders? thanks Simon -- http://mail.python.org/mailman/list

Re: calling upper() on a string, not working?

2006-05-16 Thread Scott David Daniels
John Salerno wrote: Others have shown you where the bug was. You might want to change encrypt_quote like this: XXX> def encrypt_quote(original): def encrypt_quote(original, casemap=True): XXX> original_letters = filter_letters(original) if casemap: original_letters = filter

Re: Using python for a CAD program

2006-05-16 Thread baalbek
> 1. Databases. I don't mean sql type database, but design databases, If you really want to revolutionize the CAD business, PLEASE don't base your CAD system on a file based system (ala Autocad). CAD systems available today (Autocad, Archicad, Architectural Desktop, etc) have one huge flaw: t

Re: arrays, even, roundup, odd round down ?

2006-05-16 Thread Ben Finney
Lance Hoffmeyer <[EMAIL PROTECTED]> writes: > So, I have using the following to grab numbers from MS Word. I > discovered that that there is a "special" rule being used for > rounding. > > If a ??.5 is even the number is to rounded down (20.5 = 20) > if a ??.5 is odd the number is to rounded up

Re: Option parser question - reading options from file as well as command line

2006-05-16 Thread Andrew Robert
Max Erickson wrote: > I don't know much about optparse, but since I was bored: > help(o.parse_args) > Help on method parse_args in module optparse: > > parse_args(self, args=None, values=None) method of > optparse.OptionParser instance > parse_args(args : [string] = sys.argv[1:], >

Re: Unable to extract Python source code using Windows

2006-05-16 Thread John Machin
> http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tar.bz2 And the reason for posting that would be what? WinZip doesn't support bzip2 compression. http://www.python.org/ftp/python/2.4.3/Python-2.4.3.tgz (a gzipped tar file) is what the OP would be better pointed at. FWIW, I have just downloa

Re: taking qoutes in arguments

2006-05-16 Thread Ben Finney
"Lee Caine" <[EMAIL PROTECTED]> writes: > yea thanks alot for your help, gonna read up on 'Konsole' :) Be advised that 'Konsole' is not a command shell, it's a GUI program for running a command shell. On POSIX systems, find out what your current command shell is with this command: echo $SHE

Re: Time to bundle PythonWin

2006-05-16 Thread Dave Benjamin
Martin v. Löwis wrote: > Dave Benjamin wrote: >> Why is PythonWin (win32all) still a separate download from a third >> party? Is it legal, technical, or what? I think it's about time it be >> part of the standard distribution. > > Both legal and technical. The PythonWin author and maintainer (Mark

Re: Large Dictionaries

2006-05-16 Thread Klaas
>22.2s 20m25s[3] 20m to insert 1m keys? You are doing something wrong. With bdb's it is crucial to insert keys in bytestring-sorted order. Also, be sure to give it a decent amount of cache. -Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread bob_jenkins
If you have the same number of entries as buckets, and you have a good hash function, then if you have n buckets your longest chain should have length around ln(n). The average length of a nonempty bucket would be somewhere around 1 1/2. -- http://mail.python.org/mailman/listinfo/python-list

Re: round numbers in an array without importing Numeric or Math? - SOLVED, sort of

2006-05-16 Thread Scott David Daniels
Paul McGuire wrote: > ... or if you prefer the functional approach (using map)... > > roundToInt = lambda z : int(z+0.5) > Topamax = map( roundToInt, map( float, map(str, Topamax) ) ) Somehow, the list comprehension looks simpler and clearer to me: Topamax = [int(float(uni) + .5) for uni in

Re: Time to bundle PythonWin

2006-05-16 Thread Dave Benjamin
[EMAIL PROTECTED] wrote: > The ctypes.com package is no longer part of ctypes. > It has been split by Thomas Heller into a separate package comtypes. > See: http://sourceforge.net/projects/comtypes/ > > Still in its childhood but as easy as com can get, I guess, way easier > and better than python

Re: Time to bundle PythonWin

2006-05-16 Thread Dave Benjamin
Ten wrote: > Respectfully, that sounds like a reason for *you* to bundle pythonwin (and > python, to be honest :) ), not a reason for everyone else to have to download > an extra 40-50% of potentially superfluous cruft with their standard python > setup. Certainly, I could bundle Python and Pyt

Re: Unable to extract Python source code using Windows

2006-05-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Scott , > I tried downloading for different archives, (different versions of > Python) I can't believe they are all garbled. But they all don't work > with WinZip. > OK, against my better judgment (you haven't shown your work so far): I get an md5 for python-2.4.3.tar.

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread achates
Duncan Booth wrote: >However the important thing is that a tab does >not map to a single indentation level in Python: it can map to any number >of indents, and unless I know the convention you are using to display the >tabs I cannot know how many indents are equivalent to a tabstop. Sorry but thi

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Kaz Kylheku
achates wrote: > Kaz Kylheku wrote: > > > If you want to do nice typesetting of code, you have to add markup > > which has to be stripped away if you actually want to run the code. > > Typesetting code is not a helpful activity outside of the publishing > industry. Be that as it may, code writing

Re: Unable to extract Python source code using Windows

2006-05-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Scott , > I tried downloading for different archives, (different versions of > Python) I can't believe they are all garbled. But they all don't work > with WinZip. And what checksum did you get? --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailma

arrays, even, roundup, odd round down ?

2006-05-16 Thread Lance Hoffmeyer
So, I have using the following to grab numbers from MS Word. I discovered that that there is a "special" rule being used for rounding. If a ??.5 is even the number is to rounded down (20.5 = 20) if a ??.5 is odd the number is to rounded up (21.5 = 22) Brands = ["B1","B2"] A1 = [] A1 = [ re.sear

Re: Beautiful parse joy - Oh what fun

2006-05-16 Thread Larry Bates
rh0dium wrote: > Hi all, > > I am trying to parse into a dictionary a table and I am having all > kinds of fun. Can someone please help me out. > > What I want is this: > > dic={'Division Code':'SALS','Employee':'LOO ABLE'} > > Here is what I have.. > > html=""" src="/icons/ecblank.gif"

Re: Python and Combinatorics

2006-05-16 Thread Peter Otten
Nic wrote: > In my example I've chosen the number 3. > How should I change the Python code in order to select another number > (e.g. 7)? Here is a parameterized render(). def render(w, h, suffixes="ab"): pairs = list(unique(range(1, h+1), 2)) for item in unique(pairs, w): for suf

still don't get unicode and xml - help!

2006-05-16 Thread jmdeschamps
I have to work with XML data containing accented characters (ISO-8859-1 encoding) Using ElementTree, the only way i found to get the text attribute of a node was to encode it individually, if you want. It doubles the amount of time to process :-( i surely doing this wrong... What is the good way to

Beautiful parse joy - Oh what fun

2006-05-16 Thread rh0dium
Hi all, I am trying to parse into a dictionary a table and I am having all kinds of fun. Can someone please help me out. What I want is this: dic={'Division Code':'SALS','Employee':'LOO ABLE'} Here is what I have.. html=""" Division Code: SALS Employee: LOO ABLE """ from Beautiful

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Duncan Booth
achates wrote: >>In particular a common convention is to have indentations at 4 >>spaces and tabs expanding to 8 spaces. > > Like all space-indenters, you seem to be hung up on the idea of a tab > 'expanding' to n spaces. It only does that if you make your editor > delete the tab character and re

Re: calling upper() on a string, not working?

2006-05-16 Thread John Salerno
Bruno Desthuilliers wrote: >> def encrypt_quote(original): > # Since it's here that we define that the new letters > # will be uppercase only, it's our responsability > # to handle any related conditions and problems > # The other functions shouldn't have to even know this.

Re: calling upper() on a string, not working?

2006-05-16 Thread Bruno Desthuilliers
John Salerno a écrit : > Can someone tell me what's happening here. This is my code: > > PUNCT_SPACE_SET = set(string.punctuation + string.whitespace) > > def filter_letters(original): > return ''.join(set(original) - PUNCT_SPACE_SET) > > 'original' is a string. The above works as expected,

Re: calling upper() on a string, not working?

2006-05-16 Thread Larry Bates
John Salerno wrote: > Can someone tell me what's happening here. This is my code: > > > > PUNCT_SPACE_SET = set(string.punctuation + string.whitespace) > > def filter_letters(original): > return ''.join(set(original) - PUNCT_SPACE_SET) > > > > 'original' is a string. The above works as e

Re: SystemError: ... cellobject.c:22: bad argument to internal ?

2006-05-16 Thread robert
[EMAIL PROTECTED] wrote: > robert wrote: > >>From the trace of a 2.3.5 software i got: >> >>\'SystemError: >>C:sfpythondist23srcObjectscellobject.c:22: bad >>argument to internal >>function\\n\'] > > > ... > > >>Will there be another bug-fix release of Python 2.3 ? >

Re: calling upper() on a string, not working?

2006-05-16 Thread John Salerno
Michal Kwiatkowski wrote: > And here you're translating 'original' (which contains a lot of > lowercase letters) with use of trans_table that maps only uppercase > characters. This return should be: > > return original.upper().translate(trans_table) Thank you!!! :) -- http://mail.python

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread achates
Duncan Booth wrote: >Because it doesn't mean 'one level of indentation', it means 'move to next >tabstop' and a tabstop isn't necessarily the same as a level of >indentation. 'move to next tabstop' is how your editor interprets a tab character. 'one level of indentation' is how the language parse

Re: calling upper() on a string, not working?

2006-05-16 Thread Michal Kwiatkowski
John Salerno wrote: > def encrypt_quote(original): > original_letters = filter_letters(original) You call filter_letters() which makes upper() on all letters, so original_letters contain only uppercase letters. > new_letters = list(string.ascii_uppercase) > while True: > r

Re: calling upper() on a string, not working?

2006-05-16 Thread John Salerno
Felipe Almeida Lessa wrote: > Em Ter, 2006-05-16 às 20:25 +, John Salerno escreveu: >> it doesn't seem to work. The full code is below if it helps to understand. > > Why doesn't it work? What does it do, what did you expect it to do? If you run the whole script with the first line (the one no

Re: IDLE confusion

2006-05-16 Thread Terry Reedy
"Christophe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Try in the IDLE menu [Shell] "Restart Shell" (Ctrl+F6) each time you > have changed something in your files - this "resets" anything previously > imported, which stays the same way otherwise. And I though that "bug" was f

Re: How to log only one level to a FileHandler using python logging module.

2006-05-16 Thread zacherates
Try looking into logging.Filters: http://docs.python.org/lib/node358.html An example: import logging class InfoFilter(logging.Filter): def filter(self, record): return record.levelno == 20 if __name__ == "__main__": logger = logging.getLogger() hdlr = log

Re: Option parser question - reading options from file as well as command line

2006-05-16 Thread Max Erickson
Andrew Robert <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Any ideas? I don't know much about optparse, but since I was bored: >>> help(o.parse_args) Help on method parse_args in module optparse: parse_args(self, args=None, values=None) method of optparse.OptionParser instance p

Re: calling upper() on a string, not working?

2006-05-16 Thread Felipe Almeida Lessa
Em Ter, 2006-05-16 às 20:25 +, John Salerno escreveu: > it doesn't seem to work. The full code is below if it helps to understand. Why doesn't it work? What does it do, what did you expect it to do? >>> ''.join(set('hi')) 'ih' >>> ''.join(set('HI')) 'IH' >>> ''.join(set('hiHI')) 'ihIH' >>> ''

calling upper() on a string, not working?

2006-05-16 Thread John Salerno
Can someone tell me what's happening here. This is my code: PUNCT_SPACE_SET = set(string.punctuation + string.whitespace) def filter_letters(original): return ''.join(set(original) - PUNCT_SPACE_SET) 'original' is a string. The above works as expected, but when I change it to return '

Re: Using python for a CAD program

2006-05-16 Thread Grant Edwards
On 2006-05-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Yes, I figured I should be pretty expert at what's out there > first before redoing something and making in inferior to the > existing solution. Eagle from Cadsoft.de is a pretty decent (and free for educational/hobby use) integrated s

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread Roy Smith
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >Graham> Looking up a key in a dictionary is done in constant-time, >Graham> i.e. it doesn't matter how large the dictionary is. > >Doesn't that depend on how many keys hash to the same value? For small >dictionaries keeping the

Re: A critic of Guido's blog on Python's lambda

2006-05-16 Thread Ken Tilton
Lasse Rasinen wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>If you want to insist on how perfect your code is, please go find >>ltktest-cells-inside.lisp in the source you downloaded and read the long >>comment detailing the requirements I have identified for "data integrity". >>Then (a

Re: Using python for a CAD program

2006-05-16 Thread 63q2o4i02
Yes, I figured I should be pretty expert at what's out there first before redoing something and making in inferior to the existing solution. I took a quick peek at cadence courses, and they're out of my personal price range. I have a new job coming up which should lead into IC design after some t

  1   2   3   >