Looping through a file a block of text at a time not by line

2006-06-13 Thread Rosario Morgan
Hello Help is great appreciated in advance. I need to loop through a file 6000 bytes at a time. I was going to use the following but do not know how to advance through the file 6000 bytes at a time. file = open('hotels.xml') block = file.read(6000)

Re: python-dev Summary for 2006-05-01 through 2006-05-15

2006-06-13 Thread garabik-news-2005-05
This summary is tagged as being in ISO-8859-1 encoding: Content-Type: text/plain; charset=ISO-8859-1; format=flowed However, it really is in UTF-8, which results in this mojibake: > > Martin v. Löwis and Marc-Andre Lemburg discussed how to include both -- -

Re: "groupby" is brilliant!

2006-06-13 Thread Frank Millman
Benji York wrote: > Frank Millman wrote: > > reader = csv.reader(open('trans.csv', 'rb')) > > rows = [] > > for row in reader: > > rows.append(row) > > Why do you create a list of rows instead of just iterating over the > reader directly? > -- > Benji York A - didn't think of it - good idea

curses module bug in windows python?

2006-06-13 Thread kernel1983
when I type command below in windows python: import curses it gives the error msg! It can't find _curses.pyd Is this a bug? -- http://mail.python.org/mailman/listinfo/python-list

Re: .py and running in Windows:

2006-06-13 Thread Dog Walker
On Tuesday 13 June 2006 07:04, Michael Yanowitz wrote: > Thanks. > >XP looks to be the same as 2000. > Works as expected now. Thank You. > > Not sure what this 'thread' issue is. > I never specified a thread. I think perhaps though because I did > open another message in this mailing list (to

python-dev Summary for 2006-05-01 through 2006-05-15

2006-06-13 Thread Steven Bethard
python-dev Summary for 2006-05-01 through 2006-05-15 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-05-01_2006-05-15] = Announcements = --- Pyth

python-dev Summary for 2006-04-16 through 2006-04-30

2006-06-13 Thread Steven Bethard
python-dev Summary for 2006-04-16 through 2006-04-30 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-04-16_2006-04-30] = Announcements =

Bundling an application with third-party modules

2006-06-13 Thread Ben Finney
Howdy all, I'm improving an existing application that's partly written using Python and the standard library. Many of the improvements I want to make can be done by using third-party free software. The immediate customer for this application is happy to install Python on their machine, but I'd li

Re: daily python url - gmane links dead?

2006-06-13 Thread imcs ee
same error here. On 6/14/06, K.S.Sreeram <[EMAIL PROTECTED]> wrote: > Is it just me.. or are all the gmane links on daily-python dead? > All the c.l.py.announce entries point to gmane, and none of them seem to > be working. This is the error i get on gmane: > > Warning: fsockopen(): unable to conn

os.spawn* on Windows

2006-06-13 Thread Antoine
Hello list I am using Python 2.4 to invoke other programs on Windows XP, using syntax like this: os.spawnv(P_WAIT, "C:\\my.exe", ("C:\\my.exe",)) where my.exe is a console-mode program. When the above statement is executed, the my.exe program creates a window, what used to be called a Dos promp

Re: TONIGHT! Lisp group beerfest in NYC, PyCells to be discussed

2006-06-13 Thread [EMAIL PROTECTED]
Ken Tilton wrote: > The royal We has just learned that His Kennyness will be honoring the > boozehounds of LispNYC with His Presence tonight (deets below). > > He will come bearing Celtk and news of PyCells, though the top billing > tonight goes to SoC student Extraordinaire Samantha Kleinberg. >

proper way to use popen4

2006-06-13 Thread micklee74
hi i have to execute some SQL statements against a database using a SQL client i want to use the os.popen4 module can someone correct the way i use os.popen4? thanks fin = "select * from some_table" #sql statement client = "osql server user password" #sql client syntax fin, fout = os.popen4(client

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

2006-06-13 Thread and-google
John Salerno wrote: > I love the new 'folder' icon, but how can I access it as an icon? I've just given these are proper home, so here: http://doxdesk.com/software/py/pyicons.html cheers! -- And Clover mailto:[EMAIL PROTECTED] http://www.doxdesk.com/ -- http://mail.python.org/mailman/list

Re: DispatchEx('.Application')

2006-06-13 Thread Roger Upole
There's a project to create a COM api for Firefox that's identical to IE: http://www.iol.ie/~locka/mozilla/mozilla.htm Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When using win32com and DispatchEx to work with a webbrowser, eg: > > from win32com.client import Dispat

Re: question on dict subclassing and overriding __setitems__

2006-06-13 Thread George Sakkis
Eric S. Johansson wrote: > Diez B. Roggisch wrote: > > Or better even > > > >super(subclass, self).__setitem__(key.upper(), value) > > hmm. http://fuhm.net/super-harmful/ Interesting link, didn't know about it. I've always found super() ugly and doubted that it was in practice better

Re: How to select a folder with native windows dialog box?

2006-06-13 Thread Roger Upole
You can use SHBrowseForFolder: from win32com.shell import shell shell.SHBrowseForFolder() Roger <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I found the win32ui.CreateFileDialog() function to select a file but > nothing to select a folder :'-( > Maybe someone has a solutio

Re: [*SPAM*] Python open proxy honeypot

2006-06-13 Thread Alex Reinhart
Eric S. Johansson wrote: > Alex Reinhart wrote: >> Yeah, I just realized that. What would I do to act as an open proxy as >> well? > > emulate the Apache proxy capability, especially the reverse proxy. > > more seriously, what you need to do is from common proxy and web server > ports, accept pro

Re: How do I ignore the errors thrown by the DB api?

2006-06-13 Thread Ben Finney
"fyleow" <[EMAIL PROTECTED]> writes: > It would be great if I could just insert values into the DB and let > the uniqueness check at the DB level to either add or refuse the > duplicate value. The Pythonic way to do this is find out what exception is generated by the event you want to handle, and

Re: question on dict subclassing and overriding __setitems__

2006-06-13 Thread Eric S. Johansson
Diez B. Roggisch wrote: >dict.__setitem__(self, index.upper()) = value oh duh. > Or better even > >super(subclass, self).__setitem__(key.upper(), value) hmm. http://fuhm.net/super-harmful/ I think I need to do some more reading. ---eric -- http://mail.python.org/mai

Re: [OT] Re: Python open proxy honeypot

2006-06-13 Thread Alex Reinhart
Serge Orlov wrote: > Alex Reinhart wrote: >> Serge Orlov wrote: >>> IMHO it's pretty useless, spammers are starting to use botnets, and the >>> more you make inconvenient to them use open proxies, the more of them >>> will move to closed botnets. >> As long as I inconvenience them, or at least catc

Re: Screen capturing on Windows

2006-06-13 Thread jUrner
Rune Strand schrieb: > Is it possible by use of pyWin32 or ctypes to make a screen capture of > an inactive, or a hidden window if the hwnd/WindowName/ClassName is > known? I've seen dedicated screen capture software do this. While > PIL.ImageGrab.grab() is excellent, it will only capture the for

Re: "groupby" is brilliant!

2006-06-13 Thread Paul McGuire
John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 14/06/2006 8:38 AM, Robert Kern wrote: > > Gary Herron wrote: > >> John Machin wrote: > >> > >>> On 13/06/2006 6:28 PM, Paul McGuire wrote: > >>> > (Oh, and I like groupby too! Combine it with sort to quickly create

Re: question on dict subclassing and overriding __setitems__

2006-06-13 Thread Diez B. Roggisch
Eric S. Johansson schrieb: > I apologize if this is an FAQ but googling has not turned up anything, > at least to my keywords. > > I need to parse a configuration file from an existing application and > I'm treating it as a dictionary. I created my class with a parent class > of dict. Everyth

How do I ignore the errors thrown by the DB api?

2006-06-13 Thread fyleow
Here's the code I have in place right now. cursor.execute("SELECT link FROM feeds_feed WHERE link=%s", (self.link,)) db.commit() if cursor.rowcount == 0: cursor.execute("INSERT INTO feeds_feed (release_group, title, link, category, pub_date) VALUES (%s, %s,

[OT] Re: Python open proxy honeypot

2006-06-13 Thread Serge Orlov
Alex Reinhart wrote: > Serge Orlov wrote: > > IMHO it's pretty useless, spammers are starting to use botnets, and the > > more you make inconvenient to them use open proxies, the more of them > > will move to closed botnets. > As long as I inconvenience them, or at least catch one or two, I'll be >

question on dict subclassing and overriding __setitems__

2006-06-13 Thread Eric S. Johansson
I apologize if this is an FAQ but googling has not turned up anything, at least to my keywords. I need to parse a configuration file from an existing application and I'm treating it as a dictionary. I created my class with a parent class of dict. Everything works okay except I discover I need

Re: [*SPAM*] Python open proxy honeypot

2006-06-13 Thread Eric S. Johansson
Alex Reinhart wrote: > Yeah, I just realized that. What would I do to act as an open proxy as well? emulate the Apache proxy capability, especially the reverse proxy. more seriously, what you need to do is from common proxy and web server ports, accept proxy requests with a destination port numb

Re: "groupby" is brilliant!

2006-06-13 Thread John Machin
On 14/06/2006 8:38 AM, Robert Kern wrote: > Gary Herron wrote: >> John Machin wrote: >> >>> On 13/06/2006 6:28 PM, Paul McGuire wrote: >>> (Oh, and I like groupby too! Combine it with sort to quickly create histograms.) # tally a histogram of a list of values from 1-10 dat

Re: [OT] Re: Python open proxy honeypot

2006-06-13 Thread Alex Reinhart
Serge Orlov wrote: > IMHO it's pretty useless, spammers are starting to use botnets, and the > more you make inconvenient to them use open proxies, the more of them > will move to closed botnets. As long as I inconvenience them, or at least catch one or two, I'll be satisfied. > My spam folder at

Re: "groupby" is brilliant!

2006-06-13 Thread Robert Kern
Gary Herron wrote: > John Machin wrote: > >>On 13/06/2006 6:28 PM, Paul McGuire wrote: >> >>>(Oh, and I like groupby too! Combine it with sort to quickly create >>>histograms.) >>> >>># tally a histogram of a list of values from 1-10 >>>dataValueRange = range(1,11) >>>data = [random.choice(dataVa

Re: "groupby" is brilliant!

2006-06-13 Thread John Machin
On 14/06/2006 8:06 AM, Gary Herron wrote: > John Machin wrote: >> On 13/06/2006 6:28 PM, Paul McGuire wrote: >> >> >>> (Oh, and I like groupby too! Combine it with sort to quickly create >>> histograms.) >>> >>> # tally a histogram of a list of values from 1-10 >>> dataValueRange = range(1,11)

How to select a folder with native windows dialog box?

2006-06-13 Thread flaus . a
I found the win32ui.CreateFileDialog() function to select a file but nothing to select a folder :'-( Maybe someone has a solution for this? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Correctly reading stdout/stderr from subprocess

2006-06-13 Thread Christoph Haas
Evening, I'm having trouble with running a process through Python 2.4's subprocess module. Example code: def run(command): run = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Wait for the pr

[OT] Re: Python open proxy honeypot

2006-06-13 Thread Serge Orlov
Alex Reinhart wrote: > 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 simp

Re: "groupby" is brilliant!

2006-06-13 Thread Gary Herron
John Machin wrote: > On 13/06/2006 6:28 PM, Paul McGuire wrote: > > >> (Oh, and I like groupby too! Combine it with sort to quickly create >> histograms.) >> >> # tally a histogram of a list of values from 1-10 >> dataValueRange = range(1,11) >> data = [random.choice(dataValueRange) for i in xr

Re: DispatchEx('.Application')

2006-06-13 Thread Larry Bates
[EMAIL PROTECTED] wrote: > When using win32com and DispatchEx to work with a webbrowser, eg: > > from win32com.client import DispatchEx > > ie = DispatchEx('InternetExplorer.Application') > > can anyone suggest the right answer to this? > > mf = DispatchEx('MozillaFirefox.Application') > > It

Re: "groupby" is brilliant!

2006-06-13 Thread John Machin
On 13/06/2006 6:28 PM, Paul McGuire wrote: > (Oh, and I like groupby too! Combine it with sort to quickly create > histograms.) > > # tally a histogram of a list of values from 1-10 > dataValueRange = range(1,11) > data = [random.choice(dataValueRange) for i in xrange(1)] > > hist = [ (k,le

Test functions and test discovery (was: Re: Is there a better way of accessing functions in a module?)

2006-06-13 Thread Ben Finney
"Ant" <[EMAIL PROTECTED]> writes: > def a_test(): > print "Test A" > > def b_test(): > print "Test B" Incidentally, the convention is to name test functions as 'test_foo' not 'foo_test'; this will make your module more easily compatible with existing testing tools. > if __name__ == "__m

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

2006-06-13 Thread Larry Bates
Girish Sahani wrote: >> On 13/06/2006 4:11 PM, Girish Sahani wrote: >> [snip] >>>instance = ti2(k) >>>tiNew = ti1.append(instance) >> ti2 is quacking "function" but ti1 is quacking "list". >> >> Possibilities: >> (1) You meant to type ti2[k] ... and this section of code has not yet

Re: Writing PNG with pure Python

2006-06-13 Thread Ben Finney
"Johann C. Rocholl" <[EMAIL PROTECTED]> writes: > How about this here construct? > > #!/usr/bin/env python > # png.py - PNG encoder in pure Python > # Copyright (C) 2006 Johann C. Rocholl <[EMAIL PROTECTED]> > # > # This file is licensed alternatively under one of the following: > # 1. GNU Lesser

Re: What's wrong in this HTML Source file of a Bank

2006-06-13 Thread Remi Villatel
[EMAIL PROTECTED] wrote: > Several times I logged-in successfully but after log-in I can't use > features/services which were shown prior to my login. Can anyone exoert > from this forum check , is it technical fault of Bank Web Site or this > problem pertaining to the user(me). This is definitiv

Re: "groupby" is brilliant!

2006-06-13 Thread Jon Clements
Not related to itertools.groupby, but the csv.reader object... If for some reason you have malformed CSV files, with embedded newlines or something of that effect, it will raise an exception. To skip those, you will need a construct of something like this: raw_csv_in = file('filenamehere.csv') fo

Re: Is there a better way of accessing functions in a module?

2006-06-13 Thread Kent Johnson
Ant wrote: > Ant wrote: > ... >> But this feels like a hack... Is there a cleaner way for accessing the >> functions of the current module similar to the __dict__ attribute of >> classes? i.e. a way to access the local symbol table? > > Sorry - posted too soon. Found the globals() built-in... You

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

2006-06-13 Thread Ravi Teja
Luis M. González wrote: > Diez B. Roggisch wrote: > > > But semantically it is a proper functional language. The features may > > > not attract Python users who might prefer Boo/Jython/IronPython. But it > > > does offer something to disillusioned Groovy users. > > > > Are they disillusioned? Just

Re: "groupby" is brilliant!

2006-06-13 Thread James Stroud
James Stroud wrote: > Frank Millman wrote: > >> 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 >> sorte

Re: wxpython: bringing up a dialog box with a button

2006-06-13 Thread jean-michel bain-cornu
John Salerno a écrit : > import wx > class InputForm(wx.Frame): > > def __init__(self, parent=None, id=wx.ID_ANY, title=''): > wx.Frame.__init__(self, parent, id, title) > panel = wx.Panel(self) > btnModal = wx.Button(panel, -1, 'Modal') > dialog = wx.Dialog(sel

Redirecting Print Streams

2006-06-13 Thread Mike Driscoll
Hi,I am working on a Tkinter GUI that will display software package's install status. I work for a company that wants to control how software is installed and where. Anyway, the package installer I am working with currently prints to a console window for each software package installed. So, if we h

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

2006-06-13 Thread Ravi Teja
Diez B. Roggisch wrote: > > But semantically it is a proper functional language. The features may > > not attract Python users who might prefer Boo/Jython/IronPython. But it > > does offer something to disillusioned Groovy users. > > Are they disillusioned? Just wondering. Nah! Just a poor passin

Re: "groupby" is brilliant!

2006-06-13 Thread James Stroud
Frank Millman wrote: > 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 chan

Re: [pysqlite] [ANN] pysqlite 2.3.0

2006-06-13 Thread Dawid Gajownik
Dnia 06/13/2006 09:40 PM, Użytkownik Gerhard Häring napisał: > I've uploaded a fixed source tarball now. Thanks! BTW new packages for Fedora should be available tomorrow on mirrors :) -- ^_* -- http://mail.python.org/mailman/listinfo/python-list

wxpython: bringing up a dialog box with a button

2006-06-13 Thread John Salerno
I'm not exactly sure how to call the method ShowModal(). This is what I have so far: -- import wx class InputForm(wx.Frame): def __init__(self, parent=None, id=wx.ID_ANY, title=''): wx.Frame.__init__(self, parent, id, title) panel = wx.Panel(self)

interactive programme & pyTTS

2006-06-13 Thread carmel stanley
Hi i have been making an interactive programme,i have recently tried using "pyTTS" with it. This is a small ammount of it.   import pyTTS   tts = pyTTS.Create()tts.Rate = -3tts.Speak('hi molly how old are you?.')s = raw_input ("how old are you?")if s=='3':    print "thats great"else: print "

Re: [pysqlite] [ANN] pysqlite 2.3.0

2006-06-13 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dawid Gajownik wrote: > Dnia 06/13/2006 08:52 PM, Użytkownik Gerhard Häring napisał: > >> pysqlite 2.3.0 released > > Great :) I have one more problem, though. It does not compile: [...] > src/connection.c:31:26: error: sqlitecompat.h: No such file o

Re: Tuple Syntax and ()

2006-06-13 Thread James Stroud
[EMAIL PROTECTED] wrote: > I keep accidently trying to declare t-tuples as mytuple = (myitem) > > I know this doesn't work and that you need the trailing comma, but > reading something online, I just came to realize the parenthesises > don't have any special meaning in relation to tuples at al

Tuple Syntax and ()

2006-06-13 Thread tactics40
I keep accidently trying to declare t-tuples as mytuple = (myitem) I know this doesn't work and that you need the trailing comma, but reading something online, I just came to realize the parenthesises don't have any special meaning in relation to tuples at all, do they? -- http://mail.python

Re: Making a Label that looks the same as a button.

2006-06-13 Thread Dustan
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Grayson, John <[EMAIL PROTECTED]> wrote: > > > > > > > >Buttons can look like labels without the need to create another object - > >just remove the > >Command binding, set state to DISABLED and disabledforeground='same > >color as NORMAL'...

Re: [pysqlite] [ANN] pysqlite 2.3.0

2006-06-13 Thread Dawid Gajownik
Dnia 06/13/2006 08:52 PM, Użytkownik Gerhard Häring napisał: > pysqlite 2.3.0 released Great :) I have one more problem, though. It does not compile: gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -

Re: embedded python and windows multi threading, can't get it to work

2006-06-13 Thread Serge Orlov
freesteel wrote: > I am trying to run a python programme embedded from C++. I want to run > the same python code concurrently in several threads. I read the manual > on embedding, especially chapter 8, and searched for relevant info on > google all afternoon, but I can't get this to work. What am I

[ANN] pysqlite 2.3.0

2006-06-13 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 pysqlite 2.3.0 released === I'm pleased to announce the availability of pysqlite 2.3.0. This is a major release with a few new features. Go to http://pysqlite.org/ for downloads, online documentation and reporting bugs. What is p

daily python url - gmane links dead?

2006-06-13 Thread K.S.Sreeram
Is it just me.. or are all the gmane links on daily-python dead? All the c.l.py.announce entries point to gmane, and none of them seem to be working. This is the error i get on gmane: Warning: fsockopen(): unable to connect to hugh:8010 in /home/httpd/gmane/php/lib.php on line 18 Couldn't contact

Re: numeric/numpy/numarray

2006-06-13 Thread Robert Kern
Bryan wrote: > 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. There's a reasonably complete telling (and up-to-date!) of the history behind these packages here: http://www.scipy.org/History_o

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

2006-06-13 Thread John Salerno
Scott David Daniels wrote: > def __init__(self, parent=None, id=-1, title=__file__): I get that __file__ is not defined. -- http://mail.python.org/mailman/listinfo/python-list

Re: Earthquake and Tornado Forecasting Programs June 13, 2006

2006-06-13 Thread CBFalconer
Frank Silvermann wrote: > > [snip] > I look forward to a day when meteorology has more to do with precise > models than models, although I'm all for Russian-style delivery of such > data. I forecast that a lot of people will be surprised by the weather > today, as they are categorical idiots, as

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

2006-06-13 Thread John Salerno
Scott David Daniels wrote: > class InputForm(wx.Frame): > def __init__(self, parent=None, id=-1, title=__file__): Also, is there a way to define parent and id with defaults, but not title? Is it good to change the order around to do this? -- http://mail.python.org/mailman/listinfo/python-li

Re: numeric/numpy/numarray

2006-06-13 Thread Dan Christensen
Bryan <[EMAIL PROTECTED]> writes: > on the python wiki > "NumArray is the current reimplementation of NumPy." > http://wiki.python.org/moin/NumArray > > so, was Numarray written *before* NumPY, or was it a reimplementation of > NumPy > which implies it came *after* NumPy? I clarified that wiki

Re: USB support

2006-06-13 Thread Richard Townsend
On 13 Jun 2006 11:08:59 -0700, rodmc wrote: > Hi, > > I need to write a program which can access the USB ports on Mac and > Linux, is there a library available for Python? > > Thanks in advance. > > Best, > > rod Not tried it, but: http://pyusb.berlios.de/ -- Richard -- http://mail.pytho

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

2006-06-13 Thread Luis M. González
Diez B. Roggisch wrote: > > But semantically it is a proper functional language. The features may > > not attract Python users who might prefer Boo/Jython/IronPython. But it > > does offer something to disillusioned Groovy users. > > Are they disillusioned? Just wondering. > > Diez Whay talking a

embedded python and windows multi threading, can't get it to work

2006-06-13 Thread freesteel
I am trying to run a python programme embedded from C++. I want to run the same python code concurrently in several threads. I read the manual on embedding, especially chapter 8, and searched for relevant info on google all afternoon, but I can't get this to work. What am I doing wrong? I use pytho

USB support

2006-06-13 Thread rodmc
Hi, I need to write a program which can access the USB ports on Mac and Linux, is there a library available for Python? Thanks in advance. Best, rod -- http://mail.python.org/mailman/listinfo/python-list

Re: Very nice python IDE (windows only)

2006-06-13 Thread Luis M. González
Jan Bijsterbosch wrote: > Hello Luis, > > "Luis M. González" <[EMAIL PROTECTED]> schreef in bericht > news:[EMAIL PROTECTED] > > > > [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 t

Trace KeyboardInterrupt exception?

2006-06-13 Thread Tony Nelson
I'm trying to find out what is eating some KeyboardInterrupt exceptions in a fairly large program (yum). My KeyboardInterrupt handler is called for some Ctl-C presses, but for others nothing seems to happen. Grepping the source (what of it I've found, looking at import statements) doesn't tur

Re: Customized Boot Manager in Python

2006-06-13 Thread 3c273
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now, I have to create a visual interface for such kind of small > program. > > I have 2 questions > (i) How can we use operating system specific commands like ssh within > the python program (ii) Which grphics library (wxPython or any ot

DispatchEx('.Application')

2006-06-13 Thread iainws
When using win32com and DispatchEx to work with a webbrowser, eg: from win32com.client import DispatchEx ie = DispatchEx('InternetExplorer.Application') can anyone suggest the right answer to this? mf = DispatchEx('MozillaFirefox.Application') It is an invalid class string, but I don't know ho

Re: Is there a better way of accessing functions in a module?

2006-06-13 Thread Mike Kent
Yes, you can go that route. But since it appears that what you are doing is unit testing related, and you are interested in aranging for all of your unit test cases to be run automatically, I'd suggest using the unittest module. -- http://mail.python.org/mailman/listinfo/python-list

Re: .py and running in Windows:

2006-06-13 Thread Fredrik Lundh
Michael Yanowitz wrote: > I never specified a thread. I think perhaps though because I did > open another message in this mailing list (to get the correct > email address to send to), but I deleted all its contents i put > it under that other thread, however there is no indication of a > thread in

Re: Is there a better way of accessing functions in a module?

2006-06-13 Thread Ant
Ant wrote: ... > But this feels like a hack... Is there a cleaner way for accessing the > functions of the current module similar to the __dict__ attribute of > classes? i.e. a way to access the local symbol table? Sorry - posted too soon. Found the globals() built-in... -- http://mail.python.o

Is there a better way of accessing functions in a module?

2006-06-13 Thread Ant
I have the following code which works fine for running some tests defined within a module: def a_test(): print "Test A" def b_test(): print "Test B" if __name__ == "__main__": tests = ["%s()" % x for x in dir() if x.endswith("test")] for test in tests: eval(test) But th

Re: Earthquake and Tornado Forecasting Programs June 13, 2006

2006-06-13 Thread Frank Silvermann
[snip] I look forward to a day when meteorology has more to do with precise models than models, although I'm all for Russian-style delivery of such data. I forecast that a lot of people will be surprised by the weather today, as they are categorical idiots, as is the OP. frank -- http://mail.

Re: Python 411.

2006-06-13 Thread Steve Holden
Brian van den Broek wrote: > Mike T said unto the world upon 13/06/06 10:46 AM: > >>What exactly is 411 in this context? A reference to higher education >>perhaps? Or perhaps part of the American constitution? What exactly? >>Also for that matter what is 101? >> >>Cheers, >>Mike >> > > > Hi Mi

Re: ANN: Dao 1.0.0-alpha is released

2006-06-13 Thread Ilias Lazaridis
[EMAIL PROTECTED] wrote: > Hello, > > It is a pleasure to announce in this mailing list the newly released > Dao. This is the first release after the Dao interpreter being ... > Two modules are also released along with the virtual machine: DaoMySQL > and DaoPyhon. DaoPython is particularly intere

Re: [*SPAM*] Python open proxy honeypot

2006-06-13 Thread Alex Reinhart
Tim Williams wrote: > On 13/06/06, Alex Reinhart <[EMAIL PROTECTED]> wrote: >> >> Is running Python's built-in smtpd, pretending to accept and forward all >> messages, enough to get me noticed by a spammer, or do I have to do >> something else to "advertise" my script as an open proxy? > > This wi

Re: Decimals

2006-06-13 Thread Diez B. Roggisch
Tgone wrote: > Sybren Stuvel wrote: >> Tgone enlightened us with: >> > Sorry, when I print out the variable it displays as '15.0'. The >> > price is '15.00' in the database though. >> >> That's the same thing, isn't it? 15.0 == 15.0 > > Yes, they're both mathematically the same. I never s

Re: Decimals

2006-06-13 Thread Steve Holden
Tgone wrote: > Sybren Stuvel wrote: > >>Tgone enlightened us with: >> >>>Sorry, when I print out the variable it displays as '15.0'. The >>>price is '15.00' in the database though. >> >>That's the same thing, isn't it? 15.0 == 15.0 > > > Yes, they're both mathematically the same. I never

Re: Making a Label that looks the same as a button.

2006-06-13 Thread Fredrik Lundh
Andrew Gwozdziewycz wrote: > It's imperative that you explain which toolkit you are using since > they all have differences. however, if you knew the answer, you would have recognized what toolkit he was using. -- http://mail.python.org/mailman/listinfo/python-list

TONIGHT! Lisp group beerfest in NYC, PyCells to be discussed

2006-06-13 Thread Ken Tilton
The royal We has just learned that His Kennyness will be honoring the boozehounds of LispNYC with His Presence tonight (deets below). He will come bearing Celtk and news of PyCells, though the top billing tonight goes to SoC student Extraordinaire Samantha Kleinberg. kenzo > Please join us for

Re: [newbie]apache authentication questions

2006-06-13 Thread Steve Holden
Michael Ströder wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >> >>>It is not impossible though and in cases where you don't have a choice >>>but to use a HTTP authentication scheme, use of AJAX may be the >>>answer to still allowing use of a form based login scheme. See: >>> >>> h

Re: Writing PNG with pure Python

2006-06-13 Thread Johann C. Rocholl
How about this here construct? #!/usr/bin/env python # png.py - PNG encoder in pure Python # Copyright (C) 2006 Johann C. Rocholl <[EMAIL PROTECTED]> # # This file is licensed alternatively under one of the following: # 1. GNU Lesser General Public License (LGPL), Version 2.1 or newer # 2. GNU Gen

Re: Python 411.

2006-06-13 Thread Terry Reedy
"Brian van den Broek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > meaning something like information. Introductory university course in > a field are often numbered 101 (i.e. Computer Science 101). So, that > number has acquired a slang meaning of basic and introductory > infor

Re: .py and running in Windows:

2006-06-13 Thread imcs ee
i modify "C:\Python\python.exe" -i "%1" %* to cmd /k;"C:\Python\python.exe" -i "%1" %* or cmd /k;"C:\Python\python.exe" "%1" %*   just a little trick.  On 13 Jun 2006 06:48:23 -0700, Iain King <[EMAIL PROTECTED]> wrote: Andrew Gwozdziewycz wrote:> You'll have better results posting this to it'

Re: a string problem

2006-06-13 Thread Mitja Trampus
John Salerno wrote: > [EMAIL PROTECTED] wrote: >> hi >> >> if i have a some lines like this >> a ) "here is first string" >> b ) "here is string2" >> c ) "here is string3" >> >> When i specify i only want to print the lines that contains "string" ie > ... > And I'm actually ashamed to admit that I

Re: a string problem

2006-06-13 Thread Maric Michaud
Le Mardi 13 Juin 2006 15:59, John Salerno a écrit : > And I'm actually ashamed to admit that I know the RE way, but not the > regular string manipulation way, if there is one! eheh, In [39]: import string In [40]: sub, s1, s2 = 'string', 're string2, ,string1', 're string2, ,string' In [41]: su

Re: Making a Label that looks the same as a button.

2006-06-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Grayson, John <[EMAIL PROTECTED]> wrote: > > > >Buttons can look like labels without the need to create another object - >just remove the >Command binding, set state to DISABLED and disabledforeground='same >color as NORMAL'... > >This demonstrates how to play with

Vancouver Python Workshop - Talk submission reminder

2006-06-13 Thread Brian Quinlan
What's New? === The deadline for submitting a talk or tutorial for the Vancouver Python Workshop is fast approaching. Talks will be accepted until Friday June 16th. To submit a talk, see: http://www.vanpyz.org/conference/talksubmission.html About the Vancouver Python Workshop ===

Re: "groupby" is brilliant!

2006-06-13 Thread Benji York
Frank Millman wrote: > reader = csv.reader(open('trans.csv', 'rb')) > rows = [] > for row in reader: > rows.append(row) Why do you create a list of rows instead of just iterating over the reader directly? -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: a string problem

2006-06-13 Thread Rune Strand
[EMAIL PROTECTED] wrote: > hi > > if i have a some lines like this > a ) "here is first string" > b ) "here is string2" > c ) "here is string3" > > When i specify i only want to print the lines that contains "string" ie > the first line and not the others. If i use re module, how to compile > the

Re: Python 411.

2006-06-13 Thread Ron Stephens
Steve, thanks for the note. The name Python411 comes from me copying my good friend Rob Walch, who named his podcast Podcast411, which is a popular show on which he interviews other podcasters like Adam Curry etc. He also has a book just published about podcasting. Ron Stephens -- http://mail.py

Re: numeric/numpy/numarray

2006-06-13 Thread John Hunter
> "Bryan" == Bryan <[EMAIL PROTECTED]> writes: Bryan> hi, what is the difference among numeric, numpy and Bryan> numarray? i'm going to start using matplotlib soon and i'm Bryan> not sure which one i should use. numpy is the successor to numarray and Numeric. All three do basic

Re: Linux info

2006-06-13 Thread vasudevram
os.system('ls -lL ' + path) should also work. But check, I may be wrong about the L option, and am not near a Linux system right now. That's "lL" - a small letter l (ell) followed by a capital letter L in the ls options above. This way may be slower than os.path.realpath if that is implemented as

Re: numeric/numpy/numarray

2006-06-13 Thread Bryan
Ben Sizer wrote: > Bryan wrote: > >> at the end of that page, it says: >> >> "Numarray is another implementation of an arrayobject for Python written >> after >> Numeric and before NumPy. Sponsors of numarray have indicated they will be >> moving to NumPy as soon as is feasible for them so that e

Re: a string problem

2006-06-13 Thread micklee74
John Salerno wrote: > [EMAIL PROTECTED] wrote: > > > just curious , if RE has the \b and it works, can we look into the > > source of re and see how its done for \b ? > > I had a look in the sre module (which re seems to import), but I > couldn't find much. I'm not the best at analyzing source cod

  1   2   >