Re: pyserial doesn't recognize virtual serial port

2007-11-20 Thread salrandazzo
Try reading the sourceforge.net help forum about com0com: http://sourceforge.net/forum/forum.php?thread_id=1395157&forum_id=440109 Maybe you can find the solution. I think you should prefix the port name with "\\.\" Something like "\\.\CNCA0" Did you ever try to use the com2tcp utility? I'm trying

Re: How to make a standalone Python/Tk program?

2007-11-20 Thread samuel . progin
> How to make a standalone Python/Tk program(e.g. exe file on Windows)? > Any suggestions are welcome! Hello! Here are a few pointers, try to google: - pyinstaller - python freeze - py2exe or more generally "python to exe" You may have a search on this mailing list, in my mind this topic was di

[ Please help ] how to create Python functions in C++ at runtime & call them

2007-11-20 Thread grbgooglefan
I want to compile following type of python function in my C++ program at runtime. def isSizeSmall(size,vol,ADV,prod): if ( (size < 1000) & (vol < (0.001 * ADV)) & (prod=="Stock")): print "OK"; return 10 else: print "NOK"; return 11 Using Py_CompileString, I compiled a code object from this f

How to make a standalone Python/Tk program?

2007-11-20 Thread Davy
Hi all, How to make a standalone Python/Tk program(e.g. exe file on Windows)? Any suggestions are welcome! Best regards, Davy -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter Problem?

2007-11-20 Thread Davy
Hi all, I have solved the problem after read some code. Because Tk.Canvas do not have a focus, it does not receive a key input. The solution is bind key input to the highest level 'root' root.bind('',self._onUpKey) Davy On Nov 20, 10:13 am, Davy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have w

creating color gradients using PIL

2007-11-20 Thread Ramdas
Any ideas how we can create a color gradient using Python Imaging Library. Has any got some sample code that can give me some idea. I need to create a horizontal and vertical color gradient for a college project Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Management

2007-11-20 Thread Sergio Correia
As a side note, I find much easier to drop a PTH file than messing with pythonpath. If you are not familiar with PTH files, what I do is this 1) Go to "C:\Program Files\Python25\Lib\site-packages" or whatever is appropiate in your case. 2) Create a text file, name it something like "MyProjects.PTH

Re: Python web frameworks

2007-11-20 Thread Graham Dumpleton
On Nov 21, 1:37 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > On Nov 20, 3:39 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > This only holds if actually hosted on Apache. As Django these days > > supports WSGI interface there is nothing to stop it being run with > > other hosting solu

Re: google earth / pythoncom

2007-11-20 Thread Meff
> > I'd like to write a python script to control Google Earth, > > and I've read that Google Earth provides a COM api, and that > > Python has a COM module 'pythoncom'. > Io ho fatto prima ad acquistarne uno d'importazione molto ben fatto e > professionale, costo 250euro What about Euro 108,90 fo

Re: Code Management

2007-11-20 Thread Ben Finney
Jens <[EMAIL PROTECTED]> writes: > On 21 Nov., 04:16, Jens <[EMAIL PROTECTED]> wrote: > > On 21 Nov., 01:46, [EMAIL PROTECTED] wrote: > > dummy/ > > dummy_package/ > > __init__.py > > moduleA.py > > tests/ > >__init__.py > >test.py To avoid confusion, the directory t

Re: (Tkinter) Can I bind a key to Canvas?

2007-11-20 Thread Davy
I have tried key and mouse click (when receive a event, print some diagnose information ). I found mouse click work well in canvas but key not work well. It seems canvas cannot get key event? self.canv.bind('',self._onUpKey) ## don't work self.canv.bind('', self._onClick) ## work

Compiling python functions on the fly & calling from C++

2007-11-20 Thread Borse, Ganesh
I want to call Python function which takes input arguments (parameters) from C++ program on the fly when program is running, as below: def isSizeSmall(size,vol,ADV,prod): if ( (size < 1000) & (vol < (0.001 * ADV)) & (prod=="Stock")): return 100 else: return 11 I tried following approach

[no subject]

2007-11-20 Thread liewyf
-- http://mail.python.org/mailman/listinfo/python-list

Re: Code Management

2007-11-20 Thread Jens
On 21 Nov., 04:16, Jens <[EMAIL PROTECTED]> wrote: > On 21 Nov., 01:46, [EMAIL PROTECTED] wrote: > > > > > On Nov 20, 4:09 pm, Jens <[EMAIL PROTECTED]> wrote: > > > > Dear Reader, > > > > I'm writing some modules in Python, and I'm also using unittests. I'm > > > wondering about some things: > > >

Re: Code Management

2007-11-20 Thread Jens
On 21 Nov., 01:46, [EMAIL PROTECTED] wrote: > On Nov 20, 4:09 pm, Jens <[EMAIL PROTECTED]> wrote: > > > Dear Reader, > > > I'm writing some modules in Python, and I'm also using unittests. I'm > > wondering about some things: > > I'd love to hear how others manage this sort of thing as well. I'll

Re: [regex] Basic rewriting

2007-11-20 Thread Gilles Ganault
On Tue, 20 Nov 2007 21:57:43 -0500, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: >Use raw strings for re expressions. Thanks guys for the prompt reply :-) Solved it. -- http://mail.python.org/mailman/listinfo/python-list

(Tkinter) Can I bind a key to Canvas?

2007-11-20 Thread Davy
Hi all, I have a canvas and a rectangle draw on it. Can I bind a key(e.g. UP) to the canvas and make the rectangle move up? Or shall I bind the key to rectangle(I don't think so, because it is not a widget)? Any suggestions are welcome! Best regards, Davy -- http://mail.python.org/mailman/listin

Re: Code Management

2007-11-20 Thread Ben Finney
Jens <[EMAIL PROTECTED]> writes: > 1) Should I put my unittests in a subdirectory? I find that it is best to do so even for single-module packages, because it makes writing the 'setup.py' easier ("don't install anything in the unit test directory"). > Does the subdirectory have to be a package?

Re: Python strings question (vertical stack)

2007-11-20 Thread J. Clifford Dyer
On Tue, 2007-11-20 at 13:59 -0800, John Machin wrote: > On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > > J. Clifford Dyer wrote: > > > I think you mean '\n'.join([string1,string2,string3]) > > > > > You actually do want the \ to do its thing in this case. > > > > Yeah, my brain m

RE: PyObject_GetAttrString failing when getting a function pointe r fr om PyObject* returned by Py_CompileString

2007-11-20 Thread Borse, Ganesh
> Can we not use the "PyObject*" returned by Py_CompileString as input to > PyObject_GetAttrString? > What could be wrong? >>>per documentation >>>compile string returns None when you use Py_file_input This is not true. I am getting a valid code object returned when I am using "" & Py_file_input.

Re: [regex] Basic rewriting

2007-11-20 Thread J. Clifford Dyer
On Wed, 2007-11-21 at 03:24 +0100, Gilles Ganault wrote: > Hello > > I've been reading tutorials on regexes in Python, but I still > don't get it: > > > #!/usr/bin/python > > #myscript.py 0123456789 > > import sys,re > > #Turn 0123456789 into 01.23.45.67.89 > p = re.compile('(\d

Re: [regex] Basic rewriting

2007-11-20 Thread Tim Chase
> I've been reading tutorials on regexes in Python, but I still > don't get it: > > > #!/usr/bin/python > > #myscript.py 0123456789 > > import sys,re > > #Turn 0123456789 into 01.23.45.67.89 > p = re.compile('(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)') > phone = p.sub('\1.\2.\3.\4.\5',sys.a

Re: Python web frameworks

2007-11-20 Thread BartlebyScrivener
On Nov 20, 3:39 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > This only holds if actually hosted on Apache. As Django these days > supports WSGI interface there is nothing to stop it being run with > other hosting solutions that support WSGI. So, you could host it under > paster or CherryPy WS

[regex] Basic rewriting

2007-11-20 Thread Gilles Ganault
Hello I've been reading tutorials on regexes in Python, but I still don't get it: #!/usr/bin/python #myscript.py 0123456789 import sys,re #Turn 0123456789 into 01.23.45.67.89 p = re.compile('(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)') phone = p.sub('\1.\2.\3.\4.\5',sys.argv[1]) print pho

Fwd: Formatting question.

2007-11-20 Thread Sergio Correia
Hey Mike, Welcome to Python! About your first issue, just change the line outfile.write( "'%s'," % (LoL[x][y])) With outfile.write( "'%s'," % (LoL[x][y][:-1])) Why? Because when you do the line.split, you are including the '\n' at the end, so a new line is created. Now, what you are doing is not

Re: sorting a list of list

2007-11-20 Thread Tim Chase
> are there available library or pythonic algorithm for sorting a list > of list depending on the index of the list inside the list of my > choice? The built-in sorted() function and the sort() method on various collections take an optional "key=function" keyword paramater with which you can pass

trace module and doctest

2007-11-20 Thread skip
I am trying to use the trace module with the --count flag to test for statement coverage in my doctests. The trace coverage listing is very weird, marking many statements as unexecuted which were clearly executed during the run (I can see their output on the screen). Is this some known interactio

sorting a list of list

2007-11-20 Thread james_027
hi, are there available library or pythonic algorithm for sorting a list of list depending on the index of the list inside the list of my choice? d_list = [ ['a', 1, 9], ['b', 2, 8], ['c', 3, 7], ['d', 4, 6], ['e', 5, 5], ] Thanks james -- http://mail.python.org/mailman/list

Re: Code Management

2007-11-20 Thread Sergio Correia
Let's see: > 1) Should I put my unittests in a subdirectory? Does the subdirectory > have to be a package? Sure, to avoid cluttering put the tests in a folder called 'tests' (and any input the tests require, like mock files, output files used to test if the output is correct, etc etc, should be p

Re: Code Management

2007-11-20 Thread brzrkr0
On Nov 20, 4:09 pm, Jens <[EMAIL PROTECTED]> wrote: > Dear Reader, > > I'm writing some modules in Python, and I'm also using unittests. I'm > wondering about some things: I'd love to hear how others manage this sort of thing as well. I'll describe what I've found works best for me, and if others

Code Management

2007-11-20 Thread Jens
Dear Reader, I'm writing some modules in Python, and I'm also using unittests. I'm wondering about some things: 1) Should I put my unittests in a subdirectory? Does the subdirectory have to be a package? 2) Does the main folder /myproject have to be a package? Should I put my modules directly un

Re: Python too complex ?!?!?!

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 5:01 pm, "Patrick Mullen" <[EMAIL PROTECTED]> wrote: > (Oops, sent as private, reposting to list) > > On Nov 20, 2007 12:36 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > FWIW it's trivial to run pyflakes on your code (automatically behind > > the scenes) to get syntax checki

Re: simple question on persisting variable values in a list

2007-11-20 Thread Paul Hankin
On Nov 20, 9:41 pm, [EMAIL PROTECTED] wrote: > On Nov 20, 3:25 pm, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I am an unabashed noob. > > > I am trying to build a list to store values that are generated through > > a loop. However, every time I append the variable to the list, I'd > > like to re

Re: mimicking a file in memory

2007-11-20 Thread p.
On Nov 20, 3:14 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-11-20, p. <[EMAIL PROTECTED]> wrote: > > > > >> By "memory" I presume you mean virtual memory? RAM with > >> disk-blocks as backing store? On any real OS, tempfiles are > >> just RAM with disk-blocks as backing store. > > >> So

Re: s[i:j:t] = t stipulation

2007-11-20 Thread Terry Reedy
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | s[i:j:t] = t (1) t must have the same length as the slice it is replacing. This is essentially the same rule as requiring a proper length of t for a,b,c = t # for whatever number of targets And people have made simil

Re: mimicking a file in memory

2007-11-20 Thread Grant Edwards
On 2007-11-20, p. <[EMAIL PROTECTED]> wrote: >> By "memory" I presume you mean virtual memory? RAM with >> disk-blocks as backing store? On any real OS, tempfiles are >> just RAM with disk-blocks as backing store. >> >> Sound similar? The only difference is the API used to access >> the bytes. Y

Formatting question.

2007-11-20 Thread mike5160
Hi all, My input file looks like this : ( the data is separated by tabs ) 11/26/2007 56.366 898.90 -10.086 23.11 1212.3 11/26/2007 52.25 897.6 -12.5 12.61.5 11/26/2007 52.25 897.6 -12.5 12.6133.5 The output I'm trying to get is as follows : ( Insert N

Re: Python strings question (vertical stack)

2007-11-20 Thread Diez B. Roggisch
dmitrey schrieb: > Thanks all, I have solved the problem: > > a=""" > %s > %s > %s > """ % ('asdf', 'asdf2', 'asdf3') > > print a This is more expensive and not as flexible as the join method. At least for growing string-lengths and number of arguments. Diez -- http://mail.python.org/mailman/

Re: mimicking a file in memory

2007-11-20 Thread Diez B. Roggisch
p. schrieb: > On Nov 20, 2:06 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2007-11-20, Jarek Zgoda <[EMAIL PROTECTED]> wrote: >> Here is my dilemma: I don't want to copy the files into a local directory for mutagen's sake, only to have to remove them afterward. Instead, I'd lik

Re: Python strings question (vertical stack)

2007-11-20 Thread John Machin
James Matthews top-posted: > I would say to split it by the newline! Split what by which newline? The OP appeared to be wanting some kind of UNsplit ... > > On Nov 20, 2007 10:59 PM, John Machin <[EMAIL PROTECTED] > > wrote: > > On Nov 21, 7:15 am, Farshid Lashkari

Re: mimicking a file in memory

2007-11-20 Thread p.
On Nov 20, 2:06 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-11-20, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > > >> Here is my dilemma: I don't want to copy the files into a > >> local directory for mutagen's sake, only to have to remove > >> them afterward. Instead, I'd like to load the fi

Re: Trouble getting loop to break

2007-11-20 Thread Steven D'Aprano
On Tue, 20 Nov 2007 10:42:48 -0800, [EMAIL PROTECTED] wrote: > Instead of comparing sum to the "known" value of e**x, why not test for > convergence? I.e., if sum == last_sum: break. Seems like that would be > more robust (you don't need to know the answer to computer the answer), > since it see

Re: mimicking a file in memory

2007-11-20 Thread Grant Edwards
On 2007-11-20, Jarek Zgoda <[EMAIL PROTECTED]> wrote: >> Here is my dilemma: I don't want to copy the files into a >> local directory for mutagen's sake, only to have to remove >> them afterward. Instead, I'd like to load the files into >> memory and still be able to hand the built-in "file" funct

Re: Python strings question (vertical stack)

2007-11-20 Thread James Matthews
I would say to split it by the newline! On Nov 20, 2007 10:59 PM, John Machin <[EMAIL PROTECTED]> wrote: > On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > > J. Clifford Dyer wrote: > > > I think you mean '\n'.join([string1,string2,string3]) > > > > > You actually do want the \ t

Re: Python too complex ?!?!?!

2007-11-20 Thread James Matthews
I think they need to change teachers in this school! On Nov 17, 2007 2:46 PM, Brian <[EMAIL PROTECTED]> wrote: > Had a unsettling conversation with a CS instructor that > teaches at local high schools and the community > college. This person is a long-term Linux/C/Python > programmer, but he clai

Re: Python too complex ?!?!?!

2007-11-20 Thread Patrick Mullen
(Oops, sent as private, reposting to list) On Nov 20, 2007 12:36 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > FWIW it's trivial to run pyflakes on your code (automatically behind > the scenes) to get syntax checking; in vim, my syntax errors get > underlined immediately for python code. It

Re: Python strings question (vertical stack)

2007-11-20 Thread John Machin
On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > J. Clifford Dyer wrote: > > I think you mean '\n'.join([string1,string2,string3]) > > > You actually do want the \ to do its thing in this case. > > Yeah, my brain must still be asleep. Thanks for waking it up :) You're not alone :-

Re: mimicking a file in memory

2007-11-20 Thread Tim Chase
> I thought about this approach originally, but here's the catch > there: the read method isn't the only method i need. mutagen > calls the seek method on the file object. urllib2 returns a > "file-like object" that does not have a seek method associated > with it, which means i'd have to extend ur

Re: simple question on persisting variable values in a list

2007-11-20 Thread kyosohma
On Nov 20, 3:25 pm, [EMAIL PROTECTED] wrote: > Hi, > > I am an unabashed noob. > > I am trying to build a list to store values that are generated through > a loop. However, every time I append the variable to the list, I'd > like to reset the variable, but have the value persist in the loop. I >

Re: regex problem with re and fnmatch

2007-11-20 Thread John Machin
On Nov 21, 8:05 am, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to use re to search for lines in a files with > the word "README_x.org", where x is any number. > E.g. the structure would look like this: > [[file:~/pfm_v99/README_1.org]] > > I tried to use these kind of mat

Re: Writing Error in program

2007-11-20 Thread J. Clifford Dyer
On Tue, Nov 20, 2007 at 01:02:38PM -0800, [EMAIL PROTECTED] wrote regarding Writing Error in program: > > I have a code that writes to 2 seperate files. I keep getting a "list > index out of range" error. The strange part is that when checking the > files that I'm writing too, the script has al

Re: Python web frameworks

2007-11-20 Thread Graham Dumpleton
On Nov 21, 2:33 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Nov 20, 9:42 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > 12/7. Django comes with its own little server so that you don't have > > > to set up Apache on your desktop to play with it. > > > I was rather shocked to learn t

Re: mimicking a file in memory

2007-11-20 Thread Jarek Zgoda
p. pisze: > I am using the mutagen module to extract id3 information from mp3 > files. In order to do this, you give mutagen a filename, which it > converts into a file object using the python built-in "file" function. > > Unfortunately, my mp3 files don't live locally. They are on a number > of r

Re: Trouble getting loop to break

2007-11-20 Thread Fredrik Johansson
On Nov 20, 2007 10:00 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > And also with the amazing Chudnovsky algorithm for pi. See > Nice! I'd like to suggest two improvements for speed. First, the Chudnovsky algorithm uses lots of factorials, and it's rather ine

Re: mimicking a file in memory

2007-11-20 Thread p.
On Nov 20, 1:20 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > p. wrote: > > I am using the mutagen module to extract id3 information from mp3 > > files. In order to do this, you give mutagen a filename, which it > > converts into a file object using the python built-in "file" function. > > > Unfortu

simple question on persisting variable values in a list

2007-11-20 Thread dgrissen
Hi, I am an unabashed noob. I am trying to build a list to store values that are generated through a loop. However, every time I append the variable to the list, I'd like to reset the variable, but have the value persist in the loop. I understand why this doesn't work because it's a reference n

Re: mimicking a file in memory

2007-11-20 Thread Larry Bates
p. wrote: > I am using the mutagen module to extract id3 information from mp3 > files. In order to do this, you give mutagen a filename, which it > converts into a file object using the python built-in "file" function. > > Unfortunately, my mp3 files don't live locally. They are on a number > of r

Re: Writing Error in program

2007-11-20 Thread kyosohma
On Nov 20, 3:02 pm, [EMAIL PROTECTED] wrote: > I have a code that writes to 2 seperate files. I keep getting a "list > index out of range" error. The strange part is that when checking the > files that I'm writing too, the script has already iterated through > and finished writing, yet the error

RE: Writing Error in program

2007-11-20 Thread Looney, James B
There could be any number of issues in your code that could cause that problem. Can you post some of the code in question? > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ] On Behalf Of [EMAIL PROTECTED] > Sent: Tuesday, November 20, 2007 2:03 PM > To: pyth

Re: Create thumbnail image (jpg/png) of PDF file using Python

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 11:36 am, sophie_newbie <[EMAIL PROTECTED]> wrote: > Is there any way to do this directly within python? > > If not is there any other good way to achieve it? > > Thanks in advance for any help! Take a look at PIL -- http://www.pythonware.com/products/pil/. Among other things, it allow

Writing Error in program

2007-11-20 Thread koutoo
I have a code that writes to 2 seperate files. I keep getting a "list index out of range" error. The strange part is that when checking the files that I'm writing too, the script has already iterated through and finished writing, yet the error stated implies that it hasn't? So how can it be, tha

Re: Trouble getting loop to break

2007-11-20 Thread Dick Moores
At 10:42 AM 11/20/2007, [EMAIL PROTECTED] wrote: >Instead of comparing sum to the "known" value of e**x, why not test >for convergence? I.e., if sum == last_sum: break. Seems like that >would be more robust (you don't need to know the answer to computer >the answer), since it seems like it should

Should proxy objects lie about their class name?

2007-11-20 Thread John J. Lee
Not much to add to the subject line. I mean something like this: ProxyClass.__name__ = ProxiedClass.__name__ I've been told that this is common practice. Is it? Would this surprise you if you ran into it in a debugging session? One very real advantage that I can see is avoiding breaking exis

Re: Python too complex ?!?!?!

2007-11-20 Thread John J. Lee
"Chris Mellon" <[EMAIL PROTECTED]> writes: [...] > These modules exist, but aren't that common. Certainly anything you're > likely to be using in an introductory compsci course is well packaged. > And even if it's not, it's really not that hard to create packages or > installers - a days work of co

Re: Python too complex ?!?!?!

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 10:20 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Nov 19, 1:41 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > On the other hand, C# and .NET seems like a lot of baggage to bring to > > the table. First off, you have to introduce the CLR and how it relates > > to C#, then you have

Re: logging.SocketHandler connections

2007-11-20 Thread Vinay Sajip
On Nov 20, 1:47 pm, oj <[EMAIL PROTECTED]> wrote: > On Nov 20, 12:26 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > Can you confirm that if you add the while loop back in, all messages > > are seen by the server? It worked for me. > > Yes, it works in that case. This was meant to be implied b

Re: Python strings question (vertical stack)

2007-11-20 Thread Farshid Lashkari
J. Clifford Dyer wrote: > I think you mean '\n'.join([string1,string2,string3]) > > You actually do want the \ to do its thing in this case. Yeah, my brain must still be asleep. Thanks for waking it up :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Some clauses cases BeautifulSoup to choke?

2007-11-20 Thread Marc Christiansen
Frank Stutzman <[EMAIL PROTECTED]> wrote: > > Some kind person replied: >> You have the same URL as both your good and bad example. > > Oops, dang emacs cut buffer (yeah, thats what did it). A working > example url would be (again, mind the wrap): > > http://www.naco.faa.gov/digital_tpp_search

mimicking a file in memory

2007-11-20 Thread p.
I am using the mutagen module to extract id3 information from mp3 files. In order to do this, you give mutagen a filename, which it converts into a file object using the python built-in "file" function. Unfortunately, my mp3 files don't live locally. They are on a number of remote servers which I

Re: Python strings question (vertical stack)

2007-11-20 Thread J. Clifford Dyer
On Tue, Nov 20, 2007 at 11:40:59AM -0800, Farshid Lashkari wrote regarding Re: Python strings question (vertical stack): > > dmitrey wrote: > > Hi all, > > I have some strings, let it be string1, string2, string3. > > > > So how could String= > > """ > > string1 > > string2 > > string3 > > """ >

regex problem with re and fnmatch

2007-11-20 Thread Fabian Braennstroem
Hi, I would like to use re to search for lines in a files with the word "README_x.org", where x is any number. E.g. the structure would look like this: [[file:~/pfm_v99/README_1.org]] I tried to use these kind of matchings: #org_files='.*README\_1.org]]' org_files='.*README\_*.org

Re: Python strings question (vertical stack)

2007-11-20 Thread dmitrey
Thanks all, I have solved the problem: a=""" %s %s %s """ % ('asdf', 'asdf2', 'asdf3') print a D. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings question (vertical stack)

2007-11-20 Thread Farshid Lashkari
dmitrey wrote: > Hi all, > I have some strings, let it be string1, string2, string3. > > So how could String= > """ > string1 > string2 > string3 > """ > > be obtained? > > Thank you in advance, D. If you just want the to add newlines between the strings then you can do the following: String

Python strings question (vertical stack)

2007-11-20 Thread dmitrey
Hi all, I have some strings, let it be string1, string2, string3. So how could String= """ string1 string2 string3 """ be obtained? Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: Exscript 0.9.11

2007-11-20 Thread Samuel
Introduction - Exscript is a scripting language for automating Telnet or SSH sessions. It supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Please refer to the project page for updated documentation (se

Re: How to add a Decorator to a Class Method

2007-11-20 Thread Laszlo Nagy
>> Can new_func reference self? Would self just be one of the args? >> >> -Greg >> > > For methods, self is always "just one of the args". When the > decorator is applied to a method, self will be args[0] in new_func. > If you want to use the name "self" instead of args[0] you can: def

Re: How to add a Decorator to a Class Method

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 12:32 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 20, 2:05 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 19 Nov 2007 20:59:51 -0800, [EMAIL PROTECTED] wrote: > > > How do I add a decorator to a class method? Here's what I want to do, > > > but

Re: How to add a Decorator to a Class Method

2007-11-20 Thread Laszlo Nagy
> Thanks those answers make sense. But for this function if defined > outside the class: > > >> def pre(fn): >> def new_func(*args, **kwargs): >> print "'hi'" >> fn(*args, **kwargs) >> return new_func >> > > Can new_func reference self? Would self just be one of t

Re: Trouble getting loop to break

2007-11-20 Thread [EMAIL PROTECTED]
Instead of comparing sum to the "known" value of e**x, why not test for convergence? I.e., if sum == last_sum: break. Seems like that would be more robust (you don't need to know the answer to computer the answer), since it seems like it should converge. --Nathan Davis On Nov 20, 1:41 am, Dick

Re: Trouble getting loop to break

2007-11-20 Thread Dick Moores
At 03:53 AM 11/20/2007, Fredrik Johansson wrote: >On Nov 20, 2007 8:41 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > > I'm writing a demo of the infinite series > > > > x**0/0! + x**1/1! + x**2/2! + x**3/3! + ... = e**x (x is non-negative) > > > > It works OK for many x, but for many the loop do

Re: How to add a Decorator to a Class Method

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 2:05 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 19 Nov 2007 20:59:51 -0800, [EMAIL PROTECTED] wrote: > > How do I add a decorator to a class method? Here's what I want to do, > > but I guess my syntax isn't right. Any advice? > > > class A: > > def pre(self,f

Re: Python web frameworks

2007-11-20 Thread Jeff
On Nov 20, 10:00 am, Thomas Wittek <[EMAIL PROTECTED]> wrote: > Jeff: > > > I don't know much about the others. Turbo gears uses Mochikit, which > > hasn't had a new stable release in some time. I prefer jQuery myself. > > You can use jQuery with TurboGears if you develop custom widgets (I do so)

s[i:j:t] = t stipulation

2007-11-20 Thread Neil Cerutti
s[i:j:t] = t (1) t must have the same length as the slice it is replacing. Why? >>> def foo(): ... while True: ... yield 'a' ... >>> foo() >>> x = range(10) >>> x[::2] = foo() This is infinite loop due to Python building a sequence out of the iterator to check its length. I think it migh

Re: Web update library in python?

2007-11-20 Thread [EMAIL PROTECTED]
On Nov 20, 8:48 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi Paul, > > Like I said, I do not want to limit my end users into installing > something in Apache or some other solution in order to get my tool > working. On the end user side (which also are the people who are > creating the reposi

Re: Create thumbnail image (jpg/png) of PDF file using Python

2007-11-20 Thread Robin Becker
sophie_newbie wrote: > Is there any way to do this directly within python? > > If not is there any other good way to achieve it? > > Thanks in advance for any help! I have used ghostscript from within python to do this sort of thing. You may get problems if the fonts are too exotic, but otherw

Create thumbnail image (jpg/png) of PDF file using Python

2007-11-20 Thread sophie_newbie
Is there any way to do this directly within python? If not is there any other good way to achieve it? Thanks in advance for any help! -- http://mail.python.org/mailman/listinfo/python-list

Re: PyObject_GetAttrString failing when getting a function pointer fr om PyObject* returned by Py_CompileString

2007-11-20 Thread sndive
On Nov 20, 3:27 am, "Borse, Ganesh" <[EMAIL PROTECTED]> wrote: > Hi, > > My following code is failing with an error of "isSizeSmall not function or > callable" > > //--- > char szExpr[2048]; > memset(szExpr,'\0',sizeof(szExpr)); > sprintf(szExpr,"def

Re: mmap disk performance

2007-11-20 Thread Chris Mellon
On Nov 20, 2007 10:31 AM, koara <[EMAIL PROTECTED]> wrote: > Hello all, > > i am using the mmap module (python2.4) to access contents of a file. > > My question regards the relative performance of mmap.seek() vs > mmap.tell(). I have a generator that returns stuff from the file, > piece by piece. S

mmap disk performance

2007-11-20 Thread koara
Hello all, i am using the mmap module (python2.4) to access contents of a file. My question regards the relative performance of mmap.seek() vs mmap.tell(). I have a generator that returns stuff from the file, piece by piece. Since other things may happen to the mmap object in between consecutive

Re: pydoc - how to generate documentation for an entire package?

2007-11-20 Thread Jens
On 20 Nov., 08:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 19 Nov 2007 10:50:28 -0800, Jens wrote: > > Generating documentation form code is a nice thing, but this pydoc.py > > is driving me insane - isn't there are better way? > > Epydoc!? > > Ciao, > Marc 'BlackJack'

RE: Getting name of control under mouse in Windows?

2007-11-20 Thread Shane Clark
> From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED]; python-list@python.org > Subject: RE: Getting name of control under mouse in Windows? > Date: Mon, 19 Nov 2007 17:16:13 -0500 > > > > > To: python-list@python.org > > From: [EMAIL PROTECTED] > > Subject: R

Re: Some clauses cases BeautifulSoup to choke?

2007-11-20 Thread Frank Stutzman
Some kind person replied: > You have the same URL as both your good and bad example. Oops, dang emacs cut buffer (yeah, thats what did it). A working example url would be (again, mind the wrap): http://www.naco.faa.gov/digital_tpp_search.asp?fldIdent=ksfo&fld_ident_type=ICAO&ver=0711&bnSubmit=

Re: Python web frameworks

2007-11-20 Thread Frank Miles
On Tue, 20 Nov 2007, joe jacob wrote: > There are a lot of web frameworks for python like django, mod_python, > spyce, turbo gears, Zope, Cherrypy etc. Which one is the best in terms > of performance and ease of study. Personally I found zope/plone to be very much its own enormously complex world

Re: pydoc - how to generate documentation for an entire package?

2007-11-20 Thread Jens
On 20 Nov., 08:20, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 19, 12:50 pm, Jens <[EMAIL PROTECTED]> wrote: > > > > > On 8 Nov., 02:46, Jens <[EMAIL PROTECTED]> wrote: > > > > I have a project/package for which I want to generate documentation > > > usingpydoc. > > > > My problem is th

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi Paul, > > Like I said, I do not want to limit my end users into installing > something in Apache or some other solution in order to get my tool > working. On the end user side (which also are the people who are > creating the repositories for others) there must be no burd

Re: Python web frameworks

2007-11-20 Thread Istvan Albert
On Nov 20, 9:42 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > 12/7. Django comes with its own little server so that you don't have > > to set up Apache on your desktop to play with it. > > I was rather shocked to learn that django only has this tiny server and does > not come with a stand-a

Re: size of block device by ftell()

2007-11-20 Thread Gil Hamilton
Seongsu Lee <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I want to get the size of a block device by ftell(). I found that I > can get > the size of a device by seek() and tell() in Python. But not in C. > > What is difference between them? How can I get the size of a block > device by

Re: Populating a dictionary, fast [SOLVED]

2007-11-20 Thread Istvan Albert
On Nov 19, 2:33 pm, Francesc Altet <[EMAIL PROTECTED]> wrote: > Just for the record. I was unable to stop thinking about this, and > after some investigation, I guess that my rememberings were gathered > from some benchmarks with code in Pyrex (i.e. pretty near to C speed). Pretty interesting an

Re: Python too complex ?!?!?!

2007-11-20 Thread Aaron Watters
On Nov 19, 1:41 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > On the other hand, C# and .NET seems like a lot of baggage to bring to > the table. First off, you have to introduce the CLR and how it relates > to C#, then you have to deal with all the public, private, etc, > syntaxis for constructors/d

Re: Python web frameworks

2007-11-20 Thread Bruno Desthuilliers
joe jacob a écrit : > There are a lot of web frameworks for python like django, mod_python, > spyce, turbo gears, Zope, Cherrypy etc. Which one is the best in terms > of performance and ease of study. As far as I'm concerned, the winners are Django and Pylons (my own preference going to Pylons).

  1   2   >