SQLObject 0.7.8

2007-07-27 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.7.8 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

ceODBC 1.0

2007-07-27 Thread Anthony Tuininga
What is ceODBC? ceODBC is a Python extension module that enables access to databases using the ODBC API and conforms to the Python database API 2.0 specifications with a few exceptions. I have tested this on Windows against SQL Server, Access and Oracle. On Linux I have tested this against

ANN: cssutils 0.9.2b1

2007-07-27 Thread Chris
what is it -- A Python package to parse and build CSS Cascading Style Sheets. Partly implements the DOM Level 2 Style Stylesheets and CSS interfaces. An implementation of the WD CSS Module: Namespaces which has no official DOM yet is included from v0.9.1. changes since 0.9.1

SQLObject 0.8.5

2007-07-27 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.5 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

ANN: New ShowMeDo video - Learn Django: Create a Wiki in 20 minutes

2007-07-27 Thread Ian Ozsvald
Summary: In 20 minutes learn how to write a working Wiki with Django from a fresh install. Video by Siddhi. http://showmedo.com/videos/video?name=110fromSeriesID=110 Detail: In this tutorial, I introduce the basics of Django by walking you through the development of a simple wiki

Re: C API -- Two questions

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 00:34:22 +, beginner wrote: 2) How can I make the arguments less picky without writing a lot of type conversion code? My function really needs a tuple as its argument. For example, f( (1,2,3) ) would work. However, in order to make it easy to use, I am thinking that it

Re: zip() function troubles

2007-07-27 Thread Terry Reedy
Istvan Albert [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] || if you try it yourself you'll see that it is very easy to generate 10 | million tuples, No it is not on most machines. | on my system it takes 3 (!!!) seconds to do the following: | | size = 10**7 | data = [] | for i

Re: zip() function troubles

2007-07-27 Thread Paul Rubin
Peter Otten [EMAIL PROTECTED] writes: When you are allocating a lot of objects without releasing them the garbage collector kicks in to look for cycles. Try switching it off: I think that is the answer. The zip took almost 2 minutes without turning gc off, but takes 1.25 seconds with gc off.

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Stefan Behnel
Stefan Scholl wrote: Stefan Behnel [EMAIL PROTECTED] wrote: The XML is *not* well-formed if you pass Python unicode instead of a byte encoded string. Read the XML spec. Pointers, please. There you have it: http://www.w3.org/TR/xml/#charencoding In the absence of information provided by

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 06:47:48 +0200, Stefan Scholl wrote: Chris Mellon [EMAIL PROTECTED] wrote: XML is not a string. It's a specific type of bytestream. If you want to work with XML, then generate well-formed XML in the correct encoding. There's no reason you should have an XML document (as

Re: generating objects of a type from a name.

2007-07-27 Thread chris . lyon
On Jul 27, 1:59 am, tsuraan [EMAIL PROTECTED] wrote: I'm not sure what a visual object is, but to create an instance of an object whose name is known, you can use eval: oname = 'list' obj = eval(oname)() obj [] type(obj) type 'list' Hope that helps! On 26/07/07, [EMAIL PROTECTED]

Re: generating objects of a type from a name.

2007-07-27 Thread Bruno Desthuilliers
tsuraan a écrit : I'm not sure what a visual object is, but to create an instance of an object whose name is known, you can use eval: Better to use getattr(module, classname), or locals().get(classname), or globals().get(classname). oname = 'list' obj = eval(oname)() obj [] type(obj)

Re: generating objects of a type from a name.

2007-07-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Jul 27, 1:59 am, tsuraan [EMAIL PROTECTED] wrote: I'm not sure what a visual object is, but to create an instance of an object whose name is known, you can use eval: oname = 'list' obj = eval(oname)() obj [] type(obj) type 'list' Hope that helps! (snip)

vs !=

2007-07-27 Thread James Matthews
Dear Lists What is the difference between and != Thank You James -- http://www.goldwatches.com/watches.asp?brand=55 http://www.jewelerslounge.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickled objects over the network

2007-07-27 Thread Hendrik van Rooyen
Paul Rubin http://p...AM.invalidwrote: Hendrik van Rooyen ma...rocorp.co.za writes: But more seriously - is there any need for a simple serialiser that will be able to be used to transfer a subset of the built in types over an open network in a safe manner, for the transfer of things

Problem with authentification

2007-07-27 Thread Mykle
Hi, I'm french so I apologize for mistakes I'm about to make in english... I installed Paramiko on a Debian Server for making connections with an SSH Server and here's my issue: I create a transport connection with the server for getting files from it. The server asks an authentification but the

Factory pattern again

2007-07-27 Thread Mike Howarth
Hi I was wondering whether anyone could help me, I'm pretty new to python coming from a PHP background and I'm having a few products in getting my head round how to write the factory pattern within python. I'm currently looking to try to return values from a db and load up the relevant

Re: Factory pattern again

2007-07-27 Thread Mike Howarth
Thanks that makes absolute sense. I was sure it was something simple, thanks for your time. Bruno Desthuilliers-5 wrote: Mike Howarth a écrit : Hi I was wondering whether anyone could help me, I'm pretty new to python coming from a PHP background and I'm having a few products in

Re: Filtering content of a text file

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 02:28:27 -0700, Ira.Kovac wrote: I am working with 30K+ record datasets in flat file format (.txt) that look like this: //-+alibaba sinage //-+amra damian//_9 //-+anix anire//_ //-+borom //-+bokima sun drane //-+ciren //-+cop calestieon eded //-+ciciban //-+drago

Re: Filtering content of a text file

2007-07-27 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : On Fri, 27 Jul 2007 12:15:25 +0200, Bruno Desthuilliers wrote: 4/ print //-+alibaba sinage[4:].startswith('a') print //-+alibaba sinage.startswith('a', 4) This does not create an extra string from the slicing. One learns everyday... Thanks Marc. --

[python-list] pdf read write

2007-07-27 Thread Hyunchul Kim
Dear all, How can I read a pdf file and add invisible comment? I want to make a script which read a pdf file and add tags inside the file invisibly. Then, I will make a script for managing tags of given pdf files. I know referencer can manage tags for pdf file but it seems store tag information

Re: zip() function troubles

2007-07-27 Thread Istvan Albert
On Jul 27, 2:16 am, Terry Reedy [EMAIL PROTECTED] wrote: References are not objects. yes this a valid objection, but in all fairness the example in the original post operates on comparably sized objects and also exhibited unexpected performance degradation as it turns out the garbage

Wikicodia - The code snippets wiki

2007-07-27 Thread Wikicodia Admin
Dears, Wikicodia is a wiki based project for sharing code snippets. We're collecting large number of code snippets for all code-based programming languages, scripts, shells and consoles. We wish you could help us. We're still BETA. Your suggestions, ideas and criticisms are very welcomed. We're

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Chris Mellon
On 7/26/07, Stefan Scholl [EMAIL PROTECTED] wrote: Chris Mellon [EMAIL PROTECTED] wrote: XML is not a string. It's a specific type of bytestream. If you want to work with XML, then generate well-formed XML in the correct encoding. There's no reason you should have an XML document (as

Internet surveying with EZquestionnaire

2007-07-27 Thread [EMAIL PROTECTED]
Hi , Hope you are doing great. Recently I needed to conduct a survey on Employee Satisfaction at the work place to design an employee retention program. I was searching on the net for help on conducting surveys and I came across www.ezqustionnaire.com They had a survey template on employee

Re: pyparser and recursion problem

2007-07-27 Thread Paul McGuire
On Jul 26, 10:40 pm, [EMAIL PROTECTED] wrote: Hey, Thanks Neil and Paul! After reading Neil's advice I started playing around with the setParseAction method, and then I found Paul's script 'macroExpander.py' (http://pyparsing.wikispaces.com/space/showimage/ macroExpander.py). snip Great!

Re: vs !=

2007-07-27 Thread Terry Reedy
Simon Brunning [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | On 7/26/07, James Matthews [EMAIL PROTECTED] wrote: | What is the difference between and != | | is deprecated, != isn't. Other than that, nothing AFAIK. And will disappear in 3.0. --

Re: Another C API Question

2007-07-27 Thread beginner
Hi Farshid, On Jul 26, 8:18 pm, Farshid Lashkari [EMAIL PROTECTED] wrote: beginner wrote: I know obj is a number, but I do not know the exact type. How can I convert it to double without writing a giant switch() that exhausts every single type of number? Try using the

Re: Another C API Question

2007-07-27 Thread beginner
Hi Robert, On Jul 26, 8:16 pm, Robert Kern [EMAIL PROTECTED] wrote: beginner wrote: Hi, I run into another C API question. What is the simplest way to convert an PyObject into a double? For example, I have PyObject *obj; I know obj is a number, but I do not know the exact type.

Re: Submit form, open result in a browser

2007-07-27 Thread Cameron Laird
In article [EMAIL PROTECTED], Tina I [EMAIL PROTECTED] wrote: theju wrote: Is there a way to submit a form and then open the resulting page in the default browser? (Writing the form submission code is not a problem by the way) There is a library called Client Form that does this for you.

[python-list] pdf read write

2007-07-27 Thread Hyunchul Kim
Dear all, How can I read a pdf file and add invisible comment? I want to make a script which read a pdf file and add tags inside the file invisibly. Then, I will make a script for managing tags of given pdf files. I know referencer can manage tags for pdf file but it seems store tag information

Re: vs !=

2007-07-27 Thread Paul McGuire
On Jul 27, 7:35 am, Neil Cerutti [EMAIL PROTECTED] wrote: I like 'not ==', cf 'not in'. Sadly it's a syntax error. However, as a language designer, I'm not Guido. I'd settle for == Guido myself. :) -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile python with Mingw

2007-07-27 Thread Ninereeds
Steve Holden wrote: You are wrong about the compatibility. You can't compile a library with VC 2005 and run it with a Python compiled with VC 2003. OK, my bad - sorry about that red herring. -- http://mail.python.org/mailman/listinfo/python-list

Re: Filtering content of a text file

2007-07-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: I'd greatly appreciate if you can take a look at the task I need help with. It'd be outstanding if someone can provide some sample Python code. Sure. CP: An inch of time is an inch of gold but you can't buy that inch of time with an inch of gold. So, how much

Re: Compile python with Mingw

2007-07-27 Thread iwinux
[EMAIL PROTECTED] 写道: Hi all, I was trying to build pymol with mingw on my windows box, but during the compilation it said that my python.exe was built with VS2003, and in order to build compatible binary executable file, I have to build pymol with VS2003. I don't have VS2003, so I think

Re: vs !=

2007-07-27 Thread Neil Cerutti
On 2007-07-27, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I believe Guido doesn't like '' and decided to enforce != instead. Guess it's his language :). I like 'not ==', cf 'not in'. Sadly it's a syntax error. However, as a language designer, I'm not Guido. -- Neil Cerutti I don't know what

Re: Filtering content of a text file

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 12:15:25 +0200, Bruno Desthuilliers wrote: 4/ print //-+alibaba sinage[4:].startswith('a') print //-+alibaba sinage.startswith('a', 4) This does not create an extra string from the slicing. Ciao, Marc 'BlackJack' Rintsch --

Re: [python-list] pdf read write

2007-07-27 Thread David Boddie
On Fri Jul 27 15:35:02 CEST 2007, Hyunchul Kim wrote: How can I read a pdf file and add invisible comment? I want to make a script which read a pdf file and add tags inside the file invisibly. Then, I will make a script for managing tags of given pdf files. I know referencer can manage

Re: Why is for line in f faster than readline()

2007-07-27 Thread Duncan Booth
Alexandre Ferrieux [EMAIL PROTECTED] wrote: Now, *why* is such buffering gaining speed over stdio's fgets(), which already does input buffering (though in a more subtle way, which makes it still usable with pipes etc.) ? Because the C runtime library has different constraints than Python's

Re: cls self

2007-07-27 Thread Chris Mellon
On 7/27/07, Diez B. Roggisch [EMAIL PROTECTED] wrote: james_027 schrieb: hi, is cls self the same thing? I have seen something like class A: def dosomething(cls): #doing something How is cls self differ? How is it use? cls and self are just names. And you most

Re: vs !=

2007-07-27 Thread [EMAIL PROTECTED]
On Jul 27, 1:08 pm, Simon Brunning [EMAIL PROTECTED] wrote: On 7/26/07, James Matthews [EMAIL PROTECTED] wrote: What is the difference between and != is deprecated, != isn't. Other than that, nothing AFAIK. -- Cheers, Simon B. [EMAIL PROTECTED]://www.brunningonline.net/simon/blog/

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-27 Thread zentara
On Thu, 26 Jul 2007 09:38:34 -0700, Paul Boddie [EMAIL PROTECTED] wrote: zentara wrote: This is where the big boys play, you have to be able to be able to scuffle and take punishment if you are wrong or unduly ignorant. You also need to squash somehow who attacks you, when you know you are

Re: Factory pattern again

2007-07-27 Thread Mike Howarth
Having overcome my first hurdle with the factory pattern, I've now hit another stumbling block At the moment I'm trying to return around 2000 records from a db and load up the relevant product object, what I've found is this is running extremely slowly ( 20mins), the db is normalized and indexes

Imported globals?

2007-07-27 Thread Valentina Vaneeva
Hi, I'm new to Python and I've found something in its interpreter that I don't quite understand, and I don't really know how to correctly formulate a search query. Here's the question. If we have a file module_a.py with the following content: | #!/usr/bin/env python | | value =

Re: encode/decode misunderstanding

2007-07-27 Thread Tim Arnold
If I read in the latin1 file using codecs.open(filename,encoding='latin1') and write out the utf8 file by opening with codecs.open(othername,encoding='utf8'), would I no longer have a problem -- I could just read in latin1 and write out utf8 with no more worries about encoding? thanks,

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-27 Thread RedGrittyBrick
Paul Rubin wrote: M brad [EMAIL PROTECTED] writes: Out of the pan and into the fire. :) Welcome to the world of Ph.D's in Computer Science. You think the Perl guys have attitude, just wait and see what you're in for over here. I think you'll find attitudes in any programming language...

Re: SQLObject 0.7.8

2007-07-27 Thread george williams
- Original Message - From: Oleg Broytmann [EMAIL PROTECTED] To: Python Announce Mailing List [EMAIL PROTECTED]; Python Mailing List python-list@python.org Sent: Thursday, July 26, 2007 7:23 AM Subject: SQLObject 0.7.8 Hello! I'm pleased to announce the 0.7.8 release of SQLObject.

OOP in Python book?

2007-07-27 Thread Bill
Does anyone out there have any information about this book. It's listed on Amazon to be published in November of this year. A simple Google search (1st page only) doesn't show anything useful, and I can't find a reference on the web sites of the authors. Neither of the authors appears to be

Re: zip() function troubles

2007-07-27 Thread Chris Mellon
On 26 Jul 2007 23:35:44 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Peter Otten [EMAIL PROTECTED] writes: When you are allocating a lot of objects without releasing them the garbage collector kicks in to look for cycles. Try switching it off: I think that is the answer. The zip

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-27 Thread Danyelle Gragsone
Brad Wrote: In my experience, things have not changed at most PolySci Universities (Georgia Tech, NC State, Virginia Tech, etc). The Comp Engineering/CS/Math classes are still full of boys. Although there are some girls, but not a lot. If a girl is in the class (and that's a big if) no boy in the

Re: SQLObject 0.7.8

2007-07-27 Thread Oleg Broytmann
Hello! On Fri, Jul 27, 2007 at 08:21:00AM -0700, george williams wrote: - Original Message - And what is the question? Oleg. -- Oleg Broytmannhttp://phd.pp.ru/[EMAIL PROTECTED] Programmers don't die, they just GOSUB without RETURN. --

Re: Compile python with Mingw

2007-07-27 Thread Ninereeds
[EMAIL PROTECTED] wrote: I don't have VS2003, so I think I may compile both pymol and python with mingw. Sorry I can't help with mingw, but Microsoft has released a free version of VC2005, which should be binary compatible with VC2003, I'd have thought. Of course that means going through the

Re: Submit form, open result in a browser

2007-07-27 Thread Tina I
theju wrote: Is there a way to submit a form and then open the resulting page in the default browser? (Writing the form submission code is not a problem by the way) There is a library called Client Form that does this for you. wwwsearch.sourceforge.net/ClientForm/ After the form is

Re: Filtering content of a text file

2007-07-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hello All, I'd greatly appreciate if you can take a look at the task I need help with. It'd be outstanding if someone can provide some sample Python code. No problem. It's 600 euro per day. Do I send you the contract ?

Re: adding a docstring to an instancemethod

2007-07-27 Thread Gabriel Genellina
En Thu, 26 Jul 2007 14:48:12 -0300, jelle [EMAIL PROTECTED] escribió: Hi Gabriella, thanks for pointing me in the right direction: Twice in a week... I'll have to revise my own masculinity... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Compile python with Mingw

2007-07-27 Thread [EMAIL PROTECTED]
Hi all, I was trying to build pymol with mingw on my windows box, but during the compilation it said that my python.exe was built with VS2003, and in order to build compatible binary executable file, I have to build pymol with VS2003. I don't have VS2003, so I think I may compile both pymol and

Re: Comparing Dictionaries

2007-07-27 Thread Ali
On Jul 26, 10:18 pm, Kenneth Love [EMAIL PROTECTED] wrote: Hello, I am new to Python, but not programming. I would like to start my Python career by developing programs according to the best practices of the industry. Right now, that appears to be unit tests, patterns, and source code

Re: adding a docstring to an instancemethod

2007-07-27 Thread Neil Cerutti
On 2007-07-27, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 26 Jul 2007 14:48:12 -0300, jelle [EMAIL PROTECTED] escribió: Hi Gabriella, thanks for pointing me in the right direction: Twice in a week... I'll have to revise my own masculinity... The trumpet shall sound! -- Neil

Filtering content of a text file

2007-07-27 Thread Ira . Kovac
Hello All, I'd greatly appreciate if you can take a look at the task I need help with. It'd be outstanding if someone can provide some sample Python code. Thanks a lot, Ira --- Problem

Re: a simple string question

2007-07-27 Thread Zentrader
On Jul 27, 8:23 am, [EMAIL PROTECTED] wrote: Hello, I have one question about string.I am trying to make an function to analyze line of some text, this is my example: HELLO;HELLO2:WORLD:, if that function in this text find ; and : ( in this example will find both) e.g that function must

Submit form, open result in a browser

2007-07-27 Thread Tina I
Hi, Is there a way to submit a form and then open the resulting page in the default browser? (Writing the form submission code is not a problem by the way) I guess what I'm asking is how I can get the resulting URL and feed it to the webbrowser module. I need to do it this way because the site

Re: Submit form, open result in a browser

2007-07-27 Thread Diez B. Roggisch
Tina I schrieb: Hi, Is there a way to submit a form and then open the resulting page in the default browser? (Writing the form submission code is not a problem by the way) I guess what I'm asking is how I can get the resulting URL and feed it to the webbrowser module. I need to do it

Re: Submit form, open result in a browser

2007-07-27 Thread theju
Is there a way to submit a form and then open the resulting page in the default browser? (Writing the form submission code is not a problem by the way) There is a library called Client Form that does this for you. wwwsearch.sourceforge.net/ClientForm/ I guess what I'm asking is how I can get

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Stefan Scholl
Stefan Behnel [EMAIL PROTECTED] wrote: Stefan Scholl wrote: Stefan Behnel [EMAIL PROTECTED] wrote: The XML is *not* well-formed if you pass Python unicode instead of a byte encoded string. Read the XML spec. Pointers, please. There you have it: http://www.w3.org/TR/xml/#charencoding

Re: Factory pattern again

2007-07-27 Thread Bruno Desthuilliers
Mike Howarth a écrit : Hi I was wondering whether anyone could help me, I'm pretty new to python coming from a PHP background and I'm having a few products in getting my head round how to write the factory pattern within python. I'm currently looking to try to return values from a db and

Re: Another C API Question

2007-07-27 Thread Farshid Lashkari
beginner wrote: This works with PyFloat only. It does not work with integers. Did you try it out? I have used it on ints, bools, and objects that implement the __float__ method. It does not work on strings though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Stefan Scholl
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 27 Jul 2007 06:47:48 +0200, Stefan Scholl wrote: Chris Mellon [EMAIL PROTECTED] wrote: XML is not a string. It's a specific type of bytestream. If you want to work with XML, then generate well-formed XML in the correct encoding.

Re: Any reason why cStringIO in 2.5 behaves different from 2.4?

2007-07-27 Thread Stefan Behnel
Stefan Scholl schrieb: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Fri, 27 Jul 2007 06:47:48 +0200, Stefan Scholl wrote: Chris Mellon [EMAIL PROTECTED] wrote: XML is not a string. It's a specific type of bytestream. If you want to work with XML, then generate well-formed XML in the

Re: Filtering content of a text file

2007-07-27 Thread Amit Khemka
On 7/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello All, I'd greatly appreciate if you can take a look at the task I need help with. It'd be outstanding if someone can provide some sample Python code. Thanks a lot, Ira

Re: Why PHP is so much more popular for web-development

2007-07-27 Thread Jon Ribbens
On 2007-07-26, Steve Holden [EMAIL PROTECTED] wrote: That sounds trivial to ameliorate (at least somewhat) by putting your uploads in a directory whose name is known only to you (let's say it's a random 20-letter string). The parent directory can be protected to not allow reading the

Re: cls self

2007-07-27 Thread Diez B. Roggisch
james_027 schrieb: hi, is cls self the same thing? I have seen something like class A: def dosomething(cls): #doing something How is cls self differ? How is it use? cls and self are just names. And you most certainly haven't seen the above, but this instead: class

Re: vs !=

2007-07-27 Thread Simon Brunning
On 7/26/07, James Matthews [EMAIL PROTECTED] wrote: What is the difference between and != is deprecated, != isn't. Other than that, nothing AFAIK. -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues --

Re: Compile python with Mingw

2007-07-27 Thread Steve Holden
Ninereeds wrote: [EMAIL PROTECTED] wrote: I don't have VS2003, so I think I may compile both pymol and python with mingw. Sorry I can't help with mingw, but Microsoft has released a free version of VC2005, which should be binary compatible with VC2003, I'd have thought. Of course that

a simple string question

2007-07-27 Thread vedrandekovic
Hello, I have one question about string.I am trying to make an function to analyze line of some text, this is my example: HELLO;HELLO2:WORLD:, if that function in this text find ; and : ( in this example will find both) e.g that function must return this:

Re: zip() function troubles

2007-07-27 Thread Chris Mellon
On 7/27/07, Istvan Albert [EMAIL PROTECTED] wrote: On Jul 27, 2:16 am, Terry Reedy [EMAIL PROTECTED] wrote: References are not objects. yes this a valid objection, but in all fairness the example in the original post operates on comparably sized objects and also exhibited unexpected

encoding misunderstanding

2007-07-27 Thread Tim Arnold
Hi, I'm beginning to understand the encode/decode string methods, but I'd like confirmation that I'm still thinking in the right direction: I have a file of latin1 encoded text. Let's say I put one line of that file into a string variable 'tocline', as follows: tocline = 'Ficha Datos de

Re: zip() function troubles

2007-07-27 Thread Istvan Albert
On Jul 27, 1:24 am, Peter Otten [EMAIL PROTECTED] wrote: When you are allocating a lot of objects without releasing them the garbage collector kicks in to look for cycles. Try switching it off: import gc gc.disable() Yes, this solves the problem I was experiencing. Thanks. Istvan --

Re: Imported globals?

2007-07-27 Thread Gary Herron
Valentina Vaneeva wrote: Hi, I'm new to Python and I've found something in its interpreter that I don't quite understand, and I don't really know how to correctly formulate a search query. Here's the question. If we have a file module_a.py with the following content: |

Re: pyparser and recursion problem

2007-07-27 Thread pyscottishguy
Hey, Thanks for the further explanations. I'm going to play around more with the 'recursive grammar' and 'parse-time dynamic grammar element' stuff so that I understand it a bit better. I liked the changes you suggested. The alternative grammar definitely makes the code easier to understand,

128 or 96 bit integer types?

2007-07-27 Thread Robert Dailey
Hi, Is there build-in or third party support for large integer types, such as 96 or 128 bits in size? I require such large sizes for precision issues (nanoseconds). Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Factory pattern again

2007-07-27 Thread Steve Holden
Mike Howarth wrote: Having overcome my first hurdle with the factory pattern, I've now hit another stumbling block At the moment I'm trying to return around 2000 records from a db and load up the relevant product object, what I've found is this is running extremely slowly ( 20mins), the db

Re: Filtering content of a text file

2007-07-27 Thread Ira . Kovac
Thanks all for the input. This is going to be a great basis for starting. And, yeah - I wish it was a homework. Best, Ira -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling python2.5.1 results in 3.5MB python lib?

2007-07-27 Thread Chris Mellon
On 7/27/07, simonbun [EMAIL PROTECTED] wrote: Hi all, I'm compiling 2.5.1 and end up with a 3.5MB libpython2.5.so file. I seem to remember it should be somewhere around the 1MB mark. What could be causing this? I'm using ./configure --enable-shared This is a problem for me seeing as i'm

Compiling python2.5.1 results in 3.5MB python lib?

2007-07-27 Thread simonbun
Hi all, I'm compiling 2.5.1 and end up with a 3.5MB libpython2.5.so file. I seem to remember it should be somewhere around the 1MB mark. What could be causing this? I'm using ./configure --enable-shared This is a problem for me seeing as i'm using apache+mod_python to serve web content. Each

Re: Reading data from an ISA port

2007-07-27 Thread Gabriel Dragffy
On 23 Jul 2007, at 23:09, Diez B. Roggisch wrote: Gabriel Dragffy schrieb: Dear list members I must admit I am a new user of Python, but it is a language that I enjoy using. For one of my university projects I need to write a program that can read several bytes from an ISA port. It has

Re: a simple string question

2007-07-27 Thread vedrandekovic
On 27 srp, 19:29, Wildemar Wildenburger [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I have one question about string.I am trying to make an function to analyze line of some text, this is my example: HELLO;HELLO2:WORLD:, if that function in this text find ; and : ( in this example

Removing certain tags from html files

2007-07-27 Thread sebzzz
Hi, I'm doing a little script with the help of the BeautifulSoup HTML parser and uTidyLib (HTML Tidy warper for python). Essentially what it does is fetch all the html files in a given directory (and it's subdirectories) clean the code with Tidy (removes deprecated tags, change the output to be

Re: a simple string question

2007-07-27 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: I have one question about string.I am trying to make an function to analyze line of some text, this is my example: HELLO;HELLO2:WORLD:, if that function in this text find ; and : ( in this example will find both) e.g that function must return this:

Re: 128 or 96 bit integer types?

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 16:45:05 +, Robert Dailey wrote: Is there build-in or third party support for large integer types, such as 96 or 128 bits in size? Yes there is, just use integer values. If it don't fit into an `int` it gets promoted to a `long`. Python `long`\s are only bounded by

Re: Imported globals?

2007-07-27 Thread Valentina Vaneeva
On Jul 27, 2007, at 10:56 PM, Gary Herron wrote: The variable value is global in module_a, and change_value will always refer to that variable. However, in module_b, when you from module_a import value, change_value you have created two new variables global to module_b that

Re: zip() function troubles

2007-07-27 Thread Raymond Hettinger
On Jul 26, 4:25 pm, Istvan Albert [EMAIL PROTECTED] wrote: Now I know that zip () wastes lots of memory because it copies the content of the lists, I had used zip to try to trade memory for speed (heh!) , and now that everything was replaced with izip it works just fine. What was really

Relative-importing *

2007-07-27 Thread rbygscrsepda
Hi, I'm a newbie at Python. :) Right now it's not letting me import * from any relative package name--i.e., a name that starts with a dot. For instance, none of the following work: from . import * from .sibiling import * from .. import * from ..parent_sibling import * ...and so

Re: Factory pattern again

2007-07-27 Thread [EMAIL PROTECTED]
first you need find the bottleneck of your script db or function if the bottleneck is db 1. which db do you use do you optimize the db from read 2. the sql you write do not use any index maybe select code, type from products where type = 'I' or type = 'S' will help and you need create index on

Re: Why is for line in f faster than readline()

2007-07-27 Thread Alexandre Ferrieux
On Jul 27, 2:16 pm, Duncan Booth [EMAIL PROTECTED] wrote: Alexandre Ferrieux [EMAIL PROTECTED] wrote: Now, *why* is such buffering gaining speed over stdio's fgets(), which already does input buffering (though in a more subtle way, which makes it still usable with pipes etc.) ? Because

ANN: M2Crypto 0.18

2007-07-27 Thread Heikki Toivonen
M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web

Re: a simple string question

2007-07-27 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: If I understand you correctly you want to replace ; by ;\n and : by :\n\t\t\t\t\t\t\t. Well guess what? The replace() method does just this. Have a read: URL:http://docs.python.org/lib/string-methods.html No,that's not what I need... When this function detect ;

Re: Removing certain tags from html files

2007-07-27 Thread sebzzz
Than take a hold on the content and add it to the parent. Somthing like this should work: from BeautifulSoup import BeautifulSoup def remove(soup, tagname): for tag in soup.findAll(tagname): contents = tag.contents parent = tag.parent tag.extract()

Re: Removing certain tags from html files

2007-07-27 Thread Marc 'BlackJack' Rintsch
On Fri, 27 Jul 2007 17:40:23 +, sebzzz wrote: My question, since I'm quite new to python, is about what tool I should use to remove the table, tr and td tags, but not what's enclosed in it. I think BeautifulSoup isn't good for that because it removes what's enclosed as well. Than take a

Re: 128 or 96 bit integer types?

2007-07-27 Thread Peter Otten
Robert Dailey wrote: Is there build-in or third party support for large integer types, such as 96 or 128 bits in size? I require such large sizes for precision issues (nanoseconds). Thanks. SECOND = 10**9 YEAR = 365*24*60*60 2**128/SECOND/YEAR 10790283070806014188970L What are you

Problem embedding in small Win32 App

2007-07-27 Thread Brad Johnson
I received no responses yesterday, this is a repost. I'm still stuck on this one ladies and gentlemen, and I'm sure it's one of those simple things (isn't it always?) I am creating a small test application in Windows to test the embedding of the interpreter in order to execute arbitrary Python

  1   2   >