Re: Problem with __str__ if baseclass is list

2005-11-13 Thread Serge Orlov
Edward C. Jones wrote: > #! /usr/bin/env python > > class A(list): > def __init__(self, alist, n): > list.__init__(self, alist) > self.n = n > > def __str__(self): > return 'AS(%s, %i)' % (list.__str__(self), self.n) > > def __repr__(self): > retur

Re: Inheritence Problem

2005-11-13 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Hello. I'm trying to mod an open source app called TinyERP and inherit > from a parent object, and in essence change how _column is defined. I > found sample code of: Looks like "Spot the differences" puzzle to me. Hint: look at the underscore characters. > > class cu

Re: Confusion about __call__ and attribute lookup

2005-11-13 Thread Serge Orlov
Kent Johnson wrote: > Leif K-Brooks wrote: > > New-style classes look up special methods on the class, not on the instance: > > For my future reference, is this documented somewhere in the standard docs? > Looks like it's the most detailed explanation on the net: http://mail.python.org/pipermail/

Re: newbie - How do I import automatically?

2005-11-17 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I also checked in command prompt, and there it works!, but not in IDLE. > And it's in IDLE that I work all the time. Can anything be done to get > it to work there? According to command line help (run C:\Python24\Lib\idlelib>idle.py -h ) "idle -s" is what you're looki

Re: pySonic - writing a sample to a file

2005-11-17 Thread Serge Orlov
netspeed.com.au wrote: > Hi all: > > Hopefully a simple question. I have been putting together an application > using pySonic. I find the documentaion fine with plenty of examples but I > cant see how to save a sample (or any recorded audio) to a file. > > Am I missing something obvious? Python c

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-17 Thread Serge Orlov
Jack Diederich wrote: > Electric Fence[1] uses the LD_PRELOAD method. I've successfully used it to > track down leaks in a python C extension. If you look at the setup.py in > probstat[2] you'll see > #libraries = ["efence"] # uncomment to use ElectricFence > which is a holdover from developin

Re: PyExcelerator - mishandling of formulas?

2005-11-17 Thread Serge Orlov
Marco Aschwanden wrote: > Hi, > > Yesterday I placed a bug report on PyExcelerators-Sourceforge-page... but > I am not so sure anymore, whether this is really a bug - I could imagine > that I missed something, but I don't see what. Please confirm that my bug > is due to mishandling and I will gladl

Re: sqlite utf8 encoding error

2005-11-17 Thread Serge Orlov
Jarek Zgoda wrote: > Fredrik Lundh napisa³(a): > > >>UnicodeDecodeError: 'utf8' codec can't decode bytes in position 13-18: > >>unsupported Unicode code range > >> > >>does anyone have any idea on what could be going wrong? The string > >>that I store in the database table is: > >> > >>'Keinen Tex

Re: Python obfuscation

2005-11-18 Thread Serge Orlov
Ben Sizer wrote: > Mike Meyer wrote: > > "Ben Sizer" <[EMAIL PROTECTED]> writes: > > > Decompyle (http://www.crazy-compilers.com/decompyle/ ) claims to be > > > pretty advanced. I don't know if you can download it any more to test > > > this claim though. > > > > No, it doesn't claim to be advanced

Re: Python as Guido Intended

2005-11-27 Thread Serge Orlov
Antoon Pardon wrote: > No it wasn't. From what I have picked up, the ternary operator > was finaly introduced after one of the developers tripped over > the commonly used idiom to simulate a ternary operator, which > can fail in certain cases. > > Anyway, when I was arguing for a ternary operator

Re: Locale confusion

2005-01-11 Thread Serge . Orlov
Jorgen Grahn wrote: [snip] > > frailea> cat foo > import locale > print locale.getlocale() > locale.setlocale(locale.LC_CTYPE) > print locale.getlocale() > > When I paste it into an interactive Python session, the locale is already > set up correctly (which is what I suppose interactive mode /shou

Re: Python & unicode

2005-01-11 Thread Serge . Orlov
Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle. wrote: > Hi ! > > >>> and plain Latin letters > > But not all letters (no : é à ç à ê ö ñ etc.) > > > > Therefore, the Python's support of Unicode is... limited. > So is the support of Unicode in virtually every comp

Re: Python & unicode

2005-01-11 Thread Serge Orlov
Leif K-Brooks wrote: > [EMAIL PROTECTED] wrote: > > So is the support of Unicode in virtually every computer language > > because they don't support ... digits except 0..9. > > Hex digits aren't 0..9. > You're right, I forgot about hex. But that's boring :) How about Hebrew numerals which are pres

Re: Python & unicode

2005-01-11 Thread Serge Orlov
Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle. wrote: > Hi ! > > >>> It is a least-common-denominator argument, not a "this is better" > argument. > > I understand, but I have a feeling of attempt at hegemony. Is english > language really least-common-denominator f

Re: Python & unicode

2005-01-12 Thread Serge Orlov
Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle. wrote: > Hi ! > > Sorry, but I think that, for russians, english is an *add-on*, > and not a common-denominator. You miss the point, programs are not English writings, they are written in computer languages using libra

Re: Unicode conversion in 'print'

2005-01-13 Thread Serge Orlov
Ricardo Bugalho wrote: > Hello, > I'm using Python 2.3.4 and I noticed that, when stdout is a terminal, > the 'print' statement converts Unicode strings into the encoding > defined by the locales instead of the one returned by > sys.getdefaultencoding(). Sure. It uses the encoding of you console.

Re: Unicode conversion in 'print'

2005-01-14 Thread Serge Orlov
Ricardo Bugalho wrote: > Hi, > thanks for the information. But what I was really looking for was > informaion on when and why Python started doing it (previously, it > always used sys.getdefaultencoding())) I don't have access to any other version except 2.2 at the moment but I believe it happene

Re: Why 'r' mode anyway? (was: Re: Pickled text file causing ValueError (dos/unix issue))

2005-01-14 Thread Serge Orlov
Irmen de Jong wrote: > Tim Peters wrote: > > > Yes: regardless of platform, always open files used for pickles in > > binary mode. That is, pass "rb" to open() when reading a pickle file, > > and "wb" to open() when writing a pickle file. Then your pickle files > > will work unchanged on all pla

Re: oddities in the datetime module

2005-01-14 Thread Serge Orlov
Max M wrote: > # -*- coding: latin-1 -*- > > """ > > I am currently using the datetime package, but I find that the design > is oddly > asymmetric. I would like to know why. Or perhaps I have misunderstood > how it should be used? Yes, you did. datetime.timetuple is those who want *time module* fo

Re: oddities in the datetime module

2005-01-14 Thread Serge Orlov
Max M wrote: > Serge Orlov wrote: >> Max M wrote: > >> Yes, you did. datetime.timetuple is those who want *time module* >> format, you should use datetime.data, datetime.time, datetime.year >> and so on... As they say, if the only tool you have is timetuple, every

Re: how to print unicode structures?

2005-01-17 Thread Serge Orlov
Timothy Babytch wrote: > Imagine you have some list that looks like > ('unicode', 'not-acii', 'russian') and contains characters not from > acsii. or list of dicts, or dict of dicts. > > how can I print it? not on by one, with "for" - but with just a simple > print? My debugging would be MUCH simpl

Re: how to print unicode structures?

2005-01-17 Thread Serge Orlov
Serge Orlov wrote: >>>> print unicode([u'ÁÂ×']) > [u'\u0430\u0431\u0432'] > Oops, Outlook Express has screwed the encoding, one more evidence that printing unicode is hard :) I hope this time, the message will be with real Russian characters instead

Re: Printing Filenames with non-Ascii-Characters

2005-02-01 Thread Serge Orlov
Marian Aldenhövel wrote: > Hi, > > I am very new to Python and have run into the following problem. If I do > something like > >dir = os.listdir(somepath) >for d in dir: > print d > > The program fails for filenames that contain non-ascii characters. > >'ascii' codec can't encode

Re: sre is broken in SuSE 9.2

2005-02-10 Thread Serge Orlov
Denis S. Otkidach wrote: > On all platfroms \w matches all unicode letters when used with flag > re.UNICODE, but this doesn't work on SuSE 9.2: > > Python 2.3.4 (#1, Dec 17 2004, 19:56:48) > [GCC 3.3.4 (pre 3.3.5 20040809)] on linux2 > Type "help", "copyright", "credits" or "license" for more infor

Re: sre is broken in SuSE 9.2

2005-02-10 Thread Serge Orlov
Denis S. Otkidach wrote: > On 10 Feb 2005 03:59:51 -0800 > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > > > > On all platfroms \w matches all unicode letters when used with flag > > > re.UNICODE, but this doesn't work on SuSE 9.2: > [...] > >

Re: sre is broken in SuSE 9.2

2005-02-10 Thread Serge Orlov
Denis S. Otkidach wrote: > On all platfroms \w matches all unicode letters when used with flag > re.UNICODE, but this doesn't work on SuSE 9.2: > > Python 2.3.4 (#1, Dec 17 2004, 19:56:48) > [GCC 3.3.4 (pre 3.3.5 20040809)] on linux2 > Type "help", "copyright", "credits" or "license" for more infor

Re: sre is broken in SuSE 9.2

2005-02-10 Thread Serge Orlov
Peter Maas wrote: > Serge Orlov schrieb: > > Denis S. Otkidach wrote: > > To summarize the discussion: either it's a bug in glibc or there is an > > option to specify modern POSIX locale. POSIX locale consist of > > characters from the portable character set, u

Re: sre is broken in SuSE 9.2

2005-02-11 Thread Serge Orlov
Denis S. Otkidach wrote: > On 10 Feb 2005 11:49:33 -0800 > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > > > This thread is about problems only with LANG=C or LANG=POSIX, it's not > > about other locales. Other locales are working as expected. > > You

Re: sre is broken in SuSE 9.2

2005-02-12 Thread Serge Orlov
"Martin v. Löwis" wrote: > Serge Orlov wrote: > > To summarize the discussion: either it's a bug in glibc or there > is an >> option to specify modern POSIX locale. POSIX locale consist of >> characters from the portable character set, unicode is certainly

Re: sre is broken in SuSE 9.2

2005-02-12 Thread Serge Orlov
Fredrik Lundh wrote: > Serge Orlov wrote: > >>>>>> re.compile(ur'\w+', re.U).findall(u'\xb5\xba\xe4\u0430') >>>>>> [u'\xb5\xba\xe4\u0430'] >> >> I can't find the strict definition of isalpha, but I believe

Re: sre is broken in SuSE 9.2

2005-02-12 Thread Serge Orlov
Fredrik Lundh wrote: > Serge Orlov wrote: > >>>>>> re.compile(ur'\w+', re.U).findall(u'\xb5\xba\xe4\u0430') >>>>>> [u'\xb5\xba\xe4\u0430'] >> >> I can't find the strict definition of isalpha, but I believe

Re: writing unicode apps in python - some beginner questions.

2005-02-13 Thread Serge Orlov
WX wrote: > (#2) Hindi is not displayed correctly on the screen when the > "Suplemental language support" parts for Windows XP are not installed, > in particular in the Regional and Languages Options panel in the > Control Panel, you have to check "Install files for complex script and > right-to-l

Re: writing unicode apps in python - some beginner questions.

2005-02-13 Thread Serge Orlov
WX wrote: > (#2) Hindi is not displayed correctly on the screen when the > "Suplemental language support" parts for Windows XP are not installed, > in particular in the Regional and Languages Options panel in the > Control Panel, you have to check "Install files for complex script and > right-to-l

Re: os.rename() doesn't work w/unicode??

2005-02-14 Thread Serge Orlov
fanbanlo wrote: > C:\MP3\001.txt -> 0.txt > C:\MP3\01. ??? - (???).mp3 -> 1.mp3 > > Traceback (most recent call last): > File > "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\MP3\!Renam

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-18 Thread Serge Orlov
Dan Sommers wrote: > So my question is: Is there a way to pass options "through" a format > string to the __str__ and __repr__ functions? For example, can I > define my own alternate form for use with the '#' formatting > character, so that '%#s' generates output according to SI guidelines? Yo

Re: unicode and socket

2005-02-19 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > It's really funny, I cannot send a unicode stream throuth socket with > python while all the other languages as perl,c and java can do it. You may really start laughing loudly after you find out that you can send arbitrary python objects over sockets. If you want langu

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-19 Thread Serge Orlov
Dan Sommers wrote: > On 18 Feb 2005 01:25:06 -0800, > "Serge Orlov" <[EMAIL PROTECTED]> wrote: > >> Dan Sommers wrote: > >>> So my question is: Is there a way to pass options "through" a >>> format string to the __str__ and __repr__ f

Re: UTF-8 / German, Scandinavian letters - is it really this difficult?? Linux & Windows XP

2005-02-22 Thread Serge Orlov
Mike Dee wrote: > [snip wrestling with byte strings] In addition to Martin reply I just want to add two notes: 1. Interactive console in python 2.3 has a bug that was fixed in 2.4, so you can't enter unicode strings at the prompt: C:\Python24>python.exe >>> a=u'ÐÐÐ' >>> a u'\u0430\u0431\u0432' C

Re: UTF-8 / German, Scandinavian letters - is it really this difficult?? Linux & Windows XP

2005-02-22 Thread Serge Orlov
Paul Boddie wrote: > One side-effect of the "big push" to UTF-8 amongst the Linux > distribution vendors/maintainers is the evasion of issues such as > filesystem encodings and "real" Unicode at the system level. In > Python, when you have a Unicode object, you are dealing with > idealised > sequen

Re: LC_ALL and os.listdir()

2005-02-23 Thread Serge Orlov
"Martin v. Löwis" wrote: >> My goal is to build generalized code that consistently works with all >> kinds of filenames. > > Then it is best to drop the notion that file names are > character strings (because some file names aren't). You > do so by converting your path variable into a byte > string

Re: Style guide for subclassing built-in types?

2005-02-24 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Thank you but your advice doesn't fit in my case since I want to keep > the memory usage and the initial time minimum. iterable[::-1] would > build another list and it would take big memory and time during > reversing if iterable were huge. (and the "iterable" wouldn't be

Re: LC_ALL and os.listdir()

2005-02-24 Thread Serge Orlov
Duncan Booth wrote: > Martin v. Löwis wrote: > > > Serge Orlov wrote: > >> Shouldn't os.path.join do that? If you pass a unicode string > >> and a byte string it currently tries to convert bytes to > >> characters > >> but it makes more sense t

Re: auto-completion history

2005-02-25 Thread Serge Orlov
porterboy wrote: > Hi Folks, > > I have auto-completion set up in my python interpreter so that if I > hit the tab key it will complete a variable or a python command*. eg. > if I type > >>> imp > and if I then hit the tab key, the interpreter will complete it to... > >>> import > > Now, I also use

Re: variable declaration

2005-02-25 Thread Serge Orlov
Alexander Zatvornitskiy wrote: > Hello All! > > I'am novice in python, and I find one very bad thing (from my point > of view) in language. There is no keyword or syntax to declare > variable, like 'var' in > Pascal, or special syntax in C. It can > cause very ugly errors,like this: > > epsilon=0 >

Re: fdups: calling for beta testers

2005-02-26 Thread Serge Orlov
Peter Hansen wrote: > Patrick Useldinger wrote: >>> (9) Any good reason why the "executables" don't have ".py" >>> extensions on their names? >> >> (9) Because I am lazy and Linux doesn't care. I suppose Windows does? > > Unfortunately, yes. Windows has nothing like the "x" permission > bit, so yo

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Jaime Wyant wrote: > I chose not to use py2exe because it made updating my app a bit > messier. For instance, suppose I don't use the smtplib module in > version 1 of my software. Py2exe realizes that and doesn't 'package' > smtplib with my executable. Now, if I release version 1.1 which does >

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Phillip Mills wrote: > First, thanks to all the people who have answered so far for the > suggestions. > > In article <[EMAIL PROTECTED]>, > André Søreng <[EMAIL PROTECTED]> wrote: > > > Phillip Mills wrote: > > > > My problems are: > > [...] > > > http://starship.python.net/crew/theller/py2exe/ >

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Jaime Wyant wrote: > This becomes especially hairy when someone is updating from 1.0 to > say 1.5. Then I have to keep track of all the deltas between > 1.0/1.5. My way is much simpler because I don't have to keep up with > *anything*. As long as I test my code against my custom built > distribut

Re: Gordon McMillan installer and Python 2.4

2005-03-03 Thread Serge Orlov
Svein Brekke wrote: > > Seriously, if you're only interested in Windows, just use py2exe, > > or if you want Linux+Windows, try cx_Freeze. > > According to the command line help for cx_Freeze and py2exe, they > cannot pack my program with additional installation files into one > self-extracting .ex

Re: i18n: looking for expertise

2005-03-03 Thread Serge Orlov
klappnase wrote: > Hello all, > > I am trying to internationalize my Tkinter program using gettext and > encountered various problems, so it looks like it's not a trivial > task. Considered that you decided to support old python versions, it's true. Unicode support has gradually improved. If you c

Re: Unicode error in wx_gdi ?

2005-03-04 Thread Serge Orlov
Erik Bethke wrote: > Hello All, > > I still shaking out my last few bugs in my tile matching game: > > I am now down to one stumper for me: > 1) when I initialize wxPython > 2) from an exe that I have created with py2exe > 3) when the executable is located on the desktop as opposed to > somewhe

Re: getting data with proper encoding to the finish

2005-03-14 Thread Serge Orlov
John Machin wrote: > Ksenia Marasanova wrote: >> Sorry, I meant: I use field of the type 'text' in a Postgres table to >> store my data. The data is a XML string. >> >>> Instead of "print data", do "print repr(data)" and show us what you >>> get. What *you* see on the screen is not much use for dia

Re: Python becoming less Lisp-like

2005-03-15 Thread Serge Orlov
Torsten Bronger wrote: > > Interesting. I've never thought that. What parts strike you as > > "patchwork"? > > Well, with a little bit of experience in the field of programming > languages, you can see which elements had been added later (ie years > after Python's creation). Properties surely wo

Re: Python becoming less Lisp-like

2005-03-15 Thread Serge Orlov
Fernando wrote: > On Sun, 13 Mar 2005 18:23:05 GMT, Peter Seibel <[EMAIL PROTECTED]> > wrote: > > >Looks like the BDFL is planning to take lambda, reduce, filter, and > >map out of Python in the next big rev of Python (so called Python > >3000): > > > >

Re: unicode converting

2005-03-16 Thread Serge Orlov
Maxim Kasimov wrote: > Christos TZOTZIOY Georgiou wrote: > > > > If unicode_data references your unicode data, all you have to send is: > > > > unicode_data.encode('utf-16') # maybe utf-16be for network order > > > is utf-16 string the same ucs-2? my question is how to get string > encoded as UCS-2

Re: getting data with proper encoding to the finish

2005-03-16 Thread Serge Orlov
Ksenia Marasanova wrote: > John, Serge, thanks for your help! > > utf-16le encoding didn't help. I had however to solve it yesterday, > so I used csv module to create CSV file and then import it in Excel. > Excel still had troubles with accented characters, but this is another > story: it seems t

Re: unicode converting

2005-03-16 Thread Serge Orlov
Christos TZOTZIOY Georgiou wrote: > On 16 Mar 2005 02:53:12 -0800, rumours say that "Serge Orlov" > <[EMAIL PROTECTED]> might have written: > > >3) There is a note in README: To compile > >Python2.3 with Tkinter, you will need to pass --enable-unicode=ucs4 >

Re: ConfigParser

2005-03-17 Thread Serge Orlov
Sergey wrote: > Is there an alternative to standard module ConfigParser, which can > use delimitier symbol other than ":" and "=", preferaby just space? > I need to parse such configs: > > [Passwords] > 2:5020/758 > 2:5020/794 > > ConfigParser is not able to work with option names which c

Re: Import mechanism to support multiple Python versions

2005-03-18 Thread Serge Orlov
Nicolas Fleury wrote: > Hi, > I'm trying to support two Python versions at the same time and I'm > trying to find effective mechanisms to support modules compiled in > C++ transparently. > > All my code in under a single package. Is it possible to override > the import mechanism only for mod

Re: How to pass parameter when importing a module?

2005-03-20 Thread Serge Orlov
Bo Peng wrote: > Dear list, > > What I would like to do is something like: > > In myModule.py ( a wrapper module for different versions of the > module), > if lib == 'standard': > from myModule_std import * > elsif lib == 'optimized' > from myModule_op import * > > but I do not know how

Re: IconvCodec, UTF-32 & P4 ?

2005-03-21 Thread Serge Orlov
Do Re Mi chel La Si Do wrote: > Hi ! > > Iconvcodec was good, for to work with UTF-32, with Python 2.3 > But, which tool, for the same use, with Python 2.4 ? > Thanks for suggestions. Do you mean it's impossible to build iconvcodec anymore? Serge. -- http://mail.python.org/mailman/listinfo/p

Re: IconvCodec, UTF-32 & P4 ?

2005-03-21 Thread Serge Orlov
Do Re Mi chel La Si Do wrote: > re-Hi > > > When I look http://cjkpython.i18n.org I found only binaries for > P2.1, P2.2 & P2.3 (I am on windows) > > If I run the P2.3's version, on my Python 2.4 config, the package > said that he don't found Python2.3. > > And, I don't have compiler for work wi

Re: UTF Questions

2005-03-21 Thread Serge Orlov
Fuzzyman wrote: > I have a couple of questions about the UTF encodings. > > The codecs module has constants definded for the UTF32 encoding, yet > this encoding isn't supported as a standard encoding. Why isn't it > supported ? Probably because there is little demand for it. The most widespread un

Re: Save passwords in scripts

2005-03-22 Thread Serge Orlov
Florian Lindner wrote: > Paul Rubin wrote: > >> - sort of similar: have a separate process running that knows the >> password (administrator enters it at startup time). That process >> listens on a unix socket and checks the ID of the client. It reveals >> the password to authorized clients, i.e.

Re: UTF Questions

2005-03-22 Thread Serge Orlov
Fuzzyman wrote: > Thanks Serge. You're welcome. While we at it, iconvcodec supports utf-32 and more. I have sent a 2.4 windows build of iconvcodec module to the author. He promised to publish it soon. Serge. -- http://mail.python.org/mailman/listinfo/python-list

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: > thats ok, but how do i get it to group thousands with a , ? > and thats would mean i'd have to run everything through a formatter > before i displayed it :/ it'd be nicer if i could just select a > proper locale I think you're misusing locale. There is no guarantee that any

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: > Serge Orlov wrote: > > >Timothy Smith wrote: > > > > > >>thats ok, but how do i get it to group thousands with a , ? > >>and thats would mean i'd have to run everything through a formatter > >>before i displayed it :/

Re: Interface selection

2005-03-25 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > Actually its not a server. I dont do any binding call, just a connect. Bind is not only for server sockets. Googling for "bind client socket" reveals an example: http://woozle.org/~neale/papers/sockets.html Serge. -- http://mail.python.org/mailman/listinfo/python-li

Re: Suggesting a new feature - "Inverse Generators"

2005-03-25 Thread Serge Orlov
Michael Spencer wrote: > > Still, this is fascinating going to have to spend some time > > experimenting with groupby as soon as I get a chance > > > Experimenting is good. So is the the documentation: > http://docs.python.org/tut/tut.html Reading documentation is a good idea, but I think

Re: Once again a unicode question

2005-03-26 Thread Serge Orlov
Nicolas Evrard wrote: > Hello, > > I'm puzzled by this test I made while trying to transform a page in > html to plain text. Because I cannot send unicode to feed, nor str so > how can I do this ? Seems like the parser is in the broken state after the first exception. Feed only binary strings to i

Re: Cross platform distribution of standalone executable

2005-03-27 Thread Serge Orlov
Mahesh wrote: > Hi, > > One of my clients does not want the Python VM installed on his > production machine (because it is not a supported IT language) so the > only way I can program in Python and release the application to him is > to make a standalone executable and deploy it. The last time I lo

Re: Save passwords in scripts

2005-03-29 Thread Serge Orlov
Florian Lindner wrote: > Serge Orlov wrote: > >> Florian Lindner wrote: >>> Paul Rubin wrote: >>> >>>> - sort of similar: have a separate process running that knows the >>>> password (administrator enters it at startup time). That process

Re: Secure scripts variables

2005-03-29 Thread Serge Orlov
Florian Lindner wrote: > Hello, > given the following situation: > > I have a script which is readable and executable by a user, but not > writable. > The users executes the scripts, it reads in a value and based on this > value it computes a result and stores it in a variable. > Can the user read

Re: Problem in designing a global directory in python

2005-03-30 Thread Serge Orlov
Tian wrote: > I have tried using "sysctx=None" instead of "global sysctx", but it > doesn't work either. > It seems my initialization work in the previous calling of init() has > no persistent effect when "utils" is imported using "from > myproj.utils import getContext". > > What's weird, when a mo

Re: distutils: package data

2005-03-30 Thread Serge Orlov
Qiangning Hong wrote: > ehh.. I did a little more reading and found that this function can > be easily done by the new distutils parameter "package_data" in 2.4. > > However, I am using python2.3 :( > > So, my question becomes: how to emulate the package_data function in > python 2.3? There is di

Re: LD_LIBRARY_PATH - how to set?

2005-03-31 Thread Serge Orlov
Roman Yakovenko wrote: > Hi. I have small problem. I need to load extension module that depends > on shared library. Before actually importing module I tried to edit > os.environ or to call directly to os.putenv without any success - > shared library was not found. I tried to search the Internet fo

Re: UnicodeEncodeError in string conversion

2005-03-31 Thread Serge Orlov
Maurice LING wrote: > Hi, > > I'm working on a script that searches a public database and retrives > results using SOAP interface. However, it seems that the results may > contains unicodes. When I try to pump the results into Firebird database > using kinterbasdb module, some results will give me

Re: Installing Python on a Windows 2000 Server

2005-04-02 Thread Serge Orlov
Mike Moum wrote: > Hi, > > I'm a civil engineer who also doubles as chief programmer for > technical applications at my company. Most of our software is written > in Visual Basic because our VP in charge of I.T. likes to have > "consistency", and at the moment we're a Microsoft shop. He has > assig

Re: the bugs that try men's souls

2005-04-03 Thread Serge Orlov
Sean McIlroy wrote: > This needs some background so bear with me. > > The problem: Suppose p is a permutation on {0...n} and t is the > transposition that switches x and y [x,y in {0...n}]. A "stepup pair" > (just a term I invented) for p is a pair (a,b) of integers in {0...n} > with a of p iff (p(

Re: redundant imports

2005-04-03 Thread Serge Orlov
Mike Meyer wrote: > The semantic behavior of "include" in C is the same as "from module > import *" in python. Both cases add all the names in the included > namespace directly to the including namespace. This usage is > depreciated in Python ... Did you mean discouraged? Or it's really slated f

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

[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

  1   2   3   >