Re: Incomplete sys.path with embeddable python (Windows)!?

2023-04-22 Thread Ralf M.
Am 21.04.2023 um 18:07 schrieb Thomas Passin: On 4/20/2023 5:47 PM, Ralf M. wrote: Hello, when I run a script with a "normally" installed python, the directory the script resides in is automatically added as first element to sys.path, so that "import my_local_module" find

Re: Incomplete sys.path with embeddable python (Windows)!?

2023-04-22 Thread Ralf M.
Am 22.04.2023 um 03:27 schrieb Greg Ewing via Python-list: How are you invoking your script? Presumably you have some code in your embedding application that takes a script path and runs it. Instead of putting the code to update sys.path into every script, the embedding application could do it be

Re: Incomplete sys.path with embeddable python (Windows)!?

2023-04-22 Thread Ralf M.
Am 21.04.2023 um 17:31 schrieb Mats Wichmann: On 4/20/23 15:47, Ralf M. wrote: Hello, when I run a script with a "normally" installed python, the directory the script resides in is automatically added as first element to sys.path, so that "import my_local_module" finds m

Incomplete sys.path with embeddable python (Windows)!?

2023-04-21 Thread Ralf M.
ot;, 1)[0] if script_path not in sys.path: sys.path[0:0] = [script_path] import my_local_modul That works, but it's ugly, executing code between imports is frowned upon, and it needs to be added to every script. Does anybody have a better idea? Any help is appreciated. Ralf M. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to replace an instance method?

2022-09-17 Thread Ralf M.
Am 17.09.2022 um 00:35 schrieb Dan Stromberg: On Fri, Sep 16, 2022 at 2:06 PM Ralf M. <mailto:ral...@t-online.de>> wrote: I would like to replace a method of an instance, but don't know how to do it properly. You appear to have a good answer, but...  are you sure

Re: How to replace an instance method?

2022-09-17 Thread Ralf M.
Am 16.09.2022 um 23:34 schrieb Eryk Sun: On 9/16/22, Ralf M. wrote: I would like to replace a method of an instance, but don't know how to do it properly. A function is a descriptor that binds to any object as a method. For example: >>> f = lambda self, x: self + x

How to replace an instance method?

2022-09-16 Thread Ralf M.
or what sections of the documentation to read next. Any ideas / pointers? Ralf M. -- https://mail.python.org/mailman/listinfo/python-list

Re: .0 in name

2022-05-28 Thread Ralf M.
can be used in several namespaces and as attributes. It's just a bit harder to use non-identifier names than identifiers. Whether it's a good idea to use them at all is a different question. I think the OP wondered about the .0 in the local namespace within list comprehensions. Unfortunately I cannot say much about that. Paul Ralf M. -- https://mail.python.org/mailman/listinfo/python-list

Re: "py.ini" question

2021-04-25 Thread Ralf M.
Am 25.04.2021 um 16:30 schrieb Mats Wichmann: On 4/24/21 2:57 PM, Chris Angelico wrote: On Sun, Apr 25, 2021 at 5:57 AM Gisle Vanem wrote: With 'py -3.6' or 'py 3.8' I get the expected. But with 'py -3':     Python 3.8.9 (default, Apr 13 2021, 15:54:59)  [GCC 10.2.0 64 bit (AMD64)] on win32

unittest test discovery: regular packages vs. namespace packages

2020-07-10 Thread Ralf M.
Hello, to my last question I got many helpful and enlightening answers. So I try again with a completely different topic. https://docs.python.org/3/library/unittest.html#test-discovery says about test discovery: "Unittest supports simple test discovery. In order to be compatible with test disc

Enums are Singletons - but not always?

2020-05-23 Thread Ralf M.
nd another, different instance of En and its members is created. How do I have to change mod1.py to avoid the problem? Currently I have moved main() into a new file script.py. That works, but is not what I wanted. I doubt it's a bug in the enum module, but should that be the case, I&#

Re: Spread a statement over various lines

2019-09-19 Thread Ralf M.
Am 18.09.2019 um 22:24 schrieb Alexandre Brault: On 2019-09-18 4:01 p.m., Ralf M. wrote: I don't know the exact rules of Windows wildcards, so there may be even more cases of unexpected behavior. If anyone knows where to find the complete rules (or a python module that implements the

Re: Spread a statement over various lines

2019-09-19 Thread Ralf M.
Am 18.09.2019 um 22:22 schrieb Chris Angelico: On Thu, Sep 19, 2019 at 6:20 AM Ralf M. wrote: Am 17.09.2019 um 20:59 schrieb Manfred Lotz: I have a function like follows def regex_from_filepat(fpat): rfpat = fpat.replace('.', '\\.') \

Re: Spread a statement over various lines

2019-09-18 Thread Ralf M.
unexpected behavior. If anyone knows where to find the complete rules (or a python module that implements them), I would be interested. Regards, Ralf - Details (Win 7 home SP1) - C:\tmp>more pydirb.py #!/usr/bin/env python3 import os, re, sys def regex_from_filepat(fpat):

Multidimensional dicts

2019-09-06 Thread Ralf M.
Recently I wrote a quick and dirty script to do some counting and statistics. When I re-read it a bit later I noticed that I had been using two different ways to create two-dimensional (default-)dicts. Now I'm wondering whether one of them is "better" or more pythonic than the other. What I d

Re: version

2018-05-31 Thread Ralf Schoenian
Hi Mike, you can check for the major version with import sys sys.version_info.major On 01.06.2018 04:44, Mike McClain wrote: OK so I installed python 3.2, which is the latest available as a package in Debian Wheezy, because I've seen so many folks say it's a waste of time to play with Py

Re: How to make use of .egg files?

2017-04-05 Thread Ralf Hildebrandt
* David Shi via Python-list : > Can anyone explain please. http://stackoverflow.com/questions/2051192/what-is-a-python-egg -- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebra...@charite.deCampus Benjamin Franklin https://www.charite

Re: Defamation

2015-10-21 Thread Ralf Hildebrandt
> According to Ralf, python.org is hosted in the Netherlands, One could change that. > I want to buy peanut butter, but I don't, because I know that when it comes > to peanut butter I have no self-control and would eat the entire jar in a > single sitting. So I simply don'

Re: Defamation

2015-10-20 Thread Ralf Hildebrandt
article wasn't one on > > our list, which is why we missed this one. > > I don't believe that the Python mailing list archives are hosted in a > country under the jurisdiction of European Law. The Netherlands it is. -- Ralf Hildebrandt Charite

Re: Defamation

2015-10-20 Thread Ralf Hildebrandt
that the "next in thread" also was of defamatory content. Removed as well. -- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebra...@charite.deCampus Benjamin Franklin http://www.charite.de Hindenburgdamm 30, 12203 Berlin Geschäftsbereich

Re: Defamation

2015-10-19 Thread Ralf Hildebrandt
; python-list-owner, on the theory that this will be more useful than > discussion about it here. > -- > https://mail.python.org/mailman/listinfo/python-list The right place is postmas...@python.org, since the owner cannot clean the archives. -- Ralf Hildebrandt Ch

[ANN] pypiserver 1.1.5 - minimal private pypi server

2014-01-20 Thread Ralf Schmitt
iversal wheel - remove scripts subdirectory - add --index-url cli parameter 1.1.4 (2014-01-03) -- - make pypiserver compatible with pip 1.5 (https://github.com/schmir/pypiserver/pull/42) -- Cheers Ralf -- https://mail.python.org/mailman/listinfo/python-list

Re: [ANN] bbfreeze 1.1.2

2013-07-25 Thread Ralf Schmitt
Fábio Santos writes: > Seems like it has awesome features, but py3k is really important to me. Is > this on your roadmap? Sorry, I don't have a need for python 3 and also don't have a roadmap. -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANN] bbfreeze 1.1.2

2013-07-17 Thread Ralf Schmitt
s command 'bdist_bbfreeze' A new distutils/setuptools command bdist_bbfreeze integrates bbfreeze into your setup.py. bbfreeze works on windows and UNIX-like operating systems. bbfreeze has been tested with python 2.4, 2.5, 2.6 and 2.7 bbfreeze will not work with python 3 or higher. --

[ANN] pypiserver 1.1.2 - minimal private pypi server

2013-06-25 Thread Ralf Schmitt
fix "pypi-server -U" stable/unstable detection, i.e. do not accidentally update to unstable packages -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pypiserver 1.1.1 - minimal private pypi server

2013-06-12 Thread Ralf Schmitt
broken xmlrpc api on pypi.python.org by using HTTPS -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] greenlet 0.4.1

2013-06-07 Thread Ralf Schmitt
for assembly macro for PPC Linux platforms. Many thanks to all contributors! [1] http://opensource.hyves.org/concurrence/ [2] http://eventlet.net/ [3] http://www.gevent.org/ -- Cheers Ralf Schmitt -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pypiserver 1.1.0 - minimal private pypi server

2013-02-14 Thread Ralf Schmitt
or verify, doc_upload and remove_pkg -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pypiserver 1.0.1 - minimal private pypi server

2013-01-03 Thread Ralf Schmitt
cumentation - make the test suite work on python 3 - make pypi-server-standalone work with python 2.5 -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pypiserver 1.0.0 - minimal private pypi server

2012-10-26 Thread Ralf Schmitt
pp_factory now use the the password_file option to create the app. Without this the package upload was not working. - Add --fallback-url argument to pypi-server script to make it configurable. -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.6.1 - minimal private pypi server

2012-08-07 Thread Ralf Schmitt
python setup.py register' work - added init scripts to start pypiserver on ubuntu/opensuse -- Cheers Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] greenlet 0.4.0

2012-06-21 Thread Ralf Schmitt
/ [3] http://www.gevent.org/ -- Cheers Ralf Schmitt -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.6.0 - minimal private pypi server

2012-06-14 Thread Ralf Schmitt
pypiserver work with pip on windows - add support for password protected uploads - make pypiserver work with non-root paths - make pypiserver 'paste compatible' - allow to serve multiple package directories using paste -- Cheers, Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.5.2 - minimal pypi server

2012-03-26 Thread Ralf Schmitt
e a way to get the WSGI app - improved package name and version guessing - use case insensitive matching when removing archive suffixes - fix pytz issue #6 -- Cheers, Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.5.1 - minimal pypi server

2012-02-23 Thread Ralf Schmitt
x27;pypi-server -U' compatible with pip 1.1 -- Cheers, Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] greenlet 0.3.4

2012-02-11 Thread Ralf Schmitt
://www.gevent.org/ -- Cheers Ralf Schmitt -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] greenlet 0.3.3

2012-01-06 Thread Ralf Schmitt
x64 windows * Add a test for greenlet C++ exceptions * Fix compilation on Solaris with SunStudio [1] http://opensource.hyves.org/concurrence/ [2] http://eventlet.net/ [3] http://www.gevent.org/ -- Cheers Ralf Schmitt -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] greenlet 0.3.2

2011-12-19 Thread Ralf Schmitt
build dependencies patch from flub. * #21 - Can't pass parent=None to greenlet.greenlet() [1] http://opensource.hyves.org/concurrence/ [2] http://eventlet.net/ [3] http://www.gevent.org/ -- Cheers Ralf Schmitt -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.5.0 - minimal pypi server

2011-12-05 Thread Ralf Schmitt
e setup.py install without calling 2to3 by changing source code to be compatible with both python 2 and python 3. We now ship a slightly patched version of bottle. The upcoming bottle 0.11 also contains these changes. - make the single-file pypi-server-standalone.py work with python 3 -- Ch

[ANNOUNCE] pypiserver 0.4.0 - minimal pypi server

2011-11-20 Thread Ralf Schmitt
ctionality to manage package updates - updated documentation - python 3 support has been added -- Cheers, Ralf -- http://mail.python.org/mailman/listinfo/python-list

[ANN] pypiserver 0.3.0 - minimal pypi server

2011-10-07 Thread Ralf Schmitt
server now scans the given root directory and it's subdirectories recursively for packages. Files and directories starting with a dot are now being ignored. - /favicon.ico now returns a "404 Not Found" error - pypiserver now contains some unit tests to be run with tox -

visual studio 2010 question

2010-09-19 Thread Ralf Haring
tudio 2010 will be supported? I am using python 2.6.5, but web searching seemed to show that 2.7 or 3.X didn't support it yet either. -Ralf Haring -- http://mail.python.org/mailman/listinfo/python-list

Re: Import python modules from sub-directories

2010-08-05 Thread Ralf Schoenian
here. Assuming your filename is importme.py and your classname is Test you can do the following imports: from sub1.importme import Test import sub1.importme You can find further explainations in the official tutorial http://docs.python.org/tutorial/modules.html Regards, Ralf -- http

Re: Python + webservice

2009-10-07 Thread Ralf Schoenian
are with me a bit of experience? Did you try suds https://fedorahosted.org/suds ? I've got good results with this library. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Python book

2009-09-30 Thread Ralf Schoenian
Novice to Professional by Magnus Lie Hetland. This book provides a gently introduction into Python and 10 chapters with "complete" projects. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use Python to interface with Web pages?

2009-07-07 Thread Ralf Schoenian
t know where to even start on this one. Thanks for any help/pointers Peter Hi, a good starting point possibly is http://wwwsearch.sourceforge.net/mechanize/ Regards, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Network programming ?

2009-05-25 Thread Ralf Schoenian
that it is useable at windows and linux. For the socket programming I would like to suggest using the xmlrpclib. You can find the official documentation here: http://docs.python.org/library/xmlrpclib.html Regards, Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Shell Extensions - Out of Proc

2009-04-23 Thread Ralf
> I think that for whatever reasons, explorer always tries to create > shell extensions as InProc.  CoCreateInstance, which is the usual > API to create COM instances, allows to specify which one you want. > > Thomas So there is no way to do this, other than to create a "proxy" COM object as InPr

Windows Shell Extensions - Out of Proc

2009-04-23 Thread Ralf
I'm trying to develop Windows Shell Extensions with the Python Win32 Extensions. Most of the samples are working. However, I have a slightly different need: I want the Python COM server to run as a separate process ("LocalServer" or "OutOfProc"). As I understand, both the InProc and LocalServer ve

Re: equivalent of source command in tcl for python

2009-03-18 Thread Ralf Schoenian
sys.exit() Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Email Program

2009-03-01 Thread Ralf Schoenian
these are the big ones. Actually, ff you want to see an Python email client in action have a look at Chandler: http://chandlerproject.org/ it's written in wxPython. Regards, Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Empty string is False right?

2009-01-31 Thread Ralf Schoenian
l(s) '' >>> Regards, AJ Hi, yes, the following evaluates to False: empty String: '' empty list: [] empty tuple: () empty dict: {} 0, None and False of course Regards, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Extending Python with C or C++

2009-01-05 Thread Ralf Schoenian
npapers.org/index.php/tpp/article/view/71 Regards, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Which SOAP module?

2009-01-04 Thread Ralf Schoenian
in this library were rather painful but som year ago it was the most sophisticated library. Regards, Ralf -- http://mail.python.org/mailman/listinfo/python-list

ANN: bbfreeze 0.96.5

2008-09-18 Thread Ralf Schmitt
and track binary dependencies. This release features a new bdist_bbfreeze command, which integrates bbfreeze into setup.py scripts (contributed by Hartmut Goebel, thanks). More information can be found at the python package index: http://pypi.python.org/pypi/bbfreeze/ Regards, - Ralf -- http

Re: bbfreeze problem

2008-08-12 Thread Ralf Schmitt
any matplotlib) Try running 'XREF=1 bb-freeze test5-coded-pre.py'. This should open a browser window with your dependencies... Regards, - Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for IDE advice or workflow tips

2008-08-04 Thread Ralf Schönian
ttests for your code. This will lead to more testable and shorter chunks of code and your test cases will be executed on each iteration step. Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

matplotlib: is there something like DISLIN's "call newpag" ?

2008-07-13 Thread Ralf . Schaa
Hi there, hope somebody here can help me out: is there a command in matplotlib which resembles DISLIN's "CALL NEWPAG" ? I am trying to make multiple plots on several pages, all stored in one ps (or pdf) document. Cheers -Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help me with linking libraries on Solaris 10 sparc

2008-05-01 Thread Ralf Schönian
/_psycopg.so: symbol round: referenced symbol not found Any suggestions or help will be appreciated. Hi, maybe a stupid question - but why don't you want to use the "official" package? You can download it here: http://sunfreeware.mirrors.tds.net/indexsparc10.html Regards, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI with URL problem

2008-02-13 Thread Ralf Schönian
; sock = urlopen(path) > page=sock.read() > if "There is currently no text in this page" in page: > print "found" > return True > else: > print "not found" > return False > > if __name__=="__main__": > urlexists("cheese_test") Are you using the same user in your cgi script and within IDLE? Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Oracle Output to a File

2007-12-27 Thread Ralf Schönian
ure if that is needed in this > situation. > > Best Regards, > Tom Hi, have a look at the csv Module: http://docs.python.org/lib/csv-examples.html Just iterate over your result. # Untested import csv writer = csv.writer(open("some.csv", "wb")) for row in result: row = map(str,row) writer.writerows(row) writer.close() Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Oracle Output to a File

2007-12-27 Thread Ralf Schönian
Ralf Schönian schrieb: > t_rectenwald schrieb: >> Hello, >> >> I attempting to execute an Oracle query, and write the results to a >> file in CSV format. To do so, I've done the following: >> >> import cx_Oracle >> db = cx_Oracle.conne

Re: basic web auth and verification

2007-10-24 Thread Ralf Schönian
ession_key'] = Config.username self._br['session_password'] = Config.password response=self._br.submit() self._br.set_response(response) for link in self._br.links(url_regex="www.somesite.com"): self._br.follow_link(link) if 'Sign In' in self._br.title(): raise ValueError('Wrong password') Regards, Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

CGI Script using Python

2007-04-19 Thread Ralf
Hello, is there anybody who can help me. I would like to use a Python Script to download Files from a Server to the Client, to update the Client. Thanx Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Python books?

2007-03-09 Thread Ralf Schönian
Have a look at: Core python programming from Wesley J. Chun printed by Prentice Hall. Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: uml and python

2007-02-07 Thread Ralf Schönian
ered > > thanks > Take a look at gaphor: http://gaphor.sourceforge.net/ Regards, Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: Sourcing Python Developers

2007-01-30 Thread Ralf Schönian
from http://python.org/community/jobs/)? If any one > knows of a resume repository (other than Monster, Dice, > Costs-an-arm-and-leg job site) please share. Do not know if you have to give your arm or your leg away, but maybe the following place is of interest for you: http://www.opensou

Re: Python web app. (advice sought)

2007-01-15 Thread Ralf Schönian
import them by extending the path with sys.path.append() After changing any file here, I have to restart Karrigell. Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

Re: problem while going through a tutorial

2006-12-12 Thread Ralf Schönian
> I'm not sure what changed, because it used to work. anyhow thanks a lot! You forgot to import the string module: from string import * Regards, Ralf Schoenian -- http://mail.python.org/mailman/listinfo/python-list

ADO with Python

2006-10-16 Thread Ralf
Is their anybody with xperience in using the both and can provide me with some xamples. Thx a lot Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Gadfly server startup error

2006-09-13 Thread Ralf Muschall
ion(s) in the server (which is true in some sense, since I never made a policy - I just want a blood DB). It seems the proper way to use gadfly over the net is to say echo 'SQL statement;' | ssh -l remoteuser 'gfplus -localoptions' :-( Is anybody out there who has used the server+client operation mode successfully? Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Gadfly server startup error

2006-09-13 Thread Ralf Muschall
. > Time to report a bug, methinks? Makes SQLite look good ... Carl Waldbieser reported this bug (and a few others, including fixes) in April 04 (entry 94049[35]). It seems the project fell asleep four years ago (but in "News" on SF is a more recent message from the author pointing to

Gadfly server startup error

2006-09-12 Thread Ralf Muschall
x27; is not defined which is factually correct (the script only imports sys, but then tries to instantiate the class "Server" which is nowhere defined). Is this a bug somewhere, or is just my installation broken? Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: time.clock() going backwards??

2006-08-29 Thread Ralf Muschall
MAIL PROTECTED]> SCNR, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Railroad track syntax diagrams

2006-08-02 Thread Ralf Muschall
(i.e. no ghc) and is simpler to use (no questions about inexistent .afm files etc.) Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-07 Thread Ralf Muschall
le helps only if the data is tabular (i.e. a single relation), i.e. probably never (otherwise the sending side would have shipped something like CSV). Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Name conflict in class hierarchy

2006-05-23 Thread Ralf Muschall
: 'implementation, not > API') attributes. That's what I meant. "A.func" looked like an internal implementation detail. >> or be documented. Having the implementation details documented too would be nice, but hardly enforceable in real life. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Name conflict in class hierarchy

2006-05-20 Thread Ralf Muschall
change your code. 3. Call dir(classname) at runtime and raise an exception if it contains a name used by you. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: [silly] Does the python mascot have a name ?

2006-05-19 Thread Ralf Muschall
John D Salt wrote: > I'll believe you if you can give me a list of ten things that don't have > names. [ sub{$_}, sub{$_+1}, sub{$_+2}, sub{$_+3}, sub{$_+4}, sub{$_+5}, sub{$_+6}, sub{$_+7}, sub{$_+8}, sub{$_+9}] That was easy. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Any Python lullabies?

2006-04-18 Thread Ralf Muschall
hing near the end of the Camel book (p. 552ff). This isn't exactly python, but the baby probably won't see the difference. SCNR, Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: "The World's Most Maintainable Programming Language"

2006-04-05 Thread Ralf Muschall
> set a high standard for naming techniques. So we should rename Python into Cottonmouth to get more attention. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-08 Thread Ralf Muschall
a defun and use it as a hook (nil means "just the current buffer whatever mode it is in"). Btw., vim seems to try to become a real editor - look at http://wiki.alu.org/Vim_ECL Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: processing the genetic code with python?

2006-03-07 Thread Ralf Muschall
at this is really homework. ... > data = data.upper().replace('T', 'U') ... I'd apply the "inverse" of this line to the codon table (or a copy thereof, or just adding the entries) in the hope that changing 37 table entries is less work than changing each codon in a

Re: Determing whether two ranges overlap

2006-02-17 Thread Ralf Muschall
proof ;-) You will have to decide whether you want ">" or ">=" (beware of the former when using floats). If you cannot assume that the pairs are in order, this will break. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: Shortest prime number program

2006-02-11 Thread Ralf Muschall
and 3**x%x==3 and 5**x%x==5] SCNR, Ralf PS: They both break at 561, and further strengthening of the condition will not help. Manual loop unrolling as follows works: [2,3,... ]+[x for x in range(1,99) if False] For sufficiently small values of 99, this will also be a rather short

Re: decorator question

2006-01-08 Thread Ralf Schmitt
Schüle Daniel schrieb: > hello NG, > > consider this code > > >>> def timelogger(f): > ... def wrapper(*a,**kw): > ... print "started at %s" % time.ctime() > ... t0 = time.time() > ... f(*a, **kw) > ... t1 = time.time() > ... print

Re: Encoding sniffer?

2006-01-06 Thread Ralf Muschall
Diez B. Roggisch wrote: > AFAIK iso-8859-1 has all codepoints taken - so you won't go beyond that > in your example. IIRC the range 128-159 (i.e. control codes with the high bit set) are unused. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: popen4

2005-10-19 Thread Ralf Muschall
Ganesan Rajagopal wrote: > Try pexpect instead. http://pexpect.sourceforce.net/ ^ That's a content-free ad site. You probably mean sourceforGe. Ralf -- http://mail.python.org/mailman/listinfo/python-list

Using PyGILState_Ensure

2005-09-20 Thread Ralf Riemer
)? Is there a risk that windows hangs up? Doing several calls of my dll function with the callback, is there a risk that the calls overlap and information gets lost? Thanks for your help! Ralf -- Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen für GMX

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-08-02 Thread Ralf W. Grosse-Kunstleve
ind. This is my preferred solution after thinking about it for a while (and asking myself "what would be best" while writing new Python code): def __init__(self, self.x, y, self.z) An approximation to this is attached for experimentation. It is based heavily on code posted by others in t

Re: Lots of pdf files

2005-07-21 Thread Ralf Muschall
aits until the queue is empty instead of sleep)? Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I import a py script by its absolute path name?

2005-07-14 Thread Ralf W. Grosse-Kunstleve
% python Python 2.4.1 (#1, Apr 7 2005, 11:06:30) [C] on osf1V5 Type "help", "copyright", "credits" or "license" for more information. >>> execfile.__doc__ 'execfile(filename[, globals[, locals]])\n\nRead and execute a Python script from a file.\nThe globals and locals are dictionaries, defaulting

Re: __autoinit__

2005-07-11 Thread Ralf W. Grosse-Kunstleve
> file_object, data sys.stdout = StringIO() show("hello, world.") If you run this, you will see "hello, world." on the screen. This means the right side of file_object=sys.stdout is evaluated when the Python code is parsed/compiled, not when it is executed. Chee

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-11 Thread Ralf W. Grosse-Kunstleve
plain_adopt_grouping: 0.69 autoinit_grouping: 1.14 autoinit_setattr_grouping: 1.07 autoattr_grouping: 1.01 decorated_init_grouping: 0.94 I think your decorator solution looks nice and has a good potential time-wise. Cheers, Ralf

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-11 Thread Ralf W. Grosse-Kunstleve
it immediately: in __init__() _y = 2 self.x = 1 self.z = 3 in __init__() _y = 3 self.x = 2 self.z = 1 Traceback (most recent call last): File "/net/cci/rwgk/decorated_init.py", line 45, in ? MyClass( z = 1, x = 2, _y = 3 ).show() File "/net/cci/rwgk/de

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-11 Thread Ralf W. Grosse-Kunstleve
if there is a way to hide the _ or self_ from the user of the class, i.e. given: class foo(object): @attribute_decorator def __init__(self, x, _y, z): pass can we make it such that the user can still write foo(x=1,y=2,z=3) without the underscore? Cheers, Ral

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-11 Thread Ralf W. Grosse-Kunstleve
corator doesn't need a "slots" class. > > AFAICT this differs from your proposal in that in your proposal you > want to use '.' as an include prefix the above uses '_' as an exclude > prefi

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-11 Thread Ralf W. Grosse-Kunstleve
x27;t work. 2. This approach is open to full optimization for runtime performance and should therefore be faster than the redundant conventional approach. I.e. the arguments can directly be inserted into the desired dictionary (or slot), without ever being adde

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Ralf W. Grosse-Kunstleve
ows immediately what is going on. In contrast, the __metaclass__ statement is potentially separated from the __init__ definition by unrelated code, leading to surprises (on top of intimidation for beginners). I don't think that's the best style. It is generally better if the framework doesn&

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-09 Thread Ralf W. Grosse-Kunstleve
oo slow. But it turns out to be faster: overhead: 0.00 plain_grouping: 0.27 update_grouping: 0.43 plain_adopt_grouping: 0.68 autoinit_grouping: 1.15 autoinit_setattr_grouping: 1.08 # yours autoattr_grouping: 1.06 I am am

  1   2   >