Re: [ANN] IPython 0.13 is officially out!

2012-07-01 Thread Leo
On 2012-07-01 01:55 +0800, Fernando Perez wrote: > - ~6 months of work. > - 373 pull requests merged. > - 742 issues closed (non-pull requests). > - contributions from 62 authors. > - 1760 commits. > - a diff of 114226 lines. Thank you for the hard work. Leo -- http://mail.

webbrowser.open always opens up Safari on Lion

2012-02-25 Thread Leo
Hello, On Lion and with its stock python version 2.7.1 r271:86832, webbrowser.open('file://localhost/nonexistingfile') always opens up Safari. Is this a bug? Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: webbrowser.open always opens up Safari on Lion

2012-02-25 Thread Leo
you have the default browser set to Chrome, it still opens up Safari. Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: webbrowser.open always opens up Safari on Lion

2012-02-25 Thread Leo
; open file://localhost/nonexistingfile > and > open http://www.python.org/ > > Do they both open Chome for you? The first one prints: The file /nonexistingfile does not exist. No browser is opened. The second one opened Chrome. Leo -- http://mail.python.org/mailman/listinfo/python-list

Algorithm of ordering in Python using recursion

2017-09-13 Thread Leo
Can anyone help me find the error of this implementation in Python what am I doing with this TBiS algorithm? Algorithm: Function b = TBiSort(a, n, k, dir) if n == 1 then b = a; else h1 = TBiSort(a(1:n/2), n/2, k, dir); h2 = TBiSort(a(n/2+1:n),n/2,k, -dir); b = TB

Re: mapLast, mapFirst, and just general iterator questions

2022-06-20 Thread Leo
l2.append(l1.pop()) print(len(l1), len(l2)) main() ``` -- Leo -- https://mail.python.org/mailman/listinfo/python-list

Re: How would one scrap property listing website like this?

2022-09-23 Thread Leo
On Thu, 22 Sep 2022 09:36:47 -0700 (PDT), tripd...@gmail.com wrote: > https://nigeriapropertycentre.com/ > Has anyone scrap something like this before? > probably i should try power bi first to see if it can? You can try something like this. import urllib.request from bs4 import BeautifulSoup U

Exception raising, and performance implications.

2005-10-03 Thread leo
0,000 users/hour) , so we'd like to be as tuned as possible. Thanks, leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception raising, and performance implications.

2005-10-04 Thread leo
> However, I think the functionality you're asking for is available as > inspect.currentframe(), and if the implementation is in "C" it may have a tiny > performance advantage over the Python version. You're absolutely right, in fact the code snippet from my OP was taken directly from inspect.curr

interpreter frame

2005-08-10 Thread Leo
27;, 0)] ? I must be missing something. The motivating question is: How can I get the interpreter line that triggered the current actions? TIA, Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreter frame

2005-08-10 Thread Leo
Is it different in 2.4? Maybe there is something else in sys.* that I am having trouble finding? TIA, Leo. -- http://mail.python.org/mailman/listinfo/python-list

command history behavior in windows and linux

2005-08-29 Thread Leo
forms I use? Also, the windows version remembers my commands across sections. How do I enable that in the python version? I tried editing the inputrc file that controls the readline library by adding the following lines: $if python set history-preserve-point on $endif but this did not seem to work. T

Python Requests script to login to a phpbb forum

2014-02-19 Thread Leo
Hi there, I have decided to jump in at the deep end to try and learn python. I have been able to get requests to pull the login page off the server and I think send the login request. I don't get logged in though. Please let me know if I would be better off asking in a phpBB related group or

python compile code object -- reverse how to

2006-07-19 Thread leo
Hi, following is the python scripts: import marshal script = """ print 'hello' """ code = compile(script, "

Re: python compile code object -- reverse how to

2006-07-19 Thread leo
Hi, all, i mean to convert 'c\000\000\000\000\001\000\000\000s\017\000\000\00 > 0\177\000\000\177\002\000d\000\000GHd\001\000S(\00 > 2\000\000\000s\005\000\000\000helloN(\000\000\000\ > 000(\000\000\000\000s\010\000\000\000

doctest + swig example

2006-07-26 Thread Leo
rInterface_readMps(*args) NotImplementedError: No matching function for overloaded 'OsiCbcSolverInterface_readMps' ** Thanks! Leo. -- http://mail.python.org/mailman/listinfo/python-list

what is the data from loads()

2006-08-24 Thread leo
Hi, Following is the python scripts: import marshal exec(marshal.loads('c\000\000\000\000\001\000\000\000s\017\000\000\000\177\000\000\177\002\000d\000\000GHd\001\000S(\002\000\000\000s\005\000\000\000helloN(\000\000\000\000(\000\000\000\000s\010\000\000\000

marshal and unmarshal

2006-08-26 Thread leo
Hi, following is marshal and unmarshal script import marshal strng = """ print 'hello world' """ code = compile(strng, "", "exec") data = marshal.dumps(code) strng0 = marshal.loads(data) print repr(data) print "-"*100 print strng0 ###Result: 'c\x00\x00\x00\x00\x01\x00\x00\x00s\x0f\x00\x00\x00\x7f

Re: and [True,True] --> [True, True]?????

2009-04-23 Thread Leo
Steven D'Aprano wrote: > On Mon, 20 Apr 2009 15:13:15 -0500, Grant Edwards wrote: > > >> I fail to see the difference between "length greater than 0" and "list >> is not empty". They are, by definition, the same thing, aren't they? > > For built-in lists, but not necessarily for arbitrary list

python shell crashing on paste

2010-02-23 Thread Leo
b97766 Faulting application path: C:\Windows\system32\conhost.exe Faulting module path: C:\Windows\system32\conhost.exe Report Id: 9c6afd6c-20d7-11df-bbd8-e390d387a902 Has anyone else seen anything like this? Any suggestions on how to even start figuring this out? --Leo -- http://mail.python.org/mailman/

Re: python shell crashing on paste

2010-03-01 Thread Leo
Thanks for responding Michel. It looks like its an issue with pyreadline - http://ipython.scipy.org/moin/PyReadline/Intro - causing the crash. I'm working with the author of it on trying to get the issue figured out. It's not related to UAC. -- --Leo On Feb 23, 10:41 pm, "Miche

Re: Convert '165.0' to int

2011-07-21 Thread Leo Jay
s of them!) ? I > know I can write a function to do this, but is there anything built-in? > > Thanks > > Frank Millman > How about int(x[:-2])? -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Error 0*80070570

2016-04-21 Thread Allan Leo
When running the setup for your 3.5.1(32-bit version), the setup experiences error 0*80070570 and tells me to check the log file. What could be the problem and whats the solution. On Apr 21, 2016 7:05 AM, "Allan Leo" wrote: > When running the setup for your 3.5.1(32-bit versi

Fwd: Re: Error 0*80070570

2016-04-21 Thread Allan Leo
I need help with this setup error. -- Forwarded message -- From: "Allan Leo" Date: Apr 21, 2016 10:06 AM Subject: Re: Error 0*80070570 To: Cc: When running the setup for your 3.5.1(32-bit version), the setup experiences error 0*80070570 and tells me to check the log

Learn Python + Swift 3 by creating a comprehensive system with web app and iOS app

2016-07-05 Thread Leo Trieu
. In case you're interested and want to learn more, check it out here: http://kck.st/29NjAtR Feel free to comment here with any questions. Leo -- https://mail.python.org/mailman/listinfo/python-list

Just starting to learn Python, and encounter a problem

2016-07-22 Thread Zagyen Leo
yeah, it may be quite simple to you experts, but hard to me. In one of exercises from the Tutorial it said: "Write a program that asks the user their name, if they enter your name say "That is a nice name", if they enter "John Cleese" or "Michael Palin", tell them how you feel about them ;), ot

Re: Just starting to learn Python, and encounter a problem

2016-07-22 Thread Zagyen Leo
I got it! Thank you. Hope in one day I could help other newbies as you do. -- https://mail.python.org/mailman/listinfo/python-list

How to decompile an exe file compiled by py2exe?

2005-09-23 Thread Leo Jay
Dear All, I lost my source code because of my incaution. so anyone can tell me how to decompile the exe file compiled by py2exe? Thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to decompile an exe file compiled by py2exe?

2005-09-24 Thread Leo Jay
et/crew/theller/moin.cgi/Py2Exe correctly). > Bytecode files extracted should be decompilable to something resembling > original python code by a python decompiler (quick Googling finds > "decompyle": http://www.crazy-compilers.com/). > -- > http://mail.python.org/mailman/listinfo/python-list > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing an HTML a tag

2005-09-24 Thread Leo Jay
> connect = urllib.urlopen(url) > data = connect.read() > connect.close() > return data > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

about install wxPython in Redhat Linux AS 4

2005-09-28 Thread Leo Jay
i do now? i tried to import wx in python, but python just returned an error: Traceback (most recent call last): File "", line 1, in ? ImportError: No module named wx Anyone can help me, please? Thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: about install wxPython in Redhat Linux AS 4

2005-09-28 Thread Leo Jay
On 9/28/05, Martin Franklin <[EMAIL PROTECTED]> wrote: > Leo, > > I don't have AS 4 but fedora core 4 has wx in it's YUM repositories I > assume RedHat has too, so perhaps you need to use the officially > sanctioned version. If you want to use the latest and great

how to get rate of pop3 receiving progress?

2005-07-14 Thread Leo Jay
when i use POP3.retr() in poplib module, the retr() function will not return until the receiving progress is finished so, is there any way to get the rate of receiving progress? Thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about lists

2005-07-20 Thread Leo Jay
you may use the decimal module which was introduced in Python2.4 >>> from decimal import * >>> li = [Decimal(".25"), Decimal(".10"), Decimal(".05"), Decimal(".01")] >>> print li [Decimal("0.25"), Decimal("0.10"), Decimal("0.05"), Decimal("0.01")] >>> -- http://mail.python.org/mailman/listinfo/p

Re: Newbie question about lists

2005-07-20 Thread Leo Jay
IMO, python should use the decimal for default. .25 is right for Decimal(".25"). isn't that better? -- http://mail.python.org/mailman/listinfo/python-list

how to get the return value of a thread?

2005-09-09 Thread Leo Jay
est Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Why doesn't join() call str() on its arguments?

2005-02-16 Thread Leo Breebaart
re is some counter-argument involved, some reason why people preferred the existing semantics after all. But for the life of me I can't think what that counter-argument might be... -- Leo Breebaart <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Leo Breebaart
John Machin <[EMAIL PROTECTED]> writes: > On 16 Feb 2005 18:47:21 GMT, Leo Breebaart <[EMAIL PROTECTED]> wrote: > > >What I can't find an explanation for is why str.join() doesn't > >automatically call str() on its arguments, so that e.g. > >str

Re: Why doesn't join() call str() on its arguments?

2005-02-16 Thread Leo Breebaart
a couple of hours ago, I did in fact get this right, so I'm not entirely sure who the two of you are actually talking to... -- Leo Breebaart <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

How to name Exceptions that aren't Errors

2005-04-07 Thread Leo Breebaart
the exception "CommentLine" and leave it at that, but I don't know, maybe there's something better I'm overlooking. Any suggestions? -- Leo Breebaart <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Leo Breebaart
Max <[EMAIL PROTECTED]> writes: > LOOK EVERYONE, it's Leo Breebart. You are the same Leo > Breebart, right? Breeb*aa*rt. But otherwise, yeah -- I do frequent more than just one newsgroup. :-) > This guys famous in the alternative universe of > alt.fan.pratchett. I d

Re: word replacing in a paragraph

2014-01-06 Thread leo kirotawa
Since it is for a template you can round the keyword to be replaced , something like $data$ and then just string.replace('$data','1234') On Mon, Jan 6, 2014 at 12:01 PM, Frank Cui wrote: > Hey guys, > > I'm trying to automate a process by initially creating a standard template > and then rep

Re: meaning of: line, =

2015-02-04 Thread leo kirotawa
You'll find some explanation here: http://stackoverflow.com/questions/1708292/meaning-of-using-commas-and-underscores-with-python-assignment-operator On Wed, Feb 4, 2015 at 12:08 PM, ast wrote: > hello > > I dont understand why there is a comma just after line in the following > command: > > line

Re: file handling issues

2013-09-06 Thread leo . carnovale
k if it fits the key and go on if so > > >If not, ask for a new one, check it, go on if its correct. > > > > Every time I run it, it says the key is 0!? > > I can not for the life of me figure out what it is doing. > > > > The code: > > <

file handling issues

2013-09-06 Thread leo . carnovale
f me figure out what it is doing. The code: <https://docs.google.com/document/d/1_Qo4bgmNhRer3fAt3EAtPNSei4N2q58f_q4_9r6OHbw/edit?usp=sharing> Thanks Leo -- https://mail.python.org/mailman/listinfo/python-list

Re: file handling issues

2013-09-06 Thread Leo Carnovale
ch? > > > > -- > > Piet van Oostrum > > WWW: http://pietvanoostrum.com/ > > PGP key: [8DAE142BE17999C4] Yes the code is a mess, I have been tempted to re write the whole thing... The reason for the messiness is firstly because I am relatively new to programming and because this is the result of me tinkering around with previous code, which was still messy, but cleaner than this. So the open("key","w") clears the file straight away? That helps a lot, thanks, this will definitely save me a lot of time in the future. Also the user doesn't guess the pass, I would give it to them. After they enter it, they go on to the guessing game (not shown in the code). Thanks for the help! Leo -- https://mail.python.org/mailman/listinfo/python-list

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:03:14 UTC+10, Leo Carnovale wrote: > On Saturday, 7 September 2013 02:17:03 UTC+10, Piet van Oostrum wrote: > > > leo.carnov...@gmail.com writes: > > > > > > > > > > > > > I am making this litt

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:58:43 UTC+10, Michael Torrie wrote: > On 09/06/2013 09:05 PM, Leo Carnovale wrote: > > > Ah and one other thing! What is this crypto algorithm you speak of? I > > > desperately need some sort of encryption as at the moment anyone can >

Re: AttributeError

2015-08-11 Thread leo kirotawa
assign using () creates tuple not a list. Tuples have not .sort() method. correct would be: ncount = [key,val] On Tue, Aug 11, 2015 at 9:01 PM, Ltc Hotspot wrote: > Hi Everyone, > > > What is the list equivalent to line 12: ncount.sort(reverse=True) > > > count = dict() > fname = raw_input("Enter

Re: Vaga Java (Belgica, com tudo pago)

2015-08-13 Thread leo kirotawa
Wondering why a position for Java/JS was sent to this list...just wondering... On Thu, Aug 13, 2015 at 11:59 AM, wrote: > https://walljobs.typeform.com/to/uWpUqj > > We seek a software developer with experience in web application development. > > Should you have the passion to work in the start-

Re: First time I looked at Python was(...)

2014-06-10 Thread leo kirotawa
Gzz, Guys I'm from Brazil too, and I'm ashamed for this troll. And sorry by his terrible taste in music. Wondering now about moderation , have we one? []'s On Tue, Jun 10, 2014 at 5:07 PM, Carlos Anselmo Dias wrote: > > > Terry Jan Reedy ... > > https://www.youtube.com/watch?v=HbGHq2aUXDU (yhis

Re: Distributing python applications as a zip file

2014-07-23 Thread Leo Jay
as a single file that users can just copy and run. > But if you use windows and you happen to use multiprocessing, please be aware of this bug I encountered several years ago. https://mail.python.org/pipermail/python-dev/2011-December/115071.html -- Best Regards, Leo Jay -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting a list of all modules

2014-07-30 Thread Leo Jay
understanding of cross- > platform issues, fails to include built-in modules that don't live in the > file system, and probably more). > > Is this problem already solved? Can anyone make any suggestions? > > > > -- > Steven > -- > https://mail.python.org/mailman/listinfo/python-list -- Best Regards, Leo Jay -- https://mail.python.org/mailman/listinfo/python-list

Cannot use multiprocessing and zip together on windows

2011-12-11 Thread Leo Jay
ta) File "C:\python27\lib\multiprocessing\forking.py", line 454, in prepare assert main_name not in sys.modules, main_name AssertionError: __main__ It seems that the situation described here is similar: http://bugs.python.org/issue10128 But the patch doesn't work for me.

Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Leo Breebaart
there any reason why you introduced the Name class? In Python 2.7 this works equally well if I just do: >>> apple, pear, dog, cat, fork, spoon = map(str, "apple pear dog cat fork >>> spoon".split()) So I was wondering why you used Name. -- Leo Breebaart -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on for loop

2013-03-04 Thread leo kirotawa
In fact this code is already doing what you want, but if the second character, by example, is not in secrectWord it'll jump out of the for and return. If you want that interact through the all characters and maybe count how many them are in the secrectWord, just take of the return there or do some

is there any lib can split string in this way?

2006-01-08 Thread Leo Jay
I want to split a string like this: 'abc def "this is a test" ok' into: ['abc', 'def', 'this is a test', 'ok'] is there any lib meet my need? thanks -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

how to use python com server in c++?

2006-08-19 Thread Leo Jay
ing this com server in viusal c++? a detailed sample of early binding would be better, thanks. -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: does raw_input() return unicode?

2006-10-10 Thread Leo Kislov
Theerasak Photha wrote: > On 10/10/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Theerasak Photha schrieb: > > >> At the moment, it only returns unicode objects when invoked > > >> in the IDLE shell, and only if the character entered cannot > > >> be represented in the locale's charset. > >

Re: does raw_input() return unicode?

2006-10-10 Thread Leo Kislov
Duncan Booth wrote: > "Stuart McGraw" <[EMAIL PROTECTED]> wrote: > > > So, does raw_input() ever return unicode objects and if > > so, under what conditions? > > > It returns unicode if reading from sys.stdin returns unicode. > > Unfortunately, I can't tell you how to make sys.stdin return unicode

Re: People's names (was Re: sqlite3 error)

2006-10-10 Thread Leo Kislov
John J. Lee wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > [...] > > > There would also need to be a flag field to indicate the canonical > > > ordering > > > for writing out the full name: e.g. family-name-first, given-names-first. > > > Do we need something else for the Vietnamese case? > >

Re: How to find number of characters in a unicode string?

2006-10-10 Thread Leo Kislov
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Marc 'BlackJack' > Rintsch wrote: > > > In <[EMAIL PROTECTED]>, > > Preben Randhol wrote: > > > >> Is there a way to calculate in characters > >> and not in bytes to represent the characters. > > > > Decode the byte string and use `len()

Re: Need a Regular expression to remove a char for Unicode text

2006-10-13 Thread Leo Kislov
On Oct 13, 4:44 am, [EMAIL PROTECTED] wrote: > శ్రీనివాస wrote: > > Hai friends, > > Can any one tell me how can i remove a character from a unocode text. > > కల్‌&హార is a Telugu word in Unicode. Here i want to > > remove '&' but not replace with a zero width char. And one more thing, > > if any

Re: Need a Regular expression to remove a char for Unicode text

2006-10-13 Thread Leo Kislov
On Oct 13, 4:55 am, "Leo Kislov" <[EMAIL PROTECTED]> wrote: > On Oct 13, 4:44 am, [EMAIL PROTECTED] wrote: > > > శ్రీనివాస wrote: > > > Hai friends, > > > Can any one tell me how can i remove a character from a unocode text. > > > కల్‌&హ

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Leo Kislov
On Oct 15, 10:25 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I just want to send a very simple email from within python. > > I think the standard module of smtpd in python can do this, but I > haven't found documents about how to use it after googleing. Are there > any examples o

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Leo Kislov
On Oct 16, 12:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Rob Wolfe wrote: > > [EMAIL PROTECTED] wrote: > > >> Hi, > > >> I just want to send a very simple email from within python. > > >> I think the standard module of smtpd in python can do this, but I > >> haven't found documents a

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Leo Kislov
On Oct 16, 2:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > It's not safe if I have to use login method explicitly by which I have > to put my username and password in the script. I have also tried the > Unix command 'mail', but without success, either. I could use 'mail' to > send an E-

Re: Alphabetical sorts

2006-10-16 Thread Leo Kislov
On Oct 16, 2:39 pm, Tuomas <[EMAIL PROTECTED]> wrote: > My application needs to handle different language sorts. Do you know a > way to apply strxfrm dynamically i.e. without setting the locale? Collation is almost always locale dependant. So you have to set locale. One day I needed collation th

Re: right curly quote and unicode

2006-10-18 Thread Leo Kislov
On 10/17/06, TiNo <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to compare my Itunes Library xml to the actual files on my > computer. > As the xml file is in UTF-8 encoding, I decided to do the comparison of the > filenames in that encoding. > It all works, except with one file. It is named

Re: characters in python

2006-10-18 Thread Leo Kislov
On Oct 18, 11:50 am, Stens <[EMAIL PROTECTED]> wrote: > Stens wrote: > > Can python handle this characters: c,c,ž,d,š? > > > If can how"I wanna to change some characters in text (in the file) to the > characters at this address: > > http://rapidshare.de/files/37244252/Untitled-1_copy.png.html Yo

Re: characters in python

2006-10-18 Thread Leo Kislov
Leo Kislov wrote using google groups beta: > On Oct 18, 11:50 am, Stens <[EMAIL PROTECTED]> wrote: > > Stens wrote: > > > Can python handle this characters: c,c,ž,d,š? [snip] > outfile.write(line.replace(u'd',u'd')) I hope you'l

Re: codecs.EncodedFile

2006-10-18 Thread Leo Kislov
Neil Cerutti wrote: > It turns out to be troublesome for my case because the > EncodedFile object translates calls to readline into calls to > read. > > I believe it ought to raise a NotImplemented exception when > readline is called. > > As it is it silently causes interactive applications to >

Re: Flexible Collating (feedback please)

2006-10-19 Thread Leo Kislov
l locale.atof instead of float, since you call re.compile with re.LOCALE. Everything else looks fine. The biggest missing piece is support for unicode strings. -- Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Type discrepancy using struct.unpack

2006-10-19 Thread Leo Kislov
Python 2.3.4 (#1, Feb 17 2005, 21:01:10) > [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import struct > >>> print type(struct.unpack(">L", "")[0]) > > >>> > > I would expect in both cases. Why is this not so? http://mail.python.org/pipermail/python-dev/2006-May/065199.html -- Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Flexible Collating (feedback please)

2006-10-20 Thread Leo Kislov
Ron Adam wrote: > Leo Kislov wrote: > > Ron Adam wrote: > > > >> locale.setlocale(locale.LC_ALL, '') # use current locale settings > > > > It's not current locale settings, it's user's locale settings. > > Application can actual

Re: comparing Unicode and string

2006-10-20 Thread Leo Kislov
ed to happen in python 3.0 where it's ok to break backward compatibility if needed. -- Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: right curly quote and unicode

2006-10-20 Thread Leo Kislov
u+00B4 character history as soon as possible. Googling for "itunes replaces acute with quote" reveals that char u+00B4 is not alone. Read the first hit. I'm afraid you will have to reverse engeneer what itunes is doing to some characters. -- Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding of sys.argv ?

2006-10-23 Thread Leo Kislov
Jiba wrote: > Hi all, > > I am desperately searching for the encoding of sys.argv. > > I use a Linux box, with French UTF-8 locales and an UTF-8 filesystem. > sys.getdefaultencoding() is "ascii" and sys.getfilesystemencoding() is > "utf-8". However, sys.argv is neither in ASCII (since I can pass

Re: encoding of sys.argv ?

2006-10-23 Thread Leo Kislov
e in pythonrun.c properly uses it find out the encoding. The other question if Linux or *BSD distributions confirm to the standard. -- Leo. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify generator/iterator objects?

2006-10-25 Thread Leo Kislov
t "Hello" ... yield 1 ... >>> iter(f) Traceback (most recent call last): File "", line 1, in ? TypeError: iteration over non-sequence >>> iter(f()) >>> type(f()) >>> Notice, there is no side effect of calling f function. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify generator/iterator objects?

2006-10-25 Thread Leo Kislov
>>> def f1(): yield 1 > ... > >>> def f2(): return 1 > ... > >>> is_generator(f1) > True > >>> is_generator(f2) > False > >>> It should be noted that this checking is completely irrelevant for the purpose of writing flatten generator. Given def inc(n): yield n+1 the following conditions should be true: list(flatten([inc,inc])) == [inc,inc] list(flatten([inc(3),inc(4)]) == [4,5] -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: my first software

2006-10-26 Thread Leo Kislov
done) != 0 and beensaved == 0 and askyesno(...): > saveasfile() It's a personal matter, but usually python programmers treats values in boolean context directly without comparison: if done and not beensaved and askyesno(...): The rules are documented here: http://docs.python.org/lib/truth.html . -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess cwd keyword.

2006-10-26 Thread Leo Kislov
ut how to do this properly. > > call("core/main") works but uses .. of core for input/output. > > call("core/main",cwd="core") and call("main",cwd="core") both result in [snip exception] Usually current directory is not in the PATH on UNIX. Try call("./main",cwd="core") -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: gettext on Windows

2006-10-28 Thread Leo Kislov
.error usually means input data doesn't correspond to expected format. > The .mo files were created using poEdit (www.poedit.org), and I get the > same error with various translations, all created by different people. Try msgunfmt http://www.gnu.org/software/gettext/manual/html_node/gettext_128.html#SEC128 to see if it can convert your files back to text. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess decoding?

2006-10-29 Thread Leo Kislov
t. So the problem of finding out the encoding of stdout is equal to finding out encoding of any file. It's just impossible to do in general. Now, you maybe talking about conventions. AFAIK since Windows doesn't have strong command line culture, it doesn't such conventions. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Lookuperror : unknown encoding : utf-8

2006-10-29 Thread Leo Kislov
codec was in the python.org distribution since the introduction of unicode (around python 2.0). If you can't use utf-8 codec right out of the box, something is really wrong with your setup. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Lookuperror : unknown encoding : utf-8

2006-10-30 Thread Leo Kislov
ded by the manufacturer can stop working. If the preinstalled python was installed into c:\python24 directory, choose some other directory when you install python from python.org. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Lookuperror : unknown encoding : utf-8

2006-10-30 Thread Leo Kislov
Sachin Punjabi wrote: > I installed it again but it makes no difference. It still throws me > error for LookUp Error: unknown encoding : utf-8. Most likely you're not using the new python, you're still running old one. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to test python extension modules during 'make check' / 'make distcheck'?

2006-11-02 Thread Leo Kislov
of our wrappers might be installed on the testing > machine, somewhere in python/site-packages. How can I make sure that > python only finds my 'new' local generated modules? Set PYTHONPATH to the directory where locally generated modules are located. They will be found before site packages. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Erronous "unsupported locale setting" ?

2006-11-06 Thread Leo Kislov
ssignments/language-subtag-registry> considers it Chamorro) setlocale should probably grow an additional keyword parameter: setlocale(LC_ALL, iana='de-DE') -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Erronous "unsupported locale setting" ?

2006-11-06 Thread Leo Kislov
robert wrote: > Leo Kislov wrote: > > robert wrote: > >> Why can the default locale not be set by its true name? but only by '' ? : > > > > Probably it is just not implemented. But since locale names are system > > specific (For example windows accept

Re: comparing Unicode and string

2006-11-10 Thread Leo Kislov
friendly editor or console, u"f\xfcr" is the same as u"für": >>> u"f\xfcr" is u"für" True So there is no need to write unicode strings in hexadecimal representation of code points. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: str.title question after '

2006-11-13 Thread Leo Kislov
n Dutch. I'm > not so sure about english. The problem is more complicated. First of all, why title() should be limited to human languages? What about programming languages? Is "bar.bar.spam" three tokens or one in a foo programming language? There are some problems with human

Re: Character Encodings and display of strings

2006-11-13 Thread Leo Kislov
t know where you're going to output its result so repr uses the safest encoding: ascii. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem reading with bz2.BZ2File(). Bug?

2006-11-15 Thread Leo Kislov
r: 588317 '\x1e' '' Looks like one byte of garbage is appended at the end of file. Please file a bug report. As a workaround "rU" mode seems to work fine for this file. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: how to print pdf with python on a inkjet printer.

2006-11-17 Thread Leo Kislov
52> and CUPS already supports printing PDF files, just run "lp your_file.pdf" to print a file. CUPS only have command line interface: <http://www.cups.org/documentation.php/options.html> -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: how to print pdf with python on a inkjet printer.

2006-11-17 Thread Leo Kislov
Leo Kislov wrote: > CUPS only have command line interface: > <http://www.cups.org/documentation.php/options.html> My mistake: CUPS actually has official C API <http://www.cups.org/documentation.php/api-cups.html> and unofficial python bindings <http://freshmeat.net/project

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread Leo Kislov
listdir failed completely, you could not easily find > out the cause of the failure). > > How would you propose listdir should behave? How about returning two lists, first list contains unicode names, the second list contains undecodable names: files, troublesome = os.listdir(separate_erro

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-17 Thread Leo Kislov
ace" behavior) > > what about using flags similar to how unicode() works? strict, ignore, > replace and maybe keep-as-bytestring. > > like: > os.listdir(dirname,'strict') That's actually an interesting idea. The error handling modes could be: 'mix' -- current behaviour, 'ignore' -- drop names that cannot be decoded, 'separate' -- see my other message. -- Leo -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-18 Thread Leo Kislov
Martin v. Löwis wrote: > Leo Kislov schrieb: > > How about returning two lists, first list contains unicode names, the > > second list contains undecodable names: > > > > files, troublesome = os.listdir(separate_errors=True) > > > > and make separate_errors=T

  1   2   3   >