Re: How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

2011-12-05 Thread Christian Heimes
Am 05.12.2011 17:23, schrieb Steven D'Aprano: > The trickiest part for me is ensuring that tkinter works correctly. After > installing Python from source about a dozen times now, I still don't know > why sometimes it works and sometimes it doesn't. sudo apt-get build-dep python2.7 Done ;) Howe

Re: How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

2011-12-05 Thread Christian Heimes
Am 05.12.2011 17:28, schrieb Chris Angelico: > On Tue, Dec 6, 2011 at 3:23 AM, Steven D'Aprano > wrote: >> Generally speaking, unless you are an expert, you should not use make >> install when installing Python from source, because it will replace the >> system Python with the newly installed one.

Re: Verbose and flexible args and kwargs syntax

2011-12-11 Thread Christian Heimes
Am 11.12.2011 13:39, schrieb Duncan Booth: >> Another issue: You suggest being able to use "attrdict" or some other >> dict subclass. This means that, rather than being a language >> construct, this will involve a name lookup. And what happens if you >> have a class that subclasses both list and di

Re: Localhost client-server simple ssl socket test program problems

2011-12-15 Thread Christian Heimes
Am 15.12.2011 20:09, schrieb Yang Chun-Kai: > Server side error: > > File "views.py", line 17, in > connstream = ssl.wrap_socket(newsocket, server_side=True, > certfile="/etc/home/ckyang/PHA/testsslsocket/mypha.crt", > keyfile="/etc/home/ckyang/PHA/testsslsocket/mypha.key", > ssl_version=ssl.PROT

Re: Localhost client-server simple ssl socket test program problems

2011-12-15 Thread Christian Heimes
Am 15.12.2011 21:09, schrieb Yang Chun-Kai: > Thanks for tips. > > But I dont understand one thing is if Python's SSL lib doesn't support > encrypted private keys for sockets. > > Then why should we "encrypt" the private key with "openssl rsa -in > /etc/home/ckyang/PHA/testsslsocket/mypha.key -ou

Re: Test None for an object that does not implement ==

2011-12-25 Thread Christian Heimes
Am 25.12.2011 15:04, schrieb Chris Angelico: > I think there are certain types that are actually not implemented as > classes, and hence cannot be subclassed. This is almost certainly an > implementation detail though; my testing was done in Py3.2 (on Windows > fwiw). Some extension types are not

Re: Which libraries for Python 2.5.2

2011-12-27 Thread Christian Heimes
Am 27.12.2011 17:03, schrieb W. eWatson: > from matplotlib._path import affine_transform > ImportError: DLL load failed: The specified module could not be found. You are missing one or more DLLs that is required to load the _path.pyd module. You can use http://www.dependencywalker.com/ to tra

Re: Using an OrderedDict for __dict__ in Python 3 using __prepare__

2012-01-08 Thread Christian Heimes
Am 09.01.2012 03:21, schrieb Steven D'Aprano: > What am I doing wrong? You aren't doing anything wrong. It's just not possible to have something different than a dict as a type's __dict__. It's a deliberate limitation and required optimization. The __prepare__ hook allows to you have a dict subcla

Re: How to remove ellipses from long paths in traceback?

2012-01-12 Thread Christian Heimes
Am 13.01.2012 05:34, schrieb Jason Veldicott: > Hi, > > Long paths in python traceback are contracted with ellipses. eg: > TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" > > Is there any way to see the full path? The dots don't look like an ellipses to me. An ellip

Re: Hash stability

2012-01-16 Thread Christian Heimes
Am 16.01.2012 09:18, schrieb Peter Otten: > I've taken a quick look into the suds source; the good news is that you have > to change a single method, reader.Reader.mangle(), to fix the problem with > hash stability. > > However, I didn't see any code to deal with hash collisions at all. It sme

Re: Installing Python on CentOS 6 - a big pain

2012-01-19 Thread Christian Heimes
Am 19.01.2012 12:05, schrieb Chris Angelico: > What I do is apt-get the most obvious things (g++/gcc and make, in > this case), then run configure and see if it bombs, then run make and > see if it bombs, and whenever there's a "command not found", attempt > to apt-get that command as a package nam

Re: subclassable types

2013-02-22 Thread Christian Heimes
Am 22.02.2013 10:35, schrieb Wolfgang Maier: > Also: can you use introspection to find out whether a type is valid as a > base type? I don't think so. For CPython the information is stored in the type's structure. When type->tp_flags & Py_TPFLAGS_BASETYPE is true then subclassing is allowed. But I

Re: python 3 problem: how to convert an extension method into a class Method

2013-02-26 Thread Christian Heimes
Am 26.02.2013 21:19, schrieb Ethan Furman: > Dumb question, but have you tried just assigning it? In Py3 methods are > just normal functions... > > 8<-- > class A(): > pass > > A.method = c_method > 8<-- That doesn't work with builtin functions

Re: Python Speed

2013-02-27 Thread Christian Heimes
Am 27.02.2013 23:24, schrieb Terry Reedy: > On 2/27/2013 3:21 AM, jmfauth hijacked yet another thread: >> Some are building, some are destroying. > > We are still waiting for you to help build a better 3.3+, instead of > trying to 'destroy' it with mostly irrelevant cherry-picked benchmarks. PEP

Re: Interesting list() un-optimization

2013-03-07 Thread Christian Heimes
Am 07.03.2013 17:00, schrieb Ian Kelly: > On Thu, Mar 7, 2013 at 4:22 AM, Wolfgang Maier > wrote: >> Well, it skips the costly len() call because your iter(Foo()) returns >> iter(range()) under the hood and list() uses that object's __len__() method. > > Iterators do not generally have __len__ me

Re: Surrogate pairs in new flexible string representation

2013-03-29 Thread Christian Heimes
Am 29.03.2013 07:22, schrieb Ian Kelly: > Since the PEP specifically mentions ParseTuple string conversion, I am > thinking that this is probably the motivation for caching it. A > string that is passed into a C function (that uses one of the various > UTF-8 char* format specifiers) is perhaps lik

Re: Parsing soap result

2013-04-17 Thread Christian Heimes
Am 17.04.2013 19:55, schrieb darnold: > On Apr 17, 8:50 am, Ombongi Moraa Fe > wrote: > >> how do I use xml.etree.ElementTree to print the parameters address and >> deliveryStatus? Or is there a better python method? >> > > > I'm sure there are prettier ways to do this, but you can use XPath >

Re: Red Black Tree implementation?

2013-05-02 Thread Christian Heimes
Am 02.05.2013 01:11, schrieb Dan Stromberg: > > What's the best Red Black Tree implementation for Python with an > opensource license? > > I started out looking at > http://newcenturycomputers.net/projects/rbtree.html > because it was > prett

Re: [Python.NET] What can I do with DLL?

2007-11-06 Thread Christian Heimes
jane janet wrote: > I'm a student. I wanna know how to do about my project. > I implemented aplication using Ironpython because I have to use .NET library > and c# code but I also have to use this application with another Python > implemented application. My teacher want me to create DLL file of

Re: Creating the windows MSI of python

2007-11-28 Thread Christian Heimes
Floris Bruynooghe wrote: > It would be great if someone knows how Python builds it's MSI. The Tools/ directory contains a script in Tools/msi/msi.py. Martin von Löwis is using the script to generate the official MSI bundles. You need to run it from a development shell. Good luck! Christian -- h

Re: Is os.lstat available on all platforms?

2007-11-29 Thread Christian Heimes
Giampaolo Rodola' wrote: > As far as I know where symlinks are not supported os.lstat should be > an alias for os.stat but I'm not 100% sure. You are right, it should be an alias. os.lstat is available on Windows, too. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONPATH and PYTHON_PATH

2007-12-04 Thread Christian Heimes
loial wrote: > Is there any difference? > > Does it matter which I use? Yes, it does matter. The former is interpreted by Python, the latter isn't. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Python 3?

2007-12-05 Thread Christian Heimes
A.T.Hofkamp wrote: > Well, Python 3 design is from the ground up, and aimed at the future, so they > are quite a few steps ahead of today's coding practice, let alone today's code > base (which is still 1.5 compatible as you discovered). Just a small note from me: Several people think that we are

Re: An Object's Type

2007-12-05 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Hi, > > Is it possible to find out if an object is of a certain type or of a > type derived from this type? class Example(object): pass class AnotherExample(Example): pass >>> issubclass(Example, object) True >>> issubclass(AnotherExample, object) True >>> issub

Re: Timezones in python

2007-12-05 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Is there any build in solution in python to handle timezones? My > problem is I have to convert +4 time to +0. In the worst case i can > just add +4 to the houer but I'm not very happy about that. Another > problem is the summer/winter timechange which happen with one wee

Re: Any simpler way to do this

2007-12-07 Thread Christian Heimes
Lars Johansen wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED > elif color == "BLUE": > x = term.BLUE > elif color == "GREEN": > x = term.GREEN > elif col

Re: Can I embed Windows Python in C# or VC++?

2007-12-07 Thread Christian Heimes
sturlamolden wrote: > The answer is YES. C# can access C functions exported by any DLL with > platform invoke. Since the Python C API is plain C and not C++ you can > gain access to it from C#. Import System.Runtime.InteropServices and > write wrappers like > > [DllImport("Python25.dll"), CallingC

Re: Erros when compiling a CPP program which uses CPython API functions

2007-12-07 Thread Christian Heimes
grbgooglefan wrote: > How do we resolve this error? The easiest way to solve all your problems is: make altinstall. It installs Python in PREFIX (usually /usr/local). Although it is possible to run Python in a build directory it is tricky and may not work for your own program. Christian -- ht

Re: Can I embed Windows Python in C# or VC++?

2007-12-07 Thread Christian Heimes
grbgooglefan wrote: > I want to use Python's Windows (python25.dll) version to embed in my > C# (or atleast VC++) program for performing syntax checks on the > Python expressions which are later supposed to be evaluated at runtime > by another C++ program > > For this, I would like to use CPython

Re: Erros when compiling a CPP program which uses CPython API functions

2007-12-07 Thread Christian Heimes
grbgooglefan wrote: > I am compiling CPP program which uses CPython API functions from > Python 2.5.1 source code > > First I compiled with this commanline, that time I got "pyconfig.h" > not found. On Unix you have to run ./configure and make before you can use a source tree. It creates a valid

Python 3.0a2 is out

2007-12-07 Thread Christian Heimes
A new alpha of Python 3000 was released a few minutes ago! http://www.python.org/download/releases/3.0/ Have fun and don't forget to report bugs at http://bugs.python.org/ Christian signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils & OS X universal binaries

2007-12-08 Thread Christian Heimes
Martin v. Löwis wrote: > At first, I also thought that Robin suggested that there is a problem > with Python. Upon re-reading, I now believe he rather sees the bug > in the reportlabs code, and is asking for an approach to solve it there. I saw your posting after I sent mine. The gmane web interfa

Re: distutils & OS X universal binaries

2007-12-08 Thread Christian Heimes
Robin Becker wrote: > A user reports problems with one of our extensions when running the > intel compiled extension on ppc and vice versa. He is building the > extension as a universal binary. Although the intel compiled version > runs fine it displays a known bug when run on a ppc. Have you r

Re: python from any command line?

2007-12-09 Thread Christian Heimes
waltbrad wrote: > Is there a way to set this so I can also invoke it from any command > line prompt? You can follow Adonis' advice but I'm going a different path on my computer because I've multiple versions of Python installed on my box. I usually put a simple batch file in c:\Windows, e.g. pyth

Re: Is a "real" C-Python possible?

2007-12-09 Thread Christian Heimes
Jack wrote: > I guess this is subjective :) - that's what I felt in my experience > with web applications developed in Python and PHP. I wasn't able to > find a direct comparison online. Please compare the number of serious bugs and vulnerabilities in PHP and Python. > I understand. Python module

Re: Python Exponent Question

2007-12-10 Thread Christian Heimes
databyss wrote: > I would expect 2**2**2**2 to be 256 I stumbled upon it, too. 2**2**2**2 == 2**(2**(2**2)) == 2**16 == 65536 Christian -- http://mail.python.org/mailman/listinfo/python-list

Improvements to the Python core (was: Is a "real" C-Python possible?)

2007-12-12 Thread Christian Heimes
Kay Schluehr wrote: > Given that the Python core team has been mostly silent about JIT > compilation and Armin Rigos work in particular which started 5 years > ago ( Psyco will not be promoted towards Python 3.0 and there is no > indication that anyone but Armin would maintain Psyco ) I wonder abo

Re: Is a "real" C-Python possible?

2007-12-12 Thread Christian Heimes
Kay Schluehr wrote: > class A(object): > foo = property: > def fget(self): > return self._foo > def fset(self, value): > self._foo = value > > which was translated as follows: > > class A(object): > def thunk(): > def fget(self): >

Re: Vista + Rails 2.0 upgrade => subprocess hangs

2007-12-12 Thread Christian Heimes
Eric Promislow wrote: > Here's a small Python program I use to grab the output from rake: > > = > > from subprocess import Popen, PIPE > > p = Popen(args='c:\\ruby\\bin\\ruby.exe c:\\ruby\\bin\\rake -T', > cwd=u'c:\\Users\\ericp\\testing\\file07', > shell=True, >

Re: Vista + Rails 2.0 upgrade => subprocess hangs

2007-12-12 Thread Christian Heimes
Eric Promislow wrote: >> Your usage of wait() is dangerous. The code can block indefinitely when >> the stdout or stderr buffer is full. >> >> Christian > > That's what it is. `rake -T` returns more data in Rails 2.0.1 > than it did in 1.2.6 -- cross-language breakage logically explained. > Thank

Re: Improvements to the Python core

2007-12-12 Thread Christian Heimes
Paul Boddie wrote: > Then you haven't been reading the right IRC channel recently. ;-) What's the right channel? I'm on #python and #python-dev > Indeed, but there's arguably a certain amount of deadlock around > making unpatched, released versions of Python available in all these > places, unles

Re: Is a "real" C-Python possible?

2007-12-13 Thread Christian Heimes
Duncan Booth wrote: > Unfortunately as currently implemented, getter setter and deleter just > update the existing property, so the getter defined in B changes how the > property works in A as well. I think the intention may have been that they > should create a new property each time, but this

Re: Is a "real" C-Python possible?

2007-12-13 Thread Christian Heimes
Steven D'Aprano wrote: > I'm not quite sure I understand that criticism. How is that different > from things which are not properties? > > foo.baz = 2 # oops, I meant bar > > will succeed regardless of whether foo.bar is an attribute or a property. Unless it's a new style class with __slots__

Re: More than one interpreter per process?

2007-12-18 Thread Christian Heimes
Roger Binns wrote: > sturlamolden wrote: >> If one can have more than one interpreter in a single process, > > You can. Have a look at mod_python and mod_wsgi which does exactly > this. But extension modules that use the simplified GIL api don't work > with them (well, if at all). No, you can'

Re: Changing intobject to use int rather than long

2007-12-19 Thread Christian Heimes
Terry Reedy wrote: > Good idea. I think people who moved to 64 bits to get 64 bits would be > upset if they did not ;-). Windows X64 users still get 32bit ints. The long datatype is 32bit even on the 64bit version of Windows. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get string printed by PyErr_Print( )?

2007-12-19 Thread Christian Heimes
grbgooglefan wrote: > PythonC API function PyErr_Print( ) prints an error string onto stderr > if PyErr_Occurred() is true. > I don't want to print this to stderr because my Python+C code is > running daemon mode & won't have terminal / stderr. > So, I want to retrieve the string which PyErr_Print(

Re: Python DLL in Windows Folder

2007-12-23 Thread Christian Heimes
Markus Gritsch wrote: > why does the Python installer on Windows put the Python DLL into the > Windows system32 folder? Wouldn't it be more clean to place it into > the Python installation folder beside the python.exe file? It's the easiest and best way to expose Python for 3rd party applications

Re: Building Python statically on linux

2007-12-27 Thread Christian Heimes
Micah Elliott wrote: > I'm ./configure-ing with "--disable-shared" (because this must mean > "enable static", right?), and (based on some other posts here) tried > adding "*static*" near the top of Modules/Setup. I'd like to see ldd > tell me "not a dynamic executable", but alas, it's presently:

Re: Python DLL in Windows Folder

2007-12-28 Thread Christian Heimes
Ross Ridge wrote: >> I did, and determined that it's not possible. We would have to use >> assembly manifests, and can't, as the tool chain doesn't support them. > > Your choice to use a tool chain that doesn't support side-by-side > assemblies does not make it impossible. I'm looking forward t

Re: comparing dictionaries to find the identical keys

2007-12-28 Thread Christian Heimes
Beema shafreen wrote: > hi everybody , > i need to compare two dictionary's key. I have written a script Use sets. Sets are easier to use and much faster: >>> d1 = {'a': 1, 'b': 2, 'c': 3} >>> d2 = {'b': 2, 'c': 3, 'd': 4} >>> d1.keys() ['a', 'c', 'b'] >>> d2.keys() ['c', 'b', 'd'] >>> s1 = set(

Re: Building Python statically on linux

2007-12-28 Thread Christian Heimes
Micah Elliott wrote: > Doing that (or CFLAGS=-static, or LDFLAGS=-static, or other Makefile > tweaks) gets me linker errors. Sounds like there's not a simple > prescribed means to do this (that anyone has documented). So now I'm > open to hearing about other hacks people have done to get this to

Re: parallel processing in standard library

2007-12-28 Thread Christian Heimes
Stefan Behnel wrote: > Well, there is one parallel processing API that already *is* part of stdlib: > the threading module. So the processing module would fit just nicely into the > idea of a "standard" library. Don't you forget the select module and its siblings for I/O bound concurrency? Chris

Re: Compiler or stg. to get exe!

2007-12-28 Thread Christian Heimes
SMALLp wrote: > Hy! > I have question. After short goggling, I haven't found anything good. So > my question is: > I wrote a program in python and i Get .py files and some .pyc in working > folder. Now i want program tu run under windows, so i need to get exe > files or something. > And what do

Re: Redirecting STDOUT using C calls.

2007-12-30 Thread Christian Heimes
Tom Gaudasinski wrote: > Greetings, > I'm trying to redirect python's stdout to another location. The > reason for this is that I'm embedding python in an application. Now, > originally my code was developed for Linux and that did not require > redirection due to the fact that every X11 appl

Re: TK 8.5

2007-12-31 Thread Christian Heimes
Leon wrote: > 1) Did you know if a future version of Python/Tkinter will use Tk 8.5 ? > And when ? We are planing to use Tcl/Tk 8.5 for Python 2.6 and 3.0. The topic is currently being discussed but nothing has been decided yet. > 2) Is it a way to use Tk 8.5 with the present version of Python (

Re: os.tmpfile()

2008-01-02 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Can anyone elaborate on how 'os.tmpfile()' works? I was thinking it would > create some sort of temporary file I could quickly add text too and then when > I was finished would automatically get rid of it. Here's my questions: Please don't use os.tmpfile(). It's not

Re: How do you pass compiler option to setup.py install?

2008-01-03 Thread Christian Heimes
Emin.shopper Martinian.shopper wrote: > Dear Experts, > > How do you pass the -c option to setup.py install? Specifically, when I try > to install zope.interfaces version 3.3 from source on a windows machine, I > get a message about using "-c mingw32". That works fine for setup.py build, > but it

Re: Memory Leaks and Heapy

2008-01-04 Thread Christian Heimes
Jeroen Ruigrok van der Werven wrote: > Aside from that (rant), I seriously dislike Python's memory management and > even more the fairly arcane ways people have to go about > debugging/troubleshooting some 600 MB to 2-3 GB(!) of resident memory use by > Python. > > Personally I consider this the w

Re: Cost of "unicode(s)" where s is Unicode

2008-01-06 Thread Christian Heimes
John Nagle wrote: >Does > > text = unicode(text) > > make a copy of a Unicode string, or is that essentially a > free operation if the input is already Unicode? >>> u = u"some long unicode object" >>> unicode(u) is u True -- http://mail.python.org/mailman/listinfo/python-list

Re: How to refer to the current module?

2008-01-07 Thread Christian Heimes
Mike wrote: > Is there any way around this? Can I somehow scope the 'current > module' and give getattr(...) an object that will (at run time) have > the appropriate bindings? globals() for the current name space import sys sys.modules[__name__] gets you the module object Christian -- http://

Re: Python too slow?

2008-01-09 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > I'm pretty new to Python, and even newer to Image/Video processing, > and trying to get started on a project similar to GRL Vienna's laser > marker. I found some sample code here > http://janto.blogspot.com/2006/01/motion-capture-in-python.html, > but after running the c

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Christian Heimes
Damjan wrote: > My question is, shoudn't it be enough to set PYTHONPATH and everything > automagically to work then? Is there some work done on this for python 3.0 > or 2.6 perhaps? I'm working on a PEP for a per user site dir for 2.6 and 3.0 Christian -- http://mail.python.org/mailman/listinfo

Re: virtualpython / workingenv / virtualenv ... shouldn't this be part of python

2008-01-11 Thread Christian Heimes
Goldfish wrote: > What about security holes, like a malicious version of socket getting > downloaded into a user's directory, and overriding the default, safe > version? Don't forget that in your PEP. A malicious piece of software has already hundreds of way to overwrite modules. It could add a py

Re: How to get user home directory on Windows

2008-01-12 Thread Christian Heimes
Giampaolo Rodola' wrote: > Is there a way to do that? home = os.path.expanduser("~") Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: no pass-values calling?

2008-01-15 Thread Christian Heimes
Dennis Lee Bieber wrote: > Since all "variable" names in Python are references to objects, > anything accessed using a name is accessed by reference. Anybody using the terms variable, reference or call-by-value is most likely explaining Python the wrong way. Sorry dude :) Christian -- ht

Re: no pass-values calling?

2008-01-15 Thread Christian Heimes
Ben Finney wrote: > The term "reference" is fine, since that's exactly how it works. One > gets at an object via some reference, be it a name or some access into > a container object. When an object has no more references to itself, > it becomes a candidate for garbage collection. And so on. Thank

Re: assigning values in python and perl

2008-01-16 Thread Christian Heimes
George Sakkis wrote: > Python's parameter passing is like passing a pointer in C/C++. [snip] It's not (I repeat NOT) like passing a pointer in C. Please read http://effbot.org/zone/call-by-object.htm Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: assigning values in python and perl

2008-01-16 Thread Christian Heimes
George Sakkis wrote: > Posting a counter-example where the difference is clearly shown would > be more vastly useful than referring to a list of long obscure usenet > posts with practically no examples. C/C++ are not even mentioned in > that page. I am not claiming you are wrong, I just don't find

Re: Extending the readline module?

2008-01-17 Thread Christian Heimes
Casey Rodarmor wrote: > What is the best way to go about doing this? You need some basic knowledge about C, the readline headers, Python sources and a compiler. Are you interested to contribute the extended code to the Python code base? We are always looking for new developers and additional featu

Re: Using "pickle" for interprocess communication - some notes and things that ought to be documented.

2008-01-17 Thread Christian Heimes
John Nagle wrote: > It's possible to use "pickle" for interprocess communication over > pipes, but it's not straightforward. IIRC the processing module uses pickle for IPC. Maybe you can get some idea by reading its code? http://pypi.python.org/pypi/processing/0.40 Christian -- http://mail.pyt

Re: Unique thread ID

2008-01-18 Thread Christian Heimes
Benjamin wrote: > Is there a way to obtain a unique ID for the current thread? I have an > object that I need to store local thread data in, and I don't want to > use threading.local because each thread might have multiple instances > of my object. threading.get_ident() but please use threading.lo

Re: What is a shortcut to the Default home directory in Windows

2008-01-18 Thread Christian Heimes
Mike Driscoll wrote: > I personally use Tim Golden's excellent win32 API wrapper, the > winshell script. You can find it here: > > http://timgolden.me.uk/python/winshell.html Yeah. Tim's winshell is fine but it's not using the official win32 api. However Python 2.6 will get an easier way to get a

Re: What is a shortcut to the Default home directory in Windows

2008-01-18 Thread Christian Heimes
Daniel Folkes wrote: > I am trying to write a file to the users file system. > > I need it to be in there home directory in WINDOWS. I know there is a > "shortcut" to home in Linux("~"), but is there an equivalent to that > in windows. Or to get to their "Documents and Settings" directory? > >

Re: Bug in __init__?

2008-01-18 Thread Christian Heimes
Zbigniew Braniecki wrote: > Any clue on what's going on here, and/if where I should report it? Congratulations! You've stumbled over a well known gotcha. Most newbies fall for the trap. class A: def __init__ (self, val=[]): print val self.lst = val val is created only *once* and sha

Re: finding memory leak in edgewall trac 0.11

2008-01-19 Thread Christian Heimes
rupert.thurner wrote: > what would be a good means of finding where the 0.11 version of > edgewall trac uses excessive memory. see > http://groups.google.com/group/trac-dev/browse_thread/thread/116e519da54f16b > for some details, where jonas suggested > http://wingolog.org/archives/2007/11/27/reduc

Re: What is a shortcut to the Default home directory in Windows

2008-01-19 Thread Christian Heimes
Tim Golden wrote: > Umm... Is it not? The only thing I'm aware of doing is > retaining backwards compat. by using SHGetPathFromIDList > on the SHGetSpecialFolderLocation because I was writing against > Win9x at the time. Or are you saying something else? > > (Admit I haven't checked all the docs s

Re: finding memory leak in edgewall trac 0.11

2008-01-19 Thread Christian Heimes
Jeroen Ruigrok van der Werven wrote: > Hi Christian, > > -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: >> I forgot one important point in my reply. The GC module contains some >> useful methods for debugging. Check gc.garbage. It should be empty. >

Re: Python 3000 and import __hello__

2008-01-19 Thread Christian Heimes
Brad wrote: > Just playing around with Python3000 a2 release on Windows XP 32-bit x86. > > import __hello__ > > doesn't print 'hello world...' as it does on 2.5 > > The import doesn't fail or generate errors... just no output. Perhaps > this is by design? I changed the __hello__ frozen module

Re: Linux/Win32 func. to get Python instdir (not exedir) + site-packages => extensions mgmt

2008-01-20 Thread Christian Heimes
pythonewbie wrote: > I am stucked on creating a function to get the Python install > directory (and site-packages directory) with a 100% reliable method... Only one method is 100% reliable: try: import yourextension except ImportError: available = False else: available = True Christi

Re: finding memory leak in edgewall trac 0.11

2008-01-20 Thread Christian Heimes
rupert.thurner wrote: > i forgot to mention that i cannot see any explicit sys._getframe(), or > __del__ in the genshi code, while the ones in trac-core seemed to be > there in 0.10.4. Does the code keep a reference to a traceback object or an attribute of a traceback object? Christian -- http:

Re: Memory errors with imaplib

2008-01-20 Thread Christian Heimes
Grant Edwards wrote: > The problem and the one-line soulution have been known for over > two years and it's still an open bug? Nobody was interested to provide a patch. I raised the level of the bug. It's going to be fixed soonish. Christian -- http://mail.python.org/mailman/listinfo/python-lis

Re: Memory errors with imaplib

2008-01-21 Thread Christian Heimes
Grant Edwards wrote: > If the solution shown in the bug report is correct, I'd be more > than happy to generate a patch. The solution seems fine but IMO it should be fixed in the ssl socket and not in imaplib. I like to get it *fixed* and not *worked around*. :) Christian -- http://mail.pytho

Re: isgenerator(...) - anywhere to be found?

2008-01-22 Thread Christian Heimes
Stefan Rank wrote: > on 22.01.2008 14:20 Diez B. Roggisch said the following: >> def isgenerator(v): >> def _g(): yield >> return type(v) == type(_g()) >> >> But I wonder why there is no such method already available? > > > This tests for generator objects, and you could also use:: > >

Re: translating Python to Assembler

2008-01-22 Thread Christian Heimes
Wim Vander Schelden wrote: > Python modules and scripts are normally not even compiled, if they have > been, > its probably just the Python interpreter packaged with the scripts and > resources. No, that is not correct. Python code is compiled to Python byte code and execute inside a virtual machi

Re: bags? 2.5.x?

2008-01-22 Thread Christian Heimes
Dan Stromberg wrote: > Is there a particular reason why bags didn't go into 2.5.x or 3000? > > I keep wanting something like them - especially bags with something akin > to set union, intersection and difference. Ask yourself the following questions: * Is the feature useful for the broad mass?

Re: python24 symbol file...pyhon24.pdb

2008-01-23 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > I've seen a few references on the net to a python24.pdb file. I assume > it's a symbol file along the lines of the pdb files issued by > microsoft for their products. Maybe I'm wrong. .pdb files (program database) are created by MS' compiler, see http://en.wikipedia.org/

Re: translating Python to Assembler

2008-01-23 Thread Christian Heimes
Wim Vander Schelden wrote: > I didn't know that python uses a VM, I thought it still used an > interpretter! You > learn something new everyday :) still? I don't think Python ever used a different model. Most modern languages are using an interpreted byte code approach: http://en.wikipedia.org/wi

math and numerical fixes (was: When is min(a, b) != min(b, a)?)

2008-01-23 Thread Christian Heimes
Jason wrote: > Please note that NaN's are very funky and platform dependent. They > depend on their underlying platform's C library for creation and > display. On windows, "float('nan')" will cause an exception, as there > are no valid string representations of NAN that can be converted to > the

Re: When is min(a, b) != min(b, a)?

2008-01-23 Thread Christian Heimes
Grant Edwards wrote: > In many applications (e.g. process control) propogating NaN > values are way too useful to avoid. Avoiding NaN would make a > lot of code far more complicated than would using them. NaNs are very useful for experienced power users but they are very confusing for newbies or

Re: When is min(a, b) != min(b, a)?

2008-01-24 Thread Christian Heimes
Antoon Pardon wrote: > That doesn't follow. The problem is not that x < nan returns False > because that is correct since x isn't smaller than nan. The problem > is cmp(x, nan) returning 1, because that indicates that x is greater > than nan and that isn't true. Please report the problem. cmp(),

Re: Python and binary compatibility

2008-01-25 Thread Christian Heimes
Ambush Commander wrote: > The primary problem involves binary extensions to the Python > interpreter itself, which Mercurial uses. The only C compiler I have > on my machine is Visual Studio 2005 Express, but Python's binary > distribution was compiled with VS 2003, so the installer refuses to > co

Re: Minimum Requirements for Python

2008-01-25 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Can someone tell me the minimum requitements for Python as I can't > find it anwhere on the site. I have 3 PC's which are only 256mb RAM, > wanted to know if this was sufficenent. Python runs even on mobile phones with far less memory. However the memory consumption depe

Re: "just like Java" (was :Re: translating Python to Assembler)

2008-01-25 Thread Christian Heimes
Paul Boddie wrote: > Well, it is important to make distinctions when people are wondering, > "If Python is 'so slow' and yet everyone tells me that the way it is > executed is 'just like Java', where does the difference in performance > come from?" Your responses seemed to focus more on waving that

Re: del self?

2008-01-25 Thread Christian Heimes
Simon Pickles wrote: > Hi, > > Just curious... What are the implications of a class member calling: > > del self A method like def spam(self): del self just removes self from the local namespace of the spam function and thus results in decreasing the reference count of self by one. A class

Re: psyco on mac

2008-01-25 Thread Christian Heimes
Arash Arfaee wrote: > Hello, > > I have problem installing psyco on my mac. Can anybody help me? Psyco doesn't work on a PowerPC Mac. It requires a i4986 compatible CPU (aka x86 or IA32). Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Portably killing/signalling another process not supported?

2008-01-26 Thread Christian Heimes
John Nagle wrote: > There doesn't seem to be any way to portably kill another process > in Python. "os.kill" is Mac/Unix only. The "signal" module only lets > you send signals to the current process. And the "subprocess" module > doesn't have a "kill" function. > > Subprocess objects re

Re: Python and binary compatibility

2008-01-26 Thread Christian Heimes
Joshua Kugler wrote: > That page has a link to the Microsoft Visual C++ Toolkit 2003 page, which > then says it's been discontinued and to use Visual C++ 2005 Express > Edition. Sigh... You can still find some copies of the free toolkit on the internet. Christian -- http://mail.python.org/mail

Re: optional static typing for Python

2008-01-27 Thread Christian Heimes
Arnaud Delobelle wrote: > On Jan 27, 11:00 pm, "Russ P." <[EMAIL PROTECTED]> wrote: >> On Jan 27, 2:49 pm, "André" <[EMAIL PROTECTED]> wrote: >>> Perhaps this:http://www.python.org/dev/peps/pep-3107/mightbe >>> relevant? >>> André >> Thanks. If I read this correctly, this PEP is on track for Python

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-27 Thread Christian Heimes
Paul McGuire wrote: > I thought at one time there was to be a "decorators" module in the > stdlib for just this kind of useful item. At minimum, you could post > this to the Python wiki at http://wiki.python.org/moin/PythonDecoratorLibrary. Please take the idea to the Python developer list. Seve

Re: validate string is valid maths

2008-01-28 Thread Christian Heimes
Steven D'Aprano wrote: > def rationalise_signs(s): > while "++" in s or "+-" in s or "-+" in s or "--" in s: > s = s.replace("++", "+") > s = s.replace("--", "+") > s = s.replace("+-", "-") > s = s.replace("-+", "-") > return s I assume it's faster to check

<    1   2   3   4   5   6   7   8   9   10   >