VB6 frontend GUI with Python

2007-11-20 Thread Claire Blair
I am trying to write a VB6 (not VB.Net) application that has a console window that allows Python command to be typed at the prompt. The idea is so that, I can have full Python scripting from within my application. I should be able to type commands from a Python script (include import etc, so I

Re: Recursive insertion of a line

2007-11-20 Thread Francesco Pietra
Please, see below. --- Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 19 Nov 2007 21:15:16 -0300, Henry <[EMAIL PROTECTED]> > escribió: > > > On 19/11/2007, Francesco Pietra <[EMAIL PROTECTED]> wrote: > >> > >> How to insert "TER" records recursively, i.e. some thousand fold, in a > >

Re: Tkinter Problem?

2007-11-20 Thread Peter Otten
Marc 'BlackJack' Rintsch wrote: > On Mon, 19 Nov 2007 18:13:03 -0800, Davy wrote: > >> ##-- >> from Tkinter import * >> >> class MyApp: >> def __init__(self,parent): >> self.myContainer1 = Frame(parent) >> self.myContainer1.pack() >> self.canv = Ca

Re: VB6 frontend GUI with Python

2007-11-20 Thread Claire Blair
Diez B. Roggisch wrote: > Claire Blair wrote: > > >>I am trying to write a VB6 (not VB.Net) application that has a console >>window that allows Python command to be typed at the prompt. >> >>The idea is so that, I can have full Python scripting from within my >>application. I should be able to

Re: Web update library in python?

2007-11-20 Thread A.T.Hofkamp
On 2007-11-20, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to provide my users the ability to download a repository from > the web, and after that check for updates. I thought of a mechanism > that could do that, but since there is patch and diff readily > available I wondered if t

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi all, > > I want to provide my users the ability to download a repository from > the web, and after that check for updates. I thought of a mechanism > that could do that, but since there is patch and diff readily > available I wondered if there is a python solution that al

Re: VB6 frontend GUI with Python

2007-11-20 Thread Diez B. Roggisch
Claire Blair wrote: > I am trying to write a VB6 (not VB.Net) application that has a console > window that allows Python command to be typed at the prompt. > > The idea is so that, I can have full Python scripting from within my > application. I should be able to type commands from a Python scrip

How to access C variables in Python code object generated by Py_C ompileString

2007-11-20 Thread Borse, Ganesh
Hi, May you please help in using Py_CompileString & PyEval_EvalCode to parse+compile an expression at startup & evaluate that multiple times at runtime. I want to use this in C++ program as below. Here, the expression contains the variables like size, vol, ADV, etc. The values of these variable

Re: Web update library in python?

2007-11-20 Thread James Matthews
I think the best one would be to write it on your own! It shouldn't take more then 150 lines of code! Or you can use Egg's On Nov 20, 2007 9:39 AM, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > Hi all, > > I want to provide my users the ability to download a repository from > the web, and after that

Re: Trouble getting loop to break

2007-11-20 Thread Dick Moores
At 12:45 AM 11/20/2007, Dennis Lee Bieber wrote: >On Mon, 19 Nov 2007 23:41:02 -0800, Dick Moores <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > > > a way to get it to break where I want it to, i.e., when the sum > > equals the limit as closely as the precision allows? > > > >

Re: Python for embedded devices?

2007-11-20 Thread Paul Rubin
Malte Forkel <[EMAIL PROTECTED]> writes: > I would like to use Python on a router, an Edimax BR-6104K, running > OpenWrt (http://www.openwrt.org). While I probably won't need most > of the fancier stuff in Python, serial I/O and threads should be > supported. I think I'd look for a smaller languag

Is there a Tkinter widget like Scale with two sliders?

2007-11-20 Thread WLigtenberg
Hi, I'm looking for a Scale like Tkinter widget that has two sliders, so that the user can select both the upper and lower bound of some dataset. Much like the widgets used in spotfire: http://wiserways.com/images/2004-02-10/intro_spotfire.jpg (see the widgets on the right of the picture) Thanks i

Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi all, I want to provide my users the ability to download a repository from the web, and after that check for updates. I thought of a mechanism that could do that, but since there is patch and diff readily available I wondered if there is a python solution that allows me to download a file, and l

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi All, Thanks for the input. Concering 'egg' it's not a web update for python per-ce but it should be written in python to easily interface with (wx)Python. As I believe it 'egg' is only a dependency downloader and installer for python scripts right? As for subversion, this is not possible as I

Re: How to access C variables in Python code object generated by Py_C ompileString

2007-11-20 Thread Duncan Booth
"Borse, Ganesh" <[EMAIL PROTECTED]> wrote: > 2) my this code got compiled but when running, I got an error from > Py_CompileString, as below. Why is it so? > File "", line 1 > if ( (size < 1000) & (vol < (0.001 * ADV)) & (prod=="Stock")): > print "OK" ^ > SyntaxError: invalid syntax >

marked-up Python code

2007-11-20 Thread Luc Goossens
Hi, I would like to experiment with marked-up Python source code. A more elaborate explanation of the use-case is at the end of this mail. The short story is that I would like to do things like assign colors to pieces of text in my editor and have this information saved _in my source code

Re: return image in mod python

2007-11-20 Thread Abandoned
On Nov 19, 5:32 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Abandoned wrote: > > On Nov 19, 12:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> Abandoned wrote: > >> > Hi i have a problem. > > >> > def showimage(req): > >> > from PIL import Image > >> > im=Image.ope

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi A.T.Hofkamp, Using svn still requires the people wanting to offer updates to have a svn server installed, or use one of the svn services available and that is simply too limiting. I will explain a bit more where I will use this for. I am writing a tool that takes a repository (e.g. a bunch of

Re: marked-up Python code

2007-11-20 Thread Diez B. Roggisch
Luc Goossens wrote: > Hi, > > I would like to experiment with marked-up Python source code. A more > elaborate explanation of the use-case is at the end of this mail. The > short story is that I would like to do things like assign colors to > pieces of text in my editor and have this information

RE: VB6 frontend GUI with Python

2007-11-20 Thread Ryan Ginstrom
> On Behalf Of Claire Blair > I am trying to write a VB6 (not VB.Net) application that has > a console window that allows Python command to be typed at the prompt. I'm not sure what pieces of the puzzle you're missing. Were you able to create a simple COM server with Python? At a conceptual leve

Re: VB6 frontend GUI with Python

2007-11-20 Thread Diez B. Roggisch
> Simple. its because my main application (the GUI that is), is written in > VB6. I have a MDI application (i.e. many child windows in the same > application), and I want to use one of these windows as a console to > inteactively type Python commands. If I were to use wxPython, I would > not be ab

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

2007-11-20 Thread Borse, Ganesh
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 isSizeSmall(size,vol,ADV,prod):\n if ( (size < 1000) & (vol < (0.001 * ADV))

Re: Web update library in python?

2007-11-20 Thread Diez B. Roggisch
Jorgen Bodde wrote: > Hi A.T.Hofkamp, > > Using svn still requires the people wanting to offer updates to have a > svn server installed, or use one of the svn services available and > that is simply too limiting. > > I will explain a bit more where I will use this for. I am writing a > tool that

Re: Joining open source python projects

2007-11-20 Thread Paul Boddie
On 20 Nov, 02:07, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > It thought it would be very nice having a place where developers could > submit "help requests" for their projects and let the users view them > and eventually join them if they want to. > > Does someone knows if such a service al

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi Diez , I fail to see that. If I am the one that can only put new "archive files" on my server by FTP or HTTP upload or whatever, and I update the file which contains the information about what updates are present on my site as last, there is no data corruption or loss of data. There are two ro

Re: Trouble getting loop to break

2007-11-20 Thread Fredrik Johansson
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 doesn't break. Is there > a way to get it to break where I wan

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
I must add, the way I was originally attempting to solve this is issuing delta files per upgrade cycle so that only changes are placed in a new ZIP file. The delta zip file will always be a new file on the site / ftp location. I do understand that if you are re-using the same archive file all the t

Re: Web update library in python?

2007-11-20 Thread Paul Boddie
On 20 Nov, 12:17, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > The reason is simply that without any server-side mechanism that at _least_ > allows for file-locking (something plain HTTP doesn't, nor does FTP), you > can't possibly make this work, as different concurrent requests of users > wi

Re: logging.SocketHandler connections

2007-11-20 Thread oj
On Nov 19, 5:30 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote: > > > > > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > Here is the server code. Pretty much directly copied from the example, > > aside from not having the the handler

Re: logging.SocketHandler connections

2007-11-20 Thread Vinay Sajip
On Nov 20, 12:08 pm, oj <[EMAIL PROTECTED]> wrote: > On Nov 19, 5:30 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > > On Nov 19, 10:27 am, oj <[EMAIL PROTECTED]> wrote: > > > > On Nov 16, 2:31 pm, Vinay Sajip <[EMAIL PROTECTED]> wrote: > > > > Here is the server code. Pretty much directly copie

Python web frameworks

2007-11-20 Thread joe jacob
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web update library in python?

2007-11-20 Thread A.T.Hofkamp
On 2007-11-20, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > The 'repositories' can be created by anyone who likes to share their > code templates, and let the end user configure this template and > create a customized code base of it, on which they can code their > entire app. My tool supports increme

Re: marked-up Python code

2007-11-20 Thread Tim Chase
> "all" the Python parser has to do is skip the mark-up. [snip] > I know I can put the mark-up after a # and the problem is > solved trivially, but this will not work for all cases (e.g. > mark-up of single identifiers) and to be honest I was thinking > of recycling some mark-up capable editor a

Re: marked-up Python code

2007-11-20 Thread Luc Goossens
Hi Tim, thanks for your suggestions I have two questions. 1. can I color the background of the text keeping the normal syntax coloring for actual text? can you give some hints on how to do that in vim? 2. will the # mark-up lines show in the editor? is there some visual clue that something

Re: Python web frameworks

2007-11-20 Thread Jeff
The only one that I have used extensively is Django, which is very easy to use and quite powerful in the arena for which it was created. It has a powerful admin interface that automatically generates data entry forms for content producers and a decent template system. It has some definite drawback

[no subject]

2007-11-20 Thread tome saer
h how i can built code make encryption between serever and client by use des best wishes pleas helping me _ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&fo

Re: marked-up Python code

2007-11-20 Thread A.T.Hofkamp
On 2007-11-20, Luc Goossens <[EMAIL PROTECTED]> wrote: > Hi Tim, > > thanks for your suggestions > > I have two questions. > 1. can I color the background of the text keeping the normal syntax > coloring for actual text? can you give some hints on how to do that > in vim? :help syntax > 2. wi

Re: display messages in python shell

2007-11-20 Thread jose Barcelona
Hi Kou, I use this in http://cern.ch/test-volunteers... to redirect error messages... \etc hope it helps #!/usr/bin/python import os import cgi import safeeval import sys import string import time import re import urllib class PitonEsFacilException(Exception): "Base class for all Excep

Re: Python web frameworks

2007-11-20 Thread Joe Riopel
On Nov 20, 2007 7:19 AM, joe jacob <[EMAIL PROTECTED]> 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. I wouldn't classify mod_python as a web framework: "Mod

Re: Python web frameworks

2007-11-20 Thread Joe Riopel
On Nov 20, 2007 8:46 AM, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Django comes with its own little server so that you don't have > to set up Apache on your desktop to play with it. Pylons too, it's good for development but using the bundled web server is not recommended for production. --

Re: Python web frameworks

2007-11-20 Thread BartlebyScrivener
On Nov 20, 6:19 am, joe jacob <[EMAIL PROTECTED]> 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. I'm looking at django mainly. I hope the veterans jump in wi

Re: logging.SocketHandler connections

2007-11-20 Thread oj
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 by my earlier messages, but on reflection, isn't obvious. As I

Re: python application dll

2007-11-20 Thread dongarbage
On Nov 19, 2:28 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 17 Nov 2007 12:04:49 -0300, <[EMAIL PROTECTED]> escribi�: > > > Is there a way to create a .dll from a python program which includes > > the python runtime? > > > I'm building a Windows application (C# VisualStudio2005) an

Re: python application dll

2007-11-20 Thread dongarbage
On Nov 19, 3:49 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > Is there a way to create a .dll from a python program which includes > > the python runtime? > > > I'm building a Windows application (C# VisualStudio2005) and I'd like > > to utilize some of the fun

Re: Python web frameworks

2007-11-20 Thread Bernard
On 20 nov, 07:19, joe jacob <[EMAIL PROTECTED]> 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. I'm making web apps with CherryPy at work and it's quite good.

Re: python application dll

2007-11-20 Thread Chris Mellon
On Nov 20, 2007 8:12 AM, <[EMAIL PROTECTED]> wrote: > On Nov 19, 3:49 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > Hi, > > > > > Is there a way to create a .dll from a python program which includes > > > the python runtime? > > > > > I'm building a Windows applic

Re: Python web frameworks

2007-11-20 Thread Diez B. Roggisch
> 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-alone server and is supposed to run as mod_python/cgi-driven app through ap

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
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 burden whatsoever. Your thoughts are

Re: Python web frameworks

2007-11-20 Thread Thomas Wittek
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). No problem here. -- Thomas Wittek Web: http://gedankenkonstrukt.de/ J

Re: Populating a dictionary, fast [SOLVED SOLVED]

2007-11-20 Thread harri
On Nov 15, 9:51 pm, "Michael Bacarella" <[EMAIL PROTECTED]> wrote: > > Since some people missed the EUREKA!, here's the executive summary: > > Python2.3: about 45 minutes > Python2.4: about 45 minutes > Python2.5: about _30 seconds_ FYI, I tried on two 64 bit SMP machines

Re: Web update library in python?

2007-11-20 Thread Bjoern Schliessmann
Jorgen Bodde wrote: > There are two roles: > > Repository maintainer: > - > - Developer of the 'repository' creates a snapshot > - This archive is uploaded on his private site > - A file that accompanies the archive containing the list of > updates is sent last > > Repository updater: > -

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

Re: Python web frameworks

2007-11-20 Thread Paul Boddie
On 20 Nov, 15:42, "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-alo

Re: Web update library in python?

2007-11-20 Thread Bjoern Schliessmann
Jorgen Bodde wrote: > As for subversion, this is not possible as I want to provide > people wihtout the ability to have a subversion server but only a > plain web site, What's a "plain web site"? Could mod_python be on it? > to download a file that can upgrade a local work copy. As others men

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: 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: 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: 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: 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]; [email protected] > Subject: RE: Getting name of control under mouse in Windows? > Date: Mon, 19 Nov 2007 17:16:13 -0500 > > > > > To: [email protected] > > From: [EMAIL PROTECTED] > > Subject: R

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >