Re: Unicode humor

2013-05-08 Thread Christian Gollwitzer
Am 08.05.13 15:19, schrieb Roy Smith: Apropos to any of the myriad unicode threads that have been going on recently: http://xkcd.com/1209/ http://xkcd.com/1137/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Where did you get this? The DFT is defined for any integer point number the same way. Just if you want to get i

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Oops, I thought we were posting to comp.dsp. Nevertheless, I think numpy.fft does mixed-radix (can't check it now) Am 20.05.13 19:50, schrieb Christian Gollwitzer: Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data p

Re: Utility to locate errors in regular expressions

2013-05-24 Thread Christian Gollwitzer
Am 24.05.13 14:58, schrieb Malte Forkel: Finding out why a regular expression does not match a given string can very tedious. I would like to write a utility that identifies the sub-expression causing the non-match. Try http://laurent.riesterer.free.fr/regexp/ it shows the subexpressi

Re: Beginner Question: 3D Models

2013-06-18 Thread Christian Gollwitzer
Am 19.06.13 04:47, schrieb andrewblun...@gmail.com: However, for one part of the program I'd like to be able to create a 3D model based on the user input. The model would be very basic consisting of a number of lines and objects. We have 3D models of each component within our CAD system so it w

Re: tkinter

2013-06-23 Thread Christian Gollwitzer
Ahoj, Am 23.06.13 18:06, schrieb JK: Nazdar mládenci, this is an English (only) speaking group. Therefore you will not get much response by posting in Czech. měl bych zájem dokončit překlad Tkinteru (http://tkinter.programujte.com/index.htm), na kterém před šesti lety pracovali zejména Pav

Re: io module and pdf question

2013-06-25 Thread Christian Gollwitzer
Am 25.06.13 08:33, schrieb rusi: On Tuesday, June 25, 2013 9:48:44 AM UTC+5:30, jyou...@kc.rr.com wrote: 1. Is there another way to get metadata out of a pdf without having to install another module? 2. Is it safe to assume pdf files should always be encoded as latin-1 (when trying to read it th

Re: Best Scripting Language for Embedded Work?

2013-07-10 Thread Christian Gollwitzer
Hi David, you have multi-posted this to comp.lang.tcl. Please don't do that - use crossposting and a proper follow-up (as I did now) Am 10.07.13 03:29, schrieb David T. Ashley: We develop embedded software for 32-bit micros using Windows as the development platform. Robert's answer made me

Re: Best Scripting Language for Embedded Work?

2013-07-11 Thread Christian Gollwitzer
Hi David, Am 12.07.13 03:18, schrieb David T. Ashley: On Wed, 10 Jul 2013 09:03:54 +0200, Christian Gollwitzer wrote: > Robert's answer made me hesitate - what exactly is your platform? Are you writing the scripts for the embedded platform, or for Windows, or does the embedded contro

Re: tkinter redraw rates

2013-07-18 Thread Christian Gollwitzer
Am 18.07.13 06:38, schrieb fronag...@gmail.com: On Thursday, July 18, 2013 9:07:24 AM UTC+8, Dave Angel wrote: Nope - don't use that. Instead, post an event on the queue, and return to the mainloop() from whence we came. def test_thread(self): if self.loader_thread.isAliv

Re: How can I make this piece of code even faster?

2013-07-21 Thread Christian Gollwitzer
How about using numpy? Am 20.07.13 22:22, schrieb pablobarhamal...@gmail.com: Ok, I'm working on a predator/prey simulation, which evolve using genetic algorithms. At the moment, they use a quite simple feed-forward neural network, which can change size over time. Each brain "tick" is performe

Re: tkinter progress bar

2013-07-23 Thread Christian Gollwitzer
Am 23.07.13 08:52, schrieb hsiw...@walla.com: Hi, How can I add a tkinter progress bar in python 3.2 to start before a loop and end after it. I am looking for a very simple solution. def MyFunc(): Start progress bar for fileName in fileList: … End progress bar 1. There is a progre

Re: Providing a Python wrapper to a C++ type.

2012-10-16 Thread Christian Gollwitzer
Am 16.10.12 18:42, schrieb Evan Driscoll: For instance, I used it to wrap the OS's opendir/readdir (FindFirstFile/FindNextFile) functions: I just wrote a bit of code using Cython's extensions, and I get a module I can import and use as normal. Well, but for an existing library in C++ possibly S

Re: Fwd: system tray or notification area in python

2012-10-16 Thread Christian Gollwitzer
Am 16.10.12 22:39, schrieb Daniel Fetchinson: Hi folks, So I thought I would write a brand new stand alone system tray or notification area in python. I guess I need to use gtk bindings or some such but don't really know what my options are. Where would I start something like this? Any pointers

Re: Fwd: system tray or notification area in python

2012-10-17 Thread Christian Gollwitzer
Am 17.10.12 09:49, schrieb Daniel Fetchinson: So I thought I would write a brand new stand alone system tray or notification area in python. I guess I need to use gtk bindings or some such but don't really know what my options are. Where would I start something like this? Any pointers would be g

Re: bit count or bit set && Python3

2012-10-25 Thread Christian Gollwitzer
Am 25.10.12 16:47, schrieb Charles Hixson: In Python3 is there any good way to count the number of on bits in an integer (after an & operation)? Alternatively, is there any VERY light-weight implementation of a bit set? I'd prefer to use integers, as I'm probably going to need thousands of these

Re: only .exe

2012-11-24 Thread Christian Gollwitzer
Am 24.11.12 12:36, schrieb bakie: in the last question I try how to run py script with pycharm . thank dear bro ... and then I wanna have that program with .exe ( standalone installer ) . How can i do that ? I tried with two ways 1) py2exe 2) cx_freeze but I don't like that It has many file

Re: Simple board game GUI framework

2017-09-13 Thread Christian Gollwitzer
Am 11.09.17 um 16:12 schrieb Paul Moore: Thanks for the information. That's more or less the sort of thing I was thinking of. In fact, from a bit more browsing, I found another way of approaching the problem - rather than using pygame, it turns out to be pretty easy to do this in tkinter. That

Re: "tkinter"

2017-09-13 Thread Christian Gollwitzer
Am 13.09.17 um 16:15 schrieb Grant Edwards: On 2017-09-13, Christopher Reimer wrote: When I started my technical career 20+ years ago, tcl/tk was pronounced "tickle" by the engineers. Not sure if that was correct then or now. I've always heard "tickle" as the pronounciation for "TCL". I've

Re: on a very slow function

2017-10-01 Thread Christian Gollwitzer
Am 01.10.17 um 23:27 schrieb Daniel Bastos: def make_sequence_non_recursive(N, x0 = 2, c = -1): "What's wrong with this function? It's very slow." last = x0 def sequence(): nonlocal last next = last last = last**2 + c return next % N return sequence It crawls pre

Re: The "loop and a half"

2017-10-04 Thread Christian Gollwitzer
Am 04.10.17 um 14:34 schrieb Ben Bacarisse: r...@zedat.fu-berlin.de (Stefan Ram) writes: Steve D'Aprano writes: For-each loops are MUCH easier to understand, and should be taught first. I prefer a bottom-up approach. For loops are based on iterators. So, "bottom-up" in this case

Re: Pedagogical style [was Re: The "loop and a half"]

2017-10-05 Thread Christian Gollwitzer
Am 05.10.17 um 19:04 schrieb Steve D'Aprano: On Thu, 5 Oct 2017 07:29 am, Christian Gollwitzer wrote: To understand Stefan's way of teaching, take a look at his other courses, for example the C++ course: Thanks for this Christian. It has been an eye-opener. More comments below

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Christian Gollwitzer
Am 12.10.17 um 01:15 schrieb Stefan Ram: Define a function »g« with a parameter »x« of type »int«, so that this function »g« returns a pointer to another function. This other function has a parameter of type »char« and returns a double value. Ok /Without/ a typedef. And WHY

Re: OT Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Christian Gollwitzer
Am 12.10.17 um 01:33 schrieb Chris Angelico: Yeah. The trouble is that this is a really REALLY bad way to design something. Have you seen a city that grew one house at a time, and had streets added to service those houses? Not good. I tend to disagree. Many European villages have been built th

Re: Compression of random binary data

2017-10-24 Thread Christian Gollwitzer
Am 23.10.17 um 12:13 schrieb Marko Rauhamaa: Thomas Jollans : On 2017-10-23 11:32, danceswithnumb...@gmail.com wrote: According to this website. This is an uncompressable stream. https://en.m.wikipedia.org/wiki/Incompressible_string 12344321 No, it's not. According to that article,

Re: Ide vs ide

2017-10-28 Thread Christian Gollwitzer
Am 28.10.17 um 09:04 schrieb Rustom Mody: [The other day I was writing a program to split alternate lines of a file; Apart from file-handling it was these two lines: for x in lines[0::2]: print(x.strip()) for x in lines[1::2]: print(x.strip()) ] ...and using the best(TM) tool for

Re: Invoking return through a function?

2017-10-30 Thread Christian Gollwitzer
Am 30.10.17 um 01:42 schrieb Steve D'Aprano: On Mon, 30 Oct 2017 03:35 am, Alberto Riva wrote: And as Bartc pointed out, we already have this situation with exceptions, so it would be nothing new. Pardon me, but it was *me* who pointed out the analogy with exceptions, not Bart. But this is dif

Re: Easiest way to access C module in Python

2017-11-06 Thread Christian Gollwitzer
Am 07.11.17 um 02:59 schrieb Grant Edwards: On 2017-11-06, John Pote wrote: I have successfully used Python to perform unit and integration tests in the past and I'd like to do the same for some C modules I'm working with at work. There seem to be a number of ways of doing this but being busy

Re: To ASCII Or Not To ASCII? (Posting On Python-List Prohibited)

2017-11-16 Thread Christian Gollwitzer
Am 16.11.17 um 02:45 schrieb Lawrence D’Oliveiro: From : def raıse(self) : "raises this exception." libm.feraiseexcept(self.mask) #end raıse raiise = raıse # if you prefer you do this to annoy people? Christian -- https

Re: Increasing the diversity of people who write Python

2017-11-28 Thread Christian Gollwitzer
Am 28.11.17 um 20:24 schrieb wxjmfa...@gmail.com: Le mardi 28 novembre 2017 04:44:51 UTC+1, Rustom Mody a écrit : ... Unicode codepoint names are (evidently) ALLCAPS-ASCII Are you sure ? ;-) ; Standard Unicode 10.0.0 ou ; Norme internationale ISO/CEI 10646:2017 ... 00FFLETTRE M

Re: Python script

2017-12-07 Thread Christian Gollwitzer
Am 07.12.17 um 15:06 schrieb prvn.m...@gmail.com: Hi All, I am new to python need help to write a script in python my requirement is :- write a python script to print sentence from a txt file to another txt file txt = open("another.txt", "w") print("sentence from txt file", file = txt)

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Christian Gollwitzer
Am 14.12.17 um 02:55 schrieb Chris Angelico: On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson wrote: On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: [...] That said, I don't see this feature as being very useful compared to just using "open with" when I occasionally need to o

Re: Repeated Names (Repeated Names)

2017-12-17 Thread Christian Gollwitzer
Am 17.12.17 um 15:30 schrieb Skip Montanaro: I've emailed the administrator of bbs.geek.nz, maybe he will be able to stop it. Thanks, Greg. We're actually blocking via that and related headers at the gateway, which is why the mailing list is no longer seeing the duplicates. I'm not sure any of

Re: Python Learning

2017-12-18 Thread Christian Gollwitzer
Am 18.12.17 um 05:54 schrieb Bill: Chris Angelico wrote: I don't know about vtables as needing to be in ANY programming course. They're part of a "let's dive into the internals of C++" course. You certainly don't need them to understand how things work in Python, because they don't exist; and I'

Re: [OT] Re: has sourceforge exposed the dirty little secret ?

2018-01-07 Thread Christian Gollwitzer
Am 05.01.18 um 22:15 schrieb Michael Torrie: Please, no! We don't need emoji in this group. Fortunately the vast majority of posters use plain text (as is the etiquette) and so we don't have to worry about that kind of nonsense. It's not needed, but shouldn't pose any big problems with modern

Re: Simple graphic library for beginners

2018-01-12 Thread Christian Gollwitzer
Am 11.01.18 um 06:16 schrieb Michael Torrie: On 01/10/2018 01:13 PM, bartc wrote: I couldn't see anything obviously simple there. A lot seems to do with interaction which is always much more complicated than just drawing stuff. Yes the link didn't have the simple examples I hoped for. How's t

Re: Detecting a cycle in a graph

2018-01-14 Thread Christian Gollwitzer
Am 14.01.18 um 09:30 schrieb Frank Millman: I need to detect when a 'cycle' occurs - when a path loops back on itself and revisits a node previously visited. I have figured out a way to do this, but I have a problem. I don't know if that helps, but there is a classic graph theory algorithm ca

Re: Detecting a cycle in a graph

2018-01-14 Thread Christian Gollwitzer
Am 14.01.18 um 22:04 schrieb Christian Gollwitzer: Am 14.01.18 um 09:30 schrieb Frank Millman: I need to detect when a 'cycle' occurs - when a path loops back on itself and revisits a node previously visited. I have figured out a way to do this, but I have a problem. I don'

Re: Python "Bad syntax"

2018-02-05 Thread Christian Gollwitzer
Am 05.02.18 um 18:13 schrieb darkorbitaknaen...@centrum.cz: Hi, I have a problem in continuing the function. I'm a beginner, I'm learning from a textbook. I'm going to put the following examples from a textbook that displays "wrong syntax" for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":      

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-16 Thread Christian Gollwitzer
Am 17.02.18 um 06:12 schrieb Stefan Ram: Chris Angelico quotes: Python is relatively slow compared to programming languages that run closer to the operating system. The run time of the countdown example above is orders of magnitude faster when implemented in other language runtimes. What s

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-17 Thread Christian Gollwitzer
Am 17.02.18 um 05:54 schrieb boB Stepp: And this is one I am still puzzling over: Are statically-typed languages inherently "safer" than properly implemented dynamically-typed languages? I can see the advantages of catching type errors at compile time versus run time. If you haven't tried s

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-20 Thread Christian Gollwitzer
Am 20.02.18 um 14:58 schrieb Chris Angelico: Okay. Now create a constraint on a name in C++ such that it can only accept integers representing A.D. years which, on the Gregorian calendar, are leap years. (Using a dedicated integer-like type is permitted.) It must accept all multiples of four, exc

Re: py2exe maintainer abandoned the project; is there any replacements? Or, anyone willing to continue the work?

2018-02-21 Thread Christian Gollwitzer
Am 21.02.18 um 18:30 schrieb MGHSM: Thomas Heller himself says he's "retiring" from py2exe in https://sourceforge.net/p/py2exe/mailman/message/36033869/ Is there any suitable replacement with similar or better capabilities? There is PyInstaller, which works on all major OS: http://www.pyinst

Re: help me ?

2018-02-26 Thread Christian Gollwitzer
Am 26.02.18 um 10:40 schrieb sotaro...@gmail.com: Define 2 lists. The first one must contain the integer values 1, 2 and 3 and the second one the string values a, b and c. Iterate through both lists to create another list that contains all the combinations of the A and B elements. The final li

Re: How to make Python run as fast (or faster) than Julia

2018-02-27 Thread Christian Gollwitzer
Am 27.02.18 um 03:27 schrieb Chris Angelico: On Tue, Feb 27, 2018 at 12:57 PM, bartc wrote: Anyway, even this pure Python version can deliver pseudo random numbers at some 200,000 per second, while the built-in generator does 450,000 per second, so it's not bad going. The built-in generator

Re: Issue sending data from C++ to Python

2022-05-18 Thread Christian Gollwitzer
Am 18.05.22 um 16:08 schrieb Pablo Martinez Ulloa: I have been using your C++ Python API, in order to establish a bridge from C++ to Python. We want to do this, as we have a tactile sensor, which only has a library developed in C++, but we want to obtain the data in real time in Python to perform

Re: Automatic Gain Control in Python?

2022-05-29 Thread Christian Gollwitzer
Am 29.05.22 um 00:45 schrieb Stefan Ram: "Steve GS" writes: Subject: Automatic Gain Control in Python? Automatic Gain Control in Python is trivial. You have a list of samples and normalize them, i.e., divide by max. Slightly simplified [ s/max( samples )for s in samples ] (where

Re: How to test characters of a string

2022-06-07 Thread Christian Gollwitzer
Am 07.06.22 um 21:56 schrieb Dave: It depends on the language I’m using, in Objective C, I’d use isNumeric, just wanted to know what the equivalent is in Python. Your problem is also a typical case for regular expressions. You can create an expression for "starts with any number of digits pl

Re: How to test characters of a string

2022-06-07 Thread Christian Gollwitzer
Am 07.06.22 um 23:01 schrieb Christian Gollwitzer: In [3]: re.sub(r'^\d+\s*', '', s) Out[3]: 'Trinket' that RE does match what you intended to do, but not exactly what you wrote in the OP. that would be '^\d\d.' start with exactly two digits follow

Re: How to test characters of a string

2022-06-09 Thread Christian Gollwitzer
Am 09.06.22 um 07:50 schrieb Dave: Hi, I’ve found you also need to take care of multiple disk CD releases. These have a format of “1-01 Track Name” “2-02 Trackl Name" Meaning Disk 1 Track1, Disk 2, Track 2. Also A and B Sides (from Vinyl LPs) “A1-Track Name” “B2-Track Name” Side A, Track

Re: How to test characters of a string

2022-06-09 Thread Christian Gollwitzer
Am 08.06.22 um 19:57 schrieb De ongekruisigde: On 2022-06-08, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: On 2022-06-09 at 04:15:46 +1000, Chris Angelico wrote: If you insist: >>> s = 'nm-iodine:x:996:57::/var/empty:/run/current-system/sw/bin/nologin'

Re: "CPython"

2022-06-21 Thread Christian Gollwitzer
Am 20.06.22 um 22:47 schrieb Roel Schroeven: indication that www.analyticsinsight.net is wrong on that point. Frankly that website seems very low quality in general. In that same article they say: "CPython is a descendant of Pyscript built on Pyodide, a port of CPython, or a Python distributi

Re: setup.py + cython == chicken and the egg problem

2022-08-17 Thread Christian Gollwitzer
Am 16.08.22 um 23:03 schrieb Dan Stromberg: I'm attempting to package up a python package that uses Cython. Rather than build binaries for everything under the sun, I've been focusing on including the .pyx file and running cython on it at install time. This requires a C compiler, but I'm OK wit

Re: How to manage python shebang on mixed systems?

2022-11-07 Thread Christian Gollwitzer
Am 07.11.22 um 10:28 schrieb Chris Green: Chris Green wrote: 3: with your pseudo "python3" script in place, make all the scripts use the "#!/usr/bin/env python3" shebang suggested above. Yes, that sounds a good plan to me, thanks Cameron. Doesn't '#!/usr/bin/env python3' suffer from the sam

Re: How to turn this Matlab code into python

2022-11-07 Thread Christian Gollwitzer
Am 07.11.22 um 18:12 schrieb Dioumacor FAYE: hi everyone I wanted to transform this matlab code into python. If anyone can help me please let me know. load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat prcp = reshape(precip,[140*100,13879]); dates = datenum(1981,1,1):datenum(20

Re: How to turn this Matlab code into python

2022-11-08 Thread Christian Gollwitzer
un. 7 nov. 2022 à 21:42, Christian Gollwitzer a écrit : Am 07.11.22 um 18:12 schrieb Dioumacor FAYE: hi everyone I wanted to transform this matlab code into python. If anyone can help me please let me know. load /media/lpaosf/Dioumss/maman/data/precip_chirps_SEN_1981-2018.mat prcp = reshape(precip

Re: Evaluation of variable as f-string

2023-01-27 Thread Christian Gollwitzer
Am 27.01.23 um 21:43 schrieb Johannes Bauer: I don't understand why you fully ignore literally the FIRST example I gave in my original post and angrily claim that you solution works when it does not: x = { "y": "z" } s = "-> {x['y']}" print(s.format(x = x)) Traceback (most recent call last):

Re: Evaluation of variable as f-string

2023-01-29 Thread Christian Gollwitzer
Am 28.01.23 um 02:56 schrieb Thomas Passin: On 1/27/2023 5:10 PM, Christian Gollwitzer wrote: Am 27.01.23 um 21:43 schrieb Johannes Bauer: I don't understand why you fully ignore literally the FIRST example I gave in my original post and angrily claim that you solution works when it doe

Re: Cutting slices

2023-03-06 Thread Christian Gollwitzer
Am 05.03.23 um 23:43 schrieb Stefan Ram: The following behaviour of Python strikes me as being a bit "irregular". A user tries to chop of sections from a string, but does not use "split" because the separator might become more complicated so that a regular expression will be required

Re: How to add clickable url links to 3D Matplotlib chart ?

2023-03-30 Thread Christian Gollwitzer
Am 30.03.23 um 01:11 schrieb a a: On Wednesday, 29 March 2023 at 22:51:15 UTC+2, Greg Ewing wrote: On 30/03/23 8:39 am, a a wrote: How to add clickable url links to the following 3D Matplotlib chart to make it knowledge representation 3D chart, make of 1,000+ open Tabs in Firefox ? It seems t

Re: Tkinter docs?

2023-05-24 Thread Christian Gollwitzer
Am 24.05.23 um 03:18 schrieb Rob Cliffe: I have recently started converting a large project to tkinter, starting with zero knowledge of tkinter.  (You are free to think: BAD IDEA. 😁) Welcome to the awesome world of GUI development.     I was writing a subclass of the Checkbutton class (tkinte

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Christian Gollwitzer
Am 13.01.21 um 06:24 schrieb Greg Ewing: On 13/01/21 4:18 am, Grant Edwards wrote: AFAIK, Python can't be used to write device drivers for any popular OS At least not until some crazy person embeds Python in the Linux kernel... What do you mean, "until" ? https://medium.com/@yon.goldschm

Re: idlelib re-use

2021-01-30 Thread Christian Gollwitzer
Am 28.01.21 um 20:57 schrieb Terry Reedy: On 1/28/2021 5:53 AM, Robin Becker wrote: I googled in vain for instances where parts of idlelib are re-used in a simplistic way. I would like to use the editor functionality in a tkinter window and also probably run code in a subprocess. Are there an

Re: Convert MBOX thunderbird to PST outlook

2021-02-08 Thread Christian Gollwitzer
Am 08.02.21 um 11:08 schrieb J.O. Aho: On 08/02/2021 10.22, Paul Rubin wrote: "J.O. Aho" writes: I think most migrated to use IMAP like 30 years ago That handles email but not calendar or the other stuff.  I think there are starting to be standards for that, but no idea whether either Thund

Re: New Python implementation

2021-02-14 Thread Christian Gollwitzer
Am 14.02.21 um 01:19 schrieb Chris Angelico: On Sun, Feb 14, 2021 at 11:14 AM Mr Flibble wrote: On 13/02/2021 23:30, Igor Korot wrote: Hi, But most importantly - what is the reason for this ? I mean - what problems the actual python compiler produce? Thank you. I am creating neos as I need

Re: New Python implementation

2021-02-14 Thread Christian Gollwitzer
Am 14.02.21 um 11:12 schrieb Paul Rubin: Christian Gollwitzer writes: He wants that neoGFX is scriptable in Python, but instead of linking with CPython, he will write his own Python implementation instead, because CPython is slow/not clean/ whatever. He doesn't seem to understand that th

Re: New Python implementation

2021-02-15 Thread Christian Gollwitzer
Am 15.02.21 um 21:37 schrieb Roel Schroeven: So your claim is that your compiler is able to, or will be able to, compile any language just by specifying a small schema file. Great! Do you maybe have a proof-of-concept? A simple language with a simple schema file to test the basic workings of

Re: New Python implementation

2021-02-15 Thread Christian Gollwitzer
Am 16.02.21 um 06:36 schrieb dn: Pascal's value as a teaching language was that it embodied many aspects of structured programming, and like Python, consisted of a limited range of items which could be learned very quickly (in contrast to PL/I's many 'bells and whistles'). ROFL. Maybe that was

Re: New Python implementation

2021-02-16 Thread Christian Gollwitzer
I agree to all the rest of your post, but this: Am 16.02.21 um 09:57 schrieb Tarjei Bærland: I am not sure I agree that a language like Scheme or Logo or Brainfuck, with their small number of building blocks, would be harder to learn. is strange. I'm not sure, have you actually looked at Brai

Re: Python 0.9.1

2021-02-18 Thread Christian Gollwitzer
Am 16.02.21 um 22:57 schrieb Skip Montanaro: A note to webmas...@python.org from an astute user named Hiromi in Japan* referred us to Guido's shell archives for the 0.9.1 release from 1991. I then pushed the result to a Github repo: https://github.com/smontanaro/python-0.9.1 That's a nice

Re: Tkinter long-running window freezes

2021-02-25 Thread Christian Gollwitzer
Am 24.02.21 um 12:35 schrieb John O'Hagan: Hi list I have a 3.9 tkinter interface that displays data from an arbitrary number of threads, each of which runs for an arbitrary period of time. A frame opens in the root window when each thread starts and closes when it stops. Widgets in the frame an

Re: error of opening Python

2021-02-25 Thread Christian Gollwitzer
Am 25.02.21 um 18:22 schrieb Botao Liu: Dear Python team, This is my first time using Python, I tried to launch Python and it showed "Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more informati

Re: Tkinter long-running window freezes

2021-02-25 Thread Christian Gollwitzer
Am 26.02.21 um 06:15 schrieb John O'Hagan: On Thu, 25 Feb 2021 21:57:19 +0100 Christian Gollwitzer wrote: I think it is not yet clear, if this is a bug in Tkinter or in Tcl/Tk, the underlying scripting language. It might also be platform dependent. Are you on Windows? Here is an equivalen

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-07 Thread Christian Gollwitzer
Am 07.03.21 um 20:42 schrieb Peter J. Holzer: The second part is converting a parse tree into code. I am quite sure that it is possible to devise a formal language to specify the semantics of any programming language and then to use this to generate the code. However, I strongly suspect that such

Re: .title() - annoying mistake

2021-03-22 Thread Christian Gollwitzer
Am 22.03.21 um 16:03 schrieb Robert Latest: Chris Angelico wrote: Cool thing is, nobody in Python needs to maintain anything here. That's great because I'm actually having trouble with sending log messages over the socket conection you helped me with, would you mind having a look? You misund

Re: convert script awk in python

2021-03-25 Thread Christian Gollwitzer
Am 25.03.21 um 00:30 schrieb Avi Gross: It [awk] is, as noted, a great tool and if you only had one or a few tools like it available, it can easily be bent and twisted to do much of what the others do as it is more programmable than most. But following that line of reasoning, fairly simple pytho

Re: Not found in the documentation

2021-04-29 Thread Christian Gollwitzer
Am 29.04.21 um 08:54 schrieb elas tica: Le mercredi 28 avril 2021 à 17:36:32 UTC+2, Chris Angelico a écrit : In what sense of the word "token" are you asking? The parser? You can play around with the low-level tokenizer with the aptly-named tokenizer module. It was a good suggestion, and the

Re: Bloody rubbish

2021-05-06 Thread Christian Gollwitzer
Am 06.05.21 um 19:54 schrieb Skip Montanaro: Machine language is so much simpler, and you can code with just a hexpad. Pshaa... All you need are front panel switches. ;-) (Yes, I had a professor who required is to 'key' in our programs on the front panel, of a rack mounted PDP-11 as I recall.

Re: learning python ...

2021-05-27 Thread Christian Gollwitzer
Am 25.05.21 um 06:08 schrieb hw: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it held the last reference to an object, there is no wa

Re: Is there a way to get the following result in Python?

2021-06-15 Thread Christian Gollwitzer
Am 12.06.21 um 04:02 schrieb Jach Feng: def foo(): ... # do something ... a = [] for i in range(3): ... a.append(foo()) ... a [] How about having "foo" return a list of things? Then you can append that list and return an empty list if you want nothing added: In [1]: def foo():

Re: Tkinter problem

2021-06-18 Thread Christian Gollwitzer
Am 18.06.21 um 08:28 schrieb Liya Ann Sunny: I am using Colab. How could solve this problem. TclError: couldn't connect to display ":0.0" You're either not running an X server, or having problems to connect to it. Are you sure that Google Colab supports X11 at all? This link doesn't seem to

Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer
Am 19.06.21 um 05:59 schrieb Jach Feng: import tkinter as Tk Tk from tkinter import * Tk tkinter Traceback (most recent call last): File "", line 1, in NameError: name 'tkinter' is not defined What's the point? That has no relation to the question. "import A as B" does not define

Re: Subpixel positioning on Tk canvas

2021-06-19 Thread Christian Gollwitzer
Am 19.06.21 um 06:26 schrieb George Furbish: On Saturday, June 19, 2021 at 12:22:31 AM UTC-4, Christian Gollwitzer wrote: Am 19.06.21 um 02:03 schrieb George Furbish: Does Tk support interpolation/subpixel positioning of canvas elements? (e.g. images, text.) I have moving elements on my

Re: Tkinter problem

2021-06-19 Thread Christian Gollwitzer
Am 19.06.21 um 07:16 schrieb Jach Feng: Christian Gollwitzer 在 2021年6月19日 星期六下午12:27:54 [UTC+8] 的信中寫道: Am 19.06.21 um 05:59 schrieb Jach Feng: import tkinter as Tk Tk from tkinter import * Tk tkinter Traceback (most recent call last): File "", line 1, in NameError: name &#

Re: Tkinter problem

2021-06-20 Thread Christian Gollwitzer
Am 19.06.21 um 08:48 schrieb Jach Feng: Christian Gollwitzer 在 2021年6月19日 星期六下午1:54:46 [UTC+8] 的信中寫道: I guess you wanted to post another question? Then please open a new thread. In addition, the question is unclear, you just posted a transcript of three lines of Python. I posted to point out

Re: Subpixel positioning on Tk canvas

2021-06-21 Thread Christian Gollwitzer
Am 20.06.21 um 01:49 schrieb Terry Reedy: On 6/19/2021 12:42 AM, Christian Gollwitzer wrote: Sorry for that answer, but Tkinter does not support many of the most useful extensions for Tcl/Tk, because someone has to write the wrappers. It only supports what is provided by base Tk. Among those I

Re: Create a real-time interactive TUI using Python.

2021-08-31 Thread Christian Gollwitzer
Am 31.08.21 um 18:49 schrieb Chris Angelico: On Wed, Sep 1, 2021 at 1:59 AM hongy...@gmail.com wrote: I want to know whether python can be used to create real-time interactive TUI, as hstr [1] does. [1] https://github.com/dvorka/hstr Yes. I think he also would like to know, how to achie

Re: on floating-point numbers

2021-09-02 Thread Christian Gollwitzer
Am 02.09.21 um 16:49 schrieb Julio Di Egidio: On Thursday, 2 September 2021 at 16:41:38 UTC+2, Peter Pearson wrote: On Thu, 02 Sep 2021 10:51:03 -0300, Hope Rouselle wrote: 39.61 Welcome to the exciting world of roundoff error: Welcome to the exiting world of Usenet. *Plonk*

Re: on floating-point numbers

2021-09-02 Thread Christian Gollwitzer
Am 02.09.21 um 15:51 schrieb Hope Rouselle: Just sharing a case of floating-point numbers. Nothing needed to be solved or to be figured out. Just bringing up conversation. (*) An introduction to me I don't understand floating-point numbers from the inside out, but I do know how to work with b

Re: on floating-point numbers

2021-09-03 Thread Christian Gollwitzer
Am 02.09.21 um 21:02 schrieb Julio Di Egidio: On Thursday, 2 September 2021 at 20:43:36 UTC+2, Chris Angelico wrote: On Fri, Sep 3, 2021 at 4:29 AM Hope Rouselle wrote: All I did was to take the first number, 7.23, and move it to the last position in the list. (So we have a violation of the

Re: on floating-point numbers

2021-09-04 Thread Christian Gollwitzer
Am 04.09.21 um 14:48 schrieb Hope Rouselle: Christian Gollwitzer writes: Am 02.09.21 um 15:51 schrieb Hope Rouselle: Just sharing a case of floating-point numbers. Nothing needed to be solved or to be figured out. Just bringing up conversation. (*) An introduction to me I don't under

Re: XML Considered Harmful

2021-09-23 Thread Christian Gollwitzer
Am 22.09.21 um 16:52 schrieb Michael F. Stemper: On 21/09/2021 19.30, Eli the Bearded wrote: Yes, CSV files can model that. But it would not be my first choice of data format. (Neither would JSON.) I'd probably use XML. Okay. 'Go not to the elves for counsel, for they will say both no and yes.

Re: NUmpy

2021-09-29 Thread Christian Gollwitzer
Am 29.09.21 um 18:16 schrieb Jorge Conforte: Hi, I have a netcdf file "uwnd_850_1981.nc" and I'm using the commands to read it: Your code is incomplete: from numpy import dtype  fileu ='uwnd_850_1981.nc' ncu = Dataset(fileu,'r') Where is "Dataset" defined? uwnd=ncu.variables['uwnd'][:

Re: sum() vs. loop

2021-10-11 Thread Christian Gollwitzer
Am 10.10.21 um 10:49 schrieb Steve Keller: I have found the sum() function to be much slower than to loop over the operands myself: def sum_products(seq1, seq2): return sum([a * b for a, b in zip(seq1, seq2)]) def sum_products2(seq1, seq2): sum = 0 for a, b in zip(seq1, seq2):

Re: sum() vs. loop

2021-10-12 Thread Christian Gollwitzer
Am 12.10.21 um 05:41 schrieb Dan Stromberg: On Mon, Oct 11, 2021 at 2:54 PM Steve Keller wrote: I have found the sum() function to be much slower than to loop over the operands myself: def sum_products(seq1, seq2): return sum([a * b for a, b in zip(seq1, seq2)]) def sum_products2(seq1,

Re: Create a contact book

2021-10-26 Thread Christian Gollwitzer
Am 26.10.21 um 07:40 schrieb anders Limpan: i would like to create a contact book were you can keep track of your friends. With this contact book you will both be able to add friends and view which friends that you have added. anyone interested in helping me out with this one ?=) Here is how

Re: One line sort

2021-11-16 Thread Christian Gollwitzer
Am 15.11.21 um 14:10 schrieb ast: A curiosity: q = lambda x: x and q([i for i in x[1:] if i < x[0]]) + [x[0]] + q([i for i in x[1:] if i >= x[0]]) >>> q([7, 5, 9, 0]) [0, 5, 7, 9] That seems to be a translation of the classic Haskell quicksort example: qsort [] = [] qsort (x:xs) = qsort [

Re: Failure to Display Top menu

2021-11-27 Thread Christian Gollwitzer
Am 26.11.21 um 21:38 schrieb Peter Mwale: Hello, my python 3.10 shell is not displaying the top menu. What should I do? You should explain, what you do exactly. The Python interpreter does not have a menu. a) What platform are you on? Windows, macOS, Linux? b) How did ou start Python and w

Correct way to setup a package with both compiled C code and Python code?

2022-02-07 Thread Christian Gollwitzer
Hi all, we've developed a Python pacakge which consists of both a compiled extension module and some helper functions in Python. Is there a tutorial on how to package such an extension? Most resources I found for distutils describe either building an extension or pure python modules. Current

Re: Correct way to setup a package with both compiled C code and Python code?

2022-02-08 Thread Christian Gollwitzer
Am 08.02.22 um 18:57 schrieb Dieter Maurer: Christian Gollwitzer wrote at 2022-2-7 20:33 +0100: we've developed a Python pacakge which consists of both a compiled extension module and some helper functions in Python. Is there a tutorial on how to package such an extension? Look at &

  1   2   3   4   5   6   >