Re: Getting "TypeError:list indices must be integers"

2006-06-12 Thread John Machin
On 13/06/2006 4:11 PM, Girish Sahani wrote: > Hi, > Please check out the following loop,here indexList1 and indexList2 are a > list of numbers. Later you say they are integers. Note: Python calls 2.0 a float, not an integer. |>>> foo = [9, 8, 7] |>>> foo[2.0] Traceback (most recent call last):

Re: Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread Ravi Teja
> Ok, here's the Hello World example from the Scala website: > > object HelloWorld { > def main(args: Array[String]) = { > Console.println("Hello, world!") > } > } > > Opening and closing braces? > "def main(args: Array[String])"? > Console.println? > > About the only Pythonic thing I can s

Re: How to link foreign keys & primary keys using python?

2006-06-12 Thread sonal
Hi Mr. Steve, The *indexes* i am using are lists... The code for creation of the PartionedPK is given below... *** class PartitionedPK(object): def __init__(self, name, save_to, fields): self.name= name

"groupby" is brilliant!

2006-06-12 Thread Frank Millman
Hi all This is probably old hat to most of you, but for me it was a revelation, so I thought I would share it in case someone has a similar requirement. I had to convert an old program that does a traditional pass through a sorted data file, breaking on a change of certain fields, processing each

Re: [newbie]apache authentication questions

2006-06-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >>Since HTTP authentication is managed by the browser it's difficult to >>integrate it with web application authentication: basically you have to >>choose between the two. There's no way for the server to tell the >>browse

Getting "TypeError:list indices must be integers"

2006-06-12 Thread Girish Sahani
Hi, Please check out the following loop,here indexList1 and indexList2 are a list of numbers. for index1 in indexList1: for index2 in indexList2: if ti1[index1] == ti2[index2] and not index1 != indexList1.pop(): index1+=1 index2+=1 continue elif index1 == indexList1.

numeric/numpy/numarray

2006-06-12 Thread Bryan
hi, what is the difference among numeric, numpy and numarray? i'm going to start using matplotlib soon and i'm not sure which one i should use. this page says, "Numarray is a re-implementation of an older Python array module called Numeric" http://www.stsci.edu/resources/software_hardware/nu

Re: Extending Python - Understanding Flags...

2006-06-12 Thread John Machin
On 13/06/2006 3:11 PM, John Machin wrote: > def bfunction(foo=0, bar="plugh", zot=None): > # keyword args, caller can do: > bfunction(zot=10**100) # using a keyword: args foo & bar get default values > bfunction(10, "xyzzy") # positional: foo = 10; bar = "xyzzy"; zot = 10**100 The last line above

Re: Writing PNG with pure Python

2006-06-12 Thread Ben Finney
"Johann C. Rocholl" <[EMAIL PROTECTED]> writes: > Currently, I am considering the following options: > - LGPL > - Modified BSD License > - X11 License (aka MIT License) > > I appreciate the simplicity of the BSD and MIT Licenses, except for > the names. "BSD License" can be confused with the orig

Re: Very nice python IDE (windows only)

2006-06-12 Thread Luis M. González
Jonathan Ellis wrote: > ago wrote: > > I have just discovered Python Scripter by Kiriakos Vlahos and it was a > > pleasant surprise. I thought that it deserved to be signalled. It is > > slim and fairly fast, with embedded graphical debugger, class browser, > > file browser... If you are into grap

Re: Extending Python - Understanding Flags...

2006-06-12 Thread John Machin
On 13/06/2006 1:45 PM, Redefined Horizons wrote: > I'm trying to understand the argument flags that are used in the > method table of an extension module written in C. > > First let me ask this question about the method table. Is it an C > array named "PyMethodDef"? Its *type* is PyMethodDef (the

Re: Very nice python IDE (windows only)

2006-06-12 Thread Luis M. González
[EMAIL PROTECTED] wrote: > I happen to have delphi, so if someone wants me to make small changes, > just let me know, I'll try to help Hmm... now that you offer, would it be possible to have the colors of text just like in IDLE? I tried configuring the colors, but some of them don't exist as

Re: Writing PNG with pure Python

2006-06-12 Thread Scott David Daniels
Johann C. Rocholl wrote: > I appreciate the simplicity of the BSD and MIT Licenses, except for the > names. "BSD License" can be confused with the original BSD License, > while "MIT License" according to the FSF "is misleading, since MIT has > used many licenses for software." I had one lawyer tell

Re: wxpython: how do i write this without the id parameter?

2006-06-12 Thread Scott David Daniels
John Salerno wrote: > I was reading in the wxPython wiki that most of the time you don't have > to include the id parameter at all, and you can just use keyword > arguments for other parameters. But I'm having trouble converting this > code into that method (i.e., without the id parameter) >

Re: ANN: PyGUI 1.7.2-1

2006-06-12 Thread greg
[EMAIL PROTECTED] wrote: if I try to run blobedit.py in the IDLE ide ... > the path is equal to "8833" for some reason. I believe that IDLE sets up some kind of debugging connection to its child process. That number might be a processs ID or port number or something related to that. I trie

Re: [newbie]apache authentication questions

2006-06-12 Thread grahamd
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > Since HTTP authentication is managed by the browser it's difficult to > integrate it with web application authentication: basically you have to > choose between the two. There's no way for the server to tell the > browser to start presenting the requ

Re: Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread Paul McGuire
"Tim Daneliuk" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So it is claimed: > > http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC > > Has anyone taken a look at this that can provide a meaningful contrast > with Python? Ok, he

Re: PIL show moves focus

2006-06-12 Thread kernel1983
Is the console necessary? if not, you can easily disable the console by rename the ext to .pyw [EMAIL PROTECTED] wrote: > Hi! > > I have an application where images (jpeg) have to be annotated by an > operator. I use PIL like: > > import Image > im = Image.open(Path) > im.show() > raw_input(Path +

Re: "parent" in a class __init__ def?

2006-06-12 Thread [EMAIL PROTECTED]
bruno at modulix wrote: > [EMAIL PROTECTED] wrote: > (meta : please don't top-post) > > Intuitively, the name lookup on > > self.parent.foo would be faster than if you passed in the object in > > question > > > Each dot means doing a lookup in a namespace. The more dots, the more > lookups. And l

Extending Python - Understanding Flags...

2006-06-12 Thread Redefined Horizons
I'm trying to understand the argument flags that are used in the method table of an extension module written in C. First let me ask this question about the method table. Is it an C array named "PyMethodDef"? Now, onto my questions about the arguments: [1] I see that even when the Python function

Re: ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-12 Thread K.S.Sreeram
Butternut Squash wrote: > Where is the best place to learn how to use this library??? There dont seem to any tutorials on the web for PyQt4 yet. So you'll have to make do with reading pyqt3 tutorials, and reading the bundled example code. If you are comfortable with C++, then check out the Qt tut

Re: Very nice python IDE (windows only)

2006-06-12 Thread Jonathan Ellis
ago wrote: > I have just discovered Python Scripter by Kiriakos Vlahos and it was a > pleasant surprise. I thought that it deserved to be signalled. It is > slim and fairly fast, with embedded graphical debugger, class browser, > file browser... If you are into graphical IDEs you are probably going

Profiling a fork() program

2006-06-12 Thread warspir
HiI am trying to get a profile of a program using the profile module. The program itself has some fork() call in the code, but my profile.run() is placed before that fork() call.My question is will the profiler be able to pickup the execution of the child and parent processes? Or just one of those?

Re: Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread Luis M. González
[EMAIL PROTECTED] wrote: > Scala seems terse and fast enough, few examples: > > http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=psyco&lang2=scala > > Bye, > bearophile Static typing, type inference, "sequence comprehensions"... Looks that there's a new crop of programming

Python open proxy honeypot

2006-06-12 Thread Alex Reinhart
Being deluged by spam like nearly all of us (though fortunately I have a very good spam filter), I also hate spam as much as almost everybody. I know basic Python (enough to make a simple IRC bot) and I figured a good project to help learn Python would be to make a simple "proxypot." I've done som

Re: Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread Ravi Teja
Tim Daneliuk wrote: > So it is claimed: > > > http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC > > Has anyone taken a look at this that can provide a meaningful contrast > with Python? I find the language very interesting but it is not like

Re: ANN: PyGUI 1.7.2-1

2006-06-12 Thread hale
greg wrote: > I have uploaded a new PyGUI 1.7.2 package to correct > a couple of errors in the setup.py file. > > http://www.cosc.canterbury.ac.nz/~greg/python_gui/ > > - > > What is PyGUI? > -- > > PyGUI is an experimental highly-Pyt

Re: Writing PNG with pure Python

2006-06-12 Thread Johann C. Rocholl
> > I have now decided to license my project (including the pure python PNG > > library) under the Apache License 2.0 which is less restrictive than > > the GPL in terms of sublicensing. > > But it is also incompatible with the GPL: > > http://www.fsf.org/licensing/licenses/index_html#GPLIncompatib

Re: Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread bearophileHUGS
Scala seems terse and fast enough, few examples: http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=psyco&lang2=scala Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-06-12 Thread Klaas
Thomas Ganss wrote: > Klaas schrieb: > > > 4. Insert your keys in sorted order. > This advice is questionable - > it depends on the at least on the db vendor and probably > sometimes on the sort method, if inserting pre-sorted > values is better. The article I wrote that you quoted named a specifi

Re: Writing PNG with pure Python

2006-06-12 Thread Steve Holden
Paul Boddie wrote: > Johann C. Rocholl wrote: > >>The MIT license is enticingly short and simple, thank you for the tip. >> >>I have now decided to license my project (including the pure python PNG >>library) under the Apache License 2.0 which is less restrictive than >>the GPL in terms of sublice

Combining The Best Of Python, Ruby, & Java??????

2006-06-12 Thread Tim Daneliuk
So it is claimed: http://www.infoq.com/news/Scala--combing-the-best-of-Ruby-;jsessionid=CC7C8366455E67B04EE5864B7319F5EC Has anyone taken a look at this that can provide a meaningful contrast with Python? -- Tim D

Re: Writing PNG with pure Python

2006-06-12 Thread Paul Boddie
Johann C. Rocholl wrote: > The MIT license is enticingly short and simple, thank you for the tip. > > I have now decided to license my project (including the pure python PNG > library) under the Apache License 2.0 which is less restrictive than > the GPL in terms of sublicensing. But it is also in

Re: urllib behaves strangely

2006-06-12 Thread John J. Lee
Duncan Booth <[EMAIL PROTECTED]> writes: > Gabriel Zachmann wrote: > > > Here is a very simple Python script utilizing urllib: [...] > > "http://commons.wikimedia.org/wiki/Commons:Featured_pictures/chronologi > > cal" > > print url > > print > > file = urllib.urlopen( url ) [...]

Python 411.

2006-06-12 Thread Steve
Hi folks New to the group. As a newbie to Python I`d just like to plug Ron Stephens web site which contains many excellent articles, podcasts and much Python stuff to help beginners like me. No doubt many already use it and listen to his weekly podcasts. http://www.awaretek.com/python/index.html Ch

Re: what are you using python language for?

2006-06-12 Thread John J. Lee
[EMAIL PROTECTED] writes: > I am using Python to assemble a biomedical literature analysis pipeline > as part of my PhD thesis. (http://ib-dwb.sf.net/Muscorian.html) What's a literature analysis pipeline? (mental picture: fat pressurised pipe leading to big noisy wood chipper-style machine spewi

Re: [newbie]apache authentication questions

2006-06-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I have an apache 1.3.29 server that is running my website. I have > written a bunch of scripts to generate the pages from csv files which > work great. > > My next thing to learn is how to get user authentication functioning > the way I need it. > > I understand the st

Re: wxpython: how do i write this without the id parameter?

2006-06-12 Thread jean-michel bain-cornu
Hi John John Salerno a écrit : > I was reading in the wxPython wiki that most of the time you don't have > to include the id parameter at all, and you can just use keyword > arguments for other parameters. But I'm having trouble converting this > code into that method (i.e., without the id param

Re: Most elegant way to generate 3-char sequence

2006-06-12 Thread Bruno Desthuilliers
James Stroud a écrit : > SuperHik wrote: > >> and the winner is... :D >> David Isaac wrote: >> >>> alpha = string.lowercase >>> x=(a+b+c for a in alpha for b in alpha for c in alpha) >> >> >> >> > > Not necessarily vying for winner, but David's solution is highly > specific as it doesn't do so w

Re: [OT] Most elegant way to generate 3-char sequence

2006-06-12 Thread Bruno Desthuilliers
John Machin a écrit : > On 10/06/2006 7:49 AM, Rob Cowie wrote: (snip) >> >> def generator(): >> for char in alpha: > > > Why stop at two spaces? One-space indentation is syntactically correct :-) I very often uses 2-spaces indent when posting here, to avoid problems with wrapping. -- http:

Logging to a file and closing it again properly (logging module)

2006-06-12 Thread Christoph Haas
Evening, I have an application that is running in an endless loop processing an incoming queue. Every run is supposed to write a log file about the run and then close it again. While the 'logging' module is generally working well (even though the documentation makes me miss some proper examples ho

PIL show moves focus

2006-06-12 Thread elbertlev
Hi! I have an application where images (jpeg) have to be annotated by an operator. I use PIL like: import Image im = Image.open(Path) im.show() raw_input(Path + ':') Python runs in a console window. Then show starts some application (in my case "Windows picture and FAX viewer") and the pict

wxpython: how do i write this without the id parameter?

2006-06-12 Thread John Salerno
I was reading in the wxPython wiki that most of the time you don't have to include the id parameter at all, and you can just use keyword arguments for other parameters. But I'm having trouble converting this code into that method (i.e., without the id parameter). I keep getting errors that invo

Egg cache problem with mod_python/ez_setup

2006-06-12 Thread Manuzhai
Hello there, I have this weird problem with a mod_python application. Recently I installed ElementTree and cElementTree through ez_setup.py, even though they were already installed normally (this might not be too smart, but I don't think it's related to my actual problem). I have a web applica

Re: Advanced lockfiles

2006-06-12 Thread Christopher Weimann
On 06/12/2006-11:00AM, David Hirschfield wrote: > > I want some kind of lockfile implementation that will allow one process > to lock a file (or create an appropriately named lockfile that other > processes will find and understand the meaning of), but there are some > important requirements: >

Re: Boa constructor- is it still alive?

2006-06-12 Thread jean-michel bain-cornu
tatamata a écrit : > Does anyone know is Boa constructor project still alive? > I visited Boa web site and it seems that it hasn't been updated for a long > time > I downloaded the version 0.4.4 a couple of months ago, so I guess the project is alive (I have been used the 0.3.1 before). I h

Re: Advanced lockfiles

2006-06-12 Thread Carl J. Van Arsdall
David Hirschfield wrote: > I want some kind of lockfile implementation that will allow one process > to lock a file (or create an appropriately named lockfile that other > processes will find and understand the meaning of), but there are some > important requirements: > > 1. Multiple processes w

Re: Bridge: Ruby to Python communication

2006-06-12 Thread Michel Claveau
Hi! Sorry for my bad english. Look here : http://www.mvps.org/scripting/languages/ Python, with PyWin32, can use ActiveScripting. But... only windows... -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Advanced lockfiles

2006-06-12 Thread David Hirschfield
I'm not sure it's even possible to do what I'm trying to here...just because the logistics may not really allow it, but I thought I'd ask around... I want some kind of lockfile implementation that will allow one process to lock a file (or create an appropriately named lockfile that other proce

Re: VC++ types to ctypes

2006-06-12 Thread lux
Thank you now it work!!! Thomas Heller ha scritto: > lux wrote: > > Hi to all, > > i need to traslate this struct in python using ctypes > > > > struct Soptions > > { > > char chVolumeLabel[128]; > > __int32 nSessionToImport; > > BS_BOOL bJolietFileSystem; > > BS_BOOL bBootable; >

Network Ports - blocking / taking over

2006-06-12 Thread abcd
Just curious if anyone had any information, or links, regarding the blocking of network ports and/or taking over (hijacking) ports using Python. Any python modules/libs you could recommend? tutorials/reading materials? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

[newbie]apache authentication questions

2006-06-12 Thread nuffnough
I have an apache 1.3.29 server that is running my website. I have written a bunch of scripts to generate the pages from csv files which work great. My next thing to learn is how to get user authentication functioning the way I need it. I understand the steps required to make .htpaccess files wor

Boa constructor- is it still alive?

2006-06-12 Thread tatamata
Does anyone know is Boa constructor project still alive? I visited Boa web site and it seems that it hasn't been updated for a long time -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 12)

2006-06-12 Thread John Salerno
Cameron Laird wrote: > Andrew Clover provides new Python icons: >http://doxdesk.com/img/software/py/icons2.png >http://mail.python.org/pipermail/python-dev/2006-March/063235.html >http://mail.python.org/pipermail/python-dev/2006-April/063517.html I love the new 'folder

Re: Intermittent Failure on Serial Port (Trace Result)

2006-06-12 Thread Serge Orlov
H J van Rooyen wrote: > Note that the point of failure is not the same place in the python file, but > it > is according to the traceback, again at a flush call... Yes, traceback is bogus. Maybe the error is raised during garbage collection, although the strace you've got doesn't show that. The

Re: Writing PNG with pure Python

2006-06-12 Thread Johann C. Rocholl
> Just in case anybody has the same problem, here's my first attempt at > implementing a subset of the PNG spec in pure Python. I license it to > you under the terms of the GNU GPL. Update: the code is now licensed under the Apache License 2.0. > http://trac.browsershots.org/browser/trunk/shotfac

Re: Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
Wait wait, what do I do exactly? Thanks Michel. Michel Claveau wrote: > Hi! > > For me, like PHP (message of 11h.35) : > > Only in Windows, I can call Ruby (more exactly Ruby-script) from > Python. > I can, also, call, from Python, Ruby-defined-functions, like a method > of a Python-class. > > It'

Re: Searching and manipulating lists of tuples

2006-06-12 Thread bruno at modulix
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given

Re: Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
I'll check that out, thanks! vasudevram wrote: > [EMAIL PROTECTED] wrote: > > Hello all. I want a ruby and a python module to be able to communicate > > with each other, access classes, instances and the like. Is there a > > bridge for this? I'm aware of rupy, but the documentation seems rather >

Re: VC++ types to ctypes

2006-06-12 Thread Thomas Heller
lux wrote: > Hi to all, > i need to traslate this struct in python using ctypes > > struct Soptions > { > char chVolumeLabel[128]; > __int32 nSessionToImport; > BS_BOOL bJolietFileSystem; > BS_BOOL bBootable; > TCHAR chBootImage[_MAX_PATH]; > BS_BOOL bFinalize; > BS_BOOL bTestBu

Re: Bridge: Ruby to Python communication

2006-06-12 Thread Michel Claveau
Hi! For me, like PHP (message of 11h.35) : Only in Windows, I can call Ruby (more exactly Ruby-script) from Python. I can, also, call, from Python, Ruby-defined-functions, like a method of a Python-class. It's a combination of Active-scripting & dynamic method add to a class. It's run OK with

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Fredrik Lundh
Girish Sahani wrote: > Thanks!It workedi wasted a lot of time trying to find a bug in my > code...what is wrong in iterating over a list and modifying it? > Doesnt python take the modified list every time the loop starts? this is explained in the tutorial, under "the for statement": The

Re: Bridge: Ruby to Python communication

2006-06-12 Thread vasudevram
[EMAIL PROTECTED] wrote: > Hello all. I want a ruby and a python module to be able to communicate > with each other, access classes, instances and the like. Is there a > bridge for this? I'm aware of rupy, but the documentation seems rather > inadequate for the uninitiated. Are there other librari

Re: ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-12 Thread Damjan
> QtNetwork > A set of classes to support TCP and UDP socket programming and higher > level protocols (eg. HTTP). Since QtNetwork is asynchronous how does it compare to twisted? I find Qt's signals and slots easier to understand and work with than twisted deferreds. -- damjan -- h

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Fredrik Lundh
Girish Sahani wrote: > Btw going slightly off-topic, when i try to run a code like below with > around 50 elements (pairs) in l4,python just hangs. Any ideas why this is > happening...the data is not that large :(( building a filtered new list by repeatedly removing stuff from a copy of the origi

Re: Using PHP in Python

2006-06-12 Thread Michel Claveau
Hi! Only in Windows, I can call PHP (more exactly PHP-script) from Python. I can, also, call, from Python, PHP-defined-functions, like a method of a Python-class. It's a combination of Active-scripting & dynamic method add to a class. -- @-salutations Michel Claveau -- http://mail.python.o

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Sion Arrowsmith
Steve Holden <[EMAIL PROTECTED]> wrote: >def algorith(d, s): > if s in d: > d[s] += 1 > else: > d[s] = 1 def algorith(d, s): d[s] = d.get(s, 0) + 1 And the OP should note that converting between dict d and list of pairs L is simply a matter of L = d.items() and d = di

Re: PIL problem after installation

2006-06-12 Thread Fredrik Lundh
Lad wrote: > I downloaded jpeg (from ftp://ftp.uu.net/graphics/jpeg/ ) source > libraries( file jpegsrc.v6b.tar.gz) and installed them. Now in > /usr/local/lib I have the following files: cjpeg > ,djpeg,jpegtran,rdjpgcom and wrjpgcom cjpeg, djpeg etc are executables, not libraries. if you have

Bridge: Ruby to Python communication

2006-06-12 Thread digitalorganics
Hello all. I want a ruby and a python module to be able to communicate with each other, access classes, instances and the like. Is there a bridge for this? I'm aware of rupy, but the documentation seems rather inadequate for the uninitiated. Are there other libraries/bridges or maybe a rupy tutoria

VC++ types to ctypes

2006-06-12 Thread lux
Hi to all, i need to traslate this struct in python using ctypes struct Soptions { char chVolumeLabel[128]; __int32 nSessionToImport; BS_BOOL bJolietFileSystem; BS_BOOL bBootable; TCHAR chBootImage[_MAX_PATH]; BS_BOOL bFinalize; BS_BOOL bTestBurn; BS_BOOL bPerformOPC; BS_BOOL bV

Re: Thread specific singleton

2006-06-12 Thread jhnsmth
Gabriele Farina wrote: > Hi, > > I'm tring to implement a Singleton object that should be specific for > every thread who create it, not global. > I tried a solution that seems to work, but I have a very poor knowledge > of concurrent programming, so I'd like someone to help me find some > problem

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Paul McGuire
"Girish Sahani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not

Re: Win XP: Problem with shell scripting in Python

2006-06-12 Thread A.M
>Does it overcome the problem that you reported earlier, that the contents of the output file from BCP were out of order? Yes, it does. But, to be honest, I don't know how!!! "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 10/06/2006 3:00 AM, A.M wrote: >> He

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
By the way, does anyone know if / how you can change the key bindings in PythonWin? In PyScripter, I was quite pleased that the autocomplete lets you make your selection by pressing enter (natural), yet in PythonWin you have to press tab (unnatural). Thanks. [EMAIL PROTECTED] wrote: > Great IDE! I

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
Jan Bijsterbosch wrote: > Hello ago, Bernard, > > "ago" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > > > > Bernard Lebel wrote: > >> Not me. I'll probably sound pedantic but > >> - the editor text looks awful, changing the editor options had no effect > >> at all > >> - there

Re: (pre)forking server framework?

2006-06-12 Thread Thomas Guettler
Am Mon, 12 Jun 2006 06:22:52 -0700 schrieb czajnik: > > Hi! > > I'm quite new to Python development. Can someone advise me a framework > useful for building (pre-)forking or threaded TCP servers, other than > SocketServer ? I've seen source code of a few python-based app servers, > all of theme

Re: Very nice python IDE (windows only)

2006-06-12 Thread digitalorganics
Great IDE! I love it. Two things that make me very happy: 1. Unlike PythonWin and Stan's Python Editor (SPE), PyScripter shows not just methods but also attributes in the class browser. [I'll mention that Eric3 also does this, but I don't use Eric3 much because the editor component doesn't allow s

Re: (pre)forking server framework?

2006-06-12 Thread czajnik
Diez B. Roggisch napisal(a): > Why do you care if the asynchronous model is overkill or the performance is > good? Twisted comes close to what you want - and using its strength as > arguments against it strikes me as odd. I was unclear :) I mean I don't like using asynchronous model for the kind

Re: Python or Ajax?

2006-06-12 Thread dingbat
Redefined Horizons wrote: > How does a web application that uses Python compare with one that uses AJAX? Mauve has the most RAM -- http://mail.python.org/mailman/listinfo/python-list

logging magic

2006-06-12 Thread [EMAIL PROTECTED]
Hi everyone. I've just been trying to add a bit more granularity to my logging code, as the jump from INFO (level 20) to DEBUG (level 10) is a bit too big. I was thinking of borrowing a few levels from java: fine (18), finer (16) and finest(14). This is what I've tried: log = logging.getLogger(a

Re: Python or Ajax?

2006-06-12 Thread Bo Yang
I think if you know java language very well but feel suffering with the error prone javascript , GWT is good choose for AJAX development . With the well-known IDE Eclipse your development time efficiency will promote fast ! -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 12)

2006-06-12 Thread Cameron Laird
QOTW: "Check out BeautifulSoup -- you will never write HTMLParser-based screen scrapers again. :)" - Jonathan Ellis "You clearly need something instead of XML." - Paul McGuire http://groups.google.com/group/comp.lang.python/msg/09e943c8dbf1e8c5? Johann C. Rocholl donates a PNG manager i

Re: Screen Scraping for Modern Applications?

2006-06-12 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >Scrape means simply scraping pixel colors from locations on the screen. >I'll worry about assembling it into meaningful information. > >Previously, I used Java,

Re: (pre)forking server framework?

2006-06-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > > Hi! > > I'm quite new to Python development. Can someone advise me a framework > useful for building (pre-)forking or threaded TCP servers, other than > SocketServer ? I've seen source code of a few python-based app servers, > all of theme seem to reinvent the wheel,

Re: An error ?

2006-06-12 Thread Bo Yang
It works , thank you everyone ! I think there is much more I need to learn before I can grasp a full understand of the C/S modle ! Thanks again ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Function to remove elements from a list not working (corrected)

2006-06-12 Thread Boris Borcic
Girish Sahani wrote: > Hi, > I am trying to modify a list of pairs (l4) by removing those > pairs which are not present in a third list called pairList. > The following is a simplified part of the routine i have written. However > it does not give the correct output. Please help! > Its possible

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Gerard Flanagan
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given a

(pre)forking server framework?

2006-06-12 Thread czajnik
Hi! I'm quite new to Python development. Can someone advise me a framework useful for building (pre-)forking or threaded TCP servers, other than SocketServer ? I've seen source code of a few python-based app servers, all of theme seem to reinvent the wheel, eventually reusing SocketServer. I'd ap

Re: Searching and manipulating lists of tuples

2006-06-12 Thread MTD
> Yes, use the proper tool for the job. Tuples are immutable (they are > read-only once created). Instead use a dictionary. They key would be > your string, the value would be the count. Wow, I really should have thought of that! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Harold Fellermann
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given a

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Steve Holden
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs > > e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs > twice > > If I am given

Re: Searching and manipulating lists of tuples

2006-06-12 Thread Mike Kent
MTD wrote: > Hello, > > I'm wondering if there's a quick way of resolving this problem. > > In a program, I have a list of tuples of form (str,int), where int is a > count of how often str occurs ... > So clearly that doesn't work... any ideas? Yes, use the proper tool for the job. Tuples are

Searching and manipulating lists of tuples

2006-06-12 Thread MTD
Hello, I'm wondering if there's a quick way of resolving this problem. In a program, I have a list of tuples of form (str,int), where int is a count of how often str occurs e.g. L = [ ("X",1),("Y",2)] would mean "X" occurs once and "Y" occurs twice If I am given a string, I want to search L to

Re: Very nice python IDE (windows only)

2006-06-12 Thread Jan Bijsterbosch
Hello ago, Bernard, "ago" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > > Bernard Lebel wrote: >> Not me. I'll probably sound pedantic but >> - the editor text looks awful, changing the editor options had no effect >> at all >> - there is no network access of UNC paths other th

Re: Using PHP in Python

2006-06-12 Thread Rene Pijlman
Tgone: >I have some custom PHP functions that I didn't want to re-write in >Python. But maybe I should just rewrite them :) Absolutely. The alternative is one of many IPC mechanisms that are available in both Python and PHP (such as XML-RPC). But that may require more effort than rewriting the f

Re: More pythonic shell sort?

2006-06-12 Thread John Machin
On 11/06/2006 1:26 PM, [EMAIL PROTECTED] wrote: > Thanks for the critique. > > John Machin wrote: >> On 10/06/2006 7:00 AM, [EMAIL PROTECTED] wrote: [snip] >>> def sort(self,myList): >>> for gap in self.gapSeq: >>> for i in range(1,gap+1): >>> self.gapInsert

Re: PIL problem after installation

2006-06-12 Thread peter
I had similar problems a couple of months back when I was teaching myself Tkinter and PIL. I wrote up my experiences here:- http://www.aqzj33.dsl.pipex.com/how_i_learned_tkinter/contents.htm If you look at the section on Images you will see how I eventually solved it (with bucket loads of help

Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Steve Holden
Girish Sahani wrote: >>I guess it's already the case with lst = [ e for e in lst if e in pairs ] >> >> >>In [1]: lst = (1,2,3,4) >> >>In [2]: pairs=(5,) >> >>In [3]: lst=[e for e in lst if e in pairs] >> >>In [4]: lst >>Out[4]: [] > > Yes its working. I realized that i was giving an input which di

Re: Function to remove elements from a list working, but python hangs :((

2006-06-12 Thread bruno at modulix
Girish Sahani wrote: (please don't top-post) > Hey Bruno...you are seeing the wrong post :P...please ignore this and > check out the one with (corrected) appended at the end... You should have posted the correction in the same thread. > Also, i used the list comprehension thingy which u have gi

Re: Function to remove elements from a list working, but Python Hangs :((

2006-06-12 Thread Girish Sahani
> I guess it's already the case with lst = [ e for e in lst if e in pairs ] > > > In [1]: lst = (1,2,3,4) > > In [2]: pairs=(5,) > > In [3]: lst=[e for e in lst if e in pairs] > > In [4]: lst > Out[4]: [] Yes its working. I realized that i was giving an input which didnt satisfy the condition. Now

  1   2   >