Re: ANN:proxysocket(socks4,socks5)v0.1

2008-01-17 Thread Tim Roberts
Samuel <[EMAIL PROTECTED]> wrote: > >http://code.google.com/p/proxysocket/downloads/list Allow me to introduce you to the concept of comments. Python allows you to include descriptive sentences in your program that explain what the functions do, what your intentions were, what the variables do, w

Re: Cannot catch _mysql_exceptions.OperationalError

2008-01-17 Thread John Nagle
Bob wrote: > In our database code (we are using django v0.96) we wanted to catch > and handle MySQL OperationalErrors. We use both the Django models and > database connections. > > However, even though we confirmed that a > _mysql_exceptions.OperationalError are raised (particularly 1213 > deadlo

Re: [OT] "Code Friendly" Blog?

2008-01-17 Thread Jeroen Ruigrok van der Werven
-On [20080117 23:56], Miki ([EMAIL PROTECTED]) wrote: >Is there any free blog hosting that is more "code friendly" (easy to >post code snippets and such)? I personally use a Wordpress installation on my own machine with an additional plugin for syntax highlighting. http://word

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

2008-01-17 Thread John Nagle
Irmen de Jong wrote: > Christian Heimes wrote: >> John Nagle wrote: >>> It's possible to use "pickle" for interprocess communication over >>> pipes, but it's not straightforward. >> >> IIRC the processing module uses pickle for IPC. Maybe you can get some >> idea by reading its code? >> >> http://p

Re: too long float

2008-01-17 Thread Chris
On Jan 18, 7:55 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > hello, > > why this happened on my python? > > >>> a=3.9 > >>> a > > 3.8999 > > I wanted 3.9 but got 3.89 > How to avoid it? thanks. > > this is my python version: > > >>> sys.version > > '2.3.4 (#1, Feb 6 2006,

too long float

2008-01-17 Thread J. Peng
hello, why this happened on my python? >>> a=3.9 >>> a 3.8999 I wanted 3.9 but got 3.89 How to avoid it? thanks. this is my python version: >>> sys.version '2.3.4 (#1, Feb 6 2006, 10:38:46) \n[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)]' -- http://mail.python.org/mailma

Re: [python] How to detect a remote webpage is accessible? (in HTTP)

2008-01-17 Thread Astan Chee
How about: import socket, urllib2 timeout = 10 socket.setdefaulttimeout(timeout) try: auth_handler = urllib2.HTTPBasicAuthHandler() opener = urllib2.build_opener(auth_handler) #this used if we need authentication urllib2.install_opener(opener) req = urllib2.Request('http://website.com') f = urll

[python] How to detect a remote webpage is accessible? (in HTTP)

2008-01-17 Thread 甜瓜
Howdy, all, I want to use python to detect the accessibility of website. Currently, I use urllib to obtain the remote webpage, and see whether it fails. But the problem is that the webpage may be very large; it takes too long time. Certainly, it is no need to download the entire page. Could yo

Re: array and list

2008-01-17 Thread Steven D'Aprano
On Fri, 18 Jan 2008 15:05:23 +1100, Ben Finney wrote: > "J. Peng" <[EMAIL PROTECTED]> writes: > >> what's the difference between an array and a list in python? > > In Python, 'list' is a basic built-in type. Python has no 'array' type, > though that term is often used to refer to the 'array' typ

Re: plz help how to print python variable using os.system()

2008-01-17 Thread jitender001001
Thanks Lutz... -- http://mail.python.org/mailman/listinfo/python-list

Re: array and list

2008-01-17 Thread Ben Finney
"J. Peng" <[EMAIL PROTECTED]> writes: > what's the difference between an array and a list in python? In Python, 'list' is a basic built-in type. Python has no 'array' type, though that term is often used to refer to the 'array' type defined in Numeric Python (which is not part of the standard lib

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

2008-01-17 Thread Benjamin
On Jan 17, 10:07 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > 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

Unique thread ID

2008-01-17 Thread Benjamin
Is there a way to obtain a unique ID for the current thread? I have an object that I need to store local thread data in, and I don't want to use threading.local because each thread might have multiple instances of my object. -- http://mail.python.org/mailman/listinfo/python-list

array and list

2008-01-17 Thread J. Peng
what's the difference between an array and a list in python? I see list has all features of array in C or perl. so please tell me.thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop in a loop?

2008-01-17 Thread Arnaud Delobelle
On Jan 17, 11:59 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > Instead of counting the exceptions, we can limit the padding iterables > by using an iterator that returns len(iterables) - 1 padding > generators, use a sort of lazy chain, and then just izip. > > from itertools import izip, repeat > >

Re: "Code Friendly" Blog?

2008-01-17 Thread Steven D'Aprano
On Thu, 17 Jan 2008 16:18:37 -0800, Hai Vu wrote: > On Jan 17, 2:50 pm, Miki <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Posting code examples to blogger.com hosted blog is not fun (need to >> remember alway escape < and >). >> Is there any free blog hosting that is more "code friendly" (easy to >>

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

2008-01-17 Thread Terry Jones
> "Brian" == Brian Smith <[EMAIL PROTECTED]> writes: Brian> [EMAIL PROTECTED] wrote: >> 2. Are there good python libraries for bdb available, that >> are being maintained? Brian> I would like to know the answer to this question too--if you have Brian> used the pybsddb/bsddb.db module, please

Re: bags? 2.5.x?

2008-01-17 Thread Raymond Hettinger
> >> I keep wanting something like them - especially bags with something > >> akin to set union, intersection and difference. > > > How about this recepie > > http://www.ubookcase.com/book/Oreilly/ > > The author of the bag class said that he was planning to submit bags for > inclusion in 2.5 - is

RE: [OT] "Code Friendly" Blog?

2008-01-17 Thread Ryan Ginstrom
> On Behalf Of Miki > Posting code examples to blogger.com hosted blog is not fun > (need to remember alway escape < and >). > Is there any free blog hosting that is more "code friendly" > (easy to post code snippets and such)? I use WordPress with the Dean's Code Highlighter plugin[1] (which us

Cannot catch _mysql_exceptions.OperationalError

2008-01-17 Thread Bob
In our database code (we are using django v0.96) we wanted to catch and handle MySQL OperationalErrors. We use both the Django models and database connections. However, even though we confirmed that a _mysql_exceptions.OperationalError are raised (particularly 1213 deadlock), we cannot catch them

Re: Complex discussions of "simple" problems (was: Loop in a loop?)

2008-01-17 Thread Paul Rubin
Ben Finney <[EMAIL PROTECTED]> writes: > Enjoyment of the discussion, after all, is the main reward most people > can ever hope to get for participation in most threads here. Well then, in that case, what the heck. from itertools import * def padzip(*xs, **kw): pad = kw.get('padding', None)

Re: "Code Friendly" Blog?

2008-01-17 Thread Miki
Hello Mel, [Hai] >> how about bracketing your code in the tags? [Mel] > That won't help the escape problem, though it will preserve vital > Python whitespace. HTML has to be interpreting '<' characters to > recognize the ''. They also manage to mess up the first indentation in the section :) T

Re: Loop in a loop?

2008-01-17 Thread George Sakkis
On Jan 17, 7:13 pm, Paul Rubin wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > And if the iterables don't necessarily support len(), here's a more > > general solution: > > Not trying to pick on you personally but there's this disease > when a newbie comes with a

Complex discussions of "simple" problems (was: Loop in a loop?)

2008-01-17 Thread Ben Finney
Paul Rubin writes: > Not trying to pick on you personally but there's this disease when a > newbie comes with a basically simple question (in this case, how to > solve the problem with ordinary lists) and gets back a lot of > complex, overly general "graduate level" solu

Re: Downlod from FTP, pickle

2008-01-17 Thread Tommy Nordgren
On 18 jan 2008, at 01.13, SMALLp wrote: > Hy! > > I have a little problem. I have to download file from FTP sp i use > ftplib. And then i have to pickle.load from that file. I make callback > function that saves line by line into temporary file and now i cant > read > from that file and when i

Re: "Code Friendly" Blog?

2008-01-17 Thread Mel
Hai Vu wrote: > On Jan 17, 2:50 pm, Miki <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Posting code examples to blogger.com hosted blog is not fun (need to >> remember alway escape < and >). >> Is there any free blog hosting that is more "code friendly" (easy to >> post code snippets and such)? >> >>

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

2008-01-17 Thread Irmen de Jong
Christian Heimes wrote: > John Nagle wrote: >> It's possible to use "pickle" for interprocess communication over >> pipes, but it's not straightforward. > > IIRC the processing module uses pickle for IPC. Maybe you can get some > idea by reading its code? > > http://pypi.python.org/pypi/processin

Re: "Code Friendly" Blog?

2008-01-17 Thread Hai Vu
On Jan 17, 2:50 pm, Miki <[EMAIL PROTECTED]> wrote: > Hello, > > Posting code examples to blogger.com hosted blog is not fun (need to > remember alway escape < and >). > Is there any free blog hosting that is more "code friendly" (easy to > post code snippets and such)? > > Thanks, > -- > Miki <[EM

Downlod from FTP, pickle

2008-01-17 Thread SMALLp
Hy! I have a little problem. I have to download file from FTP sp i use ftplib. And then i have to pickle.load from that file. I make callback function that saves line by line into temporary file and now i cant read from that file and when i close it i diapers. Thanks! -- http://mail.python.or

Re: Loop in a loop?

2008-01-17 Thread Paul Rubin
George Sakkis <[EMAIL PROTECTED]> writes: > And if the iterables don't necessarily support len(), here's a more > general solution: Not trying to pick on you personally but there's this disease when a newbie comes with a basically simple question (in this case, how to solve the problem with ordina

Re: Loop in a loop?

2008-01-17 Thread Paul Hankin
On Jan 17, 7:02 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > 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

Re: Creating unique combinations from lists

2008-01-17 Thread Steven D'Aprano
On Thu, 17 Jan 2008 10:44:51 -0600, Reedick, Andrew wrote: >> -Original Message- >> From: Tim Chase [mailto:[EMAIL PROTECTED] Sent: Thursday, >> January 17, 2008 10:30 AM To: Reedick, Andrew >> Cc: breal; python-list@python.org; [EMAIL PROTECTED] Subject: Re: >> Creating unique combination

[OT] "Code Friendly" Blog?

2008-01-17 Thread Miki
Hello, Posting code examples to blogger.com hosted blog is not fun (need to remember alway escape < and >). Is there any free blog hosting that is more "code friendly" (easy to post code snippets and such)? Thanks, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.

Python Tutorial.

2008-01-17 Thread Rizwan
Hiya, I found one good website for python tutorial. just thought to share with community. Hope you all also like it.. http://python.objectis.net -MR -- http://mail.python.org/mailman/listinfo/python-list

get the size of a dynamically changing file fast ?

2008-01-17 Thread Stef Mientki
hello, I've a program (not written in Python) that generates a few thousands bytes per second, these files are dumped in 2 buffers (files), at in interval time of 50 msec, the files can be read by another program, to do further processing. A program written in VB or delphi can handle the data in

Re: bags? 2.5.x?

2008-01-17 Thread Wildemar Wildenburger
Dan Stromberg wrote: > The author of the bag class said that he was planning to submit bags for > inclusion in 2.5 - is there a particular reason why they didn't go in? > I wouldn't know. Not enough convincing use cases, I guess. Fools ;) > I keep finding a need for bags. In the past, I've don

Re: Python FTP server library 0.3.0 released

2008-01-17 Thread Salvatore
Giampaolo Rodola' a écrit : > Hi, > I'm pleased to announce release 0.3.0 of Python FTP Server library > (pyftpdlib). > http://code.google.com/p/pyftpdlib/ - Giampaolo Rodola' < g.rodola [at] gmail [dot] com > Greatissimo :-) It would be nice if this could be integrate in Python Libs Regards Sa

ANN:proxysocket(socks4,socks5)v0.1

2008-01-17 Thread Samuel
http://code.google.com/p/proxysocket/downloads/list -- http://mail.python.org/mailman/listinfo/python-list

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

2008-01-17 Thread Christian Heimes
John Nagle wrote: > It's possible to use "pickle" for interprocess communication over > pipes, but it's not straightforward. IIRC the processing module uses pickle for IPC. Maybe you can get some idea by reading its code? http://pypi.python.org/pypi/processing/0.40 Christian -- http://mail.pyt

Re: Hebrew in idle ans eclipse (Windows)

2008-01-17 Thread Martin v. Löwis
> import pymssql > > con = > pymssql.connect(host='192.168.13.122',user='sa',password='',database='tempdb') > cur = con.cursor() > cur.execute('select firstname, lastname from [users]') > lines = cur.fetchall() > > print lines > > or > > print lines[0] > > 'lines' is a list containing tuples o

Re: how django discovers changed sources

2008-01-17 Thread alf
Jeff wrote: > On Jan 17, 2:51 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> 2008/1/17, alf <[EMAIL PROTECTED]>:> 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 y

Re: bags? 2.5.x?

2008-01-17 Thread Dan Stromberg
On Mon, 14 Jan 2008 20:41:27 +0100, Wildemar Wildenburger wrote: > Dan Stromberg wrote: >> Is there a particular reason why bags didn't go into 2.5.x or 3000? >> >> I keep wanting something like them - especially bags with something >> akin to set union, intersection and difference. >> > How abo

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

2008-01-17 Thread Martin v. Löwis
> This makes some sense. Thank you. As for this: > >def detect_modules(self): > # Ensure that /usr/local is always used > add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') > add_dir_to_list(self.compiler.include_dirs, '/usr/local/ > include') > > it looks l

Re: dbus-python for windows

2008-01-17 Thread est
There exists a pre-compiled binary for dbus it was primary wirtten for deluge win32 port http://www.slurdge.org/deluge-on-windows There exists a pre-compiled binary for dbus it was primary wirtten for deluge win32 port http://www.slurdge.org/deluge-on-windows On Jan 15, 9:14 pm, Suraj Barkale <[E

Re: handlers.SocketHandler and exceptions

2008-01-17 Thread writeson
On Jan 17, 2:45 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: Vinay, Again, thanks for your very timely help! I was just editing the handlers.py code, and didn't really understand how that was going to work, and of course it didn't. I was just about to write to you again, and voila, you'd already re

Re: Importing java within python

2008-01-17 Thread Laurent Pointal
Le Thu, 17 Jan 2008 08:36:59 -0800, Henry Chang a écrit : > 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

Re: how django discovers changed sources

2008-01-17 Thread Jeff
On Jan 17, 2:51 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/1/17, alf <[EMAIL PROTECTED]>:> 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

Re: how django discovers changed sources

2008-01-17 Thread Guilherme Polo
2008/1/17, alf <[EMAIL PROTECTED]>: > 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 clarific

Re: examples of logger using smtp

2008-01-17 Thread Rob Wolfe
DwBear75 <[EMAIL PROTECTED]> writes: > I am hoping to find some simple examples of how to create a logger > instance using smtphandler. I don't want to create a separate ini > file. I just want to sent the smtphost, from, to right in the code > when I instantiate the logger. I can't seem to find s

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

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

how django discovers changed sources

2008-01-17 Thread alf
hi, I started playing with django and accidentally discovered that it restarts the server once a source file is touched. does it use some python's feature or just scans for changs on its one? sources? any idea? A. -- http://mail.python.org/mailman/listinfo/python-list

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: 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 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: 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_

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 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: 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: 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: 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, 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: 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: 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: 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: 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; python-list@python.org; [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: 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: 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: 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: 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: 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

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: 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: 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 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

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 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: 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

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: 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: 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 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

  1   2   >