Re: word shifts

2008-05-04 Thread Peter Otten
dave wrote: > I made a function that takes a word list (one word per line, text file) > and searches for all the words in the list that are 'shifts' of > eachother.  'abc' shifted 1 is 'bcd' > > Please take a look and tell me if this is a viable solution. > >  def shift(word, amt): > a

Re: word shifts

2008-05-04 Thread Arnaud Delobelle
dave <[EMAIL PROTECTED]> writes: > Hello, > > I made a function that takes a word list (one word per line, text > file) and searches for all the words in the list that are 'shifts' of > eachother. 'abc' shifted 1 is 'bcd' > > Please take a look and tell me if this is a viable solution. > > def sh

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Carl Banks wrote: On May 3, 7:44 pm, Gary Herron <[EMAIL PROTECTED]> wrote: Alexander Schmolck wrote: AlFire <[EMAIL PROTECTED]> writes: The threading module already has a function to return the number of Thread objects currently alive. I have threads within threads

Re: Script Optimization

2008-05-04 Thread David
> It's too long to post here (160 lines) so here's the link: > http://uppit.com/d2/CKOYHE/af78a6bd3e21a19d5871abb9b879/utils.py > (if that doesn't work: http://uppit.com/CKOYHE) > > Thanks in advance, > lev Neither link works for me. I get an error page "Error: invalid download linnk". Ho

Re: generator functions in another language

2008-05-04 Thread David
On Sun, May 4, 2008 at 1:39 AM, <[EMAIL PROTECTED]> wrote: > I'm actually curious if there's a way to write a generator function > (not a generator expression) in C, or what the simplest way to do it > is... besides link the Python run-time. > -- Here's the itertools C code: http://svn.python

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Protected
Good thinking. It was indented with spaces, so I replaced them with tabs. Now I'm getting a SyntaxError: invalid syntax in root = Tk(). If I split the code in two parts (with the second one beginning in that line) and run them separately, I get no errors, but still nothing happens. class Applicati

Fw: Script Optimization

2008-05-04 Thread David
Forwarding back to the list. -- Forwarded message -- From: lev <[EMAIL PROTECTED]> Date: Sun, May 4, 2008 at 10:21 AM Subject: Re: Script Optimization To: David <[EMAIL PROTECTED]> On May 4, 12:32 am, David <[EMAIL PROTECTED]> wrote: > > It's too long to post here (160 lines) s

Please help - Tkinter not doing anything

2008-05-04 Thread Protected
Hello. I'm a complete newbie trying to learn Python. I decided to try some Tkinter examples, including the one from the library reference, but they don't seem to do anything! Shouldn't there be, like, a dialog? I'm running Windows XP and using IDLE. You can assume my version of Python is the lates

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-04 Thread David
> - Are there any peculiarities with using curs.executemany(...) vs. multiple > curs.execute(...) ? I read a notice, sqlite3 does internally some caching, > hence both should be similarly fast, but in my case executemany(...) is > quite a bit faster How many times are you calling execute vs a sing

Re: Encoding Text

2008-05-04 Thread Tim Golden
Paul Jefferson wrote: I'm learning this and I'm making a program which takes RSS feeds and processes them and then outputs them to a HTML file. The problem I have is that some of the RSS feeds contain chachters which I think are outside of the ascii range as when I attempt to write the file con

Re: Open a file within an ISO in python.

2008-05-04 Thread David
On Sun, May 4, 2008 at 12:01 PM, <[EMAIL PROTECTED]> wrote: > Is there a way to open a file that is inside of an ISO in python? > > Say I have an ISO file, danikars.iso and on the iso there is a file > called information.txt > > I want to be able to do something like this. > > [code] > iso_h

Open a file within an ISO in python.

2008-05-04 Thread danikar
Is there a way to open a file that is inside of an ISO in python? Say I have an ISO file, danikars.iso and on the iso there is a file called information.txt I want to be able to do something like this. [code] iso_h = openiso("danikars.iso") file_h = iso_h.extract("information.txt") contents = fi

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Chuckk Hubbard
Try adding: from Tkinter import * at the beginning, and you don't need "var" in front of root=Tk(), just "root = Tk()" (<-without the quotes of course) What OS are you on? Are you running "python testapp.py" or similar to make it run? -Chuckk On Sun, May 4, 2008 at 12:39 PM, Protected <[EMAI

ANN: eric 4.1.3 released

2008-05-04 Thread Detlev Offenbach
Hi, I'd like to inform everybody about the immediate availability of eric v4.1.3. This is a bug fix release. It is available via http://www.die-offenbachs.de/eric/index.html. What is eric? - eric is a Python IDE written using PyQt4 and QScintilla2. It comes with all batteries include

Re: Light slices + COW

2008-05-04 Thread bearophileHUGS
David: > What do you mean by best possible? Most efficient? Most readable? What's a good wine? It's not easy to define what's "good/best". In such context it's a complex balance of correct, short, fast and readable (and more, because you need to define a context. This context refers to Psyco too)

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Protected
I had previously ran the import line. I prepended it to the example code I'm trying to run every time but it did not help, still nothing happens. With or without var before 'root'. I'm pasting the code in IDLE and using Windows XP as written in the first post. On May 4, 11:04 am, "Chuckk Hubbard"

Re: is +=1 thread safe

2008-05-04 Thread Bjoern Schliessmann
Gary Herron wrote: > No NO NO! The only way to increment a variable in memory is > through a three step process: > > Load a register from a memory location > Increment the register > Store the value back into memory. I suggest you read "Intel 64 and IA-32 Architectures Software Developer

Re: word shifts

2008-05-04 Thread bearophileHUGS
George Sakkis: > A faster algorithm is to create a 'key' for each word, defined as the > tuple of ord differences (modulo 26) of consecutive characters. Very nice solution, it uses the same strategy used to find anagrams, where keys are "".join(sorted(word)) Such general strategy to look for a pos

Re: about bsddb module

2008-05-04 Thread Jorge Godoy
cocobear wrote: > On 5月3日, 下午7时17分, cocobear <[EMAIL PROTECTED]> wrote: >> How to deal with multiple databases in an file. I want to get the >> content of several databases. (...) > Anybody can help me? I believe you can only have one database per file with the Python abstraction... But you c

Re: generator functions in another language

2008-05-04 Thread castironpi
On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL > PROTECTED]> escribió: > > > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > > >> I'm actually curious if there's a way to write a generator function >

Re: Please help - Tkinter not doing anything

2008-05-04 Thread s0suk3
On May 4, 5:22 am, Protected <[EMAIL PROTECTED]> wrote: > I had previously ran the import line. I prepended it to the example > code I'm trying to run every time but it did not help, still nothing > happens. With or without var before 'root'. I'm pasting the code in > IDLE and using Windows XP as w

Re: saving a webpage's links to the hard disk

2008-05-04 Thread castironpi
On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> escribió: > > > Is there a good place to look to see where I can find some code that > > will help me to save webpage's links to the local drive, after I have > > used

ISBN Barecode reader in Python?

2008-05-04 Thread Joseph
All: I have written a program to query Amazon with ISBN and get the book details. I would like to extend so that I can read ISBN from the barcode (I will take a photo of the same using webcam or mobile). Are there any opensource/free SDK doing the same? As it is a hobby project, I don't like to spe

Re: word shifts

2008-05-04 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > George Sakkis: >> A faster algorithm is to create a 'key' for each word, defined as the >> tuple of ord differences (modulo 26) of consecutive characters. > > Very nice solution, it uses the same strategy used to find anagrams, > where keys are > "".join(sorted(word)) >

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Protected
On May 4, 12:18 pm, [EMAIL PROTECTED] wrote: > On May 4, 5:22 am, Protected <[EMAIL PROTECTED]> wrote: > > > I had previously ran the import line. I prepended it to the example > > code I'm trying to run every time but it did not help, still nothing > > happens. With or without var before 'root'. I

Re: Script Optimization

2008-05-04 Thread David
On Sun, May 4, 2008 at 4:43 AM, lev <[EMAIL PROTECTED]> wrote: > Can anyone provide some advice/suggestions to make a script more > precise/efficient/concise, etc.? Hi, I started tidying up the script a bit, but there are some parts I don't understand or look buggy. So I'm forwarding you the vers

Re: Script Optimization

2008-05-04 Thread David
Eh, I forgot the attachment. #!/usr/bin/env python import md5 from glob import glob from optparse import OptionParser from os import chdir, path, rename, remove from sys import argv def check(checksums): checksums = open(checksums, 'r') chgfiles = {} msngfiles = [] for fline in ch

matplotlib pylab plot() BadWindow error

2008-05-04 Thread oyinbo55
I am trying to use the pylab plot command on my laptop running Ubuntu 6.06 (Dapper). Although the plot command works fine on my XP desktop at work, I cannot open the plot window on the laptop. I edited matplotlibrc to change interactive: to "True". In idle, I entered the commands: >>> from

please remove me from this list

2008-05-04 Thread Vladimir Kropylev
please remove me from this list, thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Light slices + COW

2008-05-04 Thread David
> > D compiles to efficient machine code so Python is at a disadvantage > > even if you use the same syntax (see my first example). You can make > > the Python version faster, but beware of premature optimization. > > This time I don't agree with this "premature optimization" thing. My > origi

Re: is +=1 thread safe

2008-05-04 Thread Alexander Schmolck
Gary Herron <[EMAIL PROTECTED]> writes: > But... It's not! > > A simple test shows that. I've attached a tiny test program that shows this > extremely clearly. Please run it and watch it fail. In [7]: run ~/tmp/t.py final count: 200 should be: 200 (I took the liberty to correct yo

Re: please remove me from this list

2008-05-04 Thread David
On Sun, May 4, 2008 at 2:48 PM, Vladimir Kropylev <[EMAIL PROTECTED]> wrote: > please remove me from this list, thanks > -- > http://mail.python.org/mailman/listinfo/python-list > Follow that link (http://mail.python.org/mailman/listinfo/python-list) and see the "Python-list Subscribers" section

Re: ISBN Barecode reader in Python?

2008-05-04 Thread David
On Sun, May 4, 2008 at 1:41 PM, Joseph <[EMAIL PROTECTED]> wrote: > All: I have written a program to query Amazon with ISBN and get the > book details. I would like to extend so that I can read ISBN from the > barcode (I will take a photo of the same using webcam or mobile). Are > there any open

SQLObject 0.9.6

2008-05-04 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.9.6, a minor bug fix release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and qu

SQLObject 0.10.1

2008-05-04 Thread Oleg Broytmann
Hello! I'm pleased to announce version 0.10.1, a bugfix release of 0.10 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to u

Image grab in Python

2008-05-04 Thread Valerio Valerio
Hi, anyone know a Python library to grab the size of a selected image region (the selection will be made with the mouse), that work in Linux ? I found a module to do that in the PIL library but only work in Windows - http://www.pythonware.com/library/pil/handbook/imagegrab.htm Thanks in advance.

Re: Image grab in Python

2008-05-04 Thread David
On Sun, May 4, 2008 at 4:25 PM, Valerio Valerio <[EMAIL PROTECTED]> wrote: > Hi, > > anyone know a Python library to grab the size of a selected image region > (the selection will be made with the mouse), that work in Linux ? You might be able to use this tool: http://freshmeat.net/projects/gtksh

Determine socket family at runtime

2008-05-04 Thread Giampaolo Rodola'
Hi there, since the socket.socket.family attribute has been introduced only in Python 2.5 and I need to have my application to be backward compatible with Python 2.3 and 2.4 I'd like to know how could I determine the family of a socket.socket instance which may be AF_INET or AF_INET6. Is there some

Re: Colors for Rows

2008-05-04 Thread Scott David Daniels
D'Arcy J.M. Cain wrote: On Tue, 29 Apr 2008 15:03:23 -0400 "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: Or, if you aren't sure how many colors you'll be using, try the more robust: bg[z % len(bg)] Good point although I would have calculated the length once at the start rather than each time thr

python-list@python.org

2008-05-04 Thread joop renes
hi, i hope this is the right list for the following question of a c++ hacker,python newbie. i have a library in c++ to which i want to add a python GUI and other python stuff.The library has multithreading components, while python uses a reference counted memory model. Usually mixing reference coun

Writing a aiff audio file problem?

2008-05-04 Thread jym
Hi all I can not creat a usable audio file in the aiff format. The example code below creates a wav file that I can listen to just fine. However, I just get noise when I listen to the resulting aiff file. Is this a byte order problem? I am using Python 2.5.2 on Windows XP. Any guidance on this iss

Re: pyqt4: trouble making custom widget appear in mainwindow

2008-05-04 Thread Phil Thompson
On Sunday 04 May 2008, Lance Gamet wrote: > Hi, > about 3 years ago I did a bit of Qt3 and 4 on C++, now I am trying to do > something in python. > > A QMainWindow subclass as my mainwindow. Its basically a frame with no > widgets of its own. > > Several QWidget subclasses each representing a mode

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-04 Thread hdante
On May 3, 7:05 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On May 3, 10:13 pm, hdante <[EMAIL PROTECTED]> wrote: > > >  I believe that moving this to third party could be better. What about > > numpy ? Doesn't it already have something similar ? > > Yes, Kahan summation makes sence for numpy arra

Re: Image grab in Python

2008-05-04 Thread Valerio Valerio
I can grab the image, I need a way of grab the region size with the mouse, a easy way of the user select a region of the image to analyze, something like the "Rectangle selection tool" of gimp. Regards, -- Valério Valério http://www.valeriovalerio.org 2008/5/4 David <[EMAIL PROTECTED]>: > O

PyPy Berlin Sprint, 17th - 22nd May 2008

2008-05-04 Thread Carl Friedrich Bolz
= PyPy Berlin Sprint (17-22nd May 2008) = The next PyPy sprint will be in the crashed `c-base space station`_, Berlin, Germany, Earth, Solar System. Thi

Re: is +=1 thread safe

2008-05-04 Thread Marc Christiansen
Alexander Schmolck <[EMAIL PROTECTED]> wrote: > Gary Herron <[EMAIL PROTECTED]> writes: > >> But... It's not! >> >> A simple test shows that. I've attached a tiny test program that >> shows this extremely clearly. Please run it and watch it fail. > > In [7]: run ~/tmp/t.py > final count: 200

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-04 Thread Duncan Booth
Szabolcs Horvát <[EMAIL PROTECTED]> wrote: > I thought that it would be very nice if the built-in sum() function used > this algorithm by default. Has this been brought up before? Would this > have any disadvantages (apart from a slight performance impact, but > Python is a high-level languag

default gettext localedir on windows

2008-05-04 Thread ZeeGeek
Hi, what's the default localedir for gettext module on windows? In Linux, it's /usr/share/locale. Where should I put the *.mo file in order to make the translation work? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Alexander Schmolck wrote: Gary Herron <[EMAIL PROTECTED]> writes: But... It's not! A simple test shows that. I've attached a tiny test program that shows this extremely clearly. Please run it and watch it fail. In [7]: run ~/tmp/t.py final count: 200 should be: 200 (I

Re: Determine socket family at runtime

2008-05-04 Thread Wojciech Walczak
2008/5/4, Giampaolo Rodola' <[EMAIL PROTECTED]>: > For now I've been able to determine the family by using: > > # self.socket = a connected socket.socket instance > ip, port = self.socket.getsockname()[0:2] > af = socket.getaddrinfo(ip, port)[0][0] > > ...but I'd like to know if some other sol

Weird import problem

2008-05-04 Thread Anton81
I have a directory structure like NS/dir1/file1.py NS/dir2/file2.py if in the python shell I type import NS.dir1.file1 it works, however typing import NS.dir2.file2 fails with ImportError: No module named dir2.file2 Any ideas what could go wrong? Directory permissions seem to be OK. -- htt

Re: Weird import problem

2008-05-04 Thread Diez B. Roggisch
Anton81 schrieb: I have a directory structure like NS/dir1/file1.py NS/dir2/file2.py This *must* be wrong or at least not the full directory listing - please read http://docs.python.org/tut/node8.html if in the python shell I type import NS.dir1.file1 it works, however typing import N

Re: Determine socket family at runtime

2008-05-04 Thread Francesco Bochicchio
On Sun, 04 May 2008 08:49:55 -0700, Giampaolo Rodola' wrote: > Hi there, > since the socket.socket.family attribute has been introduced only in > Python 2.5 and I need to have my application to be backward compatible > with Python 2.3 and 2.4 I'd like to know how could I determine the > family of

Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Gilly
Hi I am trying to create an application that uses some form of input to create a midi file. I would like for this to be a 'real time' process. In other words, I want to be able to begin playing the midi file before I finish writing it, and continue writing as it plays. I would really appreciate an

Re: default gettext localedir on windows

2008-05-04 Thread Thorsten Kampe
* ZeeGeek (Sun, 4 May 2008 08:59:05 -0700 (PDT)) > Hi, what's the default localedir for gettext module on windows? In > Linux, it's /usr/share/locale. Where should I put the *.mo file in > order to make the translation work? %PYTHONHOME%\share\locale Thorsten -- http://mail.python.org/mailman/lis

Re: Image grab in Python

2008-05-04 Thread David
On Sun, May 4, 2008 at 5:28 PM, Valerio Valerio <[EMAIL PROTECTED]> wrote: > I can grab the image, I need a way of grab the region size with the mouse, > a easy way of the user select a region of the image to analyze, something > like the "Rectangle selection tool" of gimp. > I assume what you w

Re: Image grab in Python

2008-05-04 Thread David
> > Another way would be to listen to all events sent through X, and act > based on the mouse events. VNC does something similar. > See the 'record_demo.py' example that comes with python-xlib. -- http://mail.python.org/mailman/listinfo/python-list

Re: Image grab in Python

2008-05-04 Thread Valerio Valerio
Hi, 2008/5/4 David <[EMAIL PROTECTED]>: > On Sun, May 4, 2008 at 5:28 PM, Valerio Valerio <[EMAIL PROTECTED]> wrote: > > I can grab the image, I need a way of grab the region size with the > mouse, > > a easy way of the user select a region of the image to analyze, > something > > like the "Rec

Re: default gettext localedir on windows

2008-05-04 Thread ZeeGeek
On May 5, 1:16 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * ZeeGeek (Sun, 4 May 2008 08:59:05 -0700 (PDT)) > > > Hi, what's the default localedir for gettext module on windows? In > > Linux, it's /usr/share/locale. Where should I put the *.mo file in > > order to make the translation work? > >

Re: Image grab in Python

2008-05-04 Thread David
> What I want is display a window with a image, the user select a region of > the image, and the region value is passed to my program, my program slice > the image region, and analyze it. > If it's your apps own window, then getting a rectangle selected by the user is simple. 1) Make skeleton x/g

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread David
On Sun, May 4, 2008 at 7:11 PM, Gilly <[EMAIL PROTECTED]> wrote: > Hi > I am trying to create an application that uses some form of input to > create a midi file. > I would like for this to be a 'real time' process. In other words, I > want to be able to begin playing the midi file before I fin

Re: is +=1 thread safe

2008-05-04 Thread Carl Banks
On May 4, 12:03 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Alexander Schmolck wrote: > > Gary Herron <[EMAIL PROTECTED]> writes: > > >> But... It's not! > > >> A simple test shows that. I've attached a tiny test program that shows > >> this > >> extremely clearly. Please run it and watch it f

Re: Image grab in Python

2008-05-04 Thread Valerio Valerio
2008/5/4 David <[EMAIL PROTECTED]>: > > What I want is display a window with a image, the user select a region > of > > the image, and the region value is passed to my program, my program > slice > > the image region, and analyze it. > > > > If it's your apps own window, then getting a rectangle s

Re: HTTP Error code Info

2008-05-04 Thread David
> block. Is there any better way to get the HTTP Error code using urllib2 > lib. Something like know the exact response number (200, 404 etc) without > the above block. Python libraries usually throw exceptions to indicate error conditions. If this is a problem in your app then can write a wra

Re: is +=1 thread safe

2008-05-04 Thread Carl Banks
On May 4, 2:13 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > However, what I said was not wholly untrue: code in C extensions is > protected by the GIL and thus not interruptable, unless it either > releases the GIL, or calls back into Python code (which is apparently > what numpy scalars do). And,

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Gilly
On May 4, 9:14 pm, David <[EMAIL PROTECTED]> wrote: > On Sun, May 4, 2008 at 7:11 PM, Gilly <[EMAIL PROTECTED]> wrote: > > Hi > > I am trying to create an application that uses some form of input to > > create a midi file. > > I would like for this to be a 'real time' process. In other words, I

Re: Determine socket family at runtime

2008-05-04 Thread Giampaolo Rodola'
On 4 Mag, 19:18, Francesco Bochicchio <[EMAIL PROTECTED]> wrote: > On Sun, 04 May 2008 08:49:55 -0700, Giampaolo Rodola' wrote: > > Hi there, > > since the socket.socket.family attribute has been introduced only in > > Python 2.5 and I need to have my application to be backward compatible > > with

Re: is +=1 thread safe

2008-05-04 Thread Gary Herron
Carl Banks wrote: On May 4, 12:03 pm, Gary Herron <[EMAIL PROTECTED]> wrote: Alexander Schmolck wrote: Gary Herron <[EMAIL PROTECTED]> writes: But... It's not! A simple test shows that. I've attached a tiny test program that shows this extremely clearly. Please run

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Diez B. Roggisch
Gilly schrieb: On May 4, 9:14 pm, David <[EMAIL PROTECTED]> wrote: On Sun, May 4, 2008 at 7:11 PM, Gilly <[EMAIL PROTECTED]> wrote: Hi I am trying to create an application that uses some form of input to create a midi file. I would like for this to be a 'real time' process. In other words, I

Re: Script Optimization

2008-05-04 Thread lev
> * Remove newlines introduced by email > * Move imports to start of file used imports of the edited script you sent. > * Change indentation from 8 spaces to 4 I like using tabs because of the text editor I use, the script at the end is with 4 though. > * Move main() to bottom of script > *

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Max M
Gilly skrev: Hi I am trying to create an application that uses some form of input to create a midi file. I would like for this to be a 'real time' process. In other words, I want to be able to begin playing the midi file before I finish writing it, and continue writing as it plays. Perhaps cso

Re: is +=1 thread safe

2008-05-04 Thread Aahz
In article <[EMAIL PROTECTED]>, Gary Herron <[EMAIL PROTECTED]> wrote: > >However, the upshot of all of this is that one must maintain extreme >skepticism. Unless you know both your Python code and any extension >modules you call, and you know them at a level necessary to find such >details,

Re: ISBN Barecode reader in Python?

2008-05-04 Thread Nick Craig-Wood
Joseph <[EMAIL PROTECTED]> wrote: > All: I have written a program to query Amazon with ISBN and get the > book details. I would like to extend so that I can read ISBN from the > barcode (I will take a photo of the same using webcam or mobile). Are > there any opensource/free SDK doing the same?

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Chuckk Hubbard
Threading was recommended to me as a way to time things: http://docs.python.org/lib/timer-objects.html Dunno if that helps you. -Chuckk On Sun, May 4, 2008 at 8:11 PM, Gilly <[EMAIL PROTECTED]> wrote: > Hi > I am trying to create an application that uses some form of input to > create a midi fil

pygame.mixer.load not working

2008-05-04 Thread globalrev
import pygame pygame.mixer.music.load(example1.mp3) pygame.mixer.music.play(loops=1, start=0.0) Traceback (most recent call last): File "C:\Python25\myPrograms\pygameProgs\musicexp.py", line 3, in pygame.mixer.music.load(example1.mp3) NameError: name 'example1' is not defined example1 is

Re: Light slices + COW

2008-05-04 Thread castironpi
On May 4, 7:49 am, David <[EMAIL PROTECTED]> wrote: > >  > D compiles to efficient machine code so Python is at a disadvantage > >  > even if you use the same syntax (see my first example). You can make > >  > the Python version faster, but beware of premature optimization. > > >  This time I don't

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-04 Thread Vlastimil Brom
> > > Thank you very much for your comprehensive answer and detailed informations, David; I really appreciate it! As for the number of items, there would be approx. 34 000 calls of execute() in my present code, in the final version probably more; I think executmany is more efficient here, if there

unicode newbie - printing mixed languages to the terminal

2008-05-04 Thread David
Hi list. I've never used unicode in a Python script before, but I need to now. I'm not sure where to start. I'm hoping that a kind soul can help me out here. My current (almost non-existant) knowledge of unicode: >From the docs I know about the unicode string type, and how to declare string type

Re: Real Time Midi File Playback - Reading and Writing midi at the same time

2008-05-04 Thread Ken Starks
Gilly wrote: Hi I am trying to create an application that uses some form of input to create a midi file. I would like for this to be a 'real time' process. In other words, I want to be able to begin playing the midi file before I finish writing it, and continue writing as it plays. I would reall

Re: pygame.mixer.load not working

2008-05-04 Thread Diez B. Roggisch
globalrev schrieb: import pygame pygame.mixer.music.load(example1.mp3) pygame.mixer.music.play(loops=1, start=0.0) Traceback (most recent call last): File "C:\Python25\myPrograms\pygameProgs\musicexp.py", line 3, in pygame.mixer.music.load(example1.mp3) NameError: name 'example1' is not

Re: unicode newbie - printing mixed languages to the terminal

2008-05-04 Thread Carsten Haese
David wrote: Hi list. I've never used unicode in a Python script before, but I need to now. I'm not sure where to start. I'm hoping that a kind soul can help me out here. My current (almost non-existant) knowledge of unicode: From the docs I know about the unicode string type, and how to decl

Can I install Python 2.4 and 2.5 ?

2008-05-04 Thread adolfo
I am reviewing various visualization programs (Scipy, PYGNL, etc) and IDE´s. Some run on Python 2.4 others in 2.5. Can I have both installed at the same time if I don´t run them concurrently? Now in Windows XP soon on Ubuntu 8 Appreciating your help, Adolfo -- http://mail.python.org/mailman/lis

Re: Can I install Python 2.4 and 2.5 ?

2008-05-04 Thread Diez B. Roggisch
adolfo schrieb: I am reviewing various visualization programs (Scipy, PYGNL, etc) and IDE´s. Some run on Python 2.4 others in 2.5. Can I have both installed at the same time if I don´t run them concurrently? Now in Windows XP soon on Ubuntu 8 Appreciating your help, Yes you can. However you

Re: Please help - Tkinter not doing anything

2008-05-04 Thread rynt
WxWidgets, Tkinter, PyQT are all cross platform. Also have a look at http://wiki.python.org/moin/GuiProgramming for more GUI frameworks. RCB >On May 4, 4:59 am, Protected <[EMAIL PROTECTED]> wrote: > On May 4, 12:18 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 4, 5:22 am, Protected <[EMAIL

Re: Can I install Python 2.4 and 2.5 ?

2008-05-04 Thread Chuckk Hubbard
I have both python2.4 and python2.5 as executables, and "python" as a symbolic link to python2.4. This is the default setup if you install both from the Debian repositories, so probably with Ubuntu as well. If you like you can change "python" to point to either one (or to any other program, if you

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-04 Thread David
> > > Thank you very much for your comprehensive answer and detailed informations, > David; I really appreciate it! You're welcome. > > As for the number of items, there would be approx. 34 000 calls of execute() > in my present code, in the final version probably more; I think executmany > is mo

Re: word shifts

2008-05-04 Thread Gabriel Genellina
En Sun, 04 May 2008 03:35:05 -0300, George Sakkis <[EMAIL PROTECTED]> escribió: > On May 4, 2:04 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> En Sun, 04 May 2008 02:17:07 -0300, dave <[EMAIL PROTECTED]> escribió: >> >> > I made a function that takes a word list (one word per line, text fil

Re: Please help - Tkinter not doing anything

2008-05-04 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: On May 4, 5:22 am, Protected <[EMAIL PROTECTED]> wrote: I'm pasting the code in IDLE and using Windows XP Tkinter doesn't work if you type the statements in IDLE it doesn't > work because IDLE is itself a Tkinter app. Actually, _because_ IDLE is a Tkint

Python Poker

2008-05-04 Thread Chunky
hey Jeff Sandys sandysj at juno.com did you manage to get your game up for download it sounds really interesting i love "home made games" -- http://mail.python.org/mailman/listinfo/python-list

Are rank noobs tolerated, here?

2008-05-04 Thread notbob
I'm trying to learn how to program. I'm using: How to Think Like a Computer Scientist Learning with Python 2nd Edition Am I likely to receive any help, here, or is there another irc, forum, etc, that might better serve a complete amateur such as myself. Thnx. nb -- http://mail.python.org/m

Re: generator functions in another language

2008-05-04 Thread Gabriel Genellina
En Sun, 04 May 2008 08:11:35 -0300, <[EMAIL PROTECTED]> escribió: > On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL >> PROTECTED]> escribió: >> >> > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: >

Re: Are rank noobs tolerated, here?

2008-05-04 Thread Glenn Hutchings
notbob <[EMAIL PROTECTED]> writes: > Am I likely to receive any help, here, or is there another irc, forum, etc, > that might better serve a complete amateur such as myself. Thnx. You're very likely to receive help here. Or at the very least, people will point you at the best place to get it. F

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-04 Thread Gabriel Genellina
En Sun, 04 May 2008 12:58:25 -0300, Duncan Booth <[EMAIL PROTECTED]> escribió: > Szabolcs Horvát <[EMAIL PROTECTED]> wrote: > >> I thought that it would be very nice if the built-in sum() function used >> this algorithm by default. Has this been brought up before? Would this >> have any disadvan

Re: Are rank noobs tolerated, here?

2008-05-04 Thread Patrick Mullen
There is also the python tutor list: http://mail.python.org/mailman/listinfo/tutor Which is more geared toward beginners. Although I am subscribed to both lists, and they are both matched by the same filter for me so I wont know the difference... But there may be people who are not subscribed t

Numpy not found

2008-05-04 Thread adolfo
I downloaded and installed Phyton 2.52 (it works), numpy-1.0.4.win32- py2.5, and scipy-0.6.0.win32-py2.5 I can´t get Numpy to show up at Python´s IDLE, or command line. If I do: import Numeric # I get Traceback (most recent call last): File "", line 1, in import Numeric Import

Where are Tkinter event.type constants defined?

2008-05-04 Thread Noah
I'm trying to match against Event.type for KeyPress and ButtonPress. Currently I'm using integer constants (2 and 4). Are these constants defined anywhere? The docs talk about KeyPress and ButtonPress, but I don't see them in any of the Tkinter source files. Are these just magic values that come ou

Re: Are rank noobs tolerated, here?

2008-05-04 Thread CM
On May 4, 7:45 pm, notbob <[EMAIL PROTECTED]> wrote: > I'm trying to learn how to program. I'm using: > > How to Think Like a Computer Scientist > > Learning with Python > 2nd Edition > > Am I likely to receive any help, here, or is there another irc, forum, etc, > that might better serve a comple

Re: is +=1 thread safe

2008-05-04 Thread Alexander Schmolck
Gary Herron <[EMAIL PROTECTED]> writes: > The test was meant to simulate the OP's problem, but even with your suggestion > of using numpy, it *still* fails! Well, although I haven't tested it extensively, it doesn't appear to fail for me, with numpy 1.02 and an AMD Athlon(tm) XP 2800+ under lin

Re: Numpy not found

2008-05-04 Thread Glenn Hutchings
adolfo <[EMAIL PROTECTED]> writes: > I downloaded and installed Phyton 2.52 (it works), numpy-1.0.4.win32- > py2.5, and scipy-0.6.0.win32-py2.5 > > I can´t get Numpy to show up at Python´s IDLE, or command line. If I > do: > > import Numeric > # I get > Traceback (most recent call last):

Re: Are rank noobs tolerated, here?

2008-05-04 Thread Benjamin
On May 4, 6:45 pm, notbob <[EMAIL PROTECTED]> wrote: > I'm trying to learn how to program. I'm using: > > How to Think Like a Computer Scientist > > Learning with Python > 2nd Edition > > Am I likely to receive any help, here, or is there another irc, forum, etc, > that might better serve a comple

  1   2   >