Re: Hebrew in idle ans eclipse (Windows)

2008-01-17 Thread iu2
On Jan 17, 6:59 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > What do I need to do run my app like IDLE does? > > Can you please show the fragment of your program that prints > these strings? > > Regards, > Martin Hi, I use pymssql to get the data from a database, just like this (this is fr

Re: Extending the readline module?

2008-01-17 Thread Christian Heimes
Casey Rodarmor wrote: > What is the best way to go about doing this? You need some basic knowledge about C, the readline headers, Python sources and a compiler. Are you interested to contribute the extended code to the Python code base? We are always looking for new developers and additional featu

Replace stop words (remove words from a string)

2008-01-17 Thread BerlinBrown
if I have an array of "stop" words, and I want to replace those values with something else; in a string, how would I go about doing this. I have this code that splits the string and then does a difference but I think there is an easier approach: E.g. mystr = kljsldkfjksjdfjsdjflkdjslkf[BAD]Kkjkk

Re: assigning values in python and perl

2008-01-17 Thread George Sakkis
On Jan 17, 1:59 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > Posting a counter-example where the difference is clearly shown would > > be more vastly useful than referring to a list of long obscure usenet > > posts with practically no examples. C/C++ are not even menti

RE: Replace stop words (remove words from a string)

2008-01-17 Thread Karthik
How about - for s in stoplist: string.replace(mystr, s, "") Hope this should work. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BerlinBrown Sent: Thursday, January 17, 2008 1:55 PM To: [email protected] Subject: Replace stop words (remov

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Gary Herron
BerlinBrown wrote: > if I have an array of "stop" words, and I want to replace those values > with something else; in a string, how would I go about doing this. I > have this code that splits the string and then does a difference but I > think there is an easier approach: > > E.g. > > mystr = > kl

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Casey Rodarmor
That's much better than what I was about to post: for s in stoplist: string.join(mystr.split(s, "")) Berlin: Why are you keen on avoiding split()? On 1/17/08, Karthik <[EMAIL PROTECTED]> wrote: > > How about - > > for s in stoplist: > string.replace(mystr, s, "") > > Hope this should

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Raymond Hettinger
On Jan 17, 12:25 am, BerlinBrown <[EMAIL PROTECTED]> wrote: > if I have an array of "stop" words, and I want to replace those values > with something else; > mystr = > kljsldkfjksjdfjsdjflkdjslkf[BAD]Kkjjkkjk[BAD]LSKJFKSFJKSJF;L[BAD2]kjsld­fsd; > if I have an array stop_list = [ "[BAD]", "[BAD2

Stop tab-completing empty lines!

2008-01-17 Thread Casey Rodarmor
Hi everybody, I have the following in my python startup file: import readline, rlcompleter readline.parse_and_bind("tab: complete") This lets me tab complete identifiers in the interpreter beautifully, but there's a tiny problem... If I'm sitting at the beginning of a blank line and just want a

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Gary Herron
Karthik wrote: > How about - > > for s in stoplist: > string.replace(mystr, s, "") > That will work, but the string module is long outdated. Better to use string methods: for s in stoplist: mystr.replace(s, "") Gary Herron > Hope this should work. > > -Original Message- >

Re: Replace stop words (remove words from a string)

2008-01-17 Thread Bruno Desthuilliers
BerlinBrown a écrit : > if I have an array of "stop" words, and I want to replace those values > with something else; in a string, how would I go about doing this. I > have this code that splits the string and then does a difference but I > think there is an easier approach: > > E.g. > > mystr =

Some Berkeley DB questions (being maintained? queries?)

2008-01-17 Thread [EMAIL PROTECTED]
Hi! I have some questions.I'm evaluating berkeley db as a embeddable storage engine for a project I'm working on. My questions: 1. Now that Berkeley DB is part of Oracle, is it still being maintained? Is it free? 2. Are there good python libraries for bdb available, that are being maintain

Re: UTF-8 in basic CGI mode

2008-01-17 Thread coldpizza
Thanks, Sion, that makes sense! Would it be correct to assume that the encoding of strings retrieved by FieldStorage() would be the same as the encoding of the submitted web form (in my case utf-8)? Funny but I have the same form implemented in PSP (Python Server Pages), running under Apache with

Re: Python too slow?

2008-01-17 Thread Gary Duzan
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: > >I think the benefits of running Java on CPython are significantly less >than those had by running Python on the Java VM (or another VM). >Firstly, who wants to write statically typed code which then runs on a >virtual machin

Re: reading a specific column from file

2008-01-17 Thread Hai Vu
Here is another suggestion: col = 2 # third column filename = '4columns.txt' third_column = [line[:-1].split('\t')[col] for line in open(filename, 'r')] third_column now contains a list of items in the third column. This solution is great for small files (up to a couple of thousand of lines). Fo

Re: Great Python books for the beginner

2008-01-17 Thread Jorgen Grahn
On Sat, 12 Jan 2008 01:03:42 -0600, Landon <[EMAIL PROTECTED]> wrote: > Hi, I'm a freshman in college and I'm going to be taking an intro to > programming course next semester which mainly uses Python, so I > thought it might be a good time to pick up Python beyond the scope of > the class as well.

Re: module naming conventions

2008-01-17 Thread Jorgen Grahn
On Mon, 14 Jan 2008 15:58:49 -0800 (PST), grackle <[EMAIL PROTECTED]> wrote: > On Jan 14, 4:47 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> I'm not sure, but it sounds as though you have yet to discover Python >> module packages http://www.python.org/doc/essays/packages.html>. >> They allow a hie

Re: Great Python books for the beginner

2008-01-17 Thread Jorgen Grahn
On Sat, 12 Jan 2008 13:12:19 -0800 (PST), [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 12 jan, 21:04, Landon <[EMAIL PROTECTED]> wrote: >> One thing I wonder about is the examples these books use to teach the >> concepts. I found myself really attached to K&R because the end of >> section pro

Re: Opening/Running files through python

2008-01-17 Thread Tim Golden
Ionis wrote: > Hey guys, hope you can help me here. > > I am running in windows and I am trying to open a file via python. I > want the file (a text file) to open up in the users default text > editor. I'm not wanting to read a file, I just want to open it. Is > there a way? import os os.startfi

Opening/Running files through python

2008-01-17 Thread Ionis
Hey guys, hope you can help me here. I am running in windows and I am trying to open a file via python. I want the file (a text file) to open up in the users default text editor. I'm not wanting to read a file, I just want to open it. Is there a way? Thanks in advance. -- http://mail.python.org/

Re: reading a specific column from file

2008-01-17 Thread John Machin
On Jan 17, 8:47 pm, Hai Vu <[EMAIL PROTECTED]> wrote: > Here is another suggestion: > > col = 2 # third column > filename = '4columns.txt' > third_column = [line[:-1].split('\t')[col] for line in open(filename, > 'r')] > > third_column now contains a list of items in the third column. > > This solu

Embedding Python - Freeing Python Objects Not Using Py_DECREF

2008-01-17 Thread yuri . feldman
Hello, I'm embedding Python interpreter in a Win32 console application. I use C++. I would like to use the WinAPI LoadLibrary function to load the python dll at runtime (followed by GetProcAddress calls), so that I have to make no assumptions about the location of the dll. However I can't use th

Loop in a loop?

2008-01-17 Thread Sacred Heart
Hi, I'm new to Python and have come across a problem I don't know how to solve, enter com.lang.python :) I'm writing some small apps to learn the language, and I like it a lot so far. My problem I've stumbled upon is that I don't know how to do what I want. I want to do a loop in a loop. I think.

Re: Loop in a loop?

2008-01-17 Thread cokofreedom
On Jan 17, 1:21 pm, Sacred Heart <[EMAIL PROTECTED]> wrote: > Hi, > I'm new to Python and have come across a problem I don't know how to > solve, enter com.lang.python :) > > I'm writing some small apps to learn the language, and I like it a lot > so far. > > My problem I've stumbled upon is that I

Re: MSI read support in msilib?

2008-01-17 Thread Floris Bruynooghe
On Jan 16, 7:03 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > The introduction from the msilib documentation in python 2.5 claims it > > supports reading an msi. However on the Record class there is only a > > GetFieldCount() method and some Set*() methods. I was expecting to > > see GetSt

RE: Some Berkeley DB questions (being maintained? queries?)

2008-01-17 Thread Brian Smith
[EMAIL PROTECTED] wrote: > 1. Now that Berkeley DB is part of Oracle, is it still being > maintained? Is it free? Berkeley DB is owned by Oracle, but it is seperate from the Oracle RDBMS product. Yes, it is free. > 2. Are there good python libraries for bdb available, that > are being maintai

Re: Loop in a loop?

2008-01-17 Thread Quentin Gallet-Gilles
Hi, I'd consider using zip : >>> array1 = ['one','two','three','four'] >>> array2 = ['a','b','c','d'] >>> zip(array1, array2) [('one', 'a'), ('two', 'b'), ('three', 'c'), ('four', 'd')] >>> for one, two in zip(array1, array2): ... print one, two ... one a two b three c four d >>> HTH, Quenti

zip function for python

2008-01-17 Thread Luca
Hi, Ive written this easy and fast function cause there it was impossible for me to find one that zip a directory without external libraries: import zipfile import sys import os def zipdir(zipPath,directory="./"): """Store the cdontent of directory to a zipPath file, if directory is not given st

Re: Loop in a loop?

2008-01-17 Thread Remco Gerlich
Use zip() to combine them into a single list, then loop over that: for x, y in zip(array1, array2): ... Remco On Jan 17, 2008 1:21 PM, Sacred Heart <[EMAIL PROTECTED]> wrote: > Hi, > I'm new to Python and have come across a problem I don't know how to > solve, enter com.lang.python :) > > I'

Re: Interesting Thread Gotcha

2008-01-17 Thread Sion Arrowsmith
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >Of course start_new_thread could throw an error if it got nothing callable >as first argument. No idea why it doesn't. It does: >>> thread.start_new_thread(None, None) Traceback (most recent call last): File "", line 1, in ? TypeError: first arg must

Re: Loop in a loop?

2008-01-17 Thread Chris
On Jan 17, 2:35 pm, [EMAIL PROTECTED] wrote: > On Jan 17, 1:21 pm, Sacred Heart <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm new to Python and have come across a problem I don't know how to > > solve, enter com.lang.python :) > > > I'm writing some small apps to learn the language, and I like i

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread writeson
Mark, > > Check out the traceback module. It can translate the traceback into a > variety of formats (such as a string) that can be pickled. > > --Mark Thanks for the reply. I was looking at the traceback module and thinking along the same lines you are. The problem I'm having with that is how t

Re: Embedding Python - Freeing Python Objects Not Using Py_DECREF

2008-01-17 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello, > > I'm embedding Python interpreter in a Win32 console application. I use > C++. > > I would like to use the WinAPI LoadLibrary function to load the python > dll at runtime (followed by GetProcAddress calls), so that I have to > make no assumptions about the l

ANN: Resolver One 1.0 released

2008-01-17 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.0 - the largest IronPython application in the world, we think, at 30,000 lines of production code backed up by 110,000 lines of unit and functional tests. Resolver One is a Rapid Application Development tool for analysing and presenti

Re: Loop in a loop?

2008-01-17 Thread cokofreedom
On Jan 17, 2:52 pm, Chris <[EMAIL PROTECTED]> wrote: > On Jan 17, 2:35 pm, [EMAIL PROTECTED] wrote: > > > > > On Jan 17, 1:21 pm, Sacred Heart <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > I'm new to Python and have come across a problem I don't know how to > > > solve, enter com.lang.python :) > >

ANN: pyglet 1.0

2008-01-17 Thread Alex Holkner
The first stable/production version of pyglet has been released. http://www.pyglet.org --- pyglet provides an object-oriented programming interface for developing games and other visually-rich applications for Windows, Mac OS X and Linux. Some of the features of pyglet are: * No external de

class closure question

2008-01-17 Thread Steven W. Orr
I want to indirectly change the value of a variable. #! /usr/bin/python foo = [44] bar = foo bar[0] = 55 print 'bar = ', bar print 'foo = ', foo This works fine. bar = [55] foo = [55] But I want to do the same with a class value. #! /usr/bin/python S = None dd = { 'class': [S] } class C1(obj

RE: Creating unique combinations from lists

2008-01-17 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Tim Chase > Sent: Wednesday, January 16, 2008 3:40 PM > To: breal > Cc: [email protected] > Subject: Re: Creating unique combinations from lists > > You can use a recursive generator: > >

Boost your business with Quality Web & Design Services at Bargain Prices!

2008-01-17 Thread WOSG Services
Web Outsourcing Services Group (WOSG) is a pioneering and China-based service provider, committed to delivering quality web & design, SEO and internet marketing services to clients around the world. WOSG's strength lies in our skillful staff and lower rates in China. We have over 60 strictly selec

Re: Loop in a loop?

2008-01-17 Thread Duncan Booth
Chris <[EMAIL PROTECTED]> wrote: > You could always pre-pad the lists you are using before using the zip > function, kinda like > > def pad(*iterables): > max_length = 0 > for each_iterable in iterables: > if len(each_iterable) > max_length: max_length = > len(each_iterable) >

Re: Is this a bug, or is it me?

2008-01-17 Thread Neil Cerutti
On Jan 17, 2008 10:05 AM, <[EMAIL PROTECTED]> wrote: > Hello all, > For some reason, the following does not work : > > > class C: > TYPES = [None] > DICT = {} > for Type in TYPES: > DICT.update((E,Type) for E in [1]) > > >>> NameError: global name 'Type' is not defined > > > Wh

Re: Is this a bug, or is it me?

2008-01-17 Thread cokofreedom
On Jan 17, 4:05 pm, [EMAIL PROTECTED] wrote: > Hello all, > For some reason, the following does not work : > > class C: > TYPES = [None] > DICT = {} > for Type in TYPES: > DICT.update((E,Type) for E in [1]) > > >>> NameError: global name 'Type' is not defined > > What do you thi

Is this a bug, or is it me?

2008-01-17 Thread cptnwillard
Hello all, For some reason, the following does not work : class C: TYPES = [None] DICT = {} for Type in TYPES: DICT.update((E,Type) for E in [1]) >>> NameError: global name 'Type' is not defined What do you think? Is this a bug? -- http://mail.python.org/mailman/listinfo/p

Re: Loop in a loop?

2008-01-17 Thread cokofreedom
> > > Yes, small typo there. > > > Okey, so if my array1 is has 4 elements, and array2 has 6, it won't > > loop trough the last 2 in array2? How do I make it do that? > > > Please gentlemen: Python has no builtin type named 'array', so >s/array/list/g > > > Just pad your shortest list. I agr

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread Vinay Sajip
On Jan 17, 1:47 pm, writeson <[EMAIL PROTECTED]> wrote: > Mark, > > > > > Check out the traceback module. It can translate the traceback into a > > variety of formats (such as a string) that can be pickled. > > > --Mark > > Thanks for the reply. I was looking at the traceback module and > thinking

Importing java within python

2008-01-17 Thread Osthaus, Christopher (Mission Systems)
Hi All, This is an easy one - I'm new to Python and working on a script where I need to use some java swing classes. I'm running Python on Windows. I've got an import statement that looks something like: from java.lang import System from javax.swing import JPasswordField from javax.swing imp

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread Stef Mientki
Heiko Niedermeyer wrote: > Sorry for the fuzzy subject... > > Currently I'm writing a little programm to extract some chemical > information out of a text file, and then present it in a pleasant way. > The Extraction works so far, so now the presentation will be next. > > As I'm learning Python

working with a subversion repo

2008-01-17 Thread Luke
I want to write a script that automatically generates a subversion repository and configures apache serve the svn repo. Is there a python module that will allow me to work with subversion? I am able to import a module named "svn" on my ubuntu machine, but this module is not available on windows. I

Re: class closure question

2008-01-17 Thread Peter Otten
Steven W. Orr wrote: > I want to indirectly change the value of a variable. > > #! /usr/bin/python > foo = [44] > bar = foo > bar[0] = 55 > print 'bar = ', bar > print 'foo = ', foo > > This works fine. > > bar = [55] > foo = [55] > > But I want to do the same with a class value. > > #! /us

Re: class closure question

2008-01-17 Thread Bruno Desthuilliers
Steven W. Orr a écrit : > I want to indirectly change the value of a variable. > Are you sure this is the correct formulation of your problem ? > #! /usr/bin/python > foo = [44] > bar = foo > bar[0] = 55 > print 'bar = ', bar > print 'foo = ', foo > > This works fine. > > bar = [55] > foo =

Re: Stop tab-completing empty lines!

2008-01-17 Thread Carsten Haese
On Thu, 2008-01-17 at 00:58 -0800, Casey Rodarmor wrote: > Hi everybody, > > I have the following in my python startup file: > > import readline, rlcompleter > readline.parse_and_bind("tab: complete") > > This lets me tab complete identifiers in the interpreter beautifully, > but there's a tiny

Re: Is this a bug, or is it me?

2008-01-17 Thread Hrvoje Niksic
"Neil Cerutti" <[EMAIL PROTECTED]> writes: > You cannot access a class's class variables in it's class-statement > scope, since the name of the type is not bound until after the class > statement is completed. But they are still available as locals, so you can access them using their names, like

Re: Loop in a loop?

2008-01-17 Thread Bruno Desthuilliers
Sacred Heart a écrit : > On Jan 17, 1:35 pm, [EMAIL PROTECTED] wrote: >> for i in zip(array1, array2): >> print i >> >> Although I take it you meant four d, the issue with this method is >> that once you hit the end of one array the rest of the other one is >> ignored. > > Yes, small typo the

Re: Replace stop words (remove words from a string)

2008-01-17 Thread bearophileHUGS
Raymond Hettinger: > Regular expressions should do the trick. > >>> stoppattern = '|'.join(map(re.escape, stoplist)) > >>> re.sub(stoppattern, '', mystr) If the stop words are many (and similar) then that RE can be optimized with a trie-based strategy, like this one called "List": http://search.cp

Re: Is this a bug, or is it me?

2008-01-17 Thread Neil Cerutti
On Jan 17, 2008 10:44 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Neil Cerutti" <[EMAIL PROTECTED]> writes: > > > You cannot access a class's class variables in it's class-statement > > scope, since the name of the type is not bound until after the class > > statement is completed. > > But they

How to create graphs an embed them in GUI?

2008-01-17 Thread Heiko Niedermeyer
Sorry for the fuzzy subject... Currently I'm writing a little programm to extract some chemical information out of a text file, and then present it in a pleasant way. The Extraction works so far, so now the presentation will be next. As I'm learning Python from scratch, I don't care wether to us

the tutor list has been strangely silent for a few days. Anyone know what has happened?

2008-01-17 Thread bill.wu
the tutor list has been strangely silent for a few days. Anyone know what has happened? why? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug, or is it me?

2008-01-17 Thread cptnwillard
> > You cannot access a class's class variables in it's class-statement > scope, since the name of the type is not bound until after the class > statement is completed. > Thanks for the answer, but then why is there no error with the variable 'TYPES'? This one is accessed first... -- http://mail.

Re: Is this a bug, or is it me?

2008-01-17 Thread Neil Cerutti
On Jan 17, 2008 10:23 AM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > You cannot access a class's class variables in it's class-statement > scope, since the name of the type is not bound until after the class > statement is completed. Arrgh! I hate making the "its" error. But I wanted to add that th

Re: Is this a bug, or is it me?

2008-01-17 Thread cokofreedom
On Jan 17, 4:59 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > On Jan 17, 2008 10:44 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > "Neil Cerutti" <[EMAIL PROTECTED]> writes: > > > > You cannot access a class's class variables in it's class-statement > > > scope, since the name of the type is

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread A.T.Hofkamp
On 2008-01-17, Heiko Niedermeyer <[EMAIL PROTECTED]> wrote: > As I'm learning Python from scratch, I don't care wether to use (=learn) > TKinter or PyQt or whatever, I just need some advice, which suits my > needs best. > It would be nice to have the programm working under win and linux > (shoul

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread sturlamolden
On 17 Jan, 16:08, Heiko Niedermeyer wrote: > My problem is, that I want to add graph (simple, line connected X,Y- > scatter plots) and if possible the 3D representation of atoms in a > molecule (-> coloured spheres in space). > I think it would take me years to program those by myself, so I would

RE: Creating unique combinations from lists

2008-01-17 Thread Reedick, Andrew
> -Original Message- > From: Tim Chase [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 17, 2008 10:30 AM > To: Reedick, Andrew > Cc: breal; [email protected]; [EMAIL PROTECTED] > Subject: Re: Creating unique combinations from lists > > Yick...a nice demo of the power of eval, but

Re: Loop in a loop?

2008-01-17 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > couldn't you just do something like > > if len(array1) is not len(array2): *never* use the identity operator to test equality ! The fact that CPython memoize small integers is an implementation detail, *not* a part of the language specification. > if le

Re: Is this a bug, or is it me?

2008-01-17 Thread cptnwillard
On Jan 17, 4:14 pm, [EMAIL PROTECTED] wrote: > > Do not use those names...really poor choice... This is not the way it looks it my code. I simplified it, with generic names, in order to point out something that does not work... The only question here is why? -- http://mail.python.org/mailman/list

Re: Loop in a loop?

2008-01-17 Thread Sacred Heart
On Jan 17, 1:35 pm, [EMAIL PROTECTED] wrote: > for i in zip(array1, array2): > print i > > Although I take it you meant four d, the issue with this method is > that once you hit the end of one array the rest of the other one is > ignored. Yes, small typo there. Okey, so if my array1 is has 4

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread Yu-Xi Lim
Heiko Niedermeyer wrote: > Sorry for the fuzzy subject... > > Currently I'm writing a little programm to extract some chemical > information out of a text file, and then present it in a pleasant way. > The Extraction works so far, so now the presentation will be next. > If the GUI is only for

Re: Creating unique combinations from lists

2008-01-17 Thread Tim Chase
>> You can use a recursive generator: >> >>def iterall(*iterables): >> if iterables: >>for head in iterables[0]: >> for remainder in iterall(*iterables[1:]): >>yield [head] + remainder >> else: >>yield [] >> >>for thing in iterall( >>['

Re: Importing java within python

2008-01-17 Thread Henry Chang
www.jython.org On Jan 17, 2008 8:06 AM, Osthaus, Christopher (Mission Systems) <[EMAIL PROTECTED]> wrote: > > > Hi All, > > This is an easy one - I'm new to Python and working on a script where I need > to use some java swing classes. I'm running Python on Windows. > > I've got an import statemen

Re: How to create graphs an embed them in GUI?

2008-01-17 Thread Yu-Xi Lim
Heiko Niedermeyer wrote: > Sorry for the fuzzy subject... > > Currently I'm writing a little programm to extract some chemical > information out of a text file, and then present it in a pleasant way. > The Extraction works so far, so now the presentation will be next. > If the GUI is only for

Re: Loop in a loop?

2008-01-17 Thread Quentin Gallet-Gilles
On Jan 17, 2008 2:38 PM, Sacred Heart <[EMAIL PROTECTED]> wrote: > On Jan 17, 1:35 pm, [EMAIL PROTECTED] wrote: > > for i in zip(array1, array2): > > print i > > > > Although I take it you meant four d, the issue with this method is > > that once you hit the end of one array the rest of the ot

Re: next line (data parsing)

2008-01-17 Thread robleachza
I'm very appreciative for the comments posted. Thanks to each of you. All good stuff. Cheers, -Rob On Jan 16, 9:50 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 17, 12:42 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > > On Jan 17, 12:01 am, Scott David Daniels <[EMAIL PROTECTED]> >

Re: Is this a bug, or is it me?

2008-01-17 Thread Peter Otten
cptnwillard wrote: > Hello all, > For some reason, the following does not work : > > > class C: > TYPES = [None] > DICT = {} > for Type in TYPES: > DICT.update((E,Type) for E in [1]) > NameError: global name 'Type' is not defined > > > What do you think? Is this a bug

Re: Is this a bug, or is it me?

2008-01-17 Thread Hrvoje Niksic
[EMAIL PROTECTED] writes: > Hello all, > For some reason, the following does not work : > > > class C: > TYPES = [None] > DICT = {} > for Type in TYPES: > DICT.update((E,Type) for E in [1]) > NameError: global name 'Type' is not defined > > > What do you think? Is this a b

Re: Is this a bug, or is it me?

2008-01-17 Thread Neil Cerutti
On Jan 17, 2008 11:08 AM, <[EMAIL PROTECTED]> wrote: > On Jan 17, 4:59 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote: > > Generator expressions, unlike list comprehensions, have their own > > scope so that they don't "leak" names to the enclosing scope. The > > Python rule forbidding access to the

Re: working with a subversion repo

2008-01-17 Thread Jeroen Ruigrok van der Werven
-On [20080117 17:21], Luke ([EMAIL PROTECTED]) wrote: >I am able to import a module named "svn" on my ubuntu machine, but this >module is not available on windows. The entries libsvn and svn are installed in site-packages when you install the Python (SWIG) bindings for Subvers

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
"Bjoern Schliessmann" wrote: Hendrik van Rooyen wrote: > Absolutely! - well spotted! This is no threading problem at all; not even a syntax problem. If you don't know exactly what start_new_thread and kbd_driver functions do it's impossible to tell if your code does what is intended. > It would

Re: Loop in a loop?

2008-01-17 Thread sturlamolden
On 17 Jan, 14:38, Sacred Heart <[EMAIL PROTECTED]> wrote: > Okey, so if my array1 is has 4 elements, and array2 has 6, it won't > loop trough the last 2 in array2? How do I make it do that? In that case your problem is the data. You'll either have to truncate one array and/or pad the other. Or i

Re: Perl Template Toolkit: Now in spicy new Python flavor

2008-01-17 Thread Paul Boddie
On 16 Jan, 21:01, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I can't claim a comprehensive familiarity with Python template > offerings, but all of the packages approved for use at my previous > workplace left me cold. There are a few offerings listed on this page: http://wiki.python.org/

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread writeson
Vinay, Thanks for your reply, very interesting. We're currently running Python2.3 (though we are getting ready to move to Python2.5), so I'm guessing the code you're showing comes from Python2.5? I'm wondering if I can edit the handlers.py code in my Python2.3 installation, make the changes you sh

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
"Duncan Booth" wrote: > Given that the start_new_thread function never actually got called, what > code exactly do you expect to complain about the absence of a tuple? I don't understand this assertion. I thought that start_new_thread was called with a missing comma in its argument list, whic

Re: working with a subversion repo

2008-01-17 Thread Jeroen Ruigrok van der Werven
-On [20080117 19:04], Luke ([EMAIL PROTECTED]) wrote: >Does that mean that libsvn and svn are not modules? If they are modules, >where can I find documentation for them? What do they do? They are modules, but not part of a standard install. Subversions uses a program called SWIG to generat

Re: Loop in a loop?

2008-01-17 Thread Roel Schroeven
Sacred Heart schreef: > On Jan 17, 1:35 pm, [EMAIL PROTECTED] wrote: >> for i in zip(array1, array2): >> print i >> >> Although I take it you meant four d, the issue with this method is >> that once you hit the end of one array the rest of the other one is >> ignored. > > Yes, small typo there

Re: Interesting Thread Gotcha

2008-01-17 Thread Peter Otten
Hendrik van Rooyen wrote: > "Duncan Booth" wrote: > >> Given that the start_new_thread function never actually got called, what >> code exactly do you expect to complain about the absence of a tuple? > > I don't understand this assertion. > > I thought that start_new_thread was called with a

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
"Diez B. Roggisch" wrote: > Hendrik van Rooyen wrote: > > It would have been nice, however, to have gotten something like: > > > > TypeError - This routine needs a tuple. > > > > instead of the silent in line calling of the routine in question, > > while failing actually to start a new thread. >

Re: working with a subversion repo

2008-01-17 Thread Luke
On Jan 17, 9:14 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080117 17:21], Luke ([EMAIL PROTECTED]) wrote: > > >I am able to import a module named "svn" on my ubuntu machine, but this > >module is not available on windows.

Re: __init__ explanation please

2008-01-17 Thread Lie
On Jan 16, 5:34 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > >From the base definition of a constructor: constructor is the creator > > of an object. In this case, __new__ is technically the constructor > > while __init__ is an initializer. > > > However, it is also to be noted that __init_

Using "pickle" for interprocess communication - some notes and things that ought to be documented.

2008-01-17 Thread John Nagle
It's possible to use "pickle" for interprocess communication over pipes, but it's not straightforward. First, "pickle" output is self-delimiting. Each dump ends with ".", and, importantly, "load" doesn't read any characters after the "." So "pickle" can be used repeatedly on the same pipe, and on

Python FTP server library 0.3.0 released

2008-01-17 Thread Giampaolo Rodola'
Hi, I'm pleased to announce release 0.3.0 of Python FTP Server library (pyftpdlib). http://code.google.com/p/pyftpdlib/ === About === Python FTP server library provides an high-level portable interface to easily write asynchronous FTP servers with Python. Based on asyncore framework pyftpdlib is

very import

2008-01-17 Thread [EMAIL PROTECTED]
visit this link http://dcaic.com -- http://mail.python.org/mailman/listinfo/python-list

Re: -fno-strict-aliasing turned off when cross compiling

2008-01-17 Thread Squat'n Dive
On Jan 16, 10:56 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Does anyone have an idea why -fno-strict-aliasing is turned off when > > cross compiling? > > Because detection of -fno-strict-aliasing is made through running > the compiler output (AC_TRY_RUN, see configure.in instead). For > c

Re: Perl Template Toolkit: Now in spicy new Python flavor

2008-01-17 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Jan 15, 1:45 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: I'd like to inform the Python community that the powerful and popular Template Toolkit system, previously available only in its original Perl implementation, is now

Re: Loop in a loop?

2008-01-17 Thread George Sakkis
On Jan 17, 12:25 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Jan 17, 4:38 pm, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > > Now there are very certainly smart solutions using itertools, but the > > one I cooked is way too ugly so I'll leave this to itertools masters !-) > > Here's my ef

Re: Loop in a loop?

2008-01-17 Thread Paul Hankin
On Jan 17, 4:38 pm, Bruno Desthuilliers wrote: > Now there are very certainly smart solutions using itertools, but the > one I cooked is way too ugly so I'll leave this to itertools masters !-) Here's my effort: from itertools import izip, islice, chain, repeat def padzip(*xs, **kw): pad =

Re: Loop in a loop?

2008-01-17 Thread sturlamolden
On 17 Jan, 13:21, Sacred Heart <[EMAIL PROTECTED]> wrote: > A push in the right direction, anyone? for number,letter in zip(array1,array2): print "%s %s" % (number,letter) -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop in a loop?

2008-01-17 Thread Paul Rubin
Sacred Heart <[EMAIL PROTECTED]> writes: > array1 = ['one','two','three','four'] > array2 = ['a','b','c','d'] > > I want to loop through array1 and add elements from array2 at the end, > so it looks like this: > > one a > two b > three c > four c The "functional" style is to use the zip function

Re: Interesting Thread Gotcha

2008-01-17 Thread Peter Otten
Hendrik van Rooyen wrote: > "Bjoern Schliessmann" wrote: > > Hendrik van Rooyen wrote: >> Absolutely! - well spotted! > > This is no threading problem at all; not even a syntax problem. If > you don't know exactly what start_new_thread and kbd_driver > functions do it's impossible to tell if yo

Re: how django discovers changed sources

2008-01-17 Thread Jeff
That is the behavior of the development server. When you are writing your application, you don't want to have to manually restart the server every time you change a file. On apache it obviously doesn't do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread Vinay Sajip
On Jan 17, 5:50 pm, writeson <[EMAIL PROTECTED]> wrote: > Vinay, > > Thanks for your reply, very interesting. We're currently running > Python2.3 (though we are getting ready to move to Python2.5), so I'm > guessing the code you're showing comes from Python2.5? I'm wondering > if I can edit the han

Re: how django discovers changed sources

2008-01-17 Thread alf
Jeff wrote: > That is the behavior of the development server. When you are writing > your application, you don't want to have to manually restart the > server every time you change a file. On apache it obviously doesn't > do that. thx for clarification, but still I am curious how it is done unde

  1   2   >