Re: WxPython versus Tkinter.

2011-01-23 Thread Martin v. Loewis
This doesn't give a very good impression of wxPython - "regular" Python libraries shouldn't crash the interpreter. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-23 Thread Martin v. Loewis
gle.py And indeed, it is that simple: python -c "import tkFileDialog as tkfd;print tkfd.askopenfilename()" Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-23 Thread Martin v. Loewis
> WxPython Challenge 1 code updated... > > * Fixed tab traveral > * Removed hand-holding code > * Removed some cruft > > https://sites.google.com/site/thefutureofpython/home/code-challenges > > Good luck! Still crashes the interpreter. Regards, Martin -- htt

Re: WxPython versus Tkinter.

2011-01-24 Thread Martin v. Loewis
irectory(sys.prefix) File "wxtk_challenge_1.py", line 150, in showDirectory imageIdx = self.imageMap[iconname] KeyError: 'folder' If I then also comment out lines 150..154, I get a window, but it's empty (of course). > Simple debug skills we are talking about h

Re: WxPython versus Tkinter.

2011-01-25 Thread Martin v. Loewis
versity calendar - the software itself is bilingual; the content is not at all) etc. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: locale settings and date parsing under windows

2011-02-03 Thread Martin P. Hellwig
On 02/03/11 10:59, AlienBaby wrote: On Feb 3, 10:22 am, AlienBaby wrote: Hi, I'm attempting to convert some date-time strings from a text file under windows into a datetime object as returned by strptime() However, the strings can represent dates in various formats based on the country of ori

code structure advise for a model

2011-02-03 Thread Martin De Kauwe
Hi, I am translating some c++ code to python and just wanted to ask some advise on structure. The original has everything declared globally and nothing passed via function (I assume, but don't know, that this isn't just standard c++ practice!). So given this, I have a pretty much clean slate as I

Re: code structure advise for a model

2011-02-05 Thread Martin De Kauwe
On Feb 4, 8:41 pm, Marco Nawijn wrote: > On Feb 4, 3:43 am, Martin De Kauwe wrote: > > > > > > > Hi, > > > I am translating some c++ code to python and just wanted to ask some > > advise on structure. The original has everything declared globally and &g

Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
gh my code, e.g. class EmptyObject: pass self.animal_prices = EmptyObject() self.price_of_cats = 12 or reading a file and populating the object I would be keen to hear any reasons why this is a bad approach (if it is, I haven't managed to work this out)? Or perhaps there is a better o

Re: Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
On Feb 12, 2:40 am, Andrea Crotti wrote: > On Feb 11, 3:56 pm, Martin De Kauwe wrote: > > > Hi, > > > I have a series of parameter values which i need to pass throughout my > > code (>100), in C I would use a structure for example. However in > > python

Re: Python 32-bit on Windows 64-bit

2011-02-11 Thread Martin v. Loewis
ce the whole address space would not be larger than 4GiB). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
Hi, yes I read a .INI file using ConfigParser, just similar sections (in my opinion) to make one object which i can then pass to different classes. E.G. class Dict2Obj: """ Turn a dictionary into an object. The only purpose of this is that I think it is neater to reference values x.s

Re: Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
Sorry I should have added a little more example to help with clarity? So after reading the .INI file I then initialise the objects I described e.g. def initialise_simulation(self): """Set the initial conditions. using values from the .ini value set the C and N pools and other misc st

Re: Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
On Feb 12, 11:13 am, Steven D'Aprano wrote: > On Fri, 11 Feb 2011 10:15:27 -0800, Dan Stromberg wrote: > > I'd use a class rather than a dictionary - because with a class, pylint > > (and perhaps PyChecker and pyflakes?) should be able to detect typos > > upfront.   > > *Some* typos. Certainly not

Re: Class or Dictionary?

2011-02-11 Thread Martin De Kauwe
Steven, You make some good points and I don't disagree with you. The code is just a transfer from some older c++ code which had all sorts of windows menus etc, which isn't required and would make it impossible to run (again and again). It is not an especially complicated model, and no doubt there

Re: Class or Dictionary?

2011-02-12 Thread Martin De Kauwe
On Feb 12, 7:22 pm, John Nagle wrote: > On 2/11/2011 6:56 AM, Martin De Kauwe wrote: > > > Hi, > > > I have a series of parameter values which i need to pass throughout my > > code (>100), in C I would use a structure for example. However in > > python it is n

Re: Class or Dictionary?

2011-02-12 Thread Martin De Kauwe
On Feb 12, 7:21 pm, Andrea Crotti wrote: > Il giorno 12/feb/2011, alle ore 00.45, Martin De Kauwe ha scritto: > > > Hi, > > > yes I read a .INI file using ConfigParser, just similar sections (in > > my opinion) to make one object which i can then pass to different >

Re: Class or Dictionary?

2011-02-12 Thread Martin De Kauwe
On Feb 12, 8:06 pm, Martin De Kauwe wrote: > On Feb 12, 7:21 pm, Andrea Crotti wrote: > > > Il giorno 12/feb/2011, alle ore 00.45, Martin De Kauwe ha scritto: > > > > Hi, > > > > yes I read a .INI file using ConfigParser, just similar sections (in > > &g

Unpacking multiple dictionaries in a function?

2011-02-12 Thread Martin De Kauwe
Hi, Is there a better way to unpack more than one dictionary in a function than... def unpack_dicts(f): def wrapper(*old_dicts): dict={} for d in old_dicts: dict.update(d) return f(**dict) return wrapper @unpack_dicts def some_func(a=None, b=None, c=No

Re: Class or Dictionary?

2011-02-12 Thread Martin De Kauwe
On Feb 13, 5:12 am, Terry Reedy wrote: > On 2/12/2011 1:24 AM, Martin De Kauwe wrote: > > > The point of this posting was just to ask those that know, whether it > > was a bad idea to use the class object in the way I had or was that > > OK? And if I should have jus

Re: Class or Dictionary?

2011-02-13 Thread Martin De Kauwe
On Feb 13, 6:35 pm, Terry Reedy wrote: > On 2/12/2011 9:20 PM, Martin De Kauwe wrote: > > > On Feb 13, 5:12 am, Terry Reedy  wrote: > >> On 2/12/2011 1:24 AM, Martin De Kauwe wrote: > > >>> The point of this posting was just to ask those that know, whether it &

Re: Class or Dictionary?

2011-02-13 Thread Martin De Kauwe
On Feb 14, 10:16 am, Martin De Kauwe wrote: > On Feb 13, 6:35 pm, Terry Reedy wrote: > > > > > > > On 2/12/2011 9:20 PM, Martin De Kauwe wrote: > > > > On Feb 13, 5:12 am, Terry Reedy  wrote: > > >> On 2/12/2011 1:24 AM, Martin De Kauwe wrote: >

Re: Class or Dictionary?

2011-02-13 Thread Martin De Kauwe
On Feb 14, 12:02 pm, Terry Reedy wrote: > On 2/13/2011 6:16 PM, Martin De Kauwe wrote: > > > > > > > I think I got it, did you mean something like this? > > > class Constants: > > >      radius_of_earth = 6.37122E+6 > >      days_as_yrs = 1.0 / 365.

Re: Class or Dictionary?

2011-02-14 Thread Martin De Kauwe
On Feb 14, 7:12 pm, Terry Reedy wrote: > On 2/13/2011 8:33 PM, Martin De Kauwe wrote: > > > Cool! Thanks this seems straight forward, however if I do it this way > > then once I change it (i.e. after reading user param file) I can't > > pass the changed version to

Re: Class or Dictionary?

2011-02-14 Thread Martin De Kauwe
On Feb 14, 8:51 pm, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Martin De Kauwe wrote: > > > > > > from other_model import OtherSubModel > > class Model: > > >      def __init__(self): > > >          # included other external modules (i.e.

Re: How to create a dict based on such a file?

2011-02-14 Thread Martin De Kauwe
On Feb 14, 6:10 pm, aspineux wrote: > On 14 fév, 06:47, Wang Coeus wrote: > > > Hi all, > > I am new to python. Currently I encountered a problem, please help me to > > solve this. Thanks in advance! > > I have a file like below: > > ConfigParser Library does exacly what you want but with .ini fi

Re: Class or Dictionary?

2011-02-14 Thread Martin De Kauwe
On Feb 14, 8:57 pm, Martin De Kauwe wrote: > On Feb 14, 8:51 pm, Dave Angel wrote: > > > > > > > On 01/-10/-28163 02:59 PM, Martin De Kauwe wrote: > > > > > > > > from other_model import OtherSubModel > > > class Model: > > > >

Re: Class or Dictionary?

2011-02-14 Thread Martin De Kauwe
I managed to get it to work like it explained, apologies not sure what I did wrong earlier, odd. Anyway thanks a lot for all of the suggestions + help -- http://mail.python.org/mailman/listinfo/python-list

Displaying SVG in tkinter using cairo and rsvg

2011-02-15 Thread Martin P. Hellwig
Hi all, Information on using tkinter for displaying an svg image seems a bit low spread on the Internet. I recently played around with pygame and svg and realized, hold on this can be done with tk too. So I thought I post a little example for future generations :-) (and also have stored at ht

Re: Displaying SVG in tkinter using cairo and rsvg

2011-02-16 Thread Martin P. Hellwig
On 02/16/11 09:04, Arndt Roger Schneider wrote: raster images from SVG: There are multiple methods to convert a scalable vector graphic into a bitmap. In addition to cairo, librsvg and rsvg imageMagick contains a vector graphic format similar to svg--gradients and transparency are problematic fo

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Martin v. Loewis
> eps would be a better name than e. py> ε = 10.0 ** -7; n = 0; z = c = complex(-0.75, ε) py> while abs(z) < 2.0: ... n += 1 ... z = z * z + c ... py> π = n * ε py> print(π) 3.1415926 Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 and html.escape function

2011-02-21 Thread Martin v. Loewis
> Well, I just learned something, thank you. I was under the mistaken > impression that adding new functionality after the first alpha release > was not permitted by the Python devs. It's the first beta release after which no new functionality could be added. Regards, M

Re: Looking for some PyPI query help

2011-02-22 Thread Martin v. Loewis
s, install_requires, tests_require, extras_require. If it is implemented using distutils, you need to read the documentation to find out what the dependencies are, if any. For many packages, it should be possible to find the corresponding Debian or Redhat package, and correlate the dependency lists. HTH,

Re: In disGuiodoise?

2010-04-05 Thread Martin P. Hellwig
On 04/05/10 00:05, r wrote: However i have also considered that maybe *all* the "well knowns" are in fact the many colorful personalities of Guido. De vraag is dan natuurlijk of al zijn persoonlijkheden nog steeds nederlands machtig zijn. -- mph -- http://mail.python.org/mailman/listinfo/

Re: Py3: Read file with Unicode characters

2010-04-08 Thread Martin v. Loewis
in your situation; the specific default depends on the environment). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3: Read file with Unicode characters

2010-04-08 Thread Martin v. Loewis
Gnarlodious wrote: > On Apr 8, 9:14 am, "Martin v. Loewis" wrote: > >> When opening the file, you need to specify the file encoding. > > OK, I had tried this: > > open(path, 'r').read().encode('utf-8') No, when *opening* the file, you n

Re: Cleanup guarantees?

2010-04-08 Thread Martin P. Hellwig
On 04/09/10 05:13, Alf P. Steinbach wrote: Second, I'm unable to find documentation of when they're called and what they do. It seems that (A) when the connection object's stream is exhausted by reading, its close() method is called automatically, and (B) that when the text_reader object's clos

Re: [Possibly OT] Comments on PyPI

2010-04-11 Thread Martin v. Loewis
ask PyPI questions is catalog-...@python.org. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.7 beta 1

2010-04-11 Thread Martin P. Hellwig
On 04/12/10 06:57, Mensanator wrote: On Apr 11, 6:08 pm, Steven D'Aprano wrote: On Sun, 11 Apr 2010 11:54:04 -0700, Mensanator wrote: On Apr 11, 11:53 am, Steven D'Aprano wrote: On Sat, 10 Apr 2010 21:08:44 -0700, Mensanator wrote: Maybe because I'm a user, not a developer. You write co

Download Visual Studio Express 2008 now

2010-04-12 Thread Martin v. Loewis
from http://www.microsoft.com/express/Downloads/#2008-All Disclaimer: I'm not connected with Microsoft or its release process. Any claim on future actions that Microsoft may take is purely hypothetical. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Startup problems with Python 3.1.2 and PythonPath under XP

2010-04-12 Thread Martin v. Loewis
ut what the true cause of the problem is. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Unit testing errors (testing the platform module)

2010-04-13 Thread Martin P. Hellwig
On 04/13/10 15:01, John Maclean wrote: I normally use languages unit testing framework to get a better understanding of how a language works. Right now I want to grok the platform module; 1 #!/usr/bin/env python 2 '''a pythonic factor''' 3 import unittest 4 import platform 5 6

Re: missing dll follow-up

2010-04-14 Thread Martin v. Loewis
the VS 2008 SP1 redistributables, from http://www.microsoft.com/downloads/details.aspx?displaylang=de&FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2 Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: missing dll follow-up

2010-04-14 Thread Martin v. Löwis
ific languages? Apparently so; just remove displaylang=de from the URL to get the English version of the page. I can't imagine that the files are actually different - if anything, it should be just the installer UI, and perhaps some kind of message catalog. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows installer of Python

2010-04-15 Thread Martin v. Loewis
ll the Microsoft Redistributable Package. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Martin v. Löwis
Brian Blais wrote: > On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote: > >> If you are planning to build Python extension modules in the next five >> years, I recommend that you obtain a copy of VS Express > > Am I missing something here? I have heard this before, but

Re: Download Visual Studio Express 2008 now

2010-04-16 Thread Martin v. Loewis
but nowhere near 2 months. I'm skeptical that the switch to VS 2010 will be ready for 3.2. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: What license/copyright text to include and where to include it when selling a commercial Python based application?

2010-04-16 Thread Martin v. Loewis
are installation. No need to include it in the manual, the online documentation, or the splash screen. Putting it into the product's license text file might be appropriate, as might be putting it next to it. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7b1 and argparse's version action

2010-04-18 Thread Martin v. Loewis
> What do you think? If you want something to happen, you need to bring this up on python-dev. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a GUI Toolkit

2010-04-18 Thread Martin P. Hellwig
On 04/18/10 12:49, Tim Diels wrote: Hi I was thinking of writing a GUI toolkit from scratch using a basic '2D library'. I have already come across the Widget Construction Kit. My main question is: Could I build a GUI toolkit of reasonable performance with the Widget Construction Kit, would it s

Re: UnicodeEncodeError during repr()

2010-04-19 Thread Martin v. Loewis
to return bytes, > then what method should I use to define the unicode representation > for instances of a class? __unicode__. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: About the grammar

2010-04-19 Thread Martin v. Loewis
test) so that parsing always starts with a test. Afterwards, I either get a '=', indicating a keyword argument, or not: the '=' is not in the FIRST set of comp_for, so there is no ambiguity here. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: pyconfig.h

2010-04-19 Thread Martin v. Loewis
these macros. HAVE_NICE should be defined if you have (i.e. your system has) the nice() function. Regards, Martin NICE(P) POSIX Programmer's Manual NICE(P) NAME nice - change the nice value of a process SYNOPSIS #include int nice(int i

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use are only a simple thin wrapper over the librar

Re: Building a GUI Toolkit

2010-04-20 Thread Martin P. Hellwig
On 04/20/10 21:15, Martin P. Hellwig wrote: On 04/20/10 19:53, Lie Ryan wrote: Rather than writing a windowing toolkit from the low-level, I would rather like to see some wrapper for existing windowing toolkit which uses more pythonic idioms. Most popular python GUI toolkit currently in use

Re: Download Proprietary Microsoft Products Now

2010-04-21 Thread Martin v. Loewis
y, even if it runs on Windows only. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Download Proprietary Microsoft Products Now

2010-04-21 Thread Martin v. Loewis
y, even if it runs on Windows only. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux servers, network and file names

2010-04-23 Thread Martin P. Hellwig
On 04/22/10 15:13, Infinity77 wrote: For me: //SERVER/gavana/Folder/FileName.txt Colleague: //SERVER/Colleague/Folder/FileName.txt So, no matter what I do, the file name stored in the database is user- dependent and not universal and common to all of us. If that user dependent part happens t

Re: Download Visual Studio Express 2008 now

2010-04-27 Thread Martin v. Loewis
l.dll, then msvcrt.dll, but it's some other version now). In any case, AFAIK, the SDK binaries will be linked with one specific version of the CRT, which may or may not be the same as the one used in one specific version of Visual Studio. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: http://pypi.python.org/pypi

2010-05-01 Thread Martin v. Loewis
If it's not a Python package, it shouldn't be in the Python Package Index. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Parser

2010-05-02 Thread Martin v. Loewis
Andreas Löscher wrote: > Hi, > I am looking for an easy to use parser. I am want to get an overview > over parsing and want to try to get some information out of a C-Header > file. To get information from a header file, try Tools/scripts/h2py.py Regards, Martin -- http://mail.python

Re: Sphinx hosting

2010-05-03 Thread Martin v. Loewis
ion > there. Any hint is appreciated. If it's a Python package that this documentation is about, you can host it on PyPI. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Sphinx hosting

2010-05-03 Thread Martin v. Loewis
> Do you know of recent improvements on the PyPI side about docs > hosting? Yes; go to your package's pkg_edit page, i.e. http://pypi.python.org/pypi?%3Aaction=pkg_edit&name=decorator and provide a zip file at Upload Documentation. Regards, Martin -- http://mail.python.org/m

Re: Teaching Programming

2010-05-04 Thread Martin P. Hellwig
On 05/04/10 11:28, superpollo wrote: Samuel Williams ha scritto: I personally like indentation. I just wonder whether it is an issue that some people will dislike. there might be problems if for example you generate code from a one-line template. Well a one-line template code generator are

Re: py3 tkinter acceps bytes. why?

2010-05-04 Thread Martin v. Loewis
also provide byte strings for text properties, and Tcl supports that "nicely" (*) Regards, Martin (*) I think you also asked how Tcl interprets things. IIUC, it first assumes that a byte string is UTF-8 (starting from 8.1 or so); if it's not, it then assumes that it's in the local

Re: Teaching Programming

2010-05-05 Thread Martin P. Hellwig
On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through in some exec magic

Re: py3 tkinter acceps bytes. why?

2010-05-06 Thread Martin v. Loewis
(not that you would usually want to use them in Python, but Tkinter is actually Tclinter, and should support all Tcl commands). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to3 issues with execfile on python 3.0 on files with encoding

2010-05-06 Thread Martin v. Loewis
> The default replacement should be really providing a new execfile that > gets the encoding in the first 2 lines and opens it with the proper > encoding set (and properly closes the stream). No. The default replacement should really open the file in binary mode. Regards, Martin

Re: Picking a license

2010-05-08 Thread Martin P. Hellwig
On 05/08/10 09:37, Steven D'Aprano wrote: If encouraging third parties to take open source code and lock it up behind proprietary, closed licences *isn't* a moral hazard, then I don't know what one is. I fail to see what is morally wrong with it. When I ,as the author, share my work to the pu

Re: py3 tkinter acceps bytes. why?

2010-05-08 Thread Martin v. Loewis
Matthias Kievernagel wrote: > Me: >>> If I don't want bytes to get passed to tkinter >>> I just have to raise an exception in AsObj, no? >>> Or is it even sufficient to just remove the bytes case? > Martin v. Loewis wrote: >> But why would you want

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 04:49, Paul Rubin wrote: As I read it, he is saying that when someone releases free software, they have "for all intends and purposes lost control over its use", so they "should have made peace with the fact" and surrender gracefully. I'm asking why he doesn't think Microsoft has los

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 18:24, Stephen Hansen wrote: Wait, what? Why shouldn't I profit repeatedly from the "same work already done"? *I* created, its *mine*. I put blood, sweat and tears into it and perhaps huge amounts of resources, risking financial security and sanity, and you're arguing I shouldn't

Re: Picking a license

2010-05-09 Thread Martin P. Hellwig
On 05/09/10 21:06, Stephen Hansen wrote: On Sun, May 9, 2010 at 12:33 PM, Martin P. Hellwig mailto:martin.hell...@dcuktec.org>> wrote: On 05/09/10 18:24, Stephen Hansen wrote: Wait, what? Why shouldn't I profit repeatedly from the "same work a

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-10 Thread Martin v. Loewis
ook at the copy of python26.dll. This should be the new one; perhaps you have another copy in the system32 folder? Did the upgrade inform you that it was an upgrade, or did it warn you that you would overwrite the previous installation? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure speed improvements across revisions over time?

2010-05-10 Thread Martin v. Loewis
w much. > > Other than me writing down numbers on a piece of paper on my desk, does > some tool that does this already exist? I recommend to use rrd. This can record time series, and then generate diagrams. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread Martin v. Loewis
nfirm. If so, you now have two Python installations in the same location; one for all users, and the older one just for you (or vice versa). I recommend to uninstall them both, and start over. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Upgrade Python 2.6.4 to 2.6.5

2010-05-11 Thread Martin v. Löwis
he Python files, and leave all other files alone. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: open(False) in python3

2010-05-12 Thread Martin v. Loewis
(for small values of success) the same way that open(0).read() > does. That's because your operating system made that so. Try a different operating system, and you may get different results. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: write a 20GB file

2010-05-14 Thread Martin v. Loewis
omething like 8kiB or 32kiB) in which it writes and which it flushes when that buffer is full. The comment about flush and close merely refers to the problem that some data may still be in the buffer at any point in time, unless you just called close or flush. HTH, Martin -- http://mail.python.org/ma

Re: parsing XML

2010-05-14 Thread Martin v. Loewis
kak...@gmail.com wrote: > Hi to all, let's say we have the following Xml > > > 17.1 > 6.4 > > > 15.5 > 7.8 > > > > How can i get the players name, age and height? > DOM or SAX and how Homework? Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading C extension from memory

2010-05-14 Thread Martin v. Loewis
hared libraries anymore, so you might then have to recompile the extensions to make them loadable from memory. However, it also might be possible to reimplement the shared library loader of the operating system, in which case you could then run regular extension modules directly from memory. Regar

Re: parsing XML

2010-05-14 Thread Martin v. Loewis
'd be using reflection to access three attributes?). So you rather take these clues as the starting point for an investigation (and then hope that Google comes up with the specific source code). Of course, it may also be that getting help is explicitly allowed. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading XML namespaces

2010-05-15 Thread Martin v. Loewis
he DOM, you look at all attributes of an element node, and search for those whose namespace is "http://www.w3.org/2000/xmlns/"; In SAX, you watch the startPrefixMapping events. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by code pages

2010-05-15 Thread Martin v. Loewis
ML document, > and you should be letting the XML parser decode it for you and in any case as > an > XML document it's most likely UTF-8, not ISO-8859-2. > > It's worth examining your definition of "working". I came to the same conclusions after reading the OP's article. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading XML namespaces

2010-05-15 Thread Martin v. Loewis
omebody different from the one writing the document - if you would always write them together, you wouldn't need xpath in the first place, but could produce the selection result right away. Regards. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
ith all namespace prefixes defined in the root element. He'll find out that his approach is flawed in the general case when he encounters such a case. It's probably pointless trying to convince him in the abstract. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading XML namespaces

2010-05-16 Thread Martin v. Loewis
ng it happen]. In that case, you could also hard-code all prefixes in your application; no need to traverse the input document. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

250

2010-05-20 Thread Martin P. Hellwig
On 05/20/10 07:51, cosmeticsafrolatino wrote: hi 250 locahost.local Hello WimaxUser3645-219.wateen.net [110.36.45.219], pleased to meet you -- http://mail.python.org/mailman/listinfo/python-list

Re: where are the program that are written in python?

2010-05-21 Thread Martin P. Hellwig
On 05/21/10 11:21, Deep_Feelings wrote: python is not a new programming language ,it has been there for the last 15+ years or so ? right ? Yeah about the same as Java however by having a look at this page http://wiki.python.org/moin/Applications i could not see many programs written in py

Re: Chatroom

2010-05-24 Thread Martin P. Hellwig
On 05/24/10 19:50, narcissus wrote: Hello , I want to create a program that is one chatroom and everyone has this program can Enter into that chatroom. how can i do this? and i want gui for it too (GTK) What have you tried so far? -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: confusing error with nntplib

2010-05-27 Thread Martin P. Hellwig
t be an issue with the server itself, but still, any input would be very appreciated. yours, Here is how I approached it: # Lets see first if the server is available [mar...@aspire8930 /usr/home/martin]$ telnet nntp.aioe.org nntp Trying 94.75.214.90... Connected to nntp.aioe.org. Escape character is &

Re: if, continuation and indentation

2010-05-27 Thread Martin P. Hellwig
On 05/27/10 13:22, HH wrote: I have a question about best practices when it comes to line wrapping/ continuation and indentation, specifically in the case of an if statement. When I write an if statement with many conditions, I prefer to use a parenthesis around the whole block and get the impli

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Martin P. Hellwig
On 05/28/10 13:17, Adam Tauno Williams wrote: You should be able to point it any any file-like object. But, again, why? If you have the data in the process why send it to stdout and redirect it. Why not just send the data to the client directly? Well you might want to multiplex it to more

Re: multiprocessing and accessing server's stdout

2010-05-28 Thread Martin P. Hellwig
On 05/28/10 21:44, Adam Tauno Williams wrote: On Fri, 2010-05-28 at 15:41 +0100, Martin P. Hellwig wrote: On 05/28/10 13:17, Adam Tauno Williams wrote: You should be able to point it any any file-like object. But, again, why? If you have the data in the process why send it to stdout and

Re: xrange issue 7721

2010-05-30 Thread Martin v. Loewis
ned 3. this is what you had expected/wanted to happen instead Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: xrange issue 7721

2010-05-31 Thread Martin v. Loewis
th this example, which should be reported separately. Since the docs are read by people with vastly different levels of experience, skill and nous, I think it's a reasonable complaint to make. That may well be. The proposed approach (reopen the issue) is what I consider unreasonable. Reg

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 11:16, Pierre Quentel wrote: I'm not saying that pythonforum.org is the best solution but it certainly looks more attractive than c.l.p. to the new generation of Python users - Pierre On the other hand it might not be so bad that you don't get questions from users here who are un

Re: Python Forum

2010-06-03 Thread Martin P. Hellwig
On 06/03/10 12:46, Michele Simionato wrote: On Jun 3, 12:28 pm, "Martin P. Hellwig" wrote: On the other hand it might not be so bad that you don't get questions from users here who are unable to use a nntp reader or news to mail service. I am unable to use a nntp reader

Re: Missing DLL in win98

2010-06-06 Thread Martin v. Loewis
I can apply to 98 to make it work. There is no fix. IIUC, it (actually) complains about some symbols missing from kernel32.dll (perhaps in addition to some DLLs missing). Yes, you do have to upgrade your whole OS just to install this. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-07 Thread Martin P. Hellwig
On 06/06/10 03:22, ant wrote: I get the strong feeling that nobody is really happy with the state of Python GUIs. Tkinter is not widely liked, but is widely distributed. WxPython and PyGtk are both powerful, but quirky in different ways. PyQt is tied to one platform. And there are dozens more.

<    36   37   38   39   40   41   42   43   44   >