Re: Python/UNO/OpenOffice?

2006-10-02 Thread olive
For me the problem is that OO2.0 is compiled against P2.3. Is there any OO compiled with P2.4x for Windows somewhere ? Sybren Stuvel wrote: > Aside from what has already been said, it might be nice for you to > read my article about OOo and Python at > http://www.stuvel.eu/ooo-python ;-) -- htt

Re: PATCH: Speed up direct string concatenation by 20+%!

2006-10-02 Thread John Machin
Fredrik Lundh wrote: > > You should also benchmark this against code that uses the ordinary > append/join pattern. (you've posted conflicting benchmarks for 2.5, > but if I'm trusting the benchmarks that looks more reasonable, the > standard implementation pattern is still around 10 times faster

Re: Problem with .next() method adding junk characters.

2006-10-02 Thread Fredrik Lundh
"Rainy" <[EMAIL PROTECTED]> wrote: > I'm just curious as to what's happening. I understand that you're not > supposed to call .next on a file open for writing. But I don't know why > and how it does what happened here; besides, I've seen the same thing > happen before when I was doing something el

Re: builtin regular expressions?

2006-10-02 Thread Nick Craig-Wood
Kay Schluehr <[EMAIL PROTECTED]> wrote: > I notice two issues here. Only one has anything to do with regular > expressions. The other one with 'explicit is better than implicit': the > many implicit passing operations of Rubys case statement. Using > pseudo-Python notation this could be refacto

Re: DAT file compilation

2006-10-02 Thread Nick Craig-Wood
Jay <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Jay schrieb: > > > Is there a way through python that I can take a few graphics and/or > > > sounds and combine them into a single .dat file? If so, how? And how > > > can I access the data in the .dat file from inside the python scrip

Re: windev vs python SOS

2006-10-02 Thread Bruno Desthuilliers
Amanda wrote: (snip) > I am always amazed when I meet fanatics!! I'm always amazed when I meet PC-Soft's salespersons... > Links abour Windev for those who like facts : > > http://www.windev.com/pcsoft/testimonials/index.html > http://www.pcsoft.fr/annonce10/photos.html > http://www.pcsoft.fr/pc

Re: windev vs python SOS

2006-10-02 Thread Fredrik Lundh
Bruno Desthuilliers wrote: > Amanda wrote: > (snip) >> I am always amazed when I meet fanatics!! > > I'm always amazed when I meet PC-Soft's salespersons... isn't there some non-python forum where you can sort this one out ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Can recursive descent parser handle Python grammar?

2006-10-02 Thread Ben Sizer
[EMAIL PROTECTED] wrote: > Ben Sizer wrote: > > [EMAIL PROTECTED] wrote: > > > I'm a compiler newbie and was curious if Python's language/grammar > > > can be handled by a recursive descent parser. > > > > I believe a recursive descent parser can handle any grammar; it just > > depends on how pure

Re: preemptive OOP?

2006-10-02 Thread Bruno Desthuilliers
John Salerno wrote: > Ok, I have a new random question for today -- feel free to ignore and > get back to your real jobs! :) > > Anyway, I'm creating a GUI (yes, all part of my master plan to > eventually have some sort of database application working) and it's > going to involve a wx.Notebook con

Re: "Wiki in 10 minutes"

2006-10-02 Thread Bruno Desthuilliers
Michiel Sikma wrote: > Hello everybody. > > I recently had a bit of data loss and, among some other minor things, > lost my bookmarks. (snip) > > Any other links pertaining to the creation of web applications with > Python, which I'm only just getting into, would also be appreciated. Could it b

Re: python threading and timing

2006-10-02 Thread Laurent Pointal
Dennis Lee Bieber a écrit : > On Sun, 1 Oct 2006 22:28:10 +0200, "Oeyvind Brandtsegg" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> Also, I wonder what method I should be using to get a precise timing >> in my automation thread (acting as a sequencer). >> > Use a re

Re: strange append

2006-10-02 Thread Bruno Desthuilliers
E.Nurminski wrote: > Hello to all good people > > I am new to the great Py so am quite puzzled by the following code > > --- > > res = [] > x = [ 1, 1 ] > for i in xrange(0,5): > res.append(x) > x[1] = x[1] + 1 > print "x = ", x > print "res = ", res > >

Re: Making sure script only runs once instance at a time.

2006-10-02 Thread Hari Sekhon
Fredrik Lundh wrote: Hari Sekhon wrote: I'm not sure if that is a very old way of doing it, which is why I was reluctant to do it. My way actually uses the process list of the os (linux) and counts the number of instances. If it is more than 0 then another process is running an

Re: Making sure script only runs once instance at a time.

2006-10-02 Thread Hari Sekhon
AMENDMENT: The line number_procs=commands.getstatusoutput('ps -ef|grep %s|grep -v grep|wc -l' % scriptpath) was supposed to be number_procs=int(commands.getstatusoutput('ps -ef|grep %s|grep -v grep|wc -l' % scriptpath)[1]) -h Hari Sekhon Hari Sekhon wrote: Fredrik Lundh wrote:

Re: PyXML not supported, what to use next?

2006-10-02 Thread Oliver Andrich
Hi PaulOn 9/30/06, Paul Watson <[EMAIL PROTECTED]> wrote: It would appear that xml.dom.minidom or xml.sax.* might be the bestthing to use since PyXML is going without support.  Best of all it isincluded in the base Python distribution, so no addition hunting required. Is this right thinking?  Is th

Re: [OT] windev vs python SOS

2006-10-02 Thread Bruno Desthuilliers
Fredrik Lundh wrote: > Bruno Desthuilliers wrote: > >> Amanda wrote: >> (snip) >>> I am always amazed when I meet fanatics!! >> I'm always amazed when I meet PC-Soft's salespersons... > > isn't there some non-python forum where you can sort this one out ? Yes, you're right, sorry... -- bruno d

Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread robert
Simple Python code obviously cannot use the dual core by Python threads. Yet, a program drawing CPU mainly for matrix computations - preferably with Numeric/SciPy - will this profit from a dual core when using 2 (or more) Python threads? robert -- http://mail.python.org/mailman/listinfo/python

__init__ style questions

2006-10-02 Thread Will McGugan
I am writting a Vector3D class as a teaching aid (not for me, for others), and I find myself pondering over the __init__ function. I want it to be as easy to use as possible (speed is a secondary consideration). Heres the __init__ function I have at the moment. class Vector3D(object): __slot

Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread Fredrik Lundh
"robert" wrote: > Simple Python code obviously cannot use the dual core by Python threads. > Yet, a program drawing CPU mainly for matrix computations - preferably > with Numeric/SciPy - will this profit from a dual core when using 2 (or > more) Python threads? as long as the binding releases th

Re: __init__ style questions

2006-10-02 Thread Duncan Booth
"Will McGugan" <[EMAIL PROTECTED]> wrote: > A Vector3D can be constructed in 3 ways. If no parameters are given it > assumes a default of (0, 0, 0). If one parameter is given it is assumed > to be an iterable capable of giving 3 values. If 3 values are given > they are assumed to be the initial x,

Re: __init__ style questions

2006-10-02 Thread Fredrik Lundh
Duncan Booth wrote: > No it isn't Pythonic. rubbish. using a single constructor that handles two common use cases is perfectly Pythonic (especially if you're targeting casual programmers). -- http://mail.python.org/mailman/listinfo/python-list

Re: __init__ style questions

2006-10-02 Thread Will McGugan
Duncan Booth wrote: > No it isn't Pythonic. Why not just require 3 values and move the > responsibility onto the caller to pass them correctly? They can still use > an iterator if they want: > > Vector3D(a, b, c) > Vector3D(*some_iter) I kind of liked the ability to partially use iterato

Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread Oeyvind Brandtsegg
I've been trying to make my music app use dual core, and would very much like some more detailed information on this. Excuse my lack of knowledge, but how do I explicitly release the GIL ? I haven't learned this, but have found through experimentation that I can release a thread by using time.sle

Re: __init__ style questions

2006-10-02 Thread Duncan Booth
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > >> No it isn't Pythonic. > > rubbish. using a single constructor that handles two common use cases is > perfectly Pythonic (especially if you're targeting casual programmers). > Yes, but I don't think that the specific case the

Re: "ValueError: Empty module name" on basic import

2006-10-02 Thread alain MONTMORY
alain MONTMORY a écrit : Thank for your response :-) I have tried (it's my first try ..)  : ./TestOfficiel TestPythonFoo multiply 3 2 and i get : [EMAIL PROTECTED] swigCallPython]$ ./TestOfficiel TestPythonFoo multiply 3 2 ImportError: No module named TestPythonFoo Failed to load "

Re: __init__ style questions

2006-10-02 Thread Duncan Booth
"Will McGugan" <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > >> No it isn't Pythonic. Why not just require 3 values and move the >> responsibility onto the caller to pass them correctly? They can still >> use an iterator if they want: >> >> Vector3D(a, b, c) >> Vector3D(*some_iter) >

Re: Python/UNO/OpenOffice?

2006-10-02 Thread Colin J. Williams
wesley chun wrote: > as others have said, that project provides a working interface to OOo > (OpenOffice 2 on Ubuntu Breezy and Dapper). i've made several posts > to this regard over the summer here on CLP. i was mostly using it to > "mess around" with documents in StarWriter. > > cheers, > -- w

Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread Fredrik Lundh
Oeyvind Brandtsegg wrote: > I've been trying to make my music app use dual core, > and would very much like some more detailed information on this. > > Excuse my lack of knowledge, > but how do I explicitly release the GIL ? http://docs.python.org/api/threads.html > I haven't learned this, but h

Re: __init__ style questions

2006-10-02 Thread Will McGugan
Duncan Booth wrote: > > Yes, it would, although since the implication is that your class expected > numbers and the file iterator returns strings I'm not sure how much it > matters: you are still going to have to write more code than in your > example above. e.g. > >v1 = Vector3D(float(n) for

Re: Python/UNO/OpenOffice?

2006-10-02 Thread John Machin
Colin J. Williams wrote: > I've done some small things with Python/OpenOffice, using Windows XP. > They appear to work OK. As you might have noticed from my earlier post, I can't get off the ground. Can you please give an example (with code) of a "small thing" that works OK? TIA, John -- http

VIdeo Converence Software: Tk and thread synchronization

2006-10-02 Thread Paolo Pantaleo
Hi, I am going on writing my video conference software. I wrote the video grab, code/decode, and netwoark (multicast) transport. I have one thread doing this: [thread 1] while True: for some times: my_socket.recv() #blocking here store data compute image #here we have a complete new

PYTHON PHONE MODULE

2006-10-02 Thread vedran_dekovic
Hello, Can you tell me one simple python phone module and if that module have some moudules which need download from internet,then give me urls of that modules THANKS!! -- http://mail.python.org/mailman/listinfo/python-list

Help with ConfigParser

2006-10-02 Thread tony . ha
Hello I use ConfigParser as show below to read a config.txt file; from ConfigParser import ConfigParser config = ConfigParser() config.read('config.txt') items = config.items('FV') for item in items:    module_name = item[0]    print module_name The config.txt file has the following [FV] # Se

Re: changing a file's permissions

2006-10-02 Thread oscartheduck
> This is an attribute of the file (an object in the filesystem) which > is checked by the kernel before allowing the file to be > executed. Python has nothing to do with this; if the attributes allow > execution, you can execute it as a program; if not, you can't. > I took this to heart and chang

Re: Python/UNO/OpenOffice?

2006-10-02 Thread olive
John, Here is something that works for me under XPsp2 to either save a doc or save it as PDF: filepath = argv[0] exportpdf = argv[1] ctxLocal = uno.getComponentContext() smgrLocal = ctxLocal.ServiceManager resolver = smgrLocal.createInstanceWithContext("com.sun.star.bridge.U

Rich view for python?

2006-10-02 Thread Jorge Vilela
Hello, this is my first post and hope can help in next posts :)i have a question, and think that many peoples have same question.Do exists any component to rich editing text?I has seen the Rich View for Delphi, it looks like an embeded world in app, so i though that could exist something as it for

Re: __init__ style questions

2006-10-02 Thread Gerard Flanagan
Will McGugan wrote: > I am writting a Vector3D class as a teaching aid (not for me, for > others), and I find myself pondering over the __init__ function. I want > it to be as easy to use as possible (speed is a secondary > consideration). > > Heres the __init__ function I have at the moment. > >

Re: Python/UNO/OpenOffice?

2006-10-02 Thread olive
... and you have to start your py file with: import uno, sys, socket from com.sun.star.beans import PropertyValue ... and your start_oo_server.bat file with: @SET PYTHONPATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program Files\OpenOffice.org 2.0\program\python-core-2.3.4\lib @SET PATH=C

Re: __init__ style questions

2006-10-02 Thread bearophileHUGS
Will McGugan: > I am writting a Vector3D class as a teaching aid (not for me, for > others), and I find myself pondering over the __init__ function. I want > it to be as easy to use as possible (speed is a secondary > consideration). If optimizations are less important, then don't use __slots__, i

Re: PYTHON PHONE MODULE

2006-10-02 Thread skip
vedran> Can you tell me one simple python phone module ... What is a "phone module"? Does it manipulate phone numbers, map phone numbers to locations, place phone calls, handle phone calls? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with .next() method adding junk characters.

2006-10-02 Thread Paul McGuire
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Rainy" <[EMAIL PROTECTED]> wrote: > >> I'm just curious as to what's happening. I understand that you're not >> supposed to call .next on a file open for writing. But I don't know why >> and how it does what happened he

automatic progress indicator

2006-10-02 Thread rubbishemail
Hello, I have several functions calling each other several times: iter=0 iterations=50*20 in this case, how can the program calculate this value automatically def a(y): for x in range(20): # this takes a constant time ... iter+=1 progress=iter/iterations

Re: changing a file's permissions

2006-10-02 Thread Max Erickson
James <[EMAIL PROTECTED]> wrote: > --=_Part_63041_761240.1159752399799 > I'm writing a script in linux to excercise my python skills and > have encountered a minor issue. > > Writing the script and creating an ouput file was simple enough > and didn't take too long. However, I don't have permi

Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet
> Is anybody out there who has used the server+client operation > mode successfully? Well, several years ago, yes. Since then the project was taken over by some volunteers and they did an excellent job of restructuring and modernizing (somewhat) the *standalone* part of gadfly, but apparently the

Re: Help with ConfigParser

2006-10-02 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Question: How can I pervent ConfigParse to convert Upper case yo lower > case??, thanks. http://docs.python.org/dev/lib/RawConfigParser-objects.html """ optionxform(option) Transforms the option name option as found in an input file or as passed in by client code to t

Re: PYTHON PHONE MODULE

2006-10-02 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Can you tell me one simple python phone module and if that module have > some moudules which need download from internet,then give me urls of that > modules I did see that you were trying to get pyphone [1] to work. According to the description in that program, it seems

Re: Problems wth os.stat().st_mtime on Mac

2006-10-02 Thread Michael Glassford
Martin v. Löwis wrote: > Michael Glassford schrieb: >> Although not mentioned in the Python 2.5 News, apparently there was a >> similar change on Mac that I'm having some problems with. On the Mac, >> just as on Windows, os.stat().st_mtime now returns a float instead of an >> integer. > > It's isn

Re: Help with ConfigParser

2006-10-02 Thread TonyHa
Hello Peter, Thanks for your help, and it works now! Tony. Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > Question: How can I pervent ConfigParse to convert Upper case yo lower > > case??, thanks. > > http://docs.python.org/dev/lib/RawConfigParser-objects.html > > """ > optionxform(option)

regular expressions in the pexpect module for python

2006-10-02 Thread Mark Devine
HiI wonder if you can help me. I am using pexpect with python to access remote machines and run commands on them. I pass commands into code like so:def cmd(self, cmd):        pp=[ "|", "]", "[", "(", ")", "$", "?", "*", ".", ":"]         expcmd=cmd        for element in pp:            expcmd=expcmd

commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Hari Sekhon
I'm running a command like import commands result = commands.getstatusoutput('somecommand') print result[0] 3072 However, this exit code made no sense so I ran it manually from the command line in bash on my linux server and it gives the exit code as 12, not this weird 3072 number. So I tried

PyCon proposals (was Re: PATCH: Speed up direct string concatenation by 20+%!)

2006-10-02 Thread Aahz
In article <[EMAIL PROTECTED]>, Larry Hastings <[EMAIL PROTECTED]> wrote: >Steve Holden wrote: >> >> I think your project might make a very >> interesting PyCon paper for people who were thinking about joining the >> development effort but hadn't yet started. > >Perhaps; I've never been to PyCon, b

Re: Python/UNO/OpenOffice?

2006-10-02 Thread John Machin
olive wrote: > ... and you have to start your py file with: > > import uno, sys, socket > from com.sun.star.beans import PropertyValue > > ... and your start_oo_server.bat file with: > > @SET PYTHONPATH=C:\Program Files\OpenOffice.org 2.0\program;C:\Program > Files\OpenOffice.org 2.0\program\pytho

Re: Help with ConfigParser

2006-10-02 Thread Enrico
Hi, from the documentation: optionxform(option) Transforms the option name option as found in an input file or as passed in by client code to the form that should be used in the internal structures. The default implementation returns a lower-case version of option; subclasses may override this or

How to coerce a list of vars into a new type?

2006-10-02 Thread Matthew Wilson
I want to verify that three parameters can all be converted into integers, but I don't want to modify the parameters themselves. This seems to work: def f(a, b, c): a, b, c = [int(x) for x in (a, b, c)] Originally, I had a bunch of assert isinstance(a, int) statements at the top of

Making posts to an ASP.NET webform.

2006-10-02 Thread Bernard
hiya everyone, I've made this little webcrawler using BeautifulSoup, urllib and urllib2. I've been encountering ASP.NET Forms recently and I can't seem to make a proper post to some of them. My post function has been doing great until this particular website. Here's some explanations first so that

How can I make a class that can be converted into an int?

2006-10-02 Thread Matthew Wilson
What are the internal methods that I need to define on any class so that this code can work? c = C("three") i = int(c) # i is 3 I can handle the part of mapping "three" to 3, but I don't know what internal method is called when int(c) happens. For string conversion, I just define the __str__ me

Sort by domain name?

2006-10-02 Thread js
Hi list, I have a list of URL and I want to sort that list by the domain name. Here, domain name doesn't contain subdomain, or should I say, domain's part of 'www', mail, news and en should be excluded. For example, if the list was the following --

Re: How can I make a class that can be converted into an int?

2006-10-02 Thread Tim Chase
> What are the internal methods that I need to define on any class so that > this code can work? > > c = C("three") > > i = int(c) # i is 3 > > I can handle the part of mapping "three" to 3, but I don't know what > internal method is called when int(c) happens. > > For string conversion, I just

Re: How can I make a class that can be converted into an int?

2006-10-02 Thread Mikael Olofsson
Matthew Wilson wrote: > What are the internal methods that I need to define on any class so that > this code can work? > > c = C("three") > > i = int(c) # i is 3 From Python Reference Manual, section 3.4.7 Emulating numeric types: __complex__( self) __int__( self) __long__( self) __float__( se

Re: Python-list Digest, Vol 37, Issue 23

2006-10-02 Thread Mark Devine
HiSorry about that. Here is the full question:I wonder if you can help me. I am using pexpect with python to access remote machines and run commands on them. I pass commands into code like so:def cmd(self, cmd):     pp=[ "|", "]", "[", "(", ")", "$", "?", "*", ".", ":"]    expcmd=cmd   

SimpleParse installer available for 2.5

2006-10-02 Thread David Isaac
This is important for my move to Python 2.5, so I thought others might want to know... Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I make a class that can be converted into an int?

2006-10-02 Thread faulkner
__int__ __long__ __float__ Matthew Wilson wrote: > What are the internal methods that I need to define on any class so that > this code can work? > > c = C("three") > > i = int(c) # i is 3 > > I can handle the part of mapping "three" to 3, but I don't know what > internal method is called when in

Re: Sort by domain name?

2006-10-02 Thread Paul Rubin
"js " <[EMAIL PROTECTED]> writes: > Here, domain name doesn't contain subdomain, > or should I say, domain's part of 'www', mail, news and en should be > excluded. It's a little more complicated, you have to treat co.uk about the same way as .com, and similarly for some other countries but not al

Re: How can I make a class that can be converted into an int?

2006-10-02 Thread Peter Otten
Matthew Wilson wrote: > What are the internal methods that I need to define on any class so that > this code can work? > > c = C("three") > > i = int(c) # i is 3 > > I can handle the part of mapping "three" to 3, but I don't know what > internal method is called when int(c) happens. >>> class

Re: How to coerce a list of vars into a new type?

2006-10-02 Thread Simon Brunning
On 10/2/06, Matthew Wilson <[EMAIL PROTECTED]> wrote: > > I want to verify that three parameters can all be converted into > integers, but I don't want to modify the parameters themselves. > > This seems to work: > > def f(a, b, c): > > a, b, c = [int(x) for x in (a, b, c)] > > Original

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Steve Holden
Hari Sekhon wrote: > I'm running a command like > > import commands > result = commands.getstatusoutput('somecommand') > print result[0] > 3072 > > > However, this exit code made no sense so I ran it manually from the > command line in bash on my linux server and it gives the exit code as > 12

Re: How can I correct an error in an old post?

2006-10-02 Thread Jorgen Grahn
On 1 Oct 2006 10:18:59 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: ... > and I wish to add my findings to the post, to prevent others from > taking the wrong path. > When I tried to replay to the post I received a reject message stating > that it is impossible to replay to the topic since

Re: How to coerce a list of vars into a new type?

2006-10-02 Thread bearophileHUGS
Matthew Wilson wrote: > I want to verify that three parameters can all be converted into > integers, but I don't want to modify the parameters themselves. To do what you need you can try this: def f(a, b, c): map(int, [a, b, c]) ...code... Bye, bearophile -- http://mail.python.org/mail

Re: How can I correct an error in an old post?

2006-10-02 Thread Steve Holden
Jorgen Grahn wrote: > On 1 Oct 2006 10:18:59 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >>and I wish to add my findings to the post, to prevent others from >>taking the wrong path. > > >>When I tried to replay to the post I received a reject message stating >>that it is impossi

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Hari Sekhon
I don't quite understand what you are saying here: 2 * 256 is 512, 2 ** 256 is some extremely large number. 2**12 is 4096. So how does 3072 factor into this? Could you explain what you mean by "the error in the top half of a sixteen-bit value"? This makes no sense to me at this moment. -h

Re: Sort by domain name?

2006-10-02 Thread Tim Chase
>> Here, domain name doesn't contain subdomain, or should I >> say, domain's part of 'www', mail, news and en should be >> excluded. > > It's a little more complicated, you have to treat co.uk about > the same way as .com, and similarly for some other countries > but not all. For example, subd

Re: *** Spam *** Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Steve Holden
A famous Holden typo - it should have been "12 * 256 == 3072", but really it shouldn't have been beyond you to perform a division of 3072 by 12 (given that you already knew the number 12 was potentially involved). Basically the value you want is shifted up 8 bits. Perhaps I should more understa

postgresql database

2006-10-02 Thread Paolo
Ciao a tutti, sto cercando di implementare un applicazione che si interfaccia con postgresql(8.1), utilizzando Psycopg2, in ambiente windows (python versione 2.5). Ho installato Psycopg2 e provando solamente fare: import psycopg mi ritorna il seguente errore: import psycopg ImportError: No mod

Re: Sort by domain name?

2006-10-02 Thread js
Thanks for your quick reply. yeah, it's a hard task and unfortunately even google doesn't help me much. All I want to do is to sort out a list of url by companyname, like oreilly, ask, skype, amazon, google and so on, to find out how many company's url the list contain. -- http://mail.python.org/

Re: Sort by domain name?

2006-10-02 Thread gene tani
Paul Rubin wrote: > "js " <[EMAIL PROTECTED]> writes: > > Here, domain name doesn't contain subdomain, > > or should I say, domain's part of 'www', mail, news and en should be > > excluded. > > It's a little more complicated, you have to treat co.uk about > the same way as .com, and similarly for

Re: Making posts to an ASP.NET webform.

2006-10-02 Thread Max M
Bernard skrev: > Has anyone tried what I'm doing? and if you tried how have you > succeeded getting the data back after the post action? Most likely you get assigned a cookie that you then need to return. Try the cookielib which automates all this for you. -- http://mail.python.org/mailman/list

Multiplayer 2-D space action shooter in Python (using wxWindows)

2006-10-02 Thread [EMAIL PROTECTED]
Hi guys, Well, here is my humble contribution to the community: http://sourceforge.net/projects/erocket I started that project to learn Python and wxWindows. By all means, I am no Python Guru, but maybe someone could find something useful. Also please consider that it is under development and is

Re: Sort by domain name?

2006-10-02 Thread bearophileHUGS
Tim Chase: > to give you a sorting function. It assumes http rather than > having mixed url-types, such as ftp or mailto. They're easy > enough to strip off as well, but putting them back on becomes a > little more exercise. With a modern Python you don't need to do all that work, you can do: s

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Hari Sekhon
I'm sorry, this may seem dense to you but I have to ask. What on earth are you talking about? Why is it shifted 8 bits to the left? Why is there bitshifting at all? Why doesn't commands give the same exit value as os.system() and the unix cli? When you choose to exit a program you give it a re

Re: Sort by domain name?

2006-10-02 Thread bearophileHUGS
js: > All I want to do is to sort out a list of url by companyname, > like oreilly, ask, skype, amazon, google and so on, to find out > how many company's url the list contain. Then if you can define a good enough list of such company names, you can just do a search of such names inside each url.

Re: Sort by domain name?

2006-10-02 Thread jay graves
gene tani wrote: > Plus, how do you order "https:", "ftp", URLs with "www.", "www2." , > named anchors etc? Now is a good time to point out the urlparse module in the standard library. It will help the OP with all of this stuff. just adding my 2 cents. ... jay graves -- http://mail.python.or

Re: Making posts to an ASP.NET webform.

2006-10-02 Thread Bernard
Max M wrote: > Bernard skrev: > > > Has anyone tried what I'm doing? and if you tried how have you > > succeeded getting the data back after the post action? > > Most likely you get assigned a cookie that you then need to return. > > Try the cookielib which automates all this for you. Yea I'm alr

Re: Sort by domain name?

2006-10-02 Thread Paul Rubin
"js " <[EMAIL PROTECTED]> writes: > All I want to do is to sort out a list of url by companyname, > like oreilly, ask, skype, amazon, google and so on, to find out > how many company's url the list contain. Here's a function I used to use. It makes no attempt to be exhaustive, but did a reasonabl

Re: postgresql database

2006-10-02 Thread Michele Simionato
Paolo wrote: > Ciao a tutti, sto cercando di implementare un applicazione che si > interfaccia con postgresql(8.1), utilizzando Psycopg2, in ambiente > windows (python versione 2.5). Ho installato Psycopg2 e provando > solamente fare: import psycopg mi ritorna il seguente errore: > > import ps

Re: Sort by domain name?

2006-10-02 Thread Paul McGuire
"js " <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi list, > > I have a list of URL and I want to sort that list by the domain name. > > Here, domain name doesn't contain subdomain, > or should I say, domain's part of 'www', mail, news and en should be > excluded. > > For exampl

Re: Sort by domain name?

2006-10-02 Thread js
> Gentle reminder: is this homework? And you can expect better responses > if you show youve bootstrapped yourself on the problem to some extent. Sure thing. First I tried to solve this by using a list of domain found at http://www.neuhaus.com/domaincheck/domain_list.htm I converted this to a li

Re: Sort by domain name?

2006-10-02 Thread js
On 2 Oct 2006 08:56:09 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > js: > > All I want to do is to sort out a list of url by companyname, > > like oreilly, ask, skype, amazon, google and so on, to find out > > how many company's url the list contain. > > Then if you can define a good enoug

Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread robert
Fredrik Lundh wrote: > "robert" wrote: > > >>Simple Python code obviously cannot use the dual core by Python threads. >>Yet, a program drawing CPU mainly for matrix computations - preferably >>with Numeric/SciPy - will this profit from a dual core when using 2 (or >>more) Python threads? > >

tkinter to mpeg

2006-10-02 Thread dug
Hi, I have a small program that moves some shapes around a tkinter canvas. Is there any way to save the output in a movie file, maybe mpeg? Thank you, Douglas -- http://mail.python.org/mailman/listinfo/python-list

Re: Gadfly server startup error

2006-10-02 Thread aaronwmail-usenet
[EMAIL PROTECTED] wrote: > > Is anybody out there who has used the server+client operation > > mode successfully? > > Well, several years ago, yes. I looked into it and it was mainly a documentation and test issue, I think. The code seems to work. Please go http://gadfly.sourceforge.net/gadf

Re: Sort by domain name?

2006-10-02 Thread js
> How about sorting the strings as they are reversed? > > urls = """\ > http://mail.google.com > http://reader.google.com > http://mail.yahoo.co.uk > http://google.com > http://mail.yahoo.com""".split("\n") > > sortedList = [ su[1] for su in sorted([ (u[::-1],u) for u in urls ]) ] > > for url in so

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Fredrik Lundh
Hari Sekhon wrote: > I'm sorry, this may seem dense to you but I have to ask. What on earth > are you talking about? > > Why is it shifted 8 bits to the left? Why is there bitshifting at all? > Why doesn't commands give the same exit value as os.system() and the > unix cli? because that's how

Re: tkinter to mpeg

2006-10-02 Thread Thomas Jollans
On Mon, 02 Oct 2006 09:18:13 -0700, "dug" <[EMAIL PROTECTED]> let this slip: > Hi, > > I have a small program that moves some shapes around a tkinter canvas. > Is there any way to save the output in a movie file, maybe mpeg? you can record any app with special programs designed for the job, such

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Martin v. Löwis
Hari Sekhon schrieb: > I'm sorry, this may seem dense to you but I have to ask. What on earth > are you talking about? You may not be dense, but you are certainly fairly aggressive in your postings. If you just want to complain, go ahead. If you want actual help, you should reconsider your tone.

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Hari Sekhon
ok, I was thinking of shifting using subprocess, guess I'd better do that and forget about this waste of time. thanks Hari Sekhon Fredrik Lundh wrote: Hari Sekhon wrote: I'm sorry, this may seem dense to you but I have to ask. What on earth are you talking about? >

Pythonic API design: detailed errors when you usually don't care

2006-10-02 Thread Simon Willison
Hi all, I have an API design question. I'm writing a function that can either succeed or fail. Most of the time the code calling the function won't care about the reason for the failure, but very occasionally it will. I can see a number of ways of doing this, but none of them feel aesthetically p

Re: Python/UNO/OpenOffice?

2006-10-02 Thread Sybren Stuvel
John Machin enlightened us with: > Many thanks for all that, olive; I made the minimal hacks to make it > open an XLS ffile, and it worked! > I'll try to see why that worked and my previous experiment crashed > inside a DLL. Thanks, keep us posted! Sybren -- Sybren Stüvel Stüvel IT - http://ww

Re: Making sure script only runs once instance at a time.

2006-10-02 Thread Fredrik Lundh
Hari Sekhon wrote: > How exactly do you check that the pid is still active in python? Is > there a library or something that will allow me to manipulate system > processes and listings etc the way everybody does in unix shells by passing zero to the os.kill primitive: os.kill(pid,

Re: Python threads and Numeric/SciPy exploit Dual Core ?

2006-10-02 Thread Robert Kern
robert wrote: > Fredrik Lundh wrote: > >> "robert" wrote: >> >>> Simple Python code obviously cannot use the dual core by Python threads. >>> Yet, a program drawing CPU mainly for matrix computations - preferably >>> with Numeric/SciPy - will this profit from a dual core when using 2 (or >>> more

Re: How can I correct an error in an old post?

2006-10-02 Thread Blair P. Houghton
Steve Holden wrote: > Since this message was never on topic, I'd appreciate it if all > concerned would close this thread now. I already did. How did you get in here? --Blair -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >