Re: documentation for the change of Python 2.5

2006-06-28 Thread Serge Orlov
On 6/28/06, bussiere <[EMAIL PROTECTED]> wrote: > I've read thsi documentation n: > http://docs.python.org/dev/whatsnew/whatsnew25.html > is there a way to have it in a more printable form ? Yep: http://www.python.org/ftp/python/doc/2.5b1/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Function to prune dictionary keys not working

2006-06-27 Thread Serge Orlov
On 6/27/06, John Machin <[EMAIL PROTECTED]> wrote: > |>> '1.00' >= 0.5 > True > |>> '0.33' >= 0.5 > True > > Python (correctly) does very little (guesswork-based) implicit type > conversion. At the same time, Python (incorrectly :) compares incomparable objects. -- http://mail.python.org/mailman/

Re: Ascii Encoding Error with UTF-8 encoder

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Thanks for the thorough explanation. > > What I am doing is converting data for processing that will be tab (for > columns) and newline (for row) delimited. Some of the data contains tabs > and newlines so, I have to convert them to something e

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Well, not really. It doesn't affect the result. I still get the error > message. Did you get a different result? Yes, the program succesfully wrote text file. Without magic abilities to read the screen of your computer I guess you now get ex

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > Okay, > > Here is a sample of what I'm doing: > > > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> filterMap = {} > >>> for i in rang

Re: Problem with sets and Unicode strings

2006-06-27 Thread Serge Orlov
On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > Serge Orlov wrote: > > On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > >> Hi! > >> > >> The following program in an UTF-8 encoded file: > >> > >> > >>

Re: to py or not to py ?

2006-06-27 Thread Serge Orlov
On 6/27/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote: > HI all > I have the following prob. > I am to write a parallel vis application . > I wud have by default used C++ for the same but somehow > thought if py cud help me .. > It does as in many things that i would otherwise have written d

Re: Python UTF-8 and codecs

2006-06-27 Thread Serge Orlov
On 6/27/06, Mike Currie <[EMAIL PROTECTED]> wrote: > I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in > them. Every configuration I try I get a UnicodeError: ascii codec can't > decode byte 0x85 in position 255: oridinal not in range(128) > > I've tried using the codecs.op

Re: Problem with sets and Unicode strings

2006-06-27 Thread Serge Orlov
On 6/27/06, Dennis Benzinger <[EMAIL PROTECTED]> wrote: > Hi! > > The following program in an UTF-8 encoded file: > > > # -*- coding: UTF-8 -*- > > FIELDS = ("Fächer", ) > FROZEN_FIELDS = frozenset(FIELDS) > FIELDS_SET = set(FIELDS) > > print u"Fächer" in FROZEN_FIELDS > print u"Fächer" in FIELDS_S

Re: nested dictionary assignment goes too far

2006-06-26 Thread Serge Orlov
On 26 Jun 2006 16:56:22 -0700, Jake Emerson <[EMAIL PROTECTED]> wrote: > I'm attempting to build a process that helps me to evaluate the > performance of weather stations. The script below operates on an MS > Access database, brings back some data, and then loops through to pull > out statistics. O

Re: Python database access

2006-06-25 Thread Serge Orlov
On 25 Jun 2006 21:19:18 -0700, arvind <[EMAIL PROTECTED]> wrote: > Hi all, > I am going to work on Python 2.4.3 and MSSQL database server on > Windows platform. > But I don't know how to make the connectivity or rather which module to > import. > I searched for the modules in the Python library, b

Re: PEP 314 - requirements for Python itself

2006-06-23 Thread Serge Orlov
On 6/23/06, Mark Nottingham <[EMAIL PROTECTED]> wrote: > I was thinking more about things where people can search for packages > that need different versions of python, etc.; not so much for > automation. OK, now I see why you need it. I'm sure using virtual package name "python" to declare python

Re: PEP 314 - requirements for Python itself

2006-06-23 Thread Serge Orlov
On 6/23/06, Mark Nottingham <[EMAIL PROTECTED]> wrote: > I was looking for some normal (hopefully, machine-readable) way to > indicate it so that people can figure out the version of Python > required before they download the package. I'm sure writing English text like "make sure you have python 2

Re: PEP 314 - requirements for Python itself

2006-06-23 Thread Serge Orlov
On 6/23/06, Mark Nottingham <[EMAIL PROTECTED]> wrote: > PEP 314 introduces metadata that explains what packages are required > by a particular package. Is there any way to express what version of > Python itself is required? No, but you can do it yourself: # do not edit this file, edit actualset

Re: Python at compile - possible to add to PYTHONPATH

2006-06-21 Thread Serge Orlov
On 21 Jun 2006 15:54:56 -0700, rh0dium <[EMAIL PROTECTED]> wrote: > Hi all, > > Can anyone help me out. I would like to have python automatically look > in a path for modules similar to editing the PYTHONPATH but do it at > compile time so every user doesn't have to do this.. > > Soo... > > I want

Re: Porting python to a TI Processor (C64xx)

2006-06-21 Thread Serge Orlov
On 6/21/06, Roland Geibel <[EMAIL PROTECTED]> wrote: Dear all.We want to make python run on DSP processors (C64xx family of TI).I don't know what C64xx is, but I believe python needs general purpose CPU to run I've already tried to ask [EMAIL PROTECTED] (about his "Python forarm-Linux"),but didn't

Re: statically linked python

2006-06-19 Thread Serge Orlov
Ralph Butler wrote: > Serge Orlov wrote: > > Ralph Butler wrote: > >> Hi: > >> > >> I have searched the docs and google but have not totally figured > >> out how to accomplish my task: On a linux box, I want to compile > >> and link python

Re: statically linked python

2006-06-17 Thread Serge Orlov
Ralph Butler wrote: > Hi: > > I have searched the docs and google but have not totally figured > out how to accomplish my task: On a linux box, I want to compile > and link python so that it uses no shared libraries, but does support > import of some "extra" modules. I have made a few attempts bu

Re: BeautifulSoup error

2006-06-16 Thread Serge Orlov
William Xu wrote: > Hi, all, > > This piece of code used to work well. i guess the error occurs after > some upgrade. > > >>> import urllib > >>> from BeautifulSoup import BeautifulSoup > >>> url = 'http://www.google.com' > >>> port = urllib.urlopen(url).read() > >>> soup = BeautifulSoup() > >>> so

Re: BeautifulSoup error

2006-06-15 Thread Serge Orlov
William Xu wrote: > Hi, all, > > This piece of code used to work well. i guess the error occurs after > some upgrade. > > >>> import urllib > >>> from BeautifulSoup import BeautifulSoup > >>> url = 'http://www.google.com' > >>> port = urllib.urlopen(url).read() > >>> soup = BeautifulSoup() > >>> so

[OT] Re: Python open proxy honeypot

2006-06-15 Thread Serge Orlov
imcs ee wrote: > On 13 Jun 2006 15:09:57 -0700, Serge Orlov <[EMAIL PROTECTED]> wrote: > > Alex Reinhart wrote: > > My spam folder at gmail is not growing anymore for many months (it is > > about 600-700 spams a month). Have spammers given up spamming gmail.com >

Re: memory leak problem with arrays

2006-06-15 Thread Serge Orlov
sonjaa wrote: > Serge Orlov wrote: > > sonjaa wrote: > > > Serge Orlov wrote: > > > > sonjaa wrote: > > > > > Hi > > > > > > > > > > I'm new to programming in python and I hope that this is the problem. >

Re: Bundling an application with third-party modules

2006-06-14 Thread Serge Orlov
Ben Finney wrote: > "Serge Orlov" <[EMAIL PROTECTED]> writes: > > > Ben Finney wrote: > > > That's a large part of my question. How can I lay out these > > > modules sensibly during installation so they'll be easily > > > ava

Re: Bundling an application with third-party modules

2006-06-14 Thread Serge Orlov
Ben Finney wrote: > > 2. An Installshield-type installer can place files (essentially) > > wherever you want them > > That's a large part of my question. How can I lay out these modules > sensibly during installation so they'll be easily available to, but > specific to, my application? Put them in

Re: split with "*" in string and ljust() puzzles

2006-06-14 Thread Serge Orlov
Sambo wrote: > I have just (finally) realized that it is splitting and removing > on single space but that seams useless, and split items > 1 and 2 are empty strings not spaces?? What is useless for you is worth $1,000,000 for somebody else ;) If you have comma separated list '1,,2'.split(',') nat

Re: memory leak problem with arrays

2006-06-14 Thread Serge Orlov
sonjaa wrote: > Serge Orlov wrote: > > sonjaa wrote: > > > Hi > > > > > > I'm new to programming in python and I hope that this is the problem. > > > > > > I've created a cellular automata program in python with the numpy array

Re: memory leak problem with arrays

2006-06-14 Thread Serge Orlov
sonjaa wrote: > Hi > > I'm new to programming in python and I hope that this is the problem. > > I've created a cellular automata program in python with the numpy array > extensions. After each cycle/iteration the memory used to examine and > change the array as determined by the transition rules i

[OT] Re: Python open proxy honeypot

2006-06-13 Thread Serge Orlov
Alex Reinhart wrote: > Serge Orlov wrote: > > IMHO it's pretty useless, spammers are starting to use botnets, and the > > more you make inconvenient to them use open proxies, the more of them > > will move to closed botnets. > As long as I inconvenience them, or at le

[OT] Re: Python open proxy honeypot

2006-06-13 Thread Serge Orlov
Alex Reinhart wrote: > Being deluged by spam like nearly all of us (though fortunately I have a > very good spam filter), I also hate spam as much as almost everybody. I > know basic Python (enough to make a simple IRC bot) and I figured a good > project to help learn Python would be to make a simp

Re: embedded python and windows multi threading, can't get it to work

2006-06-13 Thread Serge Orlov
freesteel wrote: > I am trying to run a python programme embedded from C++. I want to run > the same python code concurrently in several threads. I read the manual > on embedding, especially chapter 8, and searched for relevant info on > google all afternoon, but I can't get this to work. What am I

Re: Intermittent Failure on Serial Port (Trace Result)

2006-06-12 Thread Serge Orlov
H J van Rooyen wrote: > Note that the point of failure is not the same place in the python file, but > it > is according to the traceback, again at a flush call... Yes, traceback is bogus. Maybe the error is raised during garbage collection, although the strace you've got doesn't show that. The

Re: Intermittent Failure on Serial Port

2006-06-11 Thread Serge Orlov
H J van Rooyen wrote: > Serge Orloff wrote: > > | H J van Rooyen wrote: > | > Traceback (most recent call last): > | > File "portofile.py", line 232, in ? > | > ret_val = main_routine(port, pollstruct, pfifo) > | > File "portofile.py", line 108, in main_routine > | > send_nak(port, time

Re: Intermittent Failure on Serial Port

2006-06-10 Thread Serge Orlov
H J van Rooyen wrote: > Traceback (most recent call last): > File "portofile.py", line 232, in ? > ret_val = main_routine(port, pollstruct, pfifo) > File "portofile.py", line 108, in main_routine > send_nak(port, timeout) # so bad luck - comms error > File "/home/hvr/Polling/lib/

Re: Getting start/end dates given week-number

2006-06-09 Thread Serge Orlov
Tim Chase wrote: > I've been trying to come up with a good algorithm for determining > the starting and ending dates given the week number (as defined > by the strftime("%W") function). I think you missed %U format, since later you write: > My preference would be for a Sunday->Saturday range rath

Re: Get EXE (made with py2exe) path directory name

2006-06-05 Thread Serge Orlov
Andrei B wrote: > I need to get absolute path name of a file that's in the same dir as > the exe, however the Current Working Directory is changed to somthing > else. > Use sys.path[0] -- http://mail.python.org/mailman/listinfo/python-list

Re: is it possible to find which process dumped core

2006-06-05 Thread Serge Orlov
su wrote: > to find which process dumped core at the promt we give > > $ file core.28424 > > core.28424: ELF 32-bit LSB core file of 'soffice.bin' (signal 11), > Intel 80386, version 1 (SYSV), from 'soffice.bin' > > from this command we know 'soffice.bin' process dumped core. Now can i > do the sam

Re: Freezing a static executable

2006-06-05 Thread Serge Orlov
Will Ware wrote: > I am trying to freeze a static executable. I built a static Python > executable this way: > ./configure --disable-shared --prefix=/usr/local > make > make install > Even that didn't give me a really static executable, though: AFAIK it's not supported because the inte

Re: struct: type registration?

2006-06-02 Thread Serge Orlov
John Machin wrote: > On 2/06/2006 4:18 AM, Serge Orlov wrote: > > If you want to parse binary data use pyconstruct > > <http://pyconstruct.wikispaces.com/> > > > > Looks promising on the legibility and functionality fronts. Can you make > any comment on the sp

Re: struct: type registration?

2006-06-01 Thread Serge Orlov
Giovanni Bajo wrote: > John Machin wrote: > > I am an idiot, so please be gentle with me: I don't understand why you > > are using struct.pack at all: > > Because I want to be able to parse largest chunks of binary datas with custom > formatting. Did you miss the whole point of my message: > > stru

Re: py2exe & qt4/qimage

2006-06-01 Thread Serge Orlov
aljosa wrote: > i'm trying to convert python (image resizer script using PyQt4) script > to exe but support for jpeg and tiff image formats is located in > Qt4.1\plugins\imageformats (dll files) and when script is converted > exe file doesn't support jpeg and tiff. > > i tryed using all file format

Re: Are ActivePython scripts compatible with Linux?

2006-05-31 Thread Serge Orlov
A.M wrote: > I am planning to develop python applications on windows and run them on > Linux. > "Larry Bates" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Short answer: yes A.M wrote: > Thanks alot Larry for your comprehensive answer. Small addition: test, test, test. This i

Re: Is anybody knows about a linkable, quick MD5/SHA1 calculator library ?

2006-05-30 Thread Serge Orlov
DurumDara wrote: > Hi ! > > I need to speedup my MD5/SHA1 calculator app that working on > filesystem's files. > I use the Python standard modules, but I think that it can be faster if > I use C, or other module for it. > > I use FSUM before, but I got problems, because I "move" into "DOS area", >

Re: why not in python 2.4.3

2006-05-29 Thread Serge Orlov
John Machin wrote: > On 29/05/2006 10:47 PM, Serge Orlov wrote: > > Maybe urllib2 in > > python 2.4 reports to the server that it supports compressed data but > > doesn't decompress it when receives the reply? > > > > Something funny is happening here. Other

Re: saving settings

2006-05-29 Thread Serge Orlov
SuperHik wrote: > aum wrote: > > On Mon, 29 May 2006 09:05:36 +0200, SuperHik wrote: > > > >> Hi, > >> > >> I was wondering how to make a single .exe file, say some kind od clock, > >> and be able to save some settings (alarm for example) into the same > >> file? Basically make code rewrite it self

Re: why not in python 2.4.3

2006-05-29 Thread Serge Orlov
Rocco wrote: > Also with ascii the function does not work. Well, at least you fixed misconfiguration ;) Googling for 1F8B (that's two first bytes from your strange python 2.4 result) gives a hint: it's a beginning of gzip stream. Maybe urllib2 in python 2.4 reports to the server that it supports

Re: iteration over non-sequence ,how can I resolve it?

2006-05-28 Thread Serge Orlov
python wrote: > To BJörn Lindqvist : > thank you . how to write the code specifically ?Could you give a > example? Use Queue module: import threading from Queue import Queue class PrintThread(threading.Thread): def __init__(self, urlList, results_queue): threading.Thread.__init__(self)

Re: q - including manpages in setup.py

2006-05-28 Thread Serge Orlov
aum wrote: > Hi, > > What is the best way to incorporate manpages in a distutils setup.py > script? > > Is there any distro-independent way to find the most appropriate place to > put the manpages? > For instance, /usr/man/? /usr/share/man? /usr/local/man? > /usr/local/share/man? What do you mean

Re: why not in python 2.4.3

2006-05-28 Thread Serge Orlov
Rocco wrote: > >>> import sys > >>> sys.getdefaultencoding() > 'latin_1' Don't change default encoding. It should be always ascii. -- http://mail.python.org/mailman/listinfo/python-list

Re: deploying big python applications

2006-05-24 Thread Serge Orlov
AndyL wrote: > Hi, > > let me describe how I do that today. There is standard python taken from > python.org installed in a c:\python23 with at least dozen different > additional python packages (e.g. SOAPpy, Twisted, wx, many smaller ones > etc) included. Also python23.dll moved from c:\windows

Re: Python Version Testing Tool?

2006-05-24 Thread Serge Orlov
Michael Yanowitz wrote: > Hello: > >Is there a version testing tool available for Python > such that I can check to see if my code will still run in > versions 2.2, 2.3, 2.4.3, and 1.1 (for example) (or whatever) > without having to install all these different versions on my > computer? Such t

Re: NEWB: reverse traversal of xml file

2006-05-23 Thread Serge Orlov
manstey wrote: > But will this work if I don't know parts in advance. Yes it will work as long as the highest part number in the whole file is not very high. The algorithm needs only store N records in memory, where N is the highest part number in the whole file. > I only know parts > by reading

Re: No math module??

2006-05-22 Thread Serge Orlov
WIdgeteye wrote: > I have been trying to run a python program and I get the following > error: > Traceback (most recent call last): > Fil e "", line 39, in ? That doesn't look like a python program, File "" means it's an embedded script. When a script is embedded it is responsibility of the calle

Re: NEWB: reverse traversal of xml file

2006-05-22 Thread Serge Orlov
manstey wrote: > Hi, > > I have an xml file of about 140Mb like this: > > > > ... > 1 > > > ... > 2 > > > ... > 1 > > > > I want to traverse it from bottom to top and add another field to each > record 1 > which would give the highest value of wordpartWT

Re: the tostring and XML methods in ElementTree

2006-05-19 Thread Serge Orlov
George Sakkis wrote: > > > I'm currently using > > > (a variation of) the workaround below instead of ET.tostring and it > > > works fine for me: > > > > > > def tostring(element, encoding=None): > > > text = element.text > > > if text: > > > if not isinstance(text, basestring): > >

Re: Encode exception for chinese text

2006-05-19 Thread Serge Orlov
Vinayakc wrote: > Yes serge, I have removed the first character but it is still giving > encoding exception. Then I guess this character was used as a poor man indentation tool at least in the beginning of your text. It's up to you to decide what to do with that character, you have several choices

Re: Encode exception for chinese text

2006-05-19 Thread Serge Orlov
Vinayakc wrote: > Hi all, > > I am new to python. > > I have written one small application which reads data from xml file and > tries to encode data using apprpriate charset. > I am facing problem while encoding one chinese paragraph with charset > "gb2312". > > code is: > > encoded_str = str_data.

Re: WTF? Printing unicode strings

2006-05-19 Thread Serge Orlov
Serge Orlov wrote: > Ron Garret wrote: > > In article <[EMAIL PROTECTED]>, > > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > > > > > Ron Garret wrote: > > > > > > I'm using an OS X terminal to ssh to a Linux machine. > &

Re: WTF? Printing unicode strings

2006-05-19 Thread Serge Orlov
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > > > Ron Garret wrote: > > > > > I'm using an OS X terminal to ssh to a Linux machine. > > > > > > > > In theory it s

Re: import woe

2006-05-18 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > hello, > > i have a problem. i would like to import python files above and below > my current directory. > > i'm working on /home/foo/bar/jar.py > > i would like to import /home/foo/car.py and >/home/foo/bar/far.py > > how can i do this? $ cat >>

Re: newb: comapring two strings

2006-05-18 Thread Serge Orlov
manstey wrote: > Hi, > > Is there a clever way to see if two strings of the same length vary by > only one character, and what the character is in both strings. > > E.g. str1=yaqtil str2=yaqtel > > they differ at str1[4] and the difference is ('i','e') > > But if there was str1=yiqtol and str2=yaqt

Re: WTF? Printing unicode strings

2006-05-18 Thread Serge Orlov
Ron Garret wrote: > > > I'm using an OS X terminal to ssh to a Linux machine. > > > > In theory it should work out of the box. OS X terminal should set > > enviromental variable LANG=en_US.utf-8, then ssh should transfer this > > variable to Linux and python will know that your terminal is utf-8. >

Re: WTF? Printing unicode strings

2006-05-18 Thread Serge Orlov
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > > > Ron Garret wrote: > > > In article <[EMAIL PROTECTED]>, > > > Robert Kern <[EMAIL PROTECTED]> wrote: &g

Re: WTF? Printing unicode strings

2006-05-18 Thread Serge Orlov
Ron Garret wrote: > In article <[EMAIL PROTECTED]>, > Robert Kern <[EMAIL PROTECTED]> wrote: > > > Ron Garret wrote: > > > > > I forgot to mention: > > > > > sys.getdefaultencoding() > > > > > > 'utf-8' > > > > A) You shouldn't be able to do that. > > What can I say? I can. > > > B) Don't do

Re: Python script windows servcie

2006-05-17 Thread Serge Orlov
Mivabe wrote: > Mivabe formulated the question : > > > > Google helped me discovering that it has something to do something with > > 'CTRL_LOGOFF_EVENT'. I know what it means but i don't know how to solve it. > > Is that something i have to configure in the script? > > > > I'n totally new to Python

Re: Strange IO Error when extracting zips to a network location

2006-05-17 Thread Serge Orlov
Hari Sekhon wrote: > Hi, >I've written a script to run on windows to extract all zips under a > given directory path to another directory path as such: > > python extractzips.py files under this dir> > > The purpose of this script is to retrieve backup files which are > individually zipped un

Re: arrays, even, roundup, odd round down ?

2006-05-17 Thread Serge Orlov
Lance Hoffmeyer wrote: > So, I have using the following to grab numbers from MS Word. I discovered > that that there is a "special" > rule being used for rounding. > > If a ??.5 is even the number is to rounded down (20.5 = 20) > if a ??.5 is odd the number is to rounded up (21.5 = 22) > > Brands

Re: cx_freeze and matplotlib

2006-05-13 Thread Serge Orlov
Flavio wrote: > I am trying to freeze an application which imports matplotlib. It all > works fine on the machine where it was frozen. The executable runs > without a glitch. > > But when I move the directory containing the frozen executable and > other libs to a new machine, I get the following er

Re: distributing a app frozen by cx_freeze

2006-05-13 Thread Serge Orlov
Flavio wrote: > Well I managed to get rid of the undefined symbol message by copying > all qt libs to the freeze directory, the problem is that now the > package is huge (83MB)! > > So my question is: is there a way to find out exactly which lib is > missing ? I haven't done that myself, but I've

Re: can distutils windows installer invoke another distutils windows installer

2006-05-11 Thread Serge Orlov
timw.google wrote: > Hi all. > > I have a package that uses other packages. I created a setup.py to use > 'try:' and import to check if some required packages are installed. I > have the tarballs and corresponding windows installers in my sdist > distribution, so if I untar my source distribution a

Re: FTP filename escaping

2006-05-11 Thread Serge Orlov
Almad wrote: > OK, after some investigation...problem is in non-latin characters in > filenames on ftp. > > Yes, users should be killed for this, It's futile, users will always find a way to crash you program :) And you can't kill them all, there are too many of them. > but I would like to handle

Re: How to encode html and xml tag datas with standard python modules ?

2006-05-11 Thread Serge Orlov
DurumDara wrote: > Hi ! > > I probed this function, but that is not encode the hungarian specific > characters, like áéíóüóöoúüu: so the chars above chr(127). > Have the python a function that can encode these chars too, like in Zope ? > The word encode is ambiguous. What do you mean? The example

Re: Use subprocesses in simple way...

2006-05-11 Thread Serge Orlov
DurumDara wrote: > 10 May 2006 04:57:17 -0700, Serge Orlov <[EMAIL PROTECTED]>: > > I thought md5 algorithm is pretty light, so you'll be I/O-bound, then > > why bother with multi-processor algorithm? > > This is an assessor utility. > The program's archit

Re: Memory leak in Python

2006-05-11 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I ran simulation for 128 nodes and used the following > > oo = gc.get_objects() > print len(oo) > > on every time step the number of objects are increasing. For 128 nodes > I had 1058177 objects. > > I think I need to revisit the code and remove the referencesbut how

Re: Python memory deallocate

2006-05-11 Thread Serge Orlov
Heiko Wundram wrote: > Am Donnerstag 11 Mai 2006 15:15 schrieb [EMAIL PROTECTED]: > > I MUST find a system which deallocate memory... > > Otherwise, my application crashes not hardly it's arrived to > > break-point system > > As was said before: as long as you keep a reference to an object, the ob

Re: Install libraries only without the program itself

2006-05-11 Thread Serge Orlov
Gregor Horvath wrote: > Hi, > > My application is a client/server in a LAN. I want to keep my programs > .py files on a central File Server serving all clients. The clients > should load those over the LAN every time they start the program since I > expect that they are rapidly changing and I dont

Re: data entry tool

2006-05-10 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > If the data to be entered is simple and textual you can even think > about using a text only interface. The resulting program will be really > simple, and probably good enough. FWIW here is size of "Hello, world!" program distribution using different interfaces: text co

Re: data entry tool

2006-05-10 Thread Serge Orlov
Peter wrote: > Diez B. Roggisch wrote: > > Make it a webapp. That will guarantee to make it runnable on the list of > > OSses you gave. Use Django/TurboGears/ZOPE for the application itself- > > whichever suits you best. > > A webapp isn't feasible as most of the users are on dial up (this is in Ne

Re: Use subprocesses in simple way...

2006-05-10 Thread Serge Orlov
Dara Durum wrote: [snip design of a multi-processor algorithm] I thought md5 algorithm is pretty light, so you'll be I/O-bound, then why bother with multi-processor algorithm? > 2.) > Do you know command line to just like FSUM that can compute file > hashes (MD5/SHA1), and don't have any proble

Re: ascii to latin1

2006-05-10 Thread Serge Orlov
Luis P. Mendes wrote: > Errors occur when I assign the result of ''.join(cp for cp in de_str if > not unicodedata.category(cp).startswith('M')) to a variable. The same > happens with de_str. When I print the strings everything is ok. > > Here's a short example of data: > 115448,DAÇÃO > 117788,DA

Re: Memory leak in Python

2006-05-10 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I am using Ubuntu Linux. > > My program is a simulation program with four classes and it mimics bit > torrent file sharing systems on 2000 nodes. Now, each node has lot of > attributes and my program kinds of tries to keep tab of everything. As > I mentioned its a simulat

Re: ascii to latin1

2006-05-09 Thread Serge Orlov
Luis P. Mendes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Richie Hindle escreveu: > > [Serge] > >> def search_key(s): > >> de_str = unicodedata.normalize("NFD", s) > >> return ''.join(cp for cp in de_str if not > >>unicodedata.category(cp).startswith('M

Re: ascii to latin1

2006-05-09 Thread Serge Orlov
Richie Hindle wrote: > [Serge] > > def search_key(s): > > de_str = unicodedata.normalize("NFD", s) > > return ''.join(cp for cp in de_str if not > >unicodedata.category(cp).startswith('M')) > > Lovely bit of code - thanks for posting it! Well, it is not so good. Please

Re: Embedding Python

2006-05-09 Thread Serge Orlov
gavinpaterson wrote: > Dear Pythoners, > > I am writing as I am having trouble embedding a Python program into a > Win XP C++ console application. > > I have written a script file for importing and I am trying to use the > example for "Pure Embedding" found in the product documentation. > > The pro

Re: Using time.sleep() in 2 threads causes lockup whenhyper-threading is enabled

2006-05-09 Thread Serge Orlov
Dennis Lee Bieber wrote: > On 8 May 2006 15:44:04 -0700, "Serge Orlov" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > The test program in question doesn't require a dedicated machine and it > > doesn't consume a lot of

Re: ascii to latin1

2006-05-08 Thread Serge Orlov
Luis P. Mendes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I'm developing a django based intranet web server that has a search page. > > Data contained in the database is mixed. Some of the words are > accented, some are not but they should be. This is because the > colle

Re: Using time.sleep() in 2 threads causes lockup whenhyper-threading is enabled

2006-05-08 Thread Serge Orlov
Delaney, Timothy (Tim) wrote: > [EMAIL PROTECTED] wrote: > > > I am a bit surprised that nobody else has tried running the short > > Python program above on a hyper-threading or dual core / dual > > processor system. > > Does it happen every time? Have you tried it on multiple machines? Is it > po

Re: hyperthreading locks up sleeping threads

2006-05-08 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Tried importing win32api instead of time and using the > win32api.GetTickCount() and win32api.Sleep() methods. What about win32api.SleepEx? What about WaitForMultipleObjects WaitForMultipleObjectsEx WaitForSingleObject WaitForSingleObjectEx when the object is not expe

Re: the tostring and XML methods in ElementTree

2006-05-07 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > O/S: Windows XP Home > Vsn of Python: 2.4 [snip fighting with unicode character U+2019 (RIGHT SINGLE QUOTATION MARK) ] I don't know what console you use but if it is IDLE you'll get confused even more because it is buggy and improperly handles that character: >>> print

Re: the tostring and XML methods in ElementTree

2006-05-07 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Question 1: assuming the following: > a) beforeCtag.text gets assigned a value of 'I\x92m confused' > b) afterRoot is built using the XML() method where the input to the > XML() method is the results of a tostring() method from beforeRoot > Are there any settings/argume

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Serge Orlov
Bill Atkins wrote: > "Serge Orlov" <[EMAIL PROTECTED]> writes: > > > Ken Tilton wrote: > >> It is vastly more disappointing that an alleged tech genius would sniff > >> at the chance to take undeserved credit for PyCells, something probably > >

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Serge Orlov
Ken Tilton wrote: > It is vastly more disappointing that an alleged tech genius would sniff > at the chance to take undeserved credit for PyCells, something probably > better than a similar project on which Adobe (your superiors at > software, right?) has bet the ranch. This is the Grail, dude, Bro

Re: Elegent solution to replacing ' and " ?

2006-05-05 Thread Serge Orlov
fyleow wrote: > I'm trying to replace the ' and " characters in the strings I get from > feedparser so I can enter it in the database without getting errors. > Here's what I have right now. > > self.title = entry.title.encode('utf-8') > self.title = self.title.replace('\"', '\\\"') > self.title = s

Re: Embedding Python: How to run compiled(*.pyc/*.pyo) files using Python C API?

2006-05-05 Thread Serge Orlov
Shankar wrote: > Hello, > > I am trying to run compiled Python files (*.pyc and *.pyo) using Python C > API. > > I am using the method PyRun_FileFlags() for this purpose. > > The code snippet is as follows:- > > PyCompilerFlags myFlags; > myFlags.cf_flags=1; // I tried all values 0, 1 and 2 > PyRun

Re: Why does built-in set not take keyword arguments?

2006-05-04 Thread Serge Orlov
Jack Diederich wrote: > On Thu, May 04, 2006 at 02:08:30PM -0400, Steven Watanabe wrote: > > I'm trying to do something like this in Python 2.4.3: > > > > class NamedSet(set): > > def __init__(self, items=(), name=''): > > set.__init__(self, items) > > self.name = name > > > > class Name

Re: Using time.sleep() in 2 threads causes lockup when hyper-threading is enabled

2006-05-03 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > > What do you mean "stop responding"? > > Both threads print their thread numbers (either 1 or 2) approximately > every 10 seconds. However, after a while (minutes to hours) both > programs (see above) hang! > > Pressing ctrl-c (after the printing stops) causes the thre

Re: Using time.sleep() in 2 threads causes lockup when hyper-threading is enabled

2006-05-03 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Below are 2 files that isolate the problem. Note, both programs hang > (stop responding) with hyper-threading turned on (a BIOS setting), but > work as expected with hyper-threading turned off. What do you mean "stop responding"? Not responding when you press ctrl-c? Th

Re: simultaneous assignment

2006-05-02 Thread Serge Orlov
John Salerno wrote: > bruno at modulix wrote: > > > Now if I may ask: what is your actual problem ? > > Ok, since you're so curious. :) > > Here's a scan of the page from the puzzle book: > http://johnjsalerno.com/spies.png > > Basically I'm reading this book to give me little things to try out in

Re: Strange result with math.atan2()

2006-05-02 Thread Serge Orlov
Vedran Furac wrote: > Ben Caradoc-Davies wrote: > > Vedran Furac wrote: > >> I think that this results must be the same: > >> In [3]: math.atan2(-0.0,-1) > >> Out[3]: -3.1415926535897931 > >> In [4]: math.atan2(-0,-1) > >> Out[4]: 3.1415926535897931 > > > > -0 is converted to 0, then to 0.0 for cal

Re: py2app, pythoncard build problems

2006-05-02 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Hi, > > I'm attempting to build a small app that uses pythoncard for a gui > layer. The intention is to use py2app to construct an .app bundle for > the Mac. I'm running OS 10.4 on an Intel MacBook Pro. I'm using the > default installed Python 2.3 > > The .app bundle

Re: string.find first before location

2006-05-02 Thread Serge Orlov
Peter Otten wrote: > Gary Wessle wrote: > > >> These days str methods are preferred over the string module's functions. > >> > >> >>> text = "abc abc and Here and there" > >> >>> here_pos = text.find("Here") > >> >>> text.rfind("abc", 0, here_pos) > >> 4 > >> > >> Peter > > > > and what about when

  1   2   3   >