Re: Python with Ecmascript

2008-07-06 Thread alex23
On Jul 7, 12:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I personally does not like COM solution. I prefer some simple library > but may be it is just a hope. Have you looked at the module 'python-spidermonkey'? It apparently "allows for the implementation of Javascript classes, objec

Validation in plone

2008-07-06 Thread Sallu
Hi all and one, How to do server side validation in plone? please help me its very urgent. i created a validator.py file where i wrote a script for 'special character are not allowed' and calling that script in movie.py its working fine by validators = ('splcharvalid',), and when i wrote another sc

error in SimpleXMLRPCServer

2008-07-06 Thread vaibhav pol
hi, I create a SimpleXMLRPCServer script which execute the command on server and return the result. code is below accessList=( 'test.org' ) class Server(SimpleXMLRPCServer.SimpleXMLRPCServer): def __init__(self,*args): SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self,(args

Re: Nested generator caveat

2008-07-06 Thread marek . rocki
Excellent explanation by Mark Wooding. I would only like to add that the standard pythonic idiom in such cases seems to be the (ab)use of a default argument to the function, because these get evaluated at the definition time: def gen0(): for i in range(3): def gen1(i = i):

extended setattr()

2008-07-06 Thread Rotlaus
2 weeks ago i asked for a etended getattr() which worked really fine, but now i would love to have a extended setattr() as well. Lets assume i have some classes: class A(object): def __init__(self): self.B = B() class B(object): def __init__(self): self.C = C() class C(o

Re: Very weird bug!

2008-07-06 Thread Terry Reedy
ssecorp wrote: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit wtf was this in the middle!? def build(a,b): return a+b build(5,4) (5, 4) I have exactly the same build on Windows and get the expected 9. Try it again. -- http://mail.python.org/mailman/listinfo/

Re: interpretation of special characters in Python

2008-07-06 Thread TP
Peter Pearson wrote: Thanks for your answer. > When you run echo, it recognizes the 4-character "esc" as a > convention for representing a single character, and performs > the re-interpretation for you. When you tell python > "print '\033[30;44m foo \033[0m'", python interprets > the "\033" as a

Re: interpretation of special characters in Python

2008-07-06 Thread TP
Dennis Lee Bieber wrote: > Off-hand, I'd probably try first with: > > csi = "\033[" > > and then define your > > colorblackondarkblue = $csi"30;44m" Thanks for your answer. I have tried this slight modification, but it does not change anything on my terminal. -- TP (Tribulations Parallèles)

Re: how are strings immutable in python?

2008-07-06 Thread Martin v. Löwis
> so why would you ever want mutability? > > > seems very counterintuitive and unreliable. For lists, mutability is fairly natural. Suppose you have a function f that copies some items from one list to another. You write it as def f(src, dst): for x in src: if condition(x):

VNC capture in python

2008-07-06 Thread Astan Chee
Hi, I was wondering if I can do a capture of a VNC screen in python. Kinda like this http://search.cpan.org/~lbrocard/Net-VNC-0.35/lib/Net/VNC.pm but without opening a VNC window or doing a screen capture. Thanks for any suggestions -- "Formulations of number theory: Complete, Consistent, Non-t

Re: interpretation of special characters in Python

2008-07-06 Thread Peter Pearson
On Sun, 06 Jul 2008 23:42:26 +0200, TP <[EMAIL PROTECTED]> wrote: > > $ python -c "print '\033[30;44m foo \033[0m'" [writes an escape sequence to stdout] > $ echo -e $esc$ColorBlackOnDarkblue foo $esc$ColorReset [also writes an escape sequence to stdout] > $ echo -n $esc$ColorBlackOnDarkblue foo

Re: mirroring files and data via http

2008-07-06 Thread Steve Potter
On Jul 6, 8:19 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Steve Potter wrote: > > I'm working on a project to create a central administration interface > > for several websites located on different physical servers. > > > You can think of the websites as a blog type application. My > > administ

Re: GUI Programming by hand not code with Python Code

2008-07-06 Thread Victor Noagbodji
> Is their a program that lets you design a GUI by hand (like gambas) > not by code (like wxpython) but the commands are in python? > > A program similar to gambas or vb > > Gambas with python code instead of gambas code would be perfect. > > Thanks in advance Check out the Designer program that c

Re: GUI Programming by hand not code with Python Code

2008-07-06 Thread Jason Scheirer
On Jul 6, 7:33 pm, [EMAIL PROTECTED] wrote: > Is their a program that lets you design a GUI by hand (like gambas) > not by code (like wxpython) but the commands are in python? > > A program similar to gambas or vb > > Gambas with python code instead of gambas code would be perfect. > > Thanks in ad

can't start IDLE 2.6 in Windows Vista

2008-07-06 Thread Mensanator
Python 2.6b1 installed ok on my XP laptop but not my Vista desktop. First I got a strange application log error: Activation context generation failed for "C:\Python\Dlls\_socket.pyd". Error in manifest or policy file "C:\Python26\DLLs\Microsoft.VC90.CRT.MANIFEST" on line 12. The value "..\msvcr90

GUI Programming by hand not code with Python Code

2008-07-06 Thread jayjaygibbs
Is their a program that lets you design a GUI by hand (like gambas) not by code (like wxpython) but the commands are in python? A program similar to gambas or vb Gambas with python code instead of gambas code would be perfect. Thanks in advance -- http://mail.python.org/mailman/listinfo/python-l

Re: mirroring files and data via http

2008-07-06 Thread Matt Nordhoff
Steve Potter wrote: > I'm working on a project to create a central administration interface > for several websites located on different physical servers. > > You can think of the websites as a blog type application. My > administration application will be used to create new blog posts with > assoc

mirroring files and data via http

2008-07-06 Thread Steve Potter
I'm working on a project to create a central administration interface for several websites located on different physical servers. You can think of the websites as a blog type application. My administration application will be used to create new blog posts with associated media (images, etc..) So

ANN: python-ldap-2.3.5

2008-07-06 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

RE: how are strings immutable in python?

2008-07-06 Thread Delaney, Timothy (Tim)
ssecorp wrote: > so why would you ever want mutability? > > > seems very counterintuitive and unreliable. Because immutability imposes a lot of restrictions and performance characteristics that mutable objects don't have. For example, compare building up a list and a tuple element-by-element (u

Re: Using poplib to parse headers - Thank You All!

2008-07-06 Thread Jean-Claude Neveu
Tim Roberts wrote: You've received some very confusing advice in this thread. Alex had the right answer, but I want to expand it a bit. [...] poplib.retr gives you a string. You need to hand that string to the email module, and you do that using "email.message_from_string". This is just to

Re: how are strings immutable in python?

2008-07-06 Thread ssecorp
so why would you ever want mutability? seems very counterintuitive and unreliable. -- http://mail.python.org/mailman/listinfo/python-list

Re: pythoncom InternetExplorer.Application don't work in vista || firefox pythoncom ?

2008-07-06 Thread M�ta-MCI (MVP)
H... I have a similary problem, in another circumstances. It's often a problem of configuration of IE (for news customers). But, it is not easy, because IE has many parameters. Good luck! Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: how are strings immutable in python?

2008-07-06 Thread Mark Tolonen
"ssecorp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] so if strings were mutable and i did a = b = "foo" and then did a += "bar" then a and b would be foobar? This can be demonstrated with a list of characters, which *is* mutable: a = b = list('foo') a += list('bar') a ['f'

Very weird bug!

2008-07-06 Thread ssecorp
I was looking into currying and Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. Personal firewall software may warn about

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread Mark Wooding
Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > # perl -e '("a" x 10) =~ /^(ab?)*$/;' > zsh: segmentation fault perl -e '("a" x 10) =~ /^(ab?)*$/;' (Did you really run that as root?) > It'd be interesting to know, how CL-PPCRE performs here (I don't know this > library). Stack o

interpretation of special characters in Python

2008-07-06 Thread TP
Hi everybody, I am new to Python, I try to understand how Python treats special characters. For example, if I execute the following line in a shell console, I obtain a colored string: $ python -c "print '\033[30;44m foo \033[0m'" So, it works. Some time ago, I have made a lot of shell variables

Re: how are strings immutable in python?

2008-07-06 Thread ssecorp
so if strings were mutable and i did a = b = "foo" and then did a += "bar" then a and b would be foobar? -- http://mail.python.org/mailman/listinfo/python-list

Re: how are strings immutable in python?

2008-07-06 Thread Terry Reedy
Peter Otten wrote: ssecorp wrote: h = "aja baja" h += 'e' h 'aja bajae' The inplace-add operator doesn't mutate the lvalue, it just rebinds it: In Python, neither '=' nor members of the 'op=' family are operators. They all mark *assignment* or *augmented assignment* statements that *all

Re: how are strings immutable in python?

2008-07-06 Thread Mel
ssecorp wrote: h = "aja baja" h += 'e' h > 'aja bajae' What Peter said, or, to put it another way: Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a = b = "

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread Terry Reedy
Sebastian "lunar" Wiesner wrote: I completely agree. I'd just believe, that the combination of some finite state machine for "classic" expressions with some backtracking code is terribly hard to implement. But I'm not an expert in this, probably some libraries out there already do this. In

Re: how are strings immutable in python?

2008-07-06 Thread Peter Otten
ssecorp wrote: h = "aja baja" h += 'e' h > 'aja bajae' The inplace-add operator doesn't mutate the lvalue, it just rebinds it: >>> a = b = "foo" >>> id(a) 47643036142016 >>> a += "bar" >>> id(a), a (47643036142064, 'foobar') >>> id(b), b (47643036142016, 'foo') Peter -- http

how are strings immutable in python?

2008-07-06 Thread ssecorp
>>> h = "aja baja" >>> h += 'e' >>> h 'aja bajae' >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Sebastian "lunar" Wiesner
Mathieu Prevot <[EMAIL PROTECTED]>: > it seems the script (A) finishes before the downloading ends, and the > (B) version doesn't (wanted behavior) ... this is unexpected. What > happens ? "readlines" blocks, until the pipe is closed, which usually happens, if the process dies. On the other ha

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread Sebastian "lunar" Wiesner
Mark Wooding <[EMAIL PROTECTED]>: > Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > >> I just wanted to illustrate, that the speed of the given search is >> somehow related to the complexity of the engine. >> >> Btw, other pcre implementation are as slow as Python or "grep -P". I >> tried

Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Mathieu Prevot
Hi it seems the script (A) finishes before the downloading ends, and the (B) version doesn't (wanted behavior) ... this is unexpected. What happens ? (A) class vid(threading.Thread): def __init__(self): threading.Thread.__init_

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread Mark Wooding
Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > I just wanted to illustrate, that the speed of the given search is somehow > related to the complexity of the engine. > > Btw, other pcre implementation are as slow as Python or "grep -P". I tried > a sample C++-code using pcre++ (a wrapper

Re: Nested generator caveat

2008-07-06 Thread Mark Wooding
Dieter Maurer <[EMAIL PROTECTED]> wrote: > I met the following surprising behaviour [code moved until later...] > The apparent reason is that the free variables in nested generator > definitions are not bound (to a value) at invocation time but only at > access time. No. This is about the diff

Re: Hands-on HTML Table Parser/Matrix?

2008-07-06 Thread Sebastian "lunar" Wiesner
robert <[EMAIL PROTECTED]>: > Often I want to extract some web table contents. Formats are > mostly static, simple text & numbers in it, other tags to be > stripped off. So a simple & fast approach would be ok. > > What of the different modules around is most easy to use, stable, > up-to-date, it

Re: Hands-on HTML Table Parser/Matrix?

2008-07-06 Thread robert
Tim Cook wrote: On Sun, 2008-07-06 at 14:40 +0200, robert wrote: Often I want to extract some web table contents. Formats are mostly static, simple text & numbers in it, other tags to be stripped off. So a simple & fast approach would be ok. What of the different modules around is most easy

Re: Python with Ecmascript

2008-07-06 Thread [EMAIL PROTECTED]
On 6 Čec, 07:02, Tim Roberts <[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >for my Python application (Windows platform) to be standards > >compliant, I need to embbed Ecmascript(Javascript) interpreter - I > >need to execute plugins written in this language. > >

Hi there! I need what is probably a very basic lesson in events....

2008-07-06 Thread furby
I am teaching myself Python... I'm nowhere near even intermediate level yet, so treat me like an idiot. I am using Boa Constructor on Ubuntu 8.04 if that helps. Here is what I have right now : I am plying with reading a URL (An RSS feed to be exact) and displaying it inside a HTMLWindow. I have th

Re: Recursive wildcard file search

2008-07-06 Thread Simon Brunning
2008/7/4 Gerhard Häring <[EMAIL PROTECTED]>: > Robert Dailey wrote: >> Is there a way to perform a recursive file search using wildcards in >> python 3.0b1? [...] > > glob.glob() or glob.iglob(). glob's not recursive AFAIK. This recipe probably still works under Pythion 3K, though:

Re: Hands-on HTML Table Parser/Matrix?

2008-07-06 Thread Tim Cook
There are couple of HTML examples using Pyparsing here: http://pyparsing.wikispaces.com/Examples --Tim On Sun, 2008-07-06 at 14:40 +0200, robert wrote: > Often I want to extract some web table contents. Formats are > mostly static, simple text & numbers in it, other tags to be > stripped off

Hands-on HTML Table Parser/Matrix?

2008-07-06 Thread robert
Often I want to extract some web table contents. Formats are mostly static, simple text & numbers in it, other tags to be stripped off. So a simple & fast approach would be ok. What of the different modules around is most easy to use, stable, up-to-date, iterator access or best matrix-access (

Python / WxPython error message

2008-07-06 Thread Keith Bailey
Dear All, Any help on this would be hugely appreciated. I have had a Python programme written for me, but when I try to run it, I get the following error message: /*Traceback (most recent call last): File "iTeddyConverter.py", line 3, in File "zipextimporter.pyc", line 82, in load_module

Re: multi-platform browser embedding

2008-07-06 Thread Diez B. Roggisch
Joe P. Cool schrieb: I fiddled a little with pyGTK and was quite happy to discover gtkMozEmbed because I want to write an application for Linux and Windows with a powerful browser widget. Unfortunatly I couldnt find a way to make gtkMozEmbed work on Windows. Are there alternatives? I'm lazy so I

Re: conflict between multiple installs of python (linux)

2008-07-06 Thread [EMAIL PROTECTED]
Is some problems with 2.5 i see something on internet (ex: ctypes ) So i try to install 2.5.1 for pyglet1.1, but not work with ctypes . So ctypes lib is on the path lib's !? But python2.6 work with ctypes. The python2.5 and 2.6 have been installed with same command: python setup.py install If you s

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-06 Thread Ali Servet Dönmez
On Jul 4, 8:58 am, Aspersieman <[EMAIL PROTECTED]> wrote: > Jeroen Ruigrok van der Werven wrote:> -On [20080630 23:51], Ali Servet Dönmez > ([EMAIL PROTECTED]) wrote: > > >> This could be an extension, a plugin, an Emacs mode, a new editor or > >> even a brand new huge all-fancy IDE, I don't care,

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-06 Thread Ali Servet Dönmez
On Jul 4, 7:31 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080630 23:51], Ali Servet Dönmez ([EMAIL PROTECTED]) wrote: > > >This could be an extension, a plugin, an Emacs mode, a new editor or > >even a brand new huge all-fancy IDE, I don't care, but what am I >

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-06 Thread Ali Servet Dönmez
On Jul 4, 7:10 am, Yu-Xi Lim <[EMAIL PROTECTED]> wrote: > Ali Servet Dönmez wrote: > > > I tried code come completion options in Emacs for Python, but none of > > them was satisfactory to me. I'd be glad to hear how did your friend > > get it work though. > > Perhaps it would help to say what ways

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-06 Thread Ali Servet Dönmez
On Jul 4, 12:56 am, "Python Nutter" <[EMAIL PROTECTED]> wrote: > If you guys can get your head out of IDE land, you'll find iPython > does a fantastic job at introspection and Auto-completion, you can > launch shell commands and editors and when done saving be back in the > iPython shell, save memo

Re: Not necessarily related to python Web Crawlers

2008-07-06 Thread subeen
On Jul 5, 2:31 pm, [EMAIL PROTECTED] wrote: > Hi > Does anyone here have a good recommendation for an open source crawler > that I could get my hands on? It doesn't have to be python based. I am > interested in learning how crawling works. I think python based > crawlers will ensure a high degree o

Re: pythoncom InternetExplorer.Application don't work in vista || firefox pythoncom ?

2008-07-06 Thread gcmartijn
On 5 jul, 14:14, "Méta-MCI \(MVP\)" <[EMAIL PROTECTED]> wrote: > Hi! > > Your code run OK for me (Vista Ultimate). > This other version run also OK : > > def webbrowser(url=None): >     import win32com.client, time > >     ie=win32com.client.Dispatch('InternetExplorer.Application')     >  

Re: pythoncom InternetExplorer.Application don't work in vista || firefox pythoncom ?

2008-07-06 Thread gcmartijn
On 5 jul, 15:27, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > H! > > > I using a script that opens a internet page in a small window (what I > > can control) > > In XP everything was working fine, but now I'm using Vista with IE7 > > and this is what happends now: > > > Fir

Re: Discover Islam - The Fastest Growing Religion in the World !

2008-07-06 Thread kylefarthing
On Jul 1, 4:51 pm, ah <[EMAIL PROTECTED]> wrote: > Correct your information about Islam > , > The Misunderstood Religion > >   When you are ready_ you can enter this place!!! >  http://sultan.org all u muslim liers get your facts stright According to the Carnegie Endowment for International Peace,

Re: Elisp Lesson on file processing (make downloadable copy of a website)

2008-07-06 Thread [EMAIL PROTECTED]
In this week i wrote a emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) In the process, i ran into a problem with the unix “cp” utility. I've been a unix admin for Solaris during 1998-2004. Even the first time i l

Re: Parsing MIME-encoded data in an HTTP request

2008-07-06 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Michael Ströder <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > Ron Garret <[EMAIL PROTECTED]> wrote: > > > >> In article <[EMAIL PROTECTED]>, > >> Michael Ströder <[EMAIL PROTECTED]> wrote: > >> > >>> Ron Garret wrote: > >

Re: The Yield statement

2008-07-06 Thread Mark Tolonen
"inhahe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] "Alex Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Okay, so i don't really understand the Yield thing and i know it is useful. I've read a few things about it but it is all programming jargon and so

Re: Python with Ecmascript

2008-07-06 Thread Daniel Fetchinson
>> Is there a way to do similar things on linux? > > I think no. Because these tech use COM. And COM don't exist under xxnux. > But: > - look if XPCOM, or dBus) can help you > - search with the word "MOZLAB", who work a solution (plugin) for > drive Firefox, from an external software. Wow, moz

Re: re.search much slower then grep on some regular expressions

2008-07-06 Thread [EMAIL PROTECTED]
On Jul 5, 11:13 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > Apparently, grep and Tcl convert a regex to a finite state machine. ... > But not all PCREs can be converted to a finite state machine ... > Part of the problem is a lack of agreement on what > 'regular expression' means. Strictly sp

Re: The Yield statement

2008-07-06 Thread inhahe
"Alex Bryan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Okay, so i don't really understand the Yield thing and i know it is > useful. I've read a few things about it but it is all programming jargon > and so basically it is hard for me to understand. So can anyone give me a