Re: Create a Multilanguage PDF in Python

2006-08-21 Thread Rob Wolfe
Perseo wrote: > Hi again, > > WORKS!!! I download all I need as python + reportlab. Only 2 questions: > > 1. I need all of this package? because it is 6Mb! I'm afraid you need all of it. BTW My reportlab package is only 3MB... hmm strange. > 2. How can I connect my software with MySql. In my Hos

Re: Input from the same file as the script

2006-08-21 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> Wrote: | On 20 Aug 2006 11:02:25 -0700, [EMAIL PROTECTED] declaimed the | following in comp.lang.python: | | > Can the input to the python script be given from the same file as the | > script itself. e.g., when we execute a python script with the command

permanent tempfile?

2006-08-21 Thread Colin Wildsmith
Hello, I am trying to create a temp file, however the file that is created is still there after the program has completed. Why is this so? CoLe #!/usr/bin/python import os, tempfile, sys import tempfile # creates a random file (text=True is textfile, text=False is binary file) ext = '.txt' pfx

Re: tkinter prob

2006-08-21 Thread Eric Brunel
On Mon, 21 Aug 2006 08:50:29 +0200, JyotiC <[EMAIL PROTECTED]> wrote: > i have tried it out but it's not working. > this is the code > > from Tkinter import * > > class abc: > def __init__(self,parent): > #make container myparent > self.myparent=parent > self.myparent.g

Python Editor with Autocorrection

2006-08-21 Thread Laurentiu
hello! i am searching for a free python editor with autocorrection capabillities. for example:" the wrong setfocus() call to become SetFocus(), etc." thanks ___ All New Yahoo! Mail – Tired of [EMAIL PROTECTED]@! come

Questions on exceptions

2006-08-21 Thread sc_wizard29
Hi everyone, I've just finished studying O'Reilly's "Learning python" and since I come from the Java world, there are some things that bother me concerning python's exception handling. In Java, all methods must declare the exceptions throwed (I'm speaking of checked exceptions)... but this is not

Re: Python and STL efficiency

2006-08-21 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Licheng Fang wrote: > Hi, I'm learning STL and I wrote some simple code to compare the > efficiency of python and STL. > > //C++ > #include > #include > #include > #include > #include > using namespace std; > > int main(){ > vector a; > for (long int i=0;

Re: tkinter prob

2006-08-21 Thread JyotiC
thanx got the error, but there is one more prob, button is not coming to enable again. once it is disabled the error it's giving is:- Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__ return self.func(*args)

Re: Send to all clients using UDP in Twisted

2006-08-21 Thread [EMAIL PROTECTED]
Thanks for the responce, I am sending over the internet so I can't use that method. Thanks for the reply anyway! Martin P. Hellwig wrote: > Elliot Hughes wrote: > > Hi Everyone, I am trying to right a server that can receive a message > > and send it to all clients using UDP on twisted. I have got

Re: Python and STL efficiency

2006-08-21 Thread Licheng Fang
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Licheng Fang > wrote: > > > Hi, I'm learning STL and I wrote some simple code to compare the > > efficiency of python and STL. > > > > //C++ > > #include > > #include > > #include > > #include > > #include > > using namespace std; > >

Re: tkinter prob

2006-08-21 Thread Peter Otten
JyotiC wrote: > got the error, > but there is one more prob, button is  not coming to enable again. once > it is disabled > the error it's giving is:- > NameError: global name 'ENABLED' is not defined Try NORMAL instead of ENABLED. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and STL efficiency

2006-08-21 Thread Tim N. van der Leeuw
Licheng Fang wrote: > Hi, I'm learning STL and I wrote some simple code to compare the > efficiency of python and STL. > > > I was using VC++.net and IDLE, respectively. I had expected C++ to be > way faster. However, while the python code gave the result almost > instantly, the C++ code took seve

redemo.py with named groups

2006-08-21 Thread moriwaka
Hi, I wrote an easy patch for redemo.py to print named groups. For example, regexp: (?P.*) string: foobar shows following groups. Groups: 0: 'foobar' 1: 'foobar' 'spam': 'foobar' I don't know how/where to commit this patch.. any suggestions? --- Tools/scripts/redemo.py 2004-02-13 02:35:32.0

Re: Python and STL efficiency

2006-08-21 Thread Tim N. van der Leeuw
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Licheng Fang > wrote: > > > Hi, I'm learning STL and I wrote some simple code to compare the > > efficiency of python and STL. > > [...] > > There's a difference in data structures at least. The Python `set` type > is implemented with a ha

Re: py2exe: cannot identify image file

2006-08-21 Thread Michele Petrazzo
Daniel Mark wrote: > Hello all: > > It seems that function 'Image.open' cannot read image file under EXE > application. What should I do for this problem? > google and "pil py2exe", the first reply: http://starship.python.net/crew/theller/moin.cgi/PIL_20and_20py2exe > > Thank you -Daniel >

Re: tkinter prob

2006-08-21 Thread JyotiC
thanx a lot it worked Peter Otten wrote: > JyotiC wrote: > > > got the error, > > but there is one more prob, button is not coming to enable again. once > > it is disabled > > the error it's giving is:- > > > NameError: global name 'ENABLED' is not defined > > Try NORMAL instead of ENABLED. > >

Re: Questions on exceptions

2006-08-21 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, sc_wizard29 wrote: > Also, can someone explain me why there is no try...except...finally > statement ? AFAIK historical reasons. There where some concerns about ambiguity. But in Python 2.5 this form will become legal syntax. > For example, the following code snippet is

Re: Python and STL efficiency

2006-08-21 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Tim N. van der Leeuw wrote: > (your C++ code contains some C#-isms, such as omitting the '.h' in the > include <> statements). That's no C#-ism, that's C++. The standard C++ header names don't have a trailing '.h'. ``gcc`` prints deprecation warnings if you write the nam

Re: What do you want in a new web framework?

2006-08-21 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hello Everyone, > > Now, I'm working on a new web framework. I tried many test on the other > programming languages. Then i decided to use python on my web framework > project. > > Now i want to listen all of you. What do you want in that web > framework(Easy use of

Re: Python for EXIF-info-additions ?

2006-08-21 Thread Michele Petrazzo
Bror Johansson wrote: > Is there somewhere some Python-module that can be used for adding > EXIF-info to JPEG files? > > (Modules for extraction of EXIF-data are easily found, but lacks - as > I see it - capacity to add new tags.) > Hi, this is a feature that I want to add to FreeImagePy. It's n

Re: Python and STL efficiency

2006-08-21 Thread Tim N. van der Leeuw
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Tim N. van der > Leeuw wrote: > > > (your C++ code contains some C#-isms, such as omitting the '.h' in the > > include <> statements). > > That's no C#-ism, that's C++. The standard C++ header names don't have a > trailing '.h'. ``gcc`` p

Loading module via full path

2006-08-21 Thread Andre Poenitz
Hi all. Is there a way to load a module given a full path to the module without extending sys.path first? Andre' -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions on exceptions

2006-08-21 Thread Steven D'Aprano
On Mon, 21 Aug 2006 00:40:14 -0700, sc_wizard29 wrote: > Hi everyone, > > I've just finished studying O'Reilly's "Learning python" and since I > come from the Java world, there are some things that bother me > concerning python's exception handling. > > In Java, all methods must declare the exce

Re: Stack trace in C

2006-08-21 Thread Andre Poenitz
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 25 Jul 2006 14:20:41 +0200, Andre Poenitz <[EMAIL PROTECTED]> wrote: >> >> >>Bear with me - I am new to Python. (And redirect me to a more suitable >>newsgroup in case this one is not appropriate.) >> >>I am trying to embed Python into a C++

Re: Stack trace in C

2006-08-21 Thread Andre Poenitz
Just <[EMAIL PROTECTED]> wrote: > >> On Tue, 25 Jul 2006 14:20:41 +0200, Andre Poenitz wrote: >> > >> > >> >Bear with me - I am new to Python. (And redirect me to a more suitable >> >newsgroup in case this one is not appropriate.) >> > >> >I am trying to embed Python into a C++ application and wa

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread [EMAIL PROTECTED]
As you mention, wether the methods take arguments or not is something to have into account. And they do take arguments, and a variable number of them, so AFAIK hooking with __getattr__ or __getattribute__ will not work, as you can only get the method name with that. I was thinking of some __call__

Detect current virtual desktop

2006-08-21 Thread Maciej Bliziński
Hello Pythonists, I'd like to write for myself a tiny program that counts time spent on each virtual desktop (in GNOME). In order to do that, I need my program to detect the current virtual desktop. I've googled for it for about one hour and couldn't find any solution. The closest thing I found is

Re: Python and STL efficiency

2006-08-21 Thread Fredrik Lundh
Licheng Fang wrote: > I was using VC++.net and IDLE, respectively. I had expected C++ to be > way faster. However, while the python code gave the result almost > instantly, the C++ code took several seconds to run! Can somebody > explain this to me? Or is there something wrong with my code? in th

Re: sum and strings

2006-08-21 Thread Steven D'Aprano
On Fri, 18 Aug 2006 19:08:37 -0700, Paul Rubin wrote: > If the args are strings, the above is a quadratic time algorithm and > it's better to throw an error than create such a trap for an unwary user. That's a nonsense argument. There is no shortage of slow algorithms, and some of them are built

Re: Python and STL efficiency

2006-08-21 Thread Ray
How did you compile the C++ executable? I assume that it is Release mode? Then are the optimization switches enabled? Is it compiled as Native Win32 or Managed application? I suspect that other than what other posters have suggested about your code, the difference in speed is due to the way you bu

Re: Python and STL efficiency

2006-08-21 Thread Peter Otten
Licheng Fang wrote: > Hi, I'm learning STL and I wrote some simple code to compare the > efficiency of python and STL. > I was using VC++.net and IDLE, respectively. I had expected C++ to be > way faster. However, while the python code gave the result almost > instantly, the C++ code took several

Re: What do you want in a new web framework?

2006-08-21 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Now, I'm working on a new web framework. I tried many test on the other > programming languages. Then i decided to use python on my web framework > project. > > Now i want to listen all of you. What do you want in that web > framework(Easy use of Database, Easy use of X

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > And they do take arguments, and a variable number of them, so AFAIK > hooking with __getattr__ or __getattribute__ will not work, as you can > only get the method name with that. why not just return the bound method *object* (a callable), and let the caller call that a

Py_BuildValue("I", ...) does not work

2006-08-21 Thread Martin Kulas
Hallo! I have a problem with Py_BuildValue: I want to convert an unsigned int to a PyObject *. http://docs.python.org/api/arg-parsing.html says that I can use "I" as a format string. But it does not work :-\ Here is my simplified code: $ cat -n mini.c 1 #include 2 3 static

Regular Expression question

2006-08-21 Thread stevebread
Hi, I am having some difficulty trying to create a regular expression. Consider: Whenever a tag1 is followed by a tag 2, I want to retrieve the values of the tag1:name and tag2:value attributes. So my end result here should be john, tall jack, short My low quality regexp re.compile('tag1

Re: sum and strings

2006-08-21 Thread Georg Brandl
Steven D'Aprano wrote: > On Fri, 18 Aug 2006 19:08:37 -0700, Paul Rubin wrote: > >> If the args are strings, the above is a quadratic time algorithm and >> it's better to throw an error than create such a trap for an unwary user. > > That's a nonsense argument. There is no shortage of slow algori

Re: Input from the same file as the script

2006-08-21 Thread ZeD
Dennis Lee Bieber wrote: >> Can the input to the python script be given from the same file as the >> script itself. e.g., when we execute a python script with the command >> 'python > > Redirecting? Ugh... > > Off-hand, I'd say NO > > There is no way to tell the python interpreter where the pro

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi, I am having some difficulty trying to create a regular expression. > > Consider: > > > > > > > Whenever a tag1 is followed by a tag 2, I want to retrieve the values > of the tag1:name and tag2:value attributes. So my end result here > should be > john, tall >

Re: Small Troll on notation of variables over time

2006-08-21 Thread Jeremy Sanders
Hendrik van Rooyen wrote: > What do you guys think? You could get something similar using an object, such as class Hist(object): def __init__(self): self.vals = [None] def __call__(self, index=-1): return self.vals[index] def set(self, val): self.vals.appen

Re: What do you want in a new web framework?

2006-08-21 Thread Paul Boddie
Marc 'BlackJack' Rintsch wrote: > emrahayanoglu wrote: > > > > Now i want to listen all of you. What do you want in that web > > framework(Easy use of Database, Easy use of XML, GUI Designer, etc...)? > > Don't think that yet another Python web framework is really needed. Why not? I know that some

Re: Regular Expression question

2006-08-21 Thread stevebread
Thanks, i just tried it but I got the same result. I've been thinking about it for a few hours now and the problem with this approach is that the .*? before the (?=tag2) may have matched a tag1 and i don't know how to detect it. And even if I could, how would I make the search reset its start pos

Re: sum and strings

2006-08-21 Thread Fredrik Lundh
Alex Martelli wrote: > In terms of performance, however, the simple loop that you (rhamph) > posted is generally best -- e.g., with Python 2.5c1 on a MacbookPro: > > brain:~/downloads alex$ python -mtimeit -s'deep=[range(9)]*9' > 's=sum(deep,[])' > 10 loops, best of 3: 11.2 usec per loop > >

Re: Regular Expression question

2006-08-21 Thread bearophileHUGS
I am not expert of REs yet, this my first possible solution: import re txt = """ """ tfinder = r"""<# The opening < the tag to find \s* # Possible space or newline (tag[12]) # First subgroup, the identifier, tag1 or tag2

Re: Detect current virtual desktop

2006-08-21 Thread Harald Karner
Maciej Bliziński wrote: > How to detect current virtual desktop in GNOME? How to detect a virtual > desktop change? > Take a look at http://wallpapoz.sourceforge.net/ Harald -- http://mail.python.org/mailman/listinfo/python-list

Re: sum and strings

2006-08-21 Thread Fredrik Lundh
Steven D'Aprano wrote: > That's a nonsense argument. There is no shortage of slow algorithms, and > some of them are built into Python. When did O(n**2) become an error > condition? And overhead matters: if I'm only doing a few concatenations, > it is significantly faster to add the strings using

Re: Small Troll on notation of variables over time

2006-08-21 Thread Piet van Oostrum
You are about 7 months early. -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Thanks, i just tried it but I got the same result. > > I've been thinking about it for a few hours now and the problem with > this approach is that the .*? before the (?=tag2) may have matched a > tag1 and i don't know how to detect it. Maybe like this: 'tag1.+?name="(.

Re: Regular Expression question

2006-08-21 Thread stevebread
got zero results on this one :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression question

2006-08-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Hi, I am having some difficulty trying to create a regular expression. > > Consider: > > > > > > > Whenever a tag1 is followed by a tag 2, I want to retrieve the values > of the tag1:name and tag2:value attributes. So my end result here > should be > john, tal

Re: Python for EXIF-info-additions ?

2006-08-21 Thread Bruno Dilly
I think you can find what do you need into this repository, it's a creative commons tool: https://svn.berlios.de/svnroot/repos/cctools/publisher/branches/flickr-storage-branch/ take a look in the follow directory: ccpublisher/jpeg/ I'm not sure if it's what you want, let me know. See you, Dilly

RE: how to use python com server in c++?

2006-08-21 Thread Stefan Schukat
Hello, you have to use the low level API methods for access and then the methods of IDispatch since the win32com gateway only supports late bound calls for dispatch interfaces. e.g. IDispatch* pDisp; CoCreateInstance( ... CLSID_Leelay, , IID_IDispatch, ...&pDisp);

Re:

2006-08-21 Thread Keith Perkins
wrote: > Hi guys, > > we are looking for a python developer for a European project. This > project is multilangual and free it is called EuroCv and it need a > module for exporting data in PDF. As web developer I try to create this > module but It's too complicate for me. Check out the service >

IDLE with python 2.5

2006-08-21 Thread eastier
Hi, I've just read in Python 2.5 description that IDLE 'executes code in a separate process', using a TCP connection on port 127.0.0.1 to communicate. Does it mean that we can now debug embedded python with IDLE ? Thanks for any feedback, Emmanuel -- http://mail.python.org/mailman/listinfo/

Re: Regular Expression question

2006-08-21 Thread Paddy
[EMAIL PROTECTED] wrote: > Hi, I am having some difficulty trying to create a regular expression. Steve, I find this tool is great for debugging regular expressions. http://kodos.sourceforge.net/ Just put some sample text in one window, your trial RE in another, and Kodos displays a wealth of

Re: Python and STL efficiency

2006-08-21 Thread Ray
Fredrik Lundh wrote: > in the Python example, the four strings in your example are shared, so > you're basically copying 4 pointers to the list. > > in the C++ example, you're creating 4 string objects. > > In which case, Licheng, you should try using the /GF switch. This will tell Micros

Re: What do you want in a new web framework?

2006-08-21 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Hello Everyone, > > Now, I'm working on a new web framework. I tried many test on the other > programming languages. Then i decided to use python on my web framework > project. > > Now i want to listen all of you. What do you want in that web > framework(Easy use of Data

Re: text editor suggestion?

2006-08-21 Thread Roberto Bonvallet
John Salerno wrote: > I'd really like to learn vim, but I spent days just trying to figure out > how to get the syntax highlighting and indentation working, where these > settings are and how to edit them, and it still doesn't work for me. It > just feels so insurmountable that I can't even star

Re: Python for EXIF-info-additions ?

2006-08-21 Thread Michele Petrazzo
Bruno Dilly wrote: > I think you can find what do you need into this repository, it's a > creative commons tool: > https://svn.berlios.de/svnroot/repos/cctools/publisher/branches/flickr-storage-branch/ > > > > > take a look in the follow directory: ccpublisher/jpeg/ > > I'm not sure if it's

Re: Python and STL efficiency

2006-08-21 Thread Fredrik Lundh
Ray wrote: >> in the C++ example, you're creating 4 string objects. > > In which case, Licheng, you should try using the /GF switch. This will > tell Microsoft C++ compiler to pool identical string literals together. in what way does that change the implementation of C++'s string type ? -

Re: Py_BuildValue("I", ...) does not work

2006-08-21 Thread Nick Craig-Wood
Martin Kulas <[EMAIL PROTECTED]> wrote: > I have a problem with Py_BuildValue: I want to convert an unsigned int > to a PyObject *. > http://docs.python.org/api/arg-parsing.html says that I can use > "I" as a format string. > But it does not work :-\ I tried your examples under linux. It fai

Re: MS SQL Server: NT Authentication. Possible?

2006-08-21 Thread Dirk Hagemann
> > import adodbapi > > db = adodbapi.connect ("Provider=sqloledb;Data Source=VODEV1;Initial > Catalog=EVOBACK;Integrated Security=SSPI;") > q = db.cursor () > q.execute ("SELECT SYSTEM_USER") > print q.fetchone () > q.close () > > Cool! That works :-) Thanks a lot (again) Tim! Have a great we

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread Tim N. van der Leeuw
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > And they do take arguments, and a variable number of them, so AFAIK > > hooking with __getattr__ or __getattribute__ will not work, as you can > > only get the method name with that. > > why not just return the bound method *object* (a callable

Re: Python and STL efficiency

2006-08-21 Thread Tim N. van der Leeuw
Ray wrote: > Fredrik Lundh wrote: > > in the Python example, the four strings in your example are shared, so > > you're basically copying 4 pointers to the list. > > > > in the C++ example, you're creating 4 string objects. > > > > > > In which case, Licheng, you should try using the /GF

Re: Disable close button in management window.(KDE- pyQT)

2006-08-21 Thread Gabriel - BR
HI, I am talking about the close button "X", that appears when I execute my application (pyQt), in kde. Thanks.. David Boddie escreveu: > Gabriel - BR wrote: > > Hi,,, > > Is possible disable the close button in KDE management window? Using > > python+qt? > > Can you say exactly which window

Re: Python and STL efficiency

2006-08-21 Thread Jeremy Sanders
Licheng Fang wrote: > I was using VC++.net and IDLE, respectively. I had expected C++ to be > way faster. However, while the python code gave the result almost > instantly, the C++ code took several seconds to run! Can somebody > explain this to me? Or is there something wrong with my code? It mu

Re: Python and STL efficiency

2006-08-21 Thread Christophe
Jeremy Sanders a écrit : > Licheng Fang wrote: > >> I was using VC++.net and IDLE, respectively. I had expected C++ to be >> way faster. However, while the python code gave the result almost >> instantly, the C++ code took several seconds to run! Can somebody >> explain this to me? Or is there som

Re: Python and STL efficiency

2006-08-21 Thread Tim N. van der Leeuw
Tim N. van der Leeuw wrote: > Ray wrote: > > Fredrik Lundh wrote: > > > in the Python example, the four strings in your example are shared, so > > > you're basically copying 4 pointers to the list. > > > > > > in the C++ example, you're creating 4 string objects. > > > > > > > > > > In wh

Modules... paths... newbie confusion

2006-08-21 Thread MrBlueSky
I wonder if someone could clarify how Python "knows" where modules are - or at least point to some documentation that might help me? Here's what I've been trying: I've installed Python 2.4 Windows, and have also installed tkinter, pmw, cx_Oracle, mssql and pytz (phew!) all under my c:\python24 fo

Re: Small Troll on notation of variables over time

2006-08-21 Thread Hendrik van Rooyen
"Piet van Oostrum" <[EMAIL PROTECTED]> Wrote: | You are about 7 months early. | -- Am I? - Early for what - a seven months premature baby is small indeed... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Small Troll on notation of variables over time

2006-08-21 Thread Hendrik van Rooyen
"Jeremy Sanders" <[EMAIL PROTECTED]> wrote: | Hendrik van Rooyen wrote: | | > What do you guys think? | | You could get something similar using an object, such as | | class Hist(object): | | def __init__(self): | self.vals = [None] | | def __call__(self, index=-1): | r

Re: Regular Expression question

2006-08-21 Thread Neil Cerutti
On 2006-08-21, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, I am having some difficulty trying to create a regular expression. > > Consider: > > > > > > > Whenever a tag1 is followed by a tag 2, I want to retrieve the > values of the tag1:name and tag2:value attributes. So my end > result

Re: What do you want in a new web framework?

2006-08-21 Thread BJörn Lindqvist
On 8/20/06, Dave Richards <[EMAIL PROTECTED]> wrote: > Really, really good documentation. > > Dave ... Which is the one thing no Python web framework provides. :( A framework with really good documentation (preferably translated into multiple languages) would be, I'm sure, the PHP/Ruby on Rails ki

Re: Regular Expression question

2006-08-21 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, I am having some difficulty trying to create a regular expression. > > Consider: > > > > > > > Whenever a tag1 is followed by a tag 2, I want to retrieve the values > of the tag1:name and tag2:value attributes. So my end resul

Problem of function calls from map()

2006-08-21 Thread Dasn
Hi, there. 'lines' is a large list of strings each of which is seperated by '\t' >>> lines = ['bla\tbla\tblah', 'bh\tb\tb', ... ] I wanna split each string into a list. For speed, using map() instead of 'for' loop. 'map(str.split, lines)' works fine , but... when I was trying: >>> l = map(str.

Re: MS SQL Server: NT Authentication. Possible?

2006-08-21 Thread Dirk Hagemann
Very strange. It works when I directly run the script, but when I use this script as a CGI-script on a webserver, I get this error: File "D:\Web\test\adodbapi.py", line 224, in connect raise DatabaseError(e) adodbapi.DatabaseError: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB Provider

Dynamic RadioButton creation with Python + Qt

2006-08-21 Thread Wagner Garcia Campagner
Hello, I'm trying to create dynamic RadioButton as follows: for i in out.keys(): msg = "radioButton_" + str(i) msg2 = 20 * x msg = QRadioButton(self.buttonGroup_interfaces, msg) msg.setGeometry(QRect(30,msg2,121,23)) msg.setTect(i) x += 1 The problem is that Python is cre

Re: Modules... paths... newbie confusion

2006-08-21 Thread Licheng Fang
MrBlueSky wrote: > I wonder if someone could clarify how Python "knows" where modules are > - or at least point to some documentation that might help me? Here's > what I've been trying: > > I've installed Python 2.4 Windows, and have also installed tkinter, > pmw, cx_Oracle, mssql and pytz (phew!

Re: Problem of function calls from map()

2006-08-21 Thread Tim Lesher
Dasn wrote: > So how to put '\t' argument to split() in map() ? How much is the lambda costing you, according to your profiler? Anyway, what you really want is a list comprehension: l = [line.split('\t') for line in lines] -- http://mail.python.org/mailman/listinfo/python-list

Re: write eof without closing

2006-08-21 Thread Grant Edwards
On 2006-08-21, Alex Martelli <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> wrote: >... >> IIRC, ctrl-Z is not used _in_files_ to represent EOF. Only >> when text is being entered at the console. > > Easy to test, if you have Windows: I might, but I won't admit it in public. :

Re: Dynamic RadioButton creation with Python + Qt

2006-08-21 Thread Fredrik Lundh
Wagner Garcia Campagner wrote: > I'm trying to create dynamic RadioButton as follows: > > for i in out.keys(): > msg = "radioButton_" + str(i) > msg2 = 20 * x > msg = QRadioButton(self.buttonGroup_interfaces, msg) > msg.setGeometry(QRect(30,msg2,121,23)) > msg.setTect(i) >

How to decode a string

2006-08-21 Thread Lad
To be able to decode a string successfully, I need to know what coding it is in. The string can be coded in utf8 or in windows-1250 or in another coding. Is there a method how to find out the string coding. Thank you for help L. -- http://mail.python.org/mailman/listinfo/python-list

Re: permanent tempfile?

2006-08-21 Thread skip
Colin> I am trying to create a temp file, however the file that is Colin> created is still there after the program has completed. Why is Colin> this so? After you call os.remove(filename) it's still there? My version of your script works for me: import tempfile, os filenam

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > got zero results on this one :) Really? >>> s = ''' ''' >>> pat = re.compile('tag1.+?name="(.+?)".*?(?:<)(?=tag2).*?="adj__(.*?)__', >>> re.DOTALL) >>> m = re.findall(pat, s) >>> m [('john', 'tall'), ('joe', 'short')] Regards, Rob -- http://mail.python.org/m

Re: Modules... paths... newbie confusion

2006-08-21 Thread Sibylle Koczian
MrBlueSky schrieb: > I wonder if someone could clarify how Python "knows" where modules are > - or at least point to some documentation that might help me? Here's > what I've been trying: > > I've installed Python 2.4 Windows, and have also installed tkinter, > pmw, cx_Oracle, mssql and pytz (phe

Re: Problem of function calls from map()

2006-08-21 Thread Diez B. Roggisch
Dasn wrote: > > Hi, there. > > 'lines' is a large list of strings each of which is seperated by '\t' lines = ['bla\tbla\tblah', 'bh\tb\tb', ... ] > > I wanna split each string into a list. For speed, using map() instead > of 'for' loop. 'map(str.split, lines)' works fine , but... > when I

Re: istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-21 Thread Neil Cerutti
On 2006-08-19, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > unexpected wrote: >> If have a list from 1 to 100, what's the easiest, most elegant >> way to print them out, so that there are only n elements per >> line. > > I've run into this problem a few times, and although many > solutions have been

Re: How to decode a string

2006-08-21 Thread Fredrik Lundh
Lad wrote: > To be able to decode a string successfully, I need to know what coding > it is in. ask whoever provided the string. > The string can be coded in utf8 or in windows-1250 or in another > coding. Is there a method how to find out the string coding. in general, no. if you have enough

Re: Dynamic RadioButton creation with Python + Qt

2006-08-21 Thread Wagner Garcia Campagner
Thanks Fredrik, Your suggestion solved my problems! Thanks, Wagner. >From: Fredrik Lundh <[EMAIL PROTECTED]> >To: [email protected] >Subject: Re: Dynamic RadioButton creation with Python + Qt >Date: Mon, 21 Aug 2006 16:20:09 +0200 > >Wagner Garcia Campagner wrote: > > > I'm trying

Re: Re:

2006-08-21 Thread Perseo
Hi Keith Perkins Yes of course but we are looking for a developer who help us too. Keith Perkins wrote: > wrote: > > Hi guys, > > > > we are looking for a python developer for a European project. This > > project is multilangual and free it is called EuroCv and it need a > > module for exporting d

Python Syntax Highlighting Module

2006-08-21 Thread frikker
Hello, I have an idea for a project which involves an editor that supports syntax highlighting. This would be for any language, particularly php, html, css, etc. I would like to write this program using python. It would only make sense to base this upon existing open source code. My question is

Re: Create a Multilanguage PDF in Python

2006-08-21 Thread Perseo
I can't upload in the PYTHONPATH but in a normal folder of our site. Exist another way to do it? Thanks Rob Wolfe wrote: > Perseo wrote: > > Hi again, > > > > WORKS!!! I download all I need as python + reportlab. Only 2 questions: > > > > 1. I need all of this package? because it is 6Mb! > > I'm a

Re: Need advice on how to improve this function

2006-08-21 Thread Larry Bates
Matthew Wilson wrote: > I wrote a function that converts a tuple of tuples into html. For > example: > > In [9]: x > Out[9]: > ('html', > ('head', ('title', 'this is the title!')), > ('body', > ('h1', 'this is the header!'), > ('p', 'paragraph one is boring.'), >

Re: Python Syntax Highlighting Module

2006-08-21 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Hello, > I have an idea for a project which involves an editor that supports > syntax highlighting. This would be for any language, particularly php, > html, css, etc. I would like to write this program using python. It > would only make sense to base this upon existin

Re: uploading files to file system/zipping/downloading problems

2006-08-21 Thread Larry Bates
OriginalBrownster wrote: > I am currently uploading a file from a users computer to the file > system on my server using python, just reading the file and writing the > binaries. > > total_data=' ' > while True: > data = upload_file.file.read(8192) > if not

Re: What do you want in a new web framework?

2006-08-21 Thread hardemr
Hello Everyone, I've just read all of the answers. Most of yours said that there are many web frameworks ,so it is nonsense to make a new web framework in python. Now I'm using and testing all of the frameworks in python also asp.net, jsp and java servlet, perl web frameworks and ruby on rails.

Re: Python Syntax Highlighting Module

2006-08-21 Thread gene tani
[EMAIL PROTECTED] wrote: > Hello, > I have an idea for a project which involves an editor that supports > syntax highlighting. This would be for any language, particularly php, > html, css, etc. I would like to write this program using python. It > would only make sense to base this upon existi

Re: Need advice on how to improve this function

2006-08-21 Thread Fredrik Lundh
Matthew Wilson wrote: > I'd like to know ways to make it better (more efficient, able to deal > with enormous-size arguments, etc). How would I write this as a > generator? what makes you think that a generator would be the right tool for this task? what's the use case? (btw, generating "enor

Re: Loading module via full path

2006-08-21 Thread Gary Herron
Andre Poenitz wrote: > Hi all. > > Is there a way to load a module given a full path to the module > without extending sys.path first? > > Andre' > > The standard module named "imp" can help you with this. Gary Herron -- http://mail.python.org/mailman/listinfo/python-list

wxPython getPosition() limit

2006-08-21 Thread mardif
Hi, I've this big problem: I've an wx.ScrolledWindow object, which contains element. These elements have the event OnPaint that draw itself same objects. For drawing, each element call the method GetPosition(), which returns a tuple int. But, if I have the element 5000 that it must be design

wxPython getPosition() limit

2006-08-21 Thread mardif
Hi, I've this big problem: I've an wx.ScrolledWindow object, which contains element. These elements have the event OnPaint that draw itself same objects. For drawing, each element call the method GetPosition(), which returns a tuple int. But, if I have the element 5000 that it must be design

  1   2   >