real-life example LC_CTYPE effects?

2014-10-21 Thread Albert-Jan Roskam
rent values for loc, and s is identical, there will or won't be a match. Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a dictionary from a .txt file

2013-03-31 Thread Terry Jan Reedy
On 3/31/2013 11:52 AM, C.T. wrote: Hello, I'm currently working on a homework problem that requires me to create a dictionary from a .txt file that contains some of the worst cars ever made. The file looks something like this: 1958 MGA Twin Cam 1958 Zunndapp Janus 1961 Amphicar 1961 Corvair 1

Re: collections.Iterator __subclasshook__ does not check if next() is callable

2013-03-31 Thread Terry Jan Reedy
o/blob/master/django/utils/itercompat.py#L22-L31 Who's job is it to check if `next` (and technically `__iter__`) are methods? The programmer, and a user who does not trust the competence of the programmer. But this is the least of the possible errors. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Python subdomains https

2013-04-02 Thread Terry Jan Reedy
On 4/2/2013 7:05 AM, Jakub Muszynski wrote: Hi, I need to add python.org https to my company firewall policy, but I'm not allowed to add rule for https://*.python.org subdomains. Can You give me/publish list of important subdomains (like https://pypi.pyth

Re: Performance of int/long in Python 3

2013-04-02 Thread Terry Jan Reedy
a couple of selected microbenchmarks show a slowdown. http://mail.python.org/pipermail/python-list/2012-September/631730.html "Py 3.3 succeeded to somehow kill unicode" I will stop here and let Jim explain how 'kill unicode' is different from 'destroy unicode'. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Python subdomains https

2013-04-02 Thread Terry Jan Reedy
On 4/2/2013 12:52 PM, Terry Jan Reedy wrote: On 4/2/2013 7:05 AM, Jakub Muszynski wrote: Hi, I need to add python.org <http://python.org> https to my company firewall policy, but I'm not allowed to add rule for https://*.python.org <http://python.org> subdomains. Can You giv

Re: Performance of int/long in Python 3

2013-04-02 Thread Terry Jan Reedy
On 4/3/2013 1:32 AM, Steven D'Aprano wrote: On Wed, 03 Apr 2013 14:31:03 +1100, Neil Hodgson wrote: Sorting a million string list (all the file paths on a particular computer) went from 0.4 seconds with Python 3.2 to 0.78 with 3.3 so we're out of the 'not noticeable by humans' range. Perha

Re: Python install Win 7 Problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 1:51 PM, Martin Schöön wrote: On 2013-04-02, balasubramanian Achuthan wrote: Try using Activestate python. The free version would suffice your needs and it comes with a clean install. I have been travelling and have not had time to read this thread in detail so this may be old hat

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 12:24 PM, Joe Hill wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: > I attempted to print about 10 pages of documentation from the help files > using IDLE. On all the pages the side of each page was missing about 1/4 > inch of text. You neglected to say what you actually did to have a p

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 2:50 PM, Joe Hill wrote: On Wed, 03 Apr 2013 14:40:38 -0400, Terry Jan Reedy wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: I attempted to print about 10 pages of documentation from the help files using IDLE. On all the pages the side of each page was missing about 1/4 inch of

Re: Time zone changing while Win app is running

2013-04-03 Thread Terry Jan Reedy
issue, passing a tz arg to now() will give the answer for any timezone on earth. A user-friendly app displaying times should let users choose. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 5:16 PM, Joe Hill wrote: On Wed, 03 Apr 2013 16:20:20 -0400, Terry Jan Reedy wrote: On 4/3/2013 2:50 PM, Joe Hill wrote: On Wed, 03 Apr 2013 14:40:38 -0400, Terry Jan Reedy wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: I attempted to print about 10 pages of documentation

Windows printing problem (was re; IDLE printing problem_

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 6:26 PM, Joe Hill wrote: In light of the fact that this is a new problem and has only occurred in Python - I shall just regard that as either a feature or flaw... Based on what you have said, the problem IS NOT OCCURRING IN PYTHON. It is occurring in the Microsoft HTML help viewer.

Re: Data storage Py 3.3

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 6:53 PM, Irmen de Jong wrote: On 4-4-2013 0:33, Joe Hill wrote: IDLE wants to use Python33 as the data storage folder - with exe files etc. Typically the 'default data storage' is in 'last used' directory or most programs even have a browse setting that one can quickly set and reset.

Re: problem in running a basic code in python 3.3.0 that includes HTML file

2013-04-04 Thread Terry Jan Reedy
ossible events that can be notified by our system tsunami earthquake volcano hurricane sinkholes tornado landslide downburst ''') -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I tell if I'm running under IDLE?

2013-04-06 Thread Terry Jan Reedy
#x27;) 'idlelib' in sys.stdin.__class__.__module__' is possibly more future-proof. Ideally, I'd like to detect any arbitrary environment such as Spyder, IPython, BPython, etc., but will settle for just IDLE. I expect that looking as sys.stdin in someway should work for all. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: The usage of -m option of python

2013-04-08 Thread Terry Jan Reedy
On 4/8/2013 10:50 AM, Albert van der Horst wrote: In article , Terry Reedy wrote: On 3/18/2013 5:17 PM, Peng Yu wrote: Hi, I don't quite understand how -m option is used. And it is difficult to search for -m in google. Could anybody provide me with an example on how to use this option? pyt

Re: Interactive development in Python à la Smalltalk?

2013-04-08 Thread Terry Jan Reedy
ractive enough for my purposes. Idle also has a debugger window that does some of that, though it works better on non-Windows OSes. I have never actually used it. --- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python module vs library

2013-04-09 Thread Terry Jan Reedy
On 4/9/2013 5:58 AM, [email protected] wrote: Hi, what is the difference between python module and library ? They are in different categories. A Python module is a namespace (a mapping of names to objects) created by running Python code as a main module or by import statements within Pyth

Re: newbie question about confusing exception handling in urllib

2013-04-09 Thread Terry Jan Reedy
uot;Connection reset by peer") >= 0) or (errorString.find("error timed out") >= 0)): -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: shutil.copyfile is incomplete (truncated)

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 3:32 AM, Chris Angelico wrote: On Fri, Apr 12, 2013 at 4:25 PM, Rob Schneider wrote: The close method is defined and flushing and closing a file, so it should not return until that's done. What command are you using to create the temp file? re command to write the file: f

Re: name lookup failure using metaclasses with unittests

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 3:17 AM, Ulrich Eckhardt wrote: Am 11.04.2013 10:19, schrieb Steven D'Aprano: if sys.version >= '3': Use sys.version_info >= (3,), otherwise your code breaks when upgrading to Python 10 and greater. ;^) The second question that came up was if there is a way to keep a metaclass

Re: SimpleHTTPRequestHandler used with HTTP/1.1 hangs after the second resource on a page.

2013-04-12 Thread Terry Jan Reedy
On 4/12/2013 4:46 PM, Piotr Dobrogost wrote: Hi! I'd like to bring your attention to the question titled "Use HTTP/1.1 with SimpleHTTPRequestHandler" at http://stackoverflow.com/q/15839718/95735 which reads; "When I use I find the doc slightly confusing. The SO code uses BaseHTTPServer. The d

Re: API design for Python 2 / 3 compatibility

2013-04-13 Thread Terry Jan Reedy
On 4/13/2013 12:36 PM, Stefan Schwarzer wrote: Hello, I'm currently changing the FTP client library ftputil [1] so that the same code of the library works with Python 2 (2.6 and up) and Python 3. (At the moment the code is for Python 2 only.) I've run into a API design issue where I don't know w

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-14 Thread Terry Jan Reedy
rom C to Python is 'getting' the data model difference. For Lispers, the difference is the syntax. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross-compiling Python for ARM?

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 11:20 AM, Gilles wrote: Hello I tried running uWSGI on an ARM-based appliance, but it fails. Apparently, it could be due to the official Python 2.6.6 interpreter in the depot not being compiled the way uWSGI expects it to be: ./configure --enable-shared; make; make install; www.ra

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 1:43 PM, Antoon Pardon wrote: $ python3 Python 3.2.3 (default, Feb 20 2013, 17:02:41) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class vslice (slice): ... pass ... Traceback (most recent call last): File "", line 1, in Typ

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-15 Thread Terry Jan Reedy
On 4/15/2013 10:32 PM, Steven D'Aprano wrote: On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote: Some builtin classes cannot be subclassed. There is an issue to document which better. That does not mean that it is not a class. I think it is also important to document whether

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-16 Thread Terry Jan Reedy
On 4/16/2013 5:07 AM, Antoon Pardon wrote: Op 16-04-13 05:17, Terry Jan Reedy schreef: On 4/15/2013 10:32 PM, Steven D'Aprano wrote: On Mon, 15 Apr 2013 20:52:58 -0400, Terry Jan Reedy wrote: I will keep the above in mind if I write or review a patch. here are 4 non-subclassable bu

Re: Preparing sqlite, dl and tkinter for Python installation (no admin rights)

2013-04-16 Thread Terry Jan Reedy
On 4/16/2013 10:30 AM, rosoloum wrote: I do not have admin rights on my machine The answer to your question may depend on the OS (linux), distribution (many), and version. What about `_tkinter` and `dl`? How can I have them ready for the Python installer? Building _tkinter (a Python C-co

Re: a couple of things I don't understand wrt lists

2013-04-16 Thread Terry Jan Reedy
On 4/16/2013 11:37 AM, aaB wrote: I represent the CA's rule with a list of integers, of value 1 or 0. Here is the function I use to generate the list: def get_rule(rulenum): rule = [] while rulenum > 0: rule.append(rulenume % 2) rulenum /= 2 divmod(rulenum) will return both th

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-16 Thread Terry Jan Reedy
de-js-community-is-quietly-changing-the-face-of-open-source/ The irony is that the author goes on to say that the node.js community 'works' because they all use the same infrastructure battery: git and git-hub ;-). -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-16 Thread Terry Jan Reedy
On 4/16/2013 1:29 PM, Ethan Furman wrote: On 04/16/2013 01:25 AM, Serhiy Storchaka wrote: On 16.04.13 07:46, Ian Kelly wrote: On Mon, Apr 15, 2013 at 9:17 PM, Terry Jan Reedy wrote: I will keep the above in mind if I write or review a patch. here are 4 non-subclassable builtin classes. Two

Re: Missing decimals in the code - some suggestions?

2013-04-16 Thread Terry Jan Reedy
On 4/16/2013 2:02 PM, [email protected] wrote: Hi! I am using ystockquote with the following code: def get_historical_prices(symbol, start_date, end_date): """ Get historical prices for the given ticker symbol. Date format is 'MMDD' Returns a nested list. """

Re: Understanding Boolean Expressions

2013-04-16 Thread Terry Jan Reedy
Yes. > Beyond that, though, I'm not sure whether this maps to an and_test (the first option on the right-hand side of the rule) or to the or_test "or" and_test option (the second on the right-hand side of the rule). The second. Then the or_test on the left also maps to an and_test. Each and_test eventually resolves to 'identifier', specifically 'x' and 'y'. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Preparing sqlite, dl and tkinter for Python installation (no admin rights)

2013-04-18 Thread Terry Jan Reedy
On 4/18/2013 12:24 PM, James Jong wrote: After compiling, you might want to run the test suite. libtk8.6.so I do not know that Python/_tkinter/tkinter has been very well tested, certainly not on all systems, with the newish tcl/tk 8.6, as opposed to 8.5.z used for sever

Re: Feature Request: `operator.not_in`

2013-04-19 Thread Terry Jan Reedy
ut important details. __contains__ *is* expected to return true/false. " object.__contains__(self, item) Called to implement membership test operators. Should return true if item is in self, false otherwise" -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Terry Jan Reedy
On 4/19/2013 1:17 PM, lcrocker wrote: Am I mistaken in my belief that tkinter is a non-optional part of the Python language? Yes. The PSF CPython Windows installer makes installation of tcl/tk/tkinter optional. The build files will compile and build Python without tkinter and without other mo

Re: Include and lib files for Visual Studio?

2013-04-20 Thread Terry Jan Reedy
On 4/20/2013 4:59 PM, [email protected] wrote: I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like to use python

Re: There must be a better way

2013-04-20 Thread Terry Jan Reedy
On 4/20/2013 8:34 PM, Tim Chase wrote: In 2.x, the csv.reader() class (and csv.DictReader() class) offered a .next() method that is absent in 3.x In Py 3, .next was renamed to .__next__ for *all* iterators. The intention is that one iterate with for item in iterable or use builtin functions i

Re: Is Unicode support so hard...

2013-04-21 Thread Terry Jan Reedy
On 4/20/2013 9:37 PM, rusi wrote: I believe that the recent correction in unicode performance followed jmf's grumbles No, the correction followed upon his accurate report of a regression, last August, which was unfortunately mixed in with grumbles and inaccurate claims. Others separated out

Re: suggestion for a small addition to the Python 3 list class

2013-04-21 Thread Terry Jan Reedy
On 4/21/2013 1:12 PM, Lele Gaifax wrote: "Robert Yacobellis" writes: I've noticed that the str join() method takes an iterable, Specifically, it takes an iterable of strings. Any iterable can be made such iwth map(str, iterable) or map(repr, iterble). >> so in the most general case I'm s

Re: List Count

2013-04-23 Thread Terry Jan Reedy
implemented for non-sequence collections, such as a Tree class, that allow multiple occurrences of an item. > whereas count for other objects (e.g. strings) has these. Strings (of unicode or bytes) are exceptional in multiple ways. -- Terry Jan Reedy -- http://mail.python.org/mailman/listi

Re: List Count

2013-04-23 Thread Terry Jan Reedy
On 4/23/2013 12:57 PM, Blind Anagram wrote: So, all I was doing in asking for advice was to check whether there is an easy way of avoiding the slice copy, And there is. not because this is critical, but rather because it is a pity to limit the performance because Python forces a (strictly un

Re: Nested iteration?

2013-04-23 Thread Terry Jan Reedy
once 0 1 0 2 I would only nest if the inner loop could terminate without exhausting the iterator and I wanted the outer loop to then resume. __ Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: My gui

2013-04-24 Thread Terry Jan Reedy
On 4/24/2013 1:53 PM, Chris “Kwpolska” Warrick wrote: Please try fixing it and running it _outside of IDLE_, which is also built in Tk The default mode of Idle runs user code in a separate process. Editing tkinter code with Idle and running it (in the separate process) should be no problem.

Re: Libroffice PMT equivalent in python

2013-04-25 Thread Terry Jan Reedy
On 4/25/2013 6:46 AM, ஆமாச்சு wrote: Hi, Are there equivalent in any Python libraries that could match function like PMT in libreoffice? Refer: https://help.libreoffice.org/Calc/Financial_Functions_Part_Two#PMT try the packages listed at https://pypi.python.org/pypi?%3Aaction=search&term=fina

Re: Nested For loop not running full

2013-04-26 Thread Terry Jan Reedy
On 4/26/2013 4:48 AM, inshu chauhan wrote: Hello everyone, I have this part of my code where I am trying to traverse over an image by running a for loop for both x and y co-ordinate axis. But the loop is terminating by just reading first pixel. Can think of a reason why this is happening ? *A*

Re: Comparison Style

2013-04-27 Thread Terry Jan Reedy
On 4/27/2013 5:03 PM, Roy Smith wrote: In article , Chris Angelico wrote: If you switch the order of operands in that, the compiler won't help you. Plus it "reads" wrong. So the convention is still variable==constant. I just found a nice example of putting the constant first. I've just do

Re: "python.exe has stopped working" when os.execl() runs on Windows 7

2013-04-28 Thread Terry Jan Reedy
On 4/27/2013 11:42 PM, [email protected] wrote: Is there the place to open a ticket for Python developers? bugs.python.org -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I encode and decode this data to write to a file?

2013-04-29 Thread Terry Jan Reedy
On 4/29/2013 5:47 AM, [email protected] wrote: case). Here's the traceback:- File "/usr/local/lib/python2.7/dist-packages/gallery/picture.py", line 361, > in createPictureHTML file.write("".join(html).encode('utf-8')) > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7

Re: to a human - about 2to3

2013-05-01 Thread Terry Jan Reedy
On 5/1/2013 10:52 AM, Jennifer Butler wrote: I will start teaching Python to my pupils shortly. I have been looking for materials and have gathered a collection of programs. The problem is they are written in v2 and I have v3 installed in my classroom. I read about the 2to3 conversion program, b

Re: (Learner-here) Lists + Functions = headache

2013-05-05 Thread Terry Jan Reedy
You should have discovered that by testings. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging Subway and TurboGears

2005-12-19 Thread Jan Niklas Fingerle
engines, whatever you ship as included engine. Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: Merging Subway and TurboGears

2005-12-25 Thread Jan Niklas Fingerle
Jan Niklas Fingerle <[EMAIL PROTECTED]> wrote: > > the templating language (Cheetah vs Kid). Those will be points of > (as far as "depend" might go) the Kid funtionality (i.e. importing > ElementTree-s as sub-trees, and ElementTree is part of the heart of my > appli

Re: Using super()

2006-07-19 Thread Jan Niklas Fingerle
at you are doing. (5) If you want to know about the flamewar sourrounding this issue, google for "python", "super" and "harmful"... Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: Jumping over in the class hierarchy

2006-08-01 Thread Jan Niklas Fingerle
ot; A().my_method() print "B..." B().my_method() print "C..." C().my_method() -->8 --8< A... in A B... in B in A C... in C in A -->8 I hope, this helped. FWIW, i think super is a cool tool. Like a chain saw. Use it where appropriate, then it will be real help. I also don't consider super() "harmful" (Google will tell you, what I'm referring to.) I just consider it to be named misleadingly, since it does *not* return the super class or an object re-typed to the super class. But, then again, Python is not Java... ;-) Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

ELAN IT - Python Developer - South East

2006-08-16 Thread Jan de Swart
. They are a highly progressive team and work in a dynamic environment. Please send CV for further details. £Competitive Salary£ plus excellent benefits and progression Jan de Swart Elan IT | 1st Floor New Minster House 27 - 29 Baldwin Street | Bristol, BS1 1LT Tel

Re: refering to base classes

2006-08-30 Thread Jan Niklas Fingerle
ng super() until you need diamond shape inheritance (not counting object as base) and can be sure that *all* involved classes use super(). While I don't agree with the word "harmful", googling for "python", "super" and "harmful" will give you deep

Validating CSS in python

2006-09-12 Thread Jan Niklas Fingerle
e W3C-Validator [3] would be too java... Any ideas? Cheers, --Jan Niklas [1] http://www.w3.org/TR/CSS21/grammar.html [2] http://www.w3.org/TR/CSS21/syndata.html#parsing-errors [3] http://jigsaw.w3.org/css-validator/DOWNLOAD.html -- http://mail.python.org/mailman/listinfo/python-list

Re: "Wiki in 10 minutes"

2006-10-01 Thread Jan Niklas Fingerle
, this would be http://www.turbogears.org/ Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

add encoding to standard encodings works different in python 2.5?

2006-12-22 Thread henk-jan ebbers
n 2.5, this does not work. my questions are: - should this work in 2.5? - how can i get this to work in 2.5 (nice if it would work in both 2.4 and 2.5) btw, I use ubuntu linux edgy, with both python 2.4 and 2.5 installed thanks, Henk-Jan -- http://mail.python.org/mailman/listinfo/python-list

loose methods : Smalltalk asPython

2006-12-26 Thread Jan Theodore Galkowski
a very big deal). Comments? Suggestions? Thanks, -- Jan -- http://mail.python.org/mailman/listinfo/python-list

re: Smalltalk asPython

2006-12-27 Thread Jan Theodore Galkowski
On Tue, 26 Dec 2006 22:49:30 -0500, Jan Theodore Galkowski wrote: >> Hi. >> >> One of the things I'd like to do with Python is find a way to >> consistently implement Smalltalk's "loose methods". This is a >> capability whereby additional metho

re: loose methods: Smalltalk asPython

2006-12-27 Thread Jan Theodore Galkowski
>Jan Theodore Galkowski <[EMAIL PROTECTED]> wrote: >> Comments? Suggestions? ><http://www.ruby-lang.org> Luc, don't misunderstand: There's nothing at all wrong with Python nor am I suggesting there is. I'm just exploring how far I can go using its dy

re: loose methods: Smalltalk asPython

2006-12-27 Thread Jan Theodore Galkowski
quot;? No, it's the root of its own tree. Smalltalk has "int" as well, as a *subclass* of Number. It's primitive. In any case, as respectful of Mr/Dr van Rossum as I am, simply because so-and-so says something is bad and therefore it must be true is a fallacious response. -

re: loose methods: Smalltalk asPython

2006-12-27 Thread Jan Theodore Galkowski
n since Smalltalk. and i was a big time LISP hacker once. Python obviously includes a lot of things which Smalltalk did not and does not have, simply because it's culture is more modern and Python's community is so much more vibrant. and it don't hurt that it has good numeri

re: loose methods: Smalltalk asPython

2006-12-27 Thread Jan Theodore Galkowski
>> > We've not had an excellent dynamic OO language since >> > Smalltalk, IMO. > >I would say that "excellence" in object oriented programming is not a >strong design goal of Python. Python tries to support OOP well, but >not to enhance OOP to the detriment of other, more important goals. okay.

Re: add encoding to standard encodings works different in python 2.5?

2006-12-29 Thread Henk-Jan Ebbers
OK, I am trying to register my codecs, with codecs.register Looking at the python doc, this seems to work different in 2.4/2.5 Can somebody help me with an example of how to register a codec? I do not understand how this works. regards, Henk-jan -- http://mail.python.org/mailman/listinfo/python

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Jan Niklas Fingerle
. Super is a good tool to use, when dealing with diamond shape inheritance. In any other case I would use the direct calls to the base classes. In fact, i've yet to find a non-textbook-case where I really need diamond shape inheritance. OTOH I don't mean to say that noone else needs it ei

Re: super(...).__init__() vs Base.__init__(self)

2006-02-12 Thread Jan Niklas Fingerle
Tony Nelson <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Jan Niklas Fingerle <[EMAIL PROTECTED]> wrote: > > > ...Super is a good tool to use, when dealing with > > diamond shape inheritance. In any other case I would use the direct >

Re: super(...).__init__() vs Base.__init__(self)

2006-02-12 Thread Jan Niklas Fingerle
Steven Bethard <[EMAIL PROTECTED]> wrote: > Jan Niklas Fingerle wrote: > > Steven Bethard <[EMAIL PROTECTED]> wrote: > >> Personally, I'd call the lack of the super calls in threading.Thread and > >> Base bugs. > > > > It can't b

Re: multiple inheritance

2006-02-15 Thread Jan Niklas Fingerle
Sébastien Boisgérault <[EMAIL PROTECTED]> wrote: > and search for the "cooperative methods and super" section > in http://www.python.org/2.2/descrintro.html ..., then read http://fuhm.org/super-harmful/ (not the evangelism, just the examples) and http://mail.python.org/pipermail/python-dev/2005-J

Zipf test in Python

2007-11-22 Thread Albert-jan Roskam
module that can do that? All I could find was ZipfR, a package for R. Best wishes, Albert-Jan Cheers! Albert-Jan ~~ Did you know that 87.166253% of all statistics claim a precision of results that is not justified by the method

Research-oriented Python mailing list?

2007-11-22 Thread Albert-jan Roskam
Hi again, One more Q: I was wondering if there exists a more research-oriented Python listserv. This one is good (or so it seems, I'm just a newbie!), but the topics are very broad. Suggestions, anyone? Thanks in advance! Cheers!!! Albert-Jan Cheers! Alber

newbie question: converting csv to another dialect

2008-02-15 Thread Albert-jan Roskam
) dialect, and writing it. Another option (which may be easier) I tried was: f = open('d:/temp/myfile.csv', ' rw') for row in f: row.replace("\t",",") Which is a start, but doesn't do the entire job. Could somebody help me with this plea

Re: using PIL for PCA analysis

2009-01-13 Thread Jan Erik Solem
> if i want to do an array of PIL image data i can use > img=Image.open("myimg.jpg") .convert("L") > pixelarray=img.getdata() > convert("L") is a good way to make images grayscale. An option to using getdata() is to try numpy's array: pixelarray = numpy.array(img) this gives lots of possibiliti

Re: newbie - merging xls files using xldt and xlwt

2008-10-15 Thread Albert-jan Roskam
o, I don't intend to use data fields. Wouldn't it be easier to convert those to string values if I ever came across them? Thanks again! Albert-Jan --- On Wed, 10/15/08, John Machin <[EMAIL PROTECTED]> wrote: > From: John Machin <[EMAIL PROTECTED]> > Subject: Re: new

newbie - merging xls files using xldt and xlwt

2008-10-15 Thread Albert-jan Roskam
by Spss, the program returns an error message (see below). Some details: Python 2.4, xlwt version 0.7.0, xlrd version 0.5.2, Win NT. Any ideas? Thanks in advance! Albert-Jan """ Merge all xls files in a given directory into one multisheet xls file. The sheets get the or

Newbie: Limesurvey and... MySQLdb?

2009-03-20 Thread Albert-jan Roskam
-Jan -- http://mail.python.org/mailman/listinfo/python-list

IDE for Win CE?

2009-04-27 Thread Albert-jan Roskam
Hi, A colleague of mine is looking for a Python IDE for Windows CE. Does anybody happen to know what is a good choice? Thanks, AJ -- http://mail.python.org/mailman/listinfo/python-list

pylab without X11

2008-09-30 Thread Willem-Jan Vriend
I want to use pylab (matplotlib) on a machine without X11. I'm trying to generate onthefly graphics for an apache2 web service, so they do not have to be displayed on this machine ! When i do pylab.figure() I get the error TclError: couldn't connect to display ":0.0" I tried setting the

Re: Re: pylab without X11

2008-10-02 Thread Willem-Jan Vriend
://matplotlib.sourceforge.net/matplotlibrc You may choose PS or SVG or pdf, there might be other possibilities, I do not know To save the file : savefig Marc Willem-Jan Vriend a écrit : I want to use pylab (matplotlib) on a machine without X11. I'm trying to generate onthefly graphics for an ap

Re: a question about zip...

2006-03-08 Thread Jan Niklas Fingerle
, 7)] >>> tuple(all) ((0, 1), (2, 3), (4, 5), (6, 7)) Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Jan Niklas Fingerle
'u' > prefix or the encoding tricks? It's proposed for python 3000 (http://www.python.org/doc/peps/pep-3000/) and I think it will make it into the language. Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: why isn't Unicode the default encoding?

2006-03-20 Thread Jan Niklas Fingerle
I haven't got any numbers, but my guess would be that many the chinese will add their share to the UTF-16 numbers. I don't know about other asian languages, though. Cheers, --Jan Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: covert number into string

2010-01-21 Thread Jan Ulrich Hasecke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 21.01.10 12:18, anusha k wrote: > Hi, > > Can anyone tell me how to convert number to words > For example: > If number = then it should give me *Nine thousand nine hundred > ninetynine* > Is there any build-in function or something that can do

[wxpython] change the language of a menubar

2009-06-05 Thread Jan-Heiner Dreschhoff
Hi Guys, i am new to wxpython an i have trouble with the menubar. i tried to write a dynamic menubar that can read the itemnames from an sqlite3 database, so i can change the language very easy. like this. def MakeMenuBar(self): self.dbCursor.execute("SELECT " + self.lang[self.langSelect] +"

one method of COM object needs a variant type variable

2009-08-06 Thread MICHÁLEK Jan Mgr .
How i can use this type in win32.com? One method of com object (geomedia storage service) needs this variable for storage geometry of geometry object (this variable will be writen into blob in DB). Is possible make this variable in py?? Thanks Jelen/Stack -- http://mail.python.org/mailman/listi

Re: one method of COM object needs a variant type variable

2009-08-07 Thread MICHÁLEK Jan Mgr .
t gss=win32com.client.Dispatch('Geomedia.GeometryStorageService')#geometry strorage object gss.GeometryToStorage(obj, out) #out must be a variant type variable . oRS.Fields("Geometry").Value = out # writing blob into recordset via ADO En Thu, 06 Aug 2009 09:37:55 -0300, MICHÁLEK Jan Mgr.

Re: PYTHON

2017-04-06 Thread Jan Erik Moström
On 6 Apr 2017, at 14:43, [email protected] wrote: > Hello, how can I start programming? Let me google that for you => http://www.learnpython.org -- https://mail.python.org/mailman/listinfo/python-list

OrderedDict with kwds

2017-04-22 Thread Albert-Jan Roskam
uteError: self.__hardroot = _Link() self.__root = root = _proxy(self.__hardroot) root.prev = root.next = root self.__map = {} self.__update(*args, **kwds) Thanks! Albert-Jan -- https://mail.python.org/mailman/listinfo/python-list

Re: OrderedDict with kwds

2017-04-22 Thread Albert-Jan Roskam
From: eryk sun Sent: Saturday, April 22, 2017 7:59 AM To: Python Main Cc: Albert-Jan Roskam Subject: Re: OrderedDict with kwds   On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam wrote: > Would the insertion order be preserved if the last line were to be > replaced with: >

Re: How to get Buttons to work

2017-04-22 Thread Albert-Jan Roskam
(sorry for top-posting). UpdateRecords and the other functions need to be nested so they fall under your class. Right now they are functions, not methods. AJ From: Python-list on behalf of [email protected] Sent: Saturday, April 22, 2017 12:45:09 PM To: p

Fw: Unable to convert pandas object to string

2017-06-24 Thread Albert-Jan Roskam
From: Albert-Jan Roskam Sent: Saturday, June 24, 2017 11:26:26 AM To: Paul Barry Subject: Re: Unable to convert pandas object to string (sorry for top posting) Try using fillna('') to convert np.nan into empty strings. df['desc'] = df.

Re: Combining 2 data series into one

2017-06-28 Thread Albert-Jan Roskam
(sorry for top posting) Yes, I'd try pd.concat([df1, df2]). Or this: df['both_names'] = df.apply(lambda row: row.name + ' ' + row.surname, axis=1) From: Python-list on behalf of Paul Barry Sent: Wednesday, June 28, 2017 12:30:25 PM To: Bhaskar Dhariyal Cc: python

Re: Combining 2 data series into one

2017-07-01 Thread Albert-Jan Roskam
Hi, Does your code run on a sample of the data? Does your code have categorical data in it? If so: https://pandas.pydata.org/pandas-docs/stable/categorical.html. Also, check out http://www.pytables.org. Albert-Jan From: Python-list on behalf of Bhaskar

Re: memory leak with re.match

2017-07-05 Thread Albert-Jan Roskam
From: Python-list on behalf of Mayling ge Sent: Tuesday, July 4, 2017 9:01 AM To: python-list Subject: memory leak with re.match      Hi,    My function is in the following way to handle file line by line. There are    multiple error patterns  defined and  need to apply  to each  line. I  us

Re: Test 0 and false since false is 0

2017-07-11 Thread Albert-Jan Roskam
From: Python-list on behalf of Dan Sommers Sent: Friday, July 7, 2017 2:46 AM To: [email protected] Subject: Re: Test 0 and false since false is 0   On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote: > I have tried or conditions of v == False etc but then the 0's being > false als

Re: Compare files excel

2017-07-22 Thread Albert-Jan Roskam
(sorry for top posting) Try: df1['difference'] = (df1 == df2).all(axis=1) From: Python-list on behalf of Smith Sent: Saturday, July 22, 2017 7:47:59 AM To: [email protected] Subject: Compare files excel Hello to all, I should compare two excel files with p

<    2   3   4   5   6   7   8   >