[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

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

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: 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: 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: 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: 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. >

[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: 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

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: 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: 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: 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: 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: 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: 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: > 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Anyway to designating the encoding of the "source" for compile?

2005-05-16 Thread Serge . Orlov
[EMAIL PROTECTED] wrote: > > Okay, I'll use one of the CJK codecs as the example. EUC-KR is the > > default encoding. > > > > >>> import sys;sys.getdefaultencoding() > > 'euc-kr' > > >>> 'íê' > > '\xc7\xd1\xb1\xdb' That is the problem. Non-ascii characters in byte strings are deprecated. Here is w

Re: Anyway to designating the encoding of the "source" for compile?

2005-05-17 Thread Serge . Orlov
[EMAIL PROTECTED] wrote: > Thank you but there is still a problem. > > |>>> s='euckr="\xc7\xd1";uni=u"\xc7\xd1"' > |>>> su=s.decode('euc-kr') > |>>> su > |u'euckr="\ud55c";uni=u"\ud55c"' su[7] is a non-ascii character inside the byte string euckr > |>>> c=compile(su,'','single') > |>>> exec c > |

Re: python 2.3.4, cx_Oracle 4.1 and utf-8 - trouble

2005-05-17 Thread Serge . Orlov
Maxim Kuleshov wrote: > Hello! > > Trying to fetch long varchar2 column and get the following error: > > cx_Oracle.DatabaseError: column at array pos 0 fetched with error: 1406 > > i.e. string buffer is not much enough to fetch the string. > > # fragment of code... > myCon = cx_Oracle.connect(user,

Re: Windows distribution suggestions?

2005-05-17 Thread Serge Orlov
Timothy Smith wrote: > Ivan Voras wrote: > > >Paul Rubin wrote: > > > > > > > >>>your active code is then in some library.zip shared between the > >>>three, and you need never change alice.exe, bob.exe, and carol.exe > >>> > >>> > >>I think I understand what you're saying and it sounds like a very

Re: Type question

2005-05-17 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Hello, > > is this call assumed to be True in any case? > > result = type(SomeClass) is SomeClass > > I've written a proxy class which shadows a real object. If you call > type(proxyobj) it returns the type of the proxyobject and not the type > of the shadowed object. Exa

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-17 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > How can a proprietary software developer protect their Python code? > People often ask me about obfuscating Python bytecode. They don't want > people to easily decompile their proprietary Python app. > > I suppose another idea is to rewrite entire Python app in C if com

Re: Missing interfaces in Python...

2006-04-17 Thread Serge Orlov
Jonathan Daugherty wrote: > # so with interfaces, missing methods will suddenly appear out of thin > # air ? > > With interfaces, the idea is that they're enforced; so, they'll appear > because someone implements them. But if you're writing tests you will check method signatures anyway, so why bo

Re: Activating Batch Files from Python

2006-04-19 Thread Serge Orlov
Jeff Groves wrote: > I'm writing a launcher that should do the following: > > 1. Activate a .bat file to set environmental variables. > 2. Start 3 programs, using said environmental variables as arguments. > > However, I can't get the environmental variables to stick because all > of Pythons' syste

Re: freakin out over C++ module in python

2006-04-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > pyconstruct looks cool. i dont know if the classes are using the plain > berkely-ish code. i couldn't find anything in it that pointed to send() > recv(), & such. i found other stuff like SetSocketOpt() and so on like > this : > > long CClientSocket::ConnectToServer(LPCTS

Re: Shell like syntax for subprocess.Popen # overloading >, <, |

2006-04-19 Thread Serge Orlov
jelle wrote: > Hi, > > I use python quite a bit to couple different programs together. > Doing so has been a _lot_ easier since subprocess came around, but > would really like to be able to use the succinct shell syntax; >, <, | > > That really shouldn't be too hard to wrap in a class, but so far I

Re: send pdf or jpg to printer

2006-04-19 Thread Serge Orlov
Bell, Kevin wrote: > Does anyone have any suggestions on printing pdf's? These pdf's don't > change much, so if it be more straight forward to convert them to jpgs, > or another format, then that'd be fine too. You didn't say what OS you're using, assuming it's windows: http://tgolden.sc.sabren.

Re: Method Call in Exception

2006-04-19 Thread Serge Orlov
Felipe Almeida Lessa wrote: > Em Qua, 2006-04-19 às 16:54 -0700, mwt escreveu: > > This works when I try it, but I feel vaguely uneasy about putting > > method calls in exception blocks. > > What do you put in exception blocks?! > > > > So tell me, Brave Pythoneers, is this > > evil sorcery that I

Re: freakin out over C++ module in python

2006-04-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > wow , thanks for the tips and the link.. i can at least see whats going > on here. > this project is beginning to look believable to me. > > i have another question.. later , in this same class, after it goes > thru some error handling, it returns like this > return COM_

Re: help wanted regarding displaying Japanese characters in a GUI using QT and python

2006-04-20 Thread Serge Orlov
prats wrote: > Hi all, > this is in continuation to my previous post. > The text I want to display is (in base64 encoding): > This text contains both english and japanese characters i.e first few > english characters followed by some japanese characters. > > the decoded_string variable contains th

Re: UDP performance

2006-04-20 Thread Serge Orlov
Paul Sijben wrote: > I am stumped by the following problem. I have a large multi-threaded > server accepting communications on one UDP port (chosen for its supposed > speed). > > I have been profiling the code and found that the UDP communication is > my biggest drain on performance! Communication

Re: Help! Identical code doesn't work in Wing IDE but does in Komodo.

2006-04-20 Thread Serge Orlov
fyleow wrote: > I create a new Python file with the following using Wing IDE. > > import feedparser > d = feedparser.parse("http://feedparser.org/docs/examples/atom10.xml";) > print d.feed.title > > I get this error when I debug. > > AssertionError: > > Traceback (innermost last): > > File "c:\Doc

Re: UDP performance

2006-04-20 Thread Serge Orlov
Paul Sijben wrote: > Serge Orlov wrote: > > Paul Sijben wrote: > >> I am stumped by the following problem. I have a large multi-threaded > >> server accepting communications on one UDP port (chosen for its supposed > >> speed). > >> > >>

Re: help wanted regarding displaying Japanese characters in a GUI using QT and python

2006-04-20 Thread Serge Orlov
prats wrote: > I think I could not make myself clear. On the contrary. You've given enough information for me to do what you want: decoding your text and displaying it in a GUI. The fact that I used another GUI is not important, read below why. > I have a GUI written in Python > and Qt and PyQt a

Re: help wanted regarding displaying Japanese characters in a GUI using QT and python

2006-04-20 Thread Serge Orlov
prats wrote: > sorry I did not correctly read your point. I works fine. Thanks for > your help. > I have one more query. It was said that the text I was supposed to show > was written using "ISO-2022-JP" charset. But It didn't when I decoded > it using that charset. But it worked fine with the "shi

Re: mini component distribution question

2006-04-20 Thread Serge Orlov
Eric S. Johansson wrote: > as one would expect when creating a body of software, eventually you > create a series of relatively generic components you find yourself using > over and over again. As a result, I'm finding myself slightly bit by > the same problem I have faced multiple times of the pa

Re: i18n hell

2006-04-24 Thread Serge Orlov
fyleow wrote: > I just spent hours trying to figure out why even after I set my SQL > table attributes to UTF-8 only garbage kept adding into the database. > Apparently you need to execute "SET NAMES 'utf8'" before inserting into > the tables. > > Does anyone have experience working with other lang

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > hey there, > > i have a script that waits for message packets from a data server over > a socket. > it goes a little like this: > > while 1: > x+=1 > databack = sockobj.recv(158) > if databack: > > print 'caught a message %s bytes '

Re: need a thread to keep a socket connection alive?

2006-04-24 Thread Serge Orlov
Roy Smith wrote: > Serge Orlov <[EMAIL PROTECTED]> wrote: > > sockobj.settimeout(550) > > [...] > > Also, as other people pointed out, you'd better make buffered socket > > with .makefile() socket method. > > If I understand the docs for the socket m

Re: not quite 1252

2006-04-26 Thread Serge Orlov
Anton Vredegoor wrote: > I'm trying to import text from an open office document (save as .sxw and > read the data from content.xml inside the sxw-archive using > elementtree and such tools). > > The encoding that gives me the least problems seems to be cp1252, > however it's not completely perfe

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > In fact there are a lot of printable things that haven't got a text > attribute, for example some items with tag ()s. In my sample file I see , is that you're talking about? Since my file is small I can say for sure this tag represents two space characters. -- http:

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > Serge Orlov wrote: > > > I extracted content.xml from a test file and the header is: > > > > > > So any xml library should handle it just fine, without you trying to > > guess the encoding. > > Yes my header also says UTF-8. Ho

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > Serge Orlov wrote: > > > Anton Vredegoor wrote: > >> In fact there are a lot of printable things that haven't got a text > >> attribute, for example some items with tag ()s. > > > > In my sample file I see , is that you

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > Anton Vredegoor wrote: > > > So, probably yes. If it doesn't have a text attribrute if you iterate > > over it using OOopy for example: > > Sorry about that, I meant if the text attribute is None, but there *is* > some text. OK, I think I understand what you're talking ab

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > Anton Vredegoor wrote: > > > So, probably yes. If it doesn't have a text attribrute if you iterate > > over it using OOopy for example: > > Sorry about that, I meant if the text attribute is None, but there *is* > some text. OK, I think I understand what you're talking ab

Re: not quite 1252

2006-04-28 Thread Serge Orlov
Anton Vredegoor wrote: > Serge Orlov wrote: > > > Anton Vredegoor wrote: > >> In fact there are a lot of printable things that haven't got a text > >> attribute, for example some items with tag ()s. > > > > In my sample file I see , is that you

Re: stdin: processing characters

2006-04-30 Thread Serge Orlov
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Edward Elliott <[EMAIL PROTECTED]> wrote: > >Kevin Simmons wrote: > >> I have a python script that prompts the user for input from stdin via a > >> menu. I want to process that input when the user types in two characters > >> and not have t

Re: unable to resize mmap object

2006-04-30 Thread Serge Orlov
Fabiano Sidler wrote: > Hi folks! > > I created an mmap object like so: > --- snip --- > from mmap import mmap,MAP_ANONYMOUS,MAP_PRIVATE > fl = file('/dev/zero','rw') > mm = mmap(fl.fileno(), 1, MAP_PRIVATE|MAP_ANONYMOUS) > --- snap --- > > Now, when I try to resize mm to 10 byte > --- snip --- >

Re: How to prevent this from happening?

2006-05-01 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Regarding this expression: 1 << x > > I had a bug in my code that made x become Very Large - much larger than > I had intended. This caused Python, and my PC, to lock up tight as a > drum, and it appeared that the Python task (Windows XP) was happily and > rapidly consum

Re: stdin: processing characters

2006-05-01 Thread Serge Orlov
Kevin Simmons wrote: > Thanks for your input. I found an answer that suits my needs, not curses > :-), but stty settings and sys.stdin.read(n) : > > import os, sys > > while 1: > os.system("stty -icanon min 1 time 0") > print """ > Radio computer control program. > -

Re: Can Python kill a child process that keeps on running?

2006-05-01 Thread Serge Orlov
I. Myself wrote: > Suppose we spawn a child process with Popen. I'm thinking of an > executable file, like a compiled C program. > Suppose it is supposed to run for one minute, but it just keeps going > and going. Does Python have any way to kill it? > > This is not hypothetical; I'm doing it now

Re: Can Python kill a child process that keeps on running?

2006-05-01 Thread Serge Orlov
I. Myself wrote: > Serge Orlov wrote: > > I. Myself wrote: > > > >> Suppose we spawn a child process with Popen. I'm thinking of an > >> executable file, like a compiled C program. > >> Suppose it is supposed to run for one minute, but it just keeps

Re: Can Python kill a child process that keeps on running?

2006-05-02 Thread Serge Orlov
Edward Elliott wrote: > Serge Orlov wrote: > > I. Myself wrote: > >> Suppose it is supposed to run for one minute, but it just keeps going > >> and going. Does Python have any way to kill it? > > > > On linux it's pretty easy to do, just setup alarm s

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

<    1   2   3   >