Re: Google AI challenge: planet war. Lisp won.

2010-12-03 Thread Mirko
On Dec 2, 12:06 pm, Xah Lee wrote: > discovered this rather late. > > Google has a AI Challenge: planet wars.http://ai-contest.com/index.php > > it started sometimes 2 months ago and ended first this month. > > the winner is Gábor Melis, with his code written in lisp. > > Congrats lispers! > > Gáb

reduced-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
ash tag hash) values) (let (result) (dohash (key value hash) (push (list key value) result)) result))) Comments, improvements? I am looking for a general purpose function like reduce that I can apply in various situations. Thanks, Mirko -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
On Sep 27, 11:18 am, Mirko wrote: > On Sep 26, 12:05 am, Xah Lee wrote: > > I am hijacking the following post and driving it to Cuba (the Monthy > Python fans will know what I refer to).  I want to create a `reduce'- > like function that can handle similar pr

Re: reduce-tagged (was Re: toy list processing problem: collect similar terms)

2010-09-27 Thread Mirko
On Sep 27, 11:40 am, Mirko wrote: > On Sep 27, 11:18 am, Mirko wrote: > > > > > On Sep 26, 12:05 am, Xah Lee wrote: > > > I am hijacking the following post and driving it to Cuba (the Monthy > > Python fans will know what I refer to).  I want to create a `re

Promoting your own library

2016-11-11 Thread mirko bonasorte
Hi all, what is the most appropriate way for a developer to promote his own Python library? I mean, apart from deploying it in Pypi and making the source code available in a SCV repository... Thanks. Mirko -- https://mail.python.org/mailman/listinfo/python-list

python 3000 and removal of builtin callable

2005-01-04 Thread Mirko Zeibig
; --- snap --- This is not an option for e.g. IDEs as some functions might actually do something when called ;-) and I like `callable` for introspection. Other ways would be to check for the `__call__` attribute or use several methods of the `inspect`-Module, both of which are not better than `c

Re: Best book on Python?

2004-12-16 Thread Mirko Zeibig
"Dive into Python" is available in a printed version as well ;-) (e.g. http://www.amazon.com/exec/obidos/tg/detail/-/1590593561/103-2217423-3565410). Regards Mirko -- http://mail.python.org/mailman/listinfo/python-list

metaclasses and performance

2007-06-19 Thread Mirko Dziadzka
mpact at all after class creation. Can someone explain me the performance difference between the two classes test1 and test2 Thank's in advance Mirko cut here - class meta(type): pass class test1(object): __metaclass__ = meta# using type via meta he

Re: metaclasses and performance

2007-06-21 Thread Mirko Dziadzka
for the explanation. My Linux distribution does not set NDEBUG when compiling the python package so asserts are still in place. A self compiled python does not use the asserts and is 20% faster in my micro benchmark. Mirko -- http://mail.python.org/mailman/listinfo/python-list

print string as raw string

2009-02-17 Thread Mirko Dziadzka
Hi all I'm trying to find a way to output strings in the raw-string format, e.g. print_as_raw_string(r"\.") should output r"\." instead of "\\." Is there a better way than writing your own print function? Some magic encoding? Mirko -- http://mail.python.org/mailman/listinfo/python-list

Re: print string as raw string

2009-02-17 Thread Mirko Dziadzka
lot of regex-strings and I want this code to be easy readable and editable. In fact, editing these regexes is the main reason for exporting them. So I would prefer the more compact and readable raw-string notation instead of the smantic equivalent string notation. So I'm going to write these coup

Re: print string as raw string

2009-02-17 Thread Mirko Dziadzka
Mirko Dziadzka wrote: > Hi all > > I'm trying to find a way to output strings in the raw-string format, e.g. > > print_as_raw_string(r"\.") should output r"\." instead of "\\." Ok, lets make a better example: >>> re_list = {

Threads, GIL and re.match() performance

2008-06-25 Thread Mirko Dziadzka
performance? I'm using Python 2.5 Thanks for your help Mirko -- "I've found that people who are great at something are not so much convinced of their own greatness as mystified at why everyone else seems so incompetent." Paul Graham in &qu

socket-module: different behaviour on windows / unix when a timeout is set

2008-07-09 Thread Mirko Vogt
windows does *not* raise the exception anymore. The Linux does as expected. Is that behaviour common or even documented? Found nothing. It took me lot's of time to figure this out, because there was no exception which was raised when testing for open / ports. When I try to read from the socket (e.g. on port on which nothing runs) I get a timeout after the via settimeou() specified value. Thanks in advance, Mirko -- http://mail.python.org/mailman/listinfo/python-list

Re: socket-module: different behaviour on windows / unix when a timeout is set

2008-07-11 Thread Mirko Vogt
Gabriel Genellina wrote: > En Wed, 09 Jul 2008 15:02:56 -0300, Mirko Vogt <[EMAIL PROTECTED]> escribi�: > >> it seems that the socket-module behaves differently on unix / windows >> when a timeout is set. > [...] >> Now I will change the code slightly - to be

using python2.6 on windows without installation

2010-04-29 Thread Mirko Vogt
brary? Backround is: I'd like to put the python directory on a share which is mounted by several windows hosts. That way I do not need to touch every windows host when I'm going to update a python installation but just the one which is sharing it to all others. Thanks a lot in

Re: using python2.6 on windows without installation

2010-05-03 Thread Mirko Vogt
Thanks a lot for all your solutions! Tried installing it "just for the current user" as suggested by Christian and it works like a charme, so there seems to be no need for another python distribution in this case. Thanks a lot once again! mirko On Fri, 2010-04-30 at 01:34 +0200,

Re: why function throws an error?

2022-06-28 Thread Mirko via Python-list
Am 28.06.22 um 09:57 schrieb נתי שטרן: def add_route(self, route): #""" Add a route object, but do not change the :data:`Route.app` #attribute.""" self.routes.append(route) self.router.add(route.rule, route.method, route, name=route

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Mirko via Python-list
Am 17.08.23 um 09:10 schrieb c.buhtz--- via Python-list:     UnboundLocalError: local variable '_' referenced before assignment This is a common gotcha: https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value You could solve it by

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Mirko via Python-list
Am 17.08.23 um 21:17 schrieb c.buhtz--- via Python-list: Hello Mirko, thanks for reply. Am 17.08.2023 18:19 schrieb Mirko via Python-list: You could solve it by defining _() locally like so: def foobar(translate):     _ = gettext.gettext I see no way to do that. It is not the "class

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-11 Thread Mirko via Python-list
Am 11.09.23 um 14:30 schrieb John O'Hagan via Python-list: I was surprised that the code below prints 'called' three times. from tkinter import * from tkinter.ttk import * root=Tk() def callback(*e):     print('called') tree = Treeview(root) tree.pack() iid = tree.insert('', 0, text='test'

Re: Tkinter ttk Treeview binding responds to past events!

2023-09-12 Thread Mirko via Python-list
Am 12.09.23 um 07:43 schrieb John O'Hagan via Python-list: My issue is solved, but I'm still curious about what is happening here. MRAB already said it: When you enter the callback function, Tk's mainloop waits for it to return. So what's happening is: 1. Tk's mainloop pauses 2. temp_unbind

Re: Why assert is not a function?

2021-03-02 Thread Mirko via Python-list
Am 02.03.2021 um 23:09 schrieb Stestagg: > Ignoring the question about this feature being particularly useful, it It is useful because "assert" is primarily (if not purely and exclusive) a debugging tool during development and testing. In production code you don't want any asserts, but logging. H

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Mirko via Python-list
Am 06.03.2021 um 22:24 schrieb Ben Bacarisse: > Mr Flibble writes: > >>> Someone who says that he is capable of writing a compiler that >>> translates every language has megalomania. No one can do this. >> >> Just because you can't make one it doesn't follow that nobody else >> can. > > True, bu

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-08 Thread Mirko via Python-list
Am 07.03.2021 um 21:52 schrieb Avi Gross via Python-list: > The precedence example used below made a strange assumption that the > imaginary program would not be told up-front what computer language it was > being asked to convert from. That is not the scenario being discussed as we > have describe

Re: UI design: combobox or radiobuttons?

2021-04-13 Thread Mirko via Python-list
Am 13.04.2021 um 23:53 schrieb Rich Shepard: > My applications use environmental data, each of which has to specify > the > units (e.g., cm, m, km, ft, yd, mi). With the widget sets I've used > (wxPython and TKinter) I've always used a combobox with the acceptable > choices in it. I'm now planning

Re: text displays on screen only when I click to exit the program

2021-04-30 Thread Mirko via Python-list
Am 30.04.2021 um 20:55 schrieb Quentin Bock: > code with comments for context: > > #Create a text based game where the user must find 3 items before > completing a level > #imports and variables for game > import pygame > from pygame import mixer > running = True > #initializes pygame > pygame.ini

OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-08 Thread Mirko via Python-list
I apologize for this OT post, especially because it's in reply to an at least partly troll post, but I just can't resist. Sorry. Am 08.05.2021 um 14:09 schrieb Talkie Toaster: > On 06/05/2021 18:56, Mark Lawrence wrote: >> Quite frankly I don't care how this discussion goes as the Python >> co

Re: OT: Autism in discussion groups

2021-05-10 Thread Mirko via Python-list
Am 09.05.2021 um 02:34 schrieb Michael Torrie: > On 5/8/21 3:28 PM, Mirko via Python-list wrote: >> >> I apologize for this OT post, especially because it's in reply to an >> at least partly troll post, but I just can't resist. Sorry. >> >> P.S.:

Re: The importance of mental health

2021-05-10 Thread Mirko via Python-list
Am 10.05.2021 um 15:16 schrieb Kyle Stanley: > Hey all, > > In these last few months, I have been in the process of healing from some > pretty heavy past trauma. And now that I am on the road to recovery, I want > to share my journey with the Python community in hopes that it may reach > those tha

Re: Python script accessing own source code

2021-05-12 Thread Mirko via Python-list
Am 12.05.2021 um 20:41 schrieb Robin Becker: > ... >> >> with open(__file__) as myself: >> print(myself.read(), end='') > > very nice, but accessing code that's already seems quite easy. I > think the real problem is to get a python script name that creates > and writes itself. So I would

venv and executing other python programs

2022-02-14 Thread Mirko via Python-list
Hi, I have recently started using venv for my hobby-programming. There is an annoying problem. Since venv modifies $PATH, python programs that use the "#!/usr/bin/env python" variant of the hashbang often fail since their additional modules aren't install inside in venv. How to people here deal w

Re: venv and executing other python programs

2022-02-15 Thread Mirko via Python-list
.cfg just set/add "include-system-site-packages = true" Without this, I get the following (Python 3.6.9, Linux Mint 19, Pandas installed in /usr/lib/python3/dist-packages/pandas): [2, 0] mirko@wizbox:~$ vim /home/mirko/bin/foo.py [2, 0] mirko@wizbox:~$ chmod +x /home/mirko/bin/foo.p

Re: Functionality like local static in C

2022-04-14 Thread Mirko via Python-list
Am 14.04.2022 um 17:02 schrieb Cecil Westerhof via Python-list: > In C when you declare a variable static in a function, the variable > retains its value between function calls. > The first time the function is called it has the default value (0 for > an int). > But when the function changes the va

Re: No shortcut Icon on Desktop

2022-04-14 Thread Mirko via Python-list
Am 13.04.2022 um 20:39 schrieb Dennis Lee Bieber: > On Thu, 14 Apr 2022 03:38:11 +1000, Tim Deke declaimed > the following: > >> Dear Sir, >> >> I have successfully downloaded Python into my laptop but the shortcut icon >> is not appearing on the desktop. I am using Windows 10 with the PC >> spec

Re: No shortcut Icon on Desktop

2022-04-15 Thread Mirko via Python-list
Am 15.04.2022 um 18:53 schrieb Mats Wichmann: > On 4/15/22 08:59, Grant Edwards wrote: > >> Of course it's easy to add. But, we're talking about people who have >> no idea how to do that. They have no clue how to "navigate to the >> install directory". They don't even realize anything _was_ instal

Re: Definite or indefinite article for non-singletons?

2019-07-27 Thread Mirko via Python-list
Am 27.07.2019 um 23:10 schrieb Chris Angelico: > When talking about indistinguishable objects, is it correct to talk > about "the " or "an "? > > Example: > > def f(s): > """Frob a thing. > > If s is an empty string, frobs all the things. > OR > If s is the empty string, frobs al

Re: Python shows error on line 15 that i cant fix

2019-09-21 Thread Mirko via Python-list
Am 21.09.2019 um 19:57 schrieb Dave Martin: > Can you provide an example of how to use the suite feature. Thank you. > There is no suite feature, Terry just tried to explain indented blocks to you in simple words. Really, indented blocks are one of the most basic aspects of Python. You *need* t

Re: Most elegant way to do something N times

2019-12-22 Thread Mirko via Python-list
Am 22.12.2019 um 21:34 schrieb Batuhan Taskaya: > I encounter with cases like doing a function 6 time with no argument, or > same arguments over and over or doing some structral thing N times and I > dont know how elegant I can express that to the code. I dont know why but I > dont like this for _

Re: Python error

2020-04-02 Thread Mirko via Python-list
Am 02.04.2020 um 20:09 schrieb J Conrado: > Hi, > > I have the version of python installed: > Python 3.7.6 and Python 3.8.1 > If I type: > python > Python 3.7.6 (default, Jan 8 2020, 19:59:22) > [GCC 7.3.0] :: Anaconda, Inc. on linux > Type "help", "copyright", "credits" or "license" for more inf

Re: Problem

2020-09-30 Thread Mirko via Python-list
Am 30.09.2020 um 17:55 schrieb Dennis Lee Bieber: > On Tue, 29 Sep 2020 22:31:18 + (UTC), Ron Villarreal via Python-list > declaimed the following: > >> Tried to open Python 3.8. I have Windows 10. Icon won’t open. > > What "Icon"? > > Python is a language interpreter/compiler -

Re: Problem

2020-10-01 Thread Mirko via Python-list
Am 30.09.2020 um 23:44 schrieb Chris Angelico: > On Thu, Oct 1, 2020 at 7:33 AM Mirko via Python-list >> We are seeing these troubles from newcomers on Windows all of the >> time -- and that for years. Isn't it time to ask if the way Python >> installs itself on Wind

Re: Problem

2020-10-01 Thread Mirko via Python-list
Am 01.10.2020 um 22:17 schrieb Chris Angelico: > Maybe those usability improvements have already been done. Haven't doubted that. Maybe they are just not enough yet. > Renaming Idle to "Python IDE" would be a very bad idea, since there > are many other Python IDEs. You missed the "(or similar)"

Re: Problem

2020-10-02 Thread Mirko via Python-list
Am 02.10.2020 um 11:58 schrieb Terry Reedy: > On 10/1/2020 4:09 PM, Mirko via Python-list wrote: > >> Renaming "IDLE" to "Python IDE" (or similar) might also. > "IDLE" intentionally echoes 'Idle', as in Eric Idle of Monty > Python. It sta

Re: Problem

2020-10-04 Thread Mirko via Python-list
Am 03.10.2020 um 17:25 schrieb Dennis Lee Bieber: > On Fri, 2 Oct 2020 21:47:38 +0200, Hexamorph declaimed > the following: > > >> >> - Add a folder named "Python.org " (or similar) to the >> desktop with shortcuts to Python, IDLE and the CHM. >> >> - Add a checkbox (default enabled) like "Start

Re: Installing Python (2.7) 'by hand' on Ubuntu - possible?

2020-12-22 Thread Mirko via Python-list
On 22.12.2020 at 20:24 Chris Green wrote: > Yes, I do have the Python source. The only thing I don't have the > source for is a .so file and that's why I can't simply migrate the > program(s) from Python 2 to Python 3. > If it's just one .so and that library is compatible with basic libs such a

Re: Extract lines from file, add to new files

2024-01-11 Thread Mirko via Python-list
Am 11.01.24 um 20:53 schrieb Rich Shepard via Python-list: On Thu, 11 Jan 2024, Piergiorgio Sartor via Python-list wrote: Why not to use bash script for all? Piergiorgio, That's certainly a possibility, and may well be better than python for this task. Thank you, Rich awk '/@/ {print >

Re: Terminal Emulator

2024-05-14 Thread Mirko via Python-list
Am 14.05.24 um 19:44 schrieb Gordinator via Python-list: I wish to write a terminal emulator in Python. I am a fairly competent Python user, and I wish to try a new project idea. What references can I use when writing my terminal emulator? I wish for it to be a true terminal emulator as well, n

[OT] How to improve my programming skills?

2017-06-01 Thread Mirko via Python-list
fficient way for improving my general programming skills? Do you have any other suggestions or tips? Much thanks for your time! Mirko -- https://mail.python.org/mailman/listinfo/python-list