Re: Decrypt DES by password

2006-05-16 Thread Paul Rubin
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: > > I'm not aware of a standard that says how CryptDeriveKey is supposed > > to work > I tried to find out how the monofolks did it, but also they didn't know > the algorithms. Actually this is almost certainly an entry into the Windows Crypto AP

Re: List and order

2006-05-16 Thread Nic
Perfect. Thanks. Nic "Peter Otten" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Nic wrote: > >> The only problem is that from: >> 12 >> 22 >> 21 >> In spite of writing >> 12 12 22 >> it writes >> 12 21 22 >> Do you know how is it possible to delete also this last trouble?

Re: C API: getting sys.argv

2006-05-16 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > John Machin wrote: >> > PyObject *_argv = PyImport_ImportModule("sys.argv"); >> >> What does the name of the function tell you? You can't do that in one >> hit. Start with >> PyObject *_sys = PyImport_ImportModule("sys"); >> then you need to get the module's argv attribut

Python and Combinatorics

2006-05-16 Thread Nic
Hello, I've a problem in defining a good Python code useful to articulate the following algorithm. Can you help me please? Thanks a bunch, Nic 1. Insert a number "n". Example: 3 2. List all the numbers < or = to n. Example: 1,2,3. 3. Combine the listed numbers each other. Example: 12 13 23 4.

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Duncan Booth
achates wrote: > A tab is not equivalent to a number of spaces. It is a character > signifying an indent, just like the newline character signifies the end > of a line. If your editor automatically converts tabs to spaces (i.e. > you are unable to create source files containing tabs) then either i

accessing information in a class

2006-05-16 Thread Hudson Diederich
hello, I'm writing a gui evotign program and I need to access information inputted by a user through a radiobutton. the radobuttons are in a class and I cannot get the value of the radiobuttons -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Combinatorics

2006-05-16 Thread Peter Otten
Nic wrote: [Algorithm that I may have misunderstood] > 12a 13a 23a > 12a 13b 23a > 12a 13b 23b > 12b 13a 23a > 12b 13b 23a > 12b 13b 23b What about 12a 13a 23b and 12b 13a 23b? Peter PS: Please don't top-post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-05-16 Thread Duncan Booth
Chris Foote wrote: > > Don't forget that adding keys >> requires resizing the dict, which is a moderately expensive operation. > > Yep, that's why I probably need a dictionary where I can pre-specify > an approximate size at the time of its creation. Try splitting the creation of the keys from t

Re: do/while structure needed

2006-05-16 Thread Antoon Pardon
Op 2006-05-15, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "John Salerno" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Thanks, that looks pretty good. Although I have to say, a do/while >> structure is the much more obvious way. I wonder why it hasn't been >> added to the lang

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

2006-05-16 Thread Ben
Ok, I'm sorry. This kind of discussions between two groups of people, neither of who know the other person's language very well just wind me up something chronic! It wasn't your post as such, just reading through most of the thread in one go. That will teach me to post while cross :). Sorry for an

Re: Python and Combinatorics

2006-05-16 Thread Nic
I forgot them. Sorry. They should be included. Nic "Peter Otten" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Nic wrote: > > [Algorithm that I may have misunderstood] > >> 12a 13a 23a >> 12a 13b 23a >> 12a 13b 23b >> 12b 13a 23a >> 12b 13b 23a >> 12b 13b 23b > > What abou

IDLE confusion

2006-05-16 Thread MrBlueSky
Hi, I'm trying to use IDLE to develop My First Python App and my head hurts... I've a file called spalvi.py with this in it: from Test import * firstTest("Mike") And a file called Test.py with this in it: def firstTest(name): print "Yo",name I open spalvi.py with IDLE and Run

Re: Python and Combinatorics

2006-05-16 Thread Peter Otten
Nic wrote: >> PS: Please don't top-post. You probably overlooked that :-) Here's a naive implementation: from itertools import izip def unique(items, N): assert N > 0 if N == 1: for item in items: yield item, else: for index, item in enumerate(items):

Re: IDLE confusion

2006-05-16 Thread Claudio Grondi
MrBlueSky wrote: > Hi, I'm trying to use IDLE to develop My First Python App and my head > hurts... > > I've a file called spalvi.py with this in it: > from Test import * > firstTest("Mike") > > And a file called Test.py with this in it: > def firstTest(name): > print "Yo",nam

Re: IDLE confusion

2006-05-16 Thread Christophe
Claudio Grondi a écrit : > MrBlueSky wrote: > >> Hi, I'm trying to use IDLE to develop My First Python App and my head >> hurts... >> >> I've a file called spalvi.py with this in it: >> from Test import * >> firstTest("Mike") >> >> And a file called Test.py with this in it: >> def firs

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Ed Singleton
On 5/15/06, Brian Quinlan <[EMAIL PROTECTED]> wrote: > The problem with tabs is that people use tabs for alignment e.g. > > def foo(): >->query = """SELECT * >-> -> -> FROM sometable >-> -> -> WHERE condition""" > > Now I change my editor to use 8-space tabs and the code is all

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Sybren Stuvel
Duncan Booth enlightened us with: > That is true so far as it goes, but equally if your editor inserts a > tab character when you press the tab key it is as broken as though > it inserted a backspace character when you press the backspace key. > In both of these cases you have an operation (move to

problem with namespaces using eval and exec

2006-05-16 Thread Jens
Hi, has anyone an idea why the following code does not work. s = """ def a(n): return n*n def b(t): return a(t) """ ns = {} exec(s, {}, ns) eval("b(2)", ns, {}) executing this script raises an exception (NameError: global name 'a' is not defined) in the last line. Hope for your help

Re: Large Dictionaries

2006-05-16 Thread Chris Foote
Claudio Grondi wrote: > Chris Foote wrote: >> p.s. Disk-based DBs are out of the question because most >> key lookups will result in a miss, and lookup time is >> critical for this application. >> > Python Bindings (\Python24\Lib\bsddb vers. 4.3.0) and the DLL for > BerkeleyDB (\Python24\DLLs\_bsd

Re: Large Dictionaries

2006-05-16 Thread Chris Foote
Paul McGuire wrote: > "Claudio Grondi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Chris Foote wrote: >>> Hi all. >>> >>> I have the need to store a large (10M) number of keys in a hash table, >>> based on a tuple of (long_integer, integer). The standard python >>> dictionary

Re: Multiple inheritance : waht does this error mean ?

2006-05-16 Thread Michele Simionato
[EMAIL PROTECTED] wrote: > I am using Python 2.4.3 > > >>>class K(object,list): >...: pass >...: > > Traceback (most recent call last): > File "", line 1, in ? > TypeError: Error when calling the metaclass bases > Cannot

[silly] Does the python mascot have a name ?

2006-05-16 Thread Steve
umm, was just wondering, does the python mascot have a name ? We are naming the conference rooms in our office you see :o). Also, is there a place I could get some neat, good quality pics of the python ? - steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Iain King
Oh God, I agree with Xah Lee. Someone take me out behind the chemical sheds... Iain Xah Lee wrote: > Tabs versus Spaces in Source Code > > Xah Lee, 2006-05-13 > > In coding a computer program, there's often the choices of tabs or > spaces for code indentation. There is a large amount of confus

Re: Python and Combinatorics

2006-05-16 Thread Gerard Flanagan
Nic wrote: > Hello, > I've a problem in defining a good Python code useful to articulate the > following algorithm. > Can you help me please? > Thanks a bunch, > Nic > > 1. Insert a number "n". > Example: 3 > > 2. List all the numbers < or = to n. > Example: 1,2,3. > > 3. Combine the listed number

Re: Large Dictionaries

2006-05-16 Thread Chris Foote
lcaamano wrote: > Sounds like PyTables could be useful. > > http://www.pytables.org In browsing their excellent documentation, it seems that all concepts are built around storing and reading HDF5 format files. Not suitable for this project unfortunately. Cheers, Chris -- http://mail.python.o

Re: problem with namespaces using eval and exec

2006-05-16 Thread Maric Michaud
Le Mardi 16 Mai 2006 11:05, Jens a écrit : > s = """ > def a(n): >   return n*n > > > def b(t): >   return a(t) > """ > > > ns = {} > exec(s, {}, ns) > eval("b(2)", ns, {}) you passed an empty globals dictionnary to the eval func (the local one is not in the scope of b defintion) try this : exec

Re: Far from complete

2006-05-16 Thread Steve Holden
Kay Schluehr wrote: > Section 2.3 of the Python 2.5. tutorial > > "The following sections describe the standard types that are built into > the interpreter. Historically, Python's built-in types have differed > from user-defined types because it was not possible to use the built-in > types as the

Re: problem with namespaces using eval and exec

2006-05-16 Thread Peter Otten
Jens wrote: > has anyone an idea why the following code does not work. > s = """ > def a(n): > return n*n > def b(t): > return a(t) > """ > ns = {} > exec(s, {}, ns) Here you are providing a local namespace into which all toplevel names (a and b) are inserted. > eval("b(2)", ns, {}) Here

Re: Large Dictionaries

2006-05-16 Thread John Machin
> (my dictionary values are all None). So in fact all you need is a set. Have you experimented with the Python 2.5 alpha? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Duncan Booth
Sybren Stuvel wrote: >> An editor should be capable of letting you create or modify files >> containing control characters without gratuitously corrupting them, >> but the keys should perform the expected operations > > I agree with that. > >> not insert the characters. > > But not with that, s

Re: Large Dictionaries

2006-05-16 Thread Vladimir 'Yu' Stepanov
Chris Foote wrote: > lcaamano wrote: > >> Sounds like PyTables could be useful. >> >> http://www.pytables.org >> > > In browsing their excellent documentation, it seems that all concepts > are built around storing and reading HDF5 format files. > > Not suitable for this project unfortunate

Python script windows servcie

2006-05-16 Thread Mivabe
I'm using a Python script om my Wildfire XMPP server to connect to external transports (for instantce MSN) I configured the script as a windows service with 'srvany' and 'instrv" and everything seems te work fine. The service starts with the system, but as soon as an local useraccount (remote d

Re: Large Dictionaries

2006-05-16 Thread Duncan Booth
John Machin wrote: >> (my dictionary values are all None). > > So in fact all you need is a set. Have you experimented with the Python > 2.5 alpha? > I don't think that will help him: my timings work out about the same on 2.4.2 or 2.5a2. As I pointed out, the bottleneck is creating the tuples.

Re: Argument Decorators Enhancement?

2006-05-16 Thread bayerj
Hi, -1 because I find it extremly hard to read and not necessary in that scale. Actually, there are a lot of recipes in the Cookbook [1] on how to use decorators for type-checking. On example is: @require(int, int) def add(x,y): return x + y Which I find much more readable, easier to implement

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Sybren Stuvel
Duncan Booth enlightened us with: > It could be, and for some keys (q, w, e, r, t, y, etc. spring to > mind) that is quite a reasonable implementation. For others 'tab', > 'backspace', 'enter', 'delete', etc. it is less reasonable, but it > is a quality of implementation issue. If I had an editor w

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

2006-05-16 Thread A. Rogowski
[EMAIL PROTECTED] (Alex Martelli) writes: > Bill Atkins <[EMAIL PROTECTED]> wrote: >... > > > ``allow ( as an ordinary single-character identifier'' as for the > > > unneded feature ``allow unnamed functions with all the flexibility of > > > named ones''. > > > > Not so infeasible: > > > >

Re: Large Dictionaries

2006-05-16 Thread Claudio Grondi
Chris Foote wrote: > Claudio Grondi wrote: > >> Chris Foote wrote: >> >>> p.s. Disk-based DBs are out of the question because most >>> key lookups will result in a miss, and lookup time is >>> critical for this application. >>> >> Python Bindings (\Python24\Lib\bsddb vers. 4.3.0) and the DLL for

Re: Far from complete

2006-05-16 Thread Kay Schluehr
Steve Holden wrote: > Kay Schluehr wrote: > > Section 2.3 of the Python 2.5. tutorial > > > > "The following sections describe the standard types that are built into > > the interpreter. Historically, Python's built-in types have differed > > from user-defined types because it was not possible to u

Re: Large Dictionaries

2006-05-16 Thread [EMAIL PROTECTED]
BTW why are python dicts implemented as hash tables and not judy arrays? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python for a CAD program

2006-05-16 Thread BartlebyScrivener
Art Haas posts from time to time regarding a program called PythonCad that he maintains: http://tinyurl.com/o36t8 Also, here is a search of this forum on "Cad": http://tinyurl.com/nuobe -- http://mail.python.org/mailman/listinfo/python-list

Google-API Bad-Gateway-Error

2006-05-16 Thread DierkErdmann
Hi, I am trying to query google from within a python script using the Google-Api (pygoogle). The following piece of codes gives me a "SOAPpy.Errors.HTTPError: ", the full Traceback is shown below. I am aware of the incompatibilities between the Google-Api and older versions of the SOAP-Library; I

Re: Google-API Bad-Gateway-Error

2006-05-16 Thread John Bokma
[EMAIL PROTECTED] wrote: > Hi, > > I am trying to query google from within a python script using the > Google-Api (pygoogle). > The following piece of codes gives me a "SOAPpy.Errors.HTTPError: > ", Not with Python, but with Perl, I am seeing now and then the same error. If you rerun the script

Re: Google-API Bad-Gateway-Error

2006-05-16 Thread DierkErdmann
It's quite strange, after calling the script several times it started to work; but sometimes the error occurs again. Maybe google has technical probs. Dierk -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-05-16 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > BTW why are python dicts implemented as hash tables and not judy > arrays? > Probably because: Python predates judy arrays. Nobody has proposed replacing the current dict implementation. Nobody has demonstrated that it would actually be an advantage to replace the cur

Unicode digit to unicode string

2006-05-16 Thread Gabriele *darkbard* Farina
Hi, I have a unicode digit stored into a variable ('0020' for example) and I'd like to retrieve the corrisponding unicode character based on the current encoding. How can i do that ? -- http://mail.python.org/mailman/listinfo/python-list

Python script for remotely shutting down Windows PC from Linux ?

2006-05-16 Thread diffuser78
I am a newbie in Python and want your help in writing python script. I have to remotely shut the windows px from linux box. I run OpenSSH on windows PC. I remotely connect it from Linux box using ssh [EMAIL PROTECTED]# connects me fine now without problems (LOCAL) Next, I wrote a sc

Re: Unicode digit to unicode string

2006-05-16 Thread Alexandre Fayolle
Le 16-05-2006, Gabriele <[EMAIL PROTECTED]> nous disait: > Hi, I have a unicode digit stored into a variable ('0020' for example) > and I'd like to retrieve the corrisponding unicode character based on > the current encoding. How can i do that ? use the unichr builtin function -- Alexandre Fayo

a question

2006-05-16 Thread Nader Emami
L.S., I have read all replays about web development with python. I would agree with somebody who have said that web design is depends on specific requirements. I would like to develop some in which the animation is well important. It will be an animation of a radar file. I have looked for a lot

Re: Large Dictionaries

2006-05-16 Thread Duncan Booth
Duncan Booth wrote: >> BTW why are python dicts implemented as hash tables and not judy >> arrays? >> > Probably because: > > Python predates judy arrays. > Nobody has proposed replacing the current dict implementation. > Nobody has demonstrated that it would actually be an advantage to > repla

Re: Unicode digit to unicode string

2006-05-16 Thread Gabriele *darkbard* Farina
thank you, bye -- http://mail.python.org/mailman/listinfo/python-list

which one?

2006-05-16 Thread Nader Emami
L.S., I have read your replay about web development with python. I would agree with you that web design is depends on specific requirements. I would like to develop some in which the animation is well important. It will be an animation of a radar file. I have looked for a lot of alternative but I

Re: taking qoutes in arguments

2006-05-16 Thread Lee Caine
yea thanks alot for your help, gonna read up on 'Konsole' :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-05-16 Thread Sion Arrowsmith
Maric Michaud <[EMAIL PROTECTED]> wrote: >I don't see a use case where a python programmer should need a >dictionnary "that will be probably big" but can't predict what keys will be >in. I've recently been working on an app with precisely this characteristic, although there were enough other bott

Re: Google-API Bad-Gateway-Error

2006-05-16 Thread John Bokma
[EMAIL PROTECTED] wrote: > It's quite strange, after calling the script several times it started > to work; but sometimes the error occurs again. Maybe google has > technical probs. Yup, I've seen exactly the same behavoir. So now I do several retry - sleep - retry steps before giving up. -- J

Re: Large Dictionaries

2006-05-16 Thread Chris Foote
Claudio Grondi wrote: > Chris Foote wrote: > >> However, please note that the Python bsddb module doesn't support >> in-memory based databases - note the library documentation's[1] wording: >> >> "Files never intended to be preserved on disk may be created >> by passing None as the filena

Re: Python script for remotely shutting down Windows PC from Linux ?

2006-05-16 Thread Diez B. Roggisch
> Next, I wrote a script that would log me in and also shut the windows > pc down, so I wrote a script > > ssh [EMAIL PROTECTED] # connects me fine now without problems (LOCAL) > shutdown -s# This is a windows command (REMOTE) > > Now, when I run this script, it successfully logs me

Re: Python script for remotely shutting down Windows PC from Linux ?

2006-05-16 Thread diffuser78
> ssh [EMAIL PROTECTED] shutdown -s Than indeed workedThanks > use the subprocess module or shellutils to execute the above. I am a python newbie and how easy or difficult it is using the sub process module and shell utils. Thanks, I really appreciate your help. -- http://mail.python.or

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread numeromancer
An old debate. My $0.02 : http://numeromancer.dyndns.org/~timothy/tab-width-independence/description.html The idea can be extended to other programming languages. TS -- http://mail.python.org/mailman/listinfo/python-list

Re: saving file permission denied on windows

2006-05-16 Thread zombek
That's right! I just didn't notice it. Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: my cryptogram program

2006-05-16 Thread John Salerno
Paul Rubin wrote: > You're trying to make sure that no character maps to itself in the > cryptogram. I'm not sure if that's one of the "rules". It's a rule for cryptogram puzzles, which is what I'm working on. I'm not trying to make complicated hacker-proof codes or anything. :) > It also loo

Re: Python script for remotely shutting down Windows PC from Linux ?

2006-05-16 Thread bruno at modulix
[EMAIL PROTECTED] wrote: >>ssh [EMAIL PROTECTED] shutdown -s > > > Than indeed workedThanks > > > use the subprocess module or shellutils to execute the above. > > I am a python newbie and how easy or difficult it is using the sub > process module and shell utils. It's as difficult as : 1

Questions about the event loop

2006-05-16 Thread egbert
What does a gui_event_loop know ? My gui is based on pygtk, but i suppose the mechanism is the same everywhere. The gui is created within a class-instance within a function. Normally, ie without a gui, everything that happens within a function is forgotten as soon the function ends. But in a gu

Re: my cryptogram program

2006-05-16 Thread John Salerno
Bruno Desthuilliers wrote: > Too late ! You asked for it, you get it !-) Good, I desperately need it! :) > PUNCT_SPACE_SET = set(string.punctuation + string.whitespace) > def make_set(original): > return ''.join(set(original) - PUNCT_SPACE_SET) Interesting! Always learning new, weird ways to

Re: my cryptogram program

2006-05-16 Thread John Salerno
Bruno Desthuilliers wrote: > At least someone reading this may learn about the max_split param of > str.split() !-) LOL. The first thing I did was scramble to the docs to see what that second parameter meant! :) But I was a little confused about why you included it. Just to insure that only t

Re: Large Dictionaries

2006-05-16 Thread Claudio Grondi
Chris Foote wrote: > Claudio Grondi wrote: > >> Chris Foote wrote: >> >>> However, please note that the Python bsddb module doesn't support >>> in-memory based databases - note the library documentation's[1] wording: >>> >>> "Files never intended to be preserved on disk may be created >>> by

build now requires Python exist before the build starts

2006-05-16 Thread Toon Knapen
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 this situation? Thanks,

Re: Using python for a CAD program

2006-05-16 Thread Harry George
[EMAIL PROTECTED] writes: > Hi, I'm interested in using python to start writing a CAD program for > electrical design. I just got done reading Steven Rubin's book, I've > used "real" EDA tools, and I have an MSEE, so I know what I *want* at > the end of this; I just have never taken on a programm

Re: do/while structure needed

2006-05-16 Thread John Salerno
Dennis Lee Bieber wrote: > And what syntax would you propose? I guess something like: do: stuff goes here and here and here while (condition) The absence of a colon after the while statement can be the signal that it isn't a regular while statement with a following bloc

Re: my cryptogram program

2006-05-16 Thread bruno at modulix
John Salerno wrote: > Bruno Desthuilliers wrote: > >> At least someone reading this may learn about the max_split param of >> str.split() !-) > > > LOL. The first thing I did was scramble to the docs to see what that > second parameter meant! :) > > But I was a little confused about why you inc

constucting a lookup table

2006-05-16 Thread mhodkin
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.e. not mathmatically related. An example would be a table with

Re: Using python for a CAD program

2006-05-16 Thread skip
Someone in hiding wrote: > Hi, I'm interested in using python to start writing a CAD program for > electrical design. Google for PythonCAD. Skip -- http://mail.python.org/mailman/listinfo/python-list

questions on python script compiling for embedding

2006-05-16 Thread Limin Fu
Dear all, I am trying to embed python into another scripting language, to do this I need to solve a number of problems on importing or compiling python script. First let me state what exactly I want to do, that is, I want the following syntax to be supported in the host language which I am devel

what is the difference between tuple and list?

2006-05-16 Thread daniel
is there any typical usage that shows their difference? thanks daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about the event loop

2006-05-16 Thread bruno at modulix
egbert wrote: > What does a gui_event_loop know ? > > My gui is based on pygtk, > but i suppose the mechanism is the same everywhere. > > The gui is created within a class-instance within a function. > Normally, ie without a gui, everything that happens within > a function is forgotten as soon t

Re: what is the difference between tuple and list?

2006-05-16 Thread [EMAIL PROTECTED]
Lists are mutable, i.e. one can do this: a = [1,2,3] a[0] = 100 You can't do that with a tuple. a = (1,2,3) a[0] = 100 # error -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread Diez B. Roggisch
daniel wrote: > is there any typical usage that shows their difference? >>> d = {} >>> d[('multi', 'part', 'key')] = 'schnarz' >>> d[['multi', 'part', 'key']] = 'schnarz' Traceback (most recent call last): File "", line 1, in ? TypeError: list objects are unhashable A lot of discussions regar

Re: what is the difference between tuple and list?

2006-05-16 Thread Simon Brunning
On 16 May 2006 07:47:24 -0700, daniel <[EMAIL PROTECTED]> wrote: -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread infidel
> is there any typical usage that shows their difference? I think the general idea is to use lists for homogenous collections and tuples for heterogenous structures. I think the database API provides a good usage that shows their differences. When you do cursor.fetchall() after executing a query

Re: constucting a lookup table

2006-05-16 Thread johnzenger
How about a dictionary, keyed on tuples of (height, weight)? [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

Re: what is the difference between tuple and list?

2006-05-16 Thread Harold Fellermann
The main difference is that lists are mutables while tuples are not. Tuples are fine if you only want to group some objects (e.g. as a return value) and access their members as in >>> t = (1,2,3,4) >>> t[2] 3 Lists give you a lot more flexibility, because they are mutable: you can change the orde

regex help

2006-05-16 Thread Lance Hoffmeyer
I have the following table and I am trying to match percentage the 2nd column on the 2nd Tiger line (9.0). I have tried both of the following. I expected both to match but neither did? Is there a modifier I am missing? What changes do I need to make these match? I need to keep the structure

Windows & Apache 1.3 & mod_python.dll

2006-05-16 Thread Tama
Hello, I've didn't find any answer to my problem so I start a new topic. I have installed Apache 1.3.33 on Windows XP. I've also downloaded and installed ActivePython form http://www.activestate.com/. Then I went to http://www.modpython.org/ and search how to use python script with my web pages.

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Oliver Bandel
Xah Lee wrote: > Tabs versus Spaces in Source Code > > Xah Lee, 2006-05-13 > > In coding a computer program, there's often the choices of tabs or > spaces for code indentation. There is a large amount of confusion about > which is better. It has become what's known as “religious war” — > a heated

Re: Windows & Apache 1.3 & mod_python.dll

2006-05-16 Thread Tim N. van der Leeuw
Any particular reason for not using Apache 2, and mod_python 3.x? Anyways, looks to me like there's a problem with the path where the DLL is installed, vs. where it's search for by Apache? I had no particular problems installing Apache 2 and mod_python 3.x on WinXP, using the mod_python installer

Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
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 -- http://mail.python.org/mailman/listinfo/python-list

Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
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 header after processing 0 entries" I was under the impression that I could (from reading the various pos

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread [EMAIL PROTECTED] opalinski from opalpaweb
> Simply put, tabs is proper, and spaces are improper. > Why? This may seem > ridiculously simple given the de facto ball of confusion: the semantics > of tabs is what indenting is about, while, using spaces to align code > is a hack. The reality of programming practice trumps original intent of t

Re: Google-API Bad-Gateway-Error

2006-05-16 Thread Jack Diederich
On Tue, May 16, 2006 at 01:24:25PM +, John Bokma wrote: > [EMAIL PROTECTED] wrote: > > > It's quite strange, after calling the script several times it started > > to work; but sometimes the error occurs again. Maybe google has > > technical probs. > > Yup, I've seen exactly the same behavoir.

Re: constucting a lookup table

2006-05-16 Thread Larry Bates
[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.e. not mathmatically related.

Re: what is the difference between tuple and list?

2006-05-16 Thread daniel
thank you all for replying, I'm new to python, and just reading the python tutorial now. I did not expect the FAQ to contain any relevant topics, so thanks Simon... your comments did make sense, I should have read the tutorial more thoroughly, It's not a good question, I admit. ;-) English is not

Re: what is the difference between tuple and list?

2006-05-16 Thread bruno at modulix
infidel wrote: >>is there any typical usage that shows their difference? > > > I think the general idea is to use lists for homogenous collections and > tuples for heterogenous structures. > > I think the database API provides a good usage that shows their > differences. When you do cursor.fetc

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Pascal Bourguignon
"[EMAIL PROTECTED] opalinski from opalpaweb" <[EMAIL PROTECTED]> writes: >> Simply put, tabs is proper, and spaces are improper. >> Why? This may seem >> ridiculously simple given the de facto ball of confusion: the semantics >> of tabs is what indenting is about, while, using spaces to align code

Re: regex help

2006-05-16 Thread Peter Otten
Lance Hoffmeyer wrote: > I have the following table and I am trying to match percentage the 2nd > column on the 2nd Tiger line (9.0). > > I have tried both of the following. I expected both to match but neither > did? Is there a modifier > I am missing? What changes do I need to make these mat

simultaneous reading and writing a textfile

2006-05-16 Thread Marco Herrn
Hi, I have a text file with some lines in it. Now I want to iterate over this file and exchange some lines with some others. I tried this approach: try: myfile= file('myfile', 'r+') while 1: line= myfile.readline() if not line: break l= li

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

2006-05-16 Thread Casey Hawthorne
For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range? You would need to know something of the input range and its uniformity! Self-balancing between dictionaries for separate dictionaries? -- Regards, Casey -- http://mail.python.

Help System For Python Applications

2006-05-16 Thread redefined . horizons
I did some searching for this topic, but couldn't find anything. A search of this list only turned up an old post from 2002. I'd like to add a comprehesive help system to my Python Application. By "comprehensive" I mean regular "read-like-a-book" help and context sensitive help that can be launche

Re: regex help

2006-05-16 Thread johnzenger
Why not use split instead of regular expressions? >>> ln = "3232 23 9 9 - 9 9 - 911 >>> 110" >>> ln.split() ['32', '32', '23', '9', '9', '-', '9', '9', '-', '9', '11', '1', '10'] Much simpler, yes? Just find the line that comes after a line that

spawnv throws exception under Windows XP

2006-05-16 Thread Chris Reuter
I've been trying to start a particular external program from Python using os.spawnv(). This works perfectly under Linux but under Windows, it first runs the program, then throws an OSError exception with the tuple (0, 'Error'): >>> spawnv(P_WAIT, 'c:/mctools/bin/mc', ['mc']) Arche

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Dale King
Iain King wrote: > Oh God, I agree with Xah Lee. Someone take me out behind the chemical > sheds... > > Xah Lee wrote: Please don't feed the troll! And for the record, spaces are 100% portable, tabs are not. That ends the argument for me. Worse than either tabs or spaces however is Sun's mi

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Oliver Bandel
[EMAIL PROTECTED] opalinski from opalpaweb wrote: >>Simply put, tabs is proper, and spaces are improper. >>Why? This may seem >>ridiculously simple given the de facto ball of confusion: the semantics >>of tabs is what indenting is about, while, using spaces to align code >>is a hack. > > > The r

  1   2   3   >