Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-17 Thread Christian Gollwitzer
Am 17.03.20 um 11:16 schrieb Orges Leka: The web-app could be a simple as one button: If users are before supermarket and there is a long queue, they click on the web-app button and warn other users of the queue. It might be possible to make a Facebook "app" out of it. Facebook already

Re: Application setup like windows msi

2020-03-07 Thread Christian Gollwitzer
Am 05.03.20 um 02:48 schrieb Michael Torrie: > On 3/4/20 4:51 PM, J A wrote: >> I was wondering g if there was a way to distribute an application that took >> advantage of user input like a windows .msi does. On linux of course. > > Several installer frameworks can make interactive installers for

Re: Application setup like windows msi

2020-03-06 Thread Christian Gollwitzer
Am 05.03.20 um 02:48 schrieb Michael Torrie: > On 3/4/20 4:51 PM, J A wrote: >> I was wondering g if there was a way to distribute an application that took >> advantage of user input like a windows .msi does. On linux of course. > > Several installer frameworks can make interactive installers for

Re: Application setup like windows msi

2020-03-06 Thread Christian Gollwitzer
Am 05.03.20 um 02:48 schrieb Michael Torrie: > On 3/4/20 4:51 PM, J A wrote: >> I was wondering g if there was a way to distribute an application that took >> advantage of user input like a windows .msi does. On linux of course. > > Several installer frameworks can make interactive installers for

Re: Application setup like windows msi

2020-03-05 Thread Christian Gollwitzer
Am 05.03.20 um 02:48 schrieb Michael Torrie: On 3/4/20 4:51 PM, J A wrote: I was wondering g if there was a way to distribute an application that took advantage of user input like a windows .msi does. On linux of course. Several installer frameworks can make interactive installers for Linux.

Re: Tkinter layout designer

2020-02-24 Thread Christian Gollwitzer
Am 24.02.20 um 22:29 schrieb mm0fmf: Can anyone recommend a graphic layout designer for Tkinter programs. There is no such thing for Tkinter. There is an outdated designer for Tk called Visual Tcl, but it can generate only Tcl code, not TkInter, and uses only old-style widgets. I have a

Re: Documentation of __hash__

2020-02-05 Thread Christian Gollwitzer
Am 05.02.20 um 20:55 schrieb klau...@gmail.com: If not, why should a class not define __hash__, if it does not define __eq__? Hashes are not unique. When you insert or look up something in a hashtable, the hash is computed and used as the index into the table. Because the hash is not

Re: PyInstaller needs Funding by your Company

2020-01-07 Thread Christian Gollwitzer
Am 07.01.20 um 15:09 schrieb Hartmut Goebel: Maintianing PyInstaller at a proper level requires about 4 to 5 days per month. Which means about 4,000 to 5,000 € per month and about 50,000 to 60,000 € per year. these numbers sound odd to me. 4000€ - 5000€ per month or equivalently 60,000€ per

Re: scrollable Frame object

2019-12-27 Thread Christian Gollwitzer
Hi David, Am 24.12.19 um 13:48 schrieb david.is...@gmail.com: thank you for your answer. I downloaded and had a look at your library, it is a great solution to use a canvas-free scrollable frame. but it is in pure tcl, how do I use this with python tkinter ? Yes, because you asked this in

OT language barrier, was: How execute at least two python files at once when imported?

2019-11-07 Thread Christian Gollwitzer
Am 06.11.19 um 17:34 schrieb Igor Korot: On Wed, Nov 6, 2019 at 10:22 AM Spencer Du wrote: Sorry if I haven't stated my requirements clearly. I just wanted a way to import at least two python files in parallel and I wanted to know how this can be done or a reason why its bad as stated in

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Christian Gollwitzer
Am 06.11.19 um 03:59 schrieb Dennis Lee Bieber: On Tue, 5 Nov 2019 10:33:20 -0800 (PST), Spencer Du declaimed the following: Hi I want to execute at least two python files at once when imported but I dont know how to do this. Currently I can only import each file one after another but what

Re: Funny code

2019-09-26 Thread Christian Gollwitzer
Am 26.09.19 um 08:34 schrieb ast: Hello A line of code which produce itself when executed >>> s='s=%r;print(s%%s)';print(s%s) s='s=%r;print(s%%s)';print(s%s) Thats funny ! This is called a "quine" and there exist several methods how to do this.

Re: Proper shebang for python3

2019-07-21 Thread Christian Gollwitzer
Am 21.07.19 um 07:31 schrieb Tim Daneliuk: On 7/20/19 6:04 PM, Chris Angelico wrote: Are you aware of every systemwide command that happens to be implemented in Python, such that you won't execute any of them while you have the venv active? No, but this has never been a problem because the

Re: Embedding Python in C

2019-07-19 Thread Christian Gollwitzer
Am 19.07.19 um 16:26 schrieb Jesse Ibarra: On Friday, July 19, 2019 at 8:17:43 AM UTC-6, Chris Angelico wrote: On Sat, Jul 20, 2019 at 12:16 AM Jesse Ibarra wrote: On Thursday, July 18, 2019 at 2:01:39 PM UTC-6, Chris Angelico wrote: On Fri, Jul 19, 2019 at 5:51 AM Christian Gollwitzer

Re: Embedding Python in C

2019-07-18 Thread Christian Gollwitzer
Am 18.07.19 um 16:18 schrieb Jesse Ibarra: On Wednesday, July 17, 2019 at 2:20:51 PM UTC-6, Christian Gollwitzer wrote: What level of integration do you want to achieve? Do you want a) to call Python functions from Smalltalk b) call Smalltalk functions from Python c) pass callbacks around, e.g

Re: Embedding Python in C

2019-07-17 Thread Christian Gollwitzer
Am 17.07.19 um 20:39 schrieb Jesse Ibarra: My options seem rather limited, I need to make a Pipeline from (Smalltalk -> C -> Python) then go back (Smalltalk <- C <- Python). Since Smalltalk does not support Python directly I have to settle with the C/Python API

Re: Why Python has no equivalent of JDBC of Java?

2019-05-26 Thread Christian Gollwitzer
Am 21.05.19 um 14:27 schrieb Adriaan Renting: Java was meant to be generic, run anywhere and abstract and hide differences in its underlying infrastructure. This has led to the Java VM, and also JDBC I guess. Python was more of a script interpreted C-derivative, much closer to the bare metal,

Re: More CPUs doen't equal more speed

2019-05-24 Thread Christian Gollwitzer
Am 23.05.19 um 23:44 schrieb Paul Rubin: Bob van der Poel writes: for i in range(0, len(filelist), CPU_COUNT): for z in range(i, i+CPU_COUNT): doit( filelist[z]) Write your program to just process one file, then use GNU Parallel to run the program on your 1200 files, 6 at a

Re: repr = expression representation?

2019-05-17 Thread Christian Gollwitzer
Am 17.05.19 um 06:13 schrieb Stefan Ram: However, look at this |>>> print( str( print )) | |>>> print( repr( print )) | . While it is nice that »str( print )« gives some useful information, I would expect »repr( print )« to give »print« - This is impossible. Python does not use

Re: Tkinter on Mac OS crashes python

2019-05-16 Thread Christian Gollwitzer
Am 15.05.19 um 20:25 schrieb Chip Towner: Terry, Thanks for the input and FYI I am running 10.14.4 Mojave. Apple changed a couple of APIs on Mojave (versus High Sierra) that made Tk stop working, when it was compiled with the Mojave SDK. Tk compiled against the High Sierra SDK continued to

Re: CAD Application

2019-05-06 Thread Christian Gollwitzer
Am 06.05.19 um 07:23 schrieb Britto .: What are the frameworks available for developing a CAD application with Python? For 3D visualization VTK is your best bet. It can efficiently handle large data sets. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: What is a, b, c, and d in: rect1 = drawing.create_rectangle(a, b, c, d) and circle1 = drawing.create_oval(a, b, c, d)

2019-04-09 Thread Christian Gollwitzer
Am 09.04.19 um 21:57 schrieb CrazyVideoGamez: What is a, b, c, and d in: from tkinter import * window = Tk() drawing = Canvas(window, height=500, width=500) rectangle = drawing.create_rectangle(a, b, c, d) and: circle = drawing.create_oval(a, b, c, d) ??? Look it up in the original Tk

Re: The slash "/" as used in the documentation

2019-02-09 Thread Christian Gollwitzer
Am 09.02.19 um 14:40 schrieb Stefan Ram: Piet van Oostrum writes: r...@zedat.fu-berlin.de (Stefan Ram) writes: The slash »/« as used in the documentation f( x, /, y ) What are you talking about? What documentation? It seems to me you are talking about a completely different programming

Re: The sum of ten numbers inserted from the user

2019-02-09 Thread Christian Gollwitzer
Am 08.02.19 um 09:58 schrieb ^Bart: A colleague did: total=0 for n in range(10):     n= int(input("Enter a number: ")) Here, you are reusing "n" for two different things: 1. The loop index, indicating which number you ask for 2. The number entered from the user This is avery bad thing.

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-07 Thread Christian Gollwitzer
Am 05.02.19 um 02:20 schrieb DL Neil: So, even with the French making their dates into sentences, not a single one uses ordinals! - did the computer people in all these languages/cultures decide that the more numeric approach was better/easier/... (ie simpler/less-complex) :) For the two

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ordinal_indicator So I

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 04:11 schrieb DL Neil: > On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to co

Re: Implement C's Switch in Python 3

2019-02-03 Thread Christian Gollwitzer
Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ... language! Only for some languages. In other languages there can be, for example,

Re: tkinter resizable text with grid

2018-12-06 Thread Christian Gollwitzer
Am 07.12.18 um 03:00 schrieb Paulo da Silva: Às 21:15 de 06/12/18, Rick Johnson escreveu: I kinda have a love/hate relationship with Tkinter and IDLE. On one hand i find them to be practical[2] and simple[3] and on the other, i find them to be poorly designed and unintuitive. And it's a

Re: on the prng behind random.random()

2018-11-20 Thread Christian Gollwitzer
Am 19.11.18 um 22:05 schrieb Robert Girault: Chris Angelico writes: On Tue, Nov 20, 2018 at 7:31 AM Robert Girault wrote: Nice. So Python's random.random() does indeed use mt19937. Since it's been broken for years, why isn't it replaced by something newer like ChaCha20? Is it due to

Re: Python indentation (3 spaces)

2018-10-14 Thread Christian Gollwitzer
Am 14.10.18 um 02:45 schrieb Grant Edwards: On 2018-10-13, Peter J. Holzer wrote: For "just use tabs" to work, all of those tools would have to magically recognize that they're looking at Python source and adjust the tab size accordingly. That isn't going to happen. Well, no. The idea of

Re: How to change '\\' to '\'

2018-10-02 Thread Christian Gollwitzer
Am 02.10.18 um 04:17 schrieb Jach Fong: It was supposed that most discussant want to see the reply message instantly when they open the mail. They already know what is going on and no need to pass through all those previous message. "top posting" seems more reasonable to me:-) You assume that

Re: clever exit of nested loops

2018-09-27 Thread Christian Gollwitzer
Am 26.09.18 um 12:28 schrieb Bart: On 26/09/2018 10:10, Peter Otten wrote: class Break(Exception): pass try: for i in range(10): print(f'i: {i}') for j in range(10): print(f'\tj: {j}') for k in range(10):   

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-19 Thread Christian Gollwitzer
Am 19.07.2018 um 14:50 schrieb Gregory Ewing: Chris Angelico wrote: On Thu, Jul 19, 2018 at 4:41 PM, Gregory Ewing wrote: (Google doesn't seem to think so -- it asks me whether I meant "assist shop". Although it does offer to translateč it into Czech...) Into or from?? I'm thoroughly

Re: Cult-like behaviour [was Re: Kindness]

2018-07-16 Thread Christian Gollwitzer
Am 16.07.18 um 03:02 schrieb Jim Lee: But I don't speak Esperanto,  and my programs don't generally care what characters are used for European currencies.  When I create a simple program that takes a text file (created by me) and munges it into a different format, I don't care if someone from

Re: Users banned

2018-07-15 Thread Christian Gollwitzer
Am 15.07.18 um 19:25 schrieb Ethan Furman: The following users are now banned from Python List: ... BartC I don't really think that this is appropriate. Bart may have deviant optinions, mostly he thinks that his own work is superior to Python - but he has always argued in a calm and

Re: PEP 526 - var annotations and the spirit of python

2018-07-15 Thread Christian Gollwitzer
Am 05.07.18 um 12:04 schrieb Steven D'Aprano: On Thu, 05 Jul 2018 09:17:20 +0200, Christian Gollwitzer wrote: Am 04.07.18 um 17:31 schrieb Steven D'Aprano: On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote: Presumably one type hint applies for the whole scope of the variable, not just the one

Re: Cult-like behaviour [was Re: Kindness]

2018-07-14 Thread Christian Gollwitzer
Am 14.07.18 um 10:00 schrieb Marko Rauhamaa: Steven D'Aprano : Apparently Marko didn't notice the irony of suggesting that we display excessive commitment to GvR The object of the "cult" isn't GvR, it's Python itself. I agree with this observation and it feels quite strange to me. I

Re: testing code

2018-07-08 Thread Christian Gollwitzer
Am 08.07.18 um 06:21 schrieb Sharan Basappa: sorry. there was a copy paste error when i posted. I pasted test_2.py for both the files: here are the files again. The issue remains. output: %run "D:/Projects/Initiatives/machine learning/programs/test_2_test.py" 30 Jim spotted it... '%run'

Re: PEP 526 - var annotations and the spirit of python

2018-07-05 Thread Christian Gollwitzer
Am 04.07.18 um 17:31 schrieb Steven D'Aprano: On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote: Presumably one type hint applies for the whole scope of the variable, not just the one assignment. You know how in C you can write int x = 1; # the type applies for just this one assignment

Re: How to find an object existing?

2018-06-13 Thread Christian Gollwitzer
Am 14.06.18 um 05:14 schrieb huey.y.ji...@gmail.com: root = Tkinter.Tk() button = Tkinter.Button(root, text="Find me") button.pack() I created a button, Python object. I recall I can check this object existing by using winfo, such as winfo.exists(button). However, I forgot which super class

Re: tkinter (ttk) combobox dropdown text is white on white

2018-06-03 Thread Christian Gollwitzer
Am 03.06.18 um 21:54 schrieb Jim Lee:> import tkinter as tk from tkinter import ttk root = tk.Tk() cb = ttk.Combobox(root) cb.grid(row=0, column=0, sticky='NSEW') cb['values'] = ['one', 'two', 'three', 'four'] root.mainloop() The text of the values in the combobox dropdown list is white on

Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-27 Thread Christian Gollwitzer
Am 27.05.18 um 23:58 schrieb Cameron Simpson: On 27May2018 20:15, Paul St George wrote: This is very helpful indeed, thank you. Awe-inspiring. It occurred to me that I could edit the PIL/ImageShow.py, replacing ‘xv’ (in five places) with the utility of my choice and

Re: "Data blocks" syntax specification draft

2018-05-22 Thread Christian Gollwitzer
Am 23.05.18 um 07:22 schrieb Chris Angelico: On Wed, May 23, 2018 at 9:51 AM, bartc wrote: Sorry, but I don't think you're right at all. unless the official references for the language specifically say that commas are primarily for constructing tuples, and all other uses are

Re: "Data blocks" syntax specification draft

2018-05-22 Thread Christian Gollwitzer
Am 22.05.18 um 04:17 schrieb Mikhail V: On Mon, May 21, 2018 at 1:41 PM, Chris Lindsay via Python-list wrote: If a block of static data is large enough to start to be ugly, a common approach is to load the data from some other file, in a language which is designed

Re: Levenberg-Marquardt Algorithm

2018-04-11 Thread Christian Gollwitzer
Am 11.04.18 um 08:38 schrieb Priya Singh: I have two 2D arrays one R and another T (which is also a 2D array). Do you know how can I fit T with R in order to find central coordinate x0,y0 for T relative to R??? So the main question is do you know in python how can I fit two 2D arrays to find

Re: Entering a very large number

2018-03-26 Thread Christian Gollwitzer
Am 26.03.18 um 12:31 schrieb bartc: On 26/03/2018 10:34, Steven D'Aprano wrote: So what exactly did you do? I did this: def fn():     C = int(     "28871482380507712126714295971303939919776094592797"     "22700926516024197432303799152733116328983144639225"    

Re: Entering a very large number

2018-03-25 Thread Christian Gollwitzer
Am 25.03.18 um 14:32 schrieb bartc: Using CPython on my machine, doing a string to int conversion that specific number took 200 times as long as doing a normal assignment. That conversion took 4 microseconds. Not significant if it's only done once. But it might be executed a million times.

Re: macOS specific - reading calendar information

2018-03-15 Thread Christian Gollwitzer
Am 15.03.18 um 08:32 schrieb Jan Erik Moström: I would like to read what calendar events I have on a range of days. I would like to get the data from whatever storage Calendar use, in my personal case I sync to iCloud. An example would be something along these lines x =

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

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

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:

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,

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

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

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: 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't know

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

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

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: 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

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: 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

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: 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

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 --

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

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

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

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

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

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: 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. You're

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.

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

Re: Linux/Windows GUI programming: tk or wx?

2017-08-05 Thread Christian Gollwitzer
Am 05.08.17 um 01:45 schrieb Ulli Horlacher: I have to transfer a python 2.7 CLI programm into one with a (simple) GUI. The program must run on Linux and Windows and must be compilable with pyinstall, because I have to ship a standalone windows.exe Any kind of installer is not acceptable.

Re: Teaching the "range" function in Python 3

2017-06-30 Thread Christian Gollwitzer
Am 30.06.17 um 04:33 schrieb Rick Johnson: And to further drive home the point, you can manually insert a list literal to prove this: >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> for value in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]: ... print(value) ... 0 1

Re: Strang thing in tkinter, and pdb too?

2017-06-12 Thread Christian Gollwitzer
Am 12.06.17 um 06:03 schrieb Terry Reedy: On 6/11/2017 10:06 PM, jf...@ms4.hinet.net wrote: D:\Temp\widget-tour-py3>python canvasruler.py can't invoke "event" command: application has been destroyed while executing "event generate $w <>" (procedure

Re: How to install Python package from source on Windows

2017-05-21 Thread Christian Gollwitzer
Am 21.05.17 um 12:23 schrieb bartc: On 20/05/2017 19:37, Chris Angelico wrote: rosuav@sikorsky:~/linux$ find -name \*.c -or -name \*.h | wc -l 44546 These repositories, by the way, correspond to git URLs https://github.com/python/cpython, git://pike-git.lysator.liu.se/pike.git,

Re: Python compiled by tcc

2017-05-21 Thread Christian Gollwitzer
Am 21.05.17 um 12:38 schrieb bartc: On 21/05/2017 10:32, Christian Gollwitzer wrote: Am 18.05.17 um 10:10 schrieb Christian Gollwitzer: The whole discussion reminds me of the "bumblebees can't fly" thing. tcc is a very small compiler (some 100kb) which supports most of C99. For

Python compiled by tcc

2017-05-21 Thread Christian Gollwitzer
Am 18.05.17 um 10:10 schrieb Christian Gollwitzer: The whole discussion reminds me of the "bumblebees can't fly" thing. tcc is a very small compiler (some 100kb) which supports most of C99. For what it's worth, I compiled Python 3.6.1 on Linux/x86 using tcc. It was a sim

Re: How to install Python package from source on Windows

2017-05-19 Thread Christian Gollwitzer
Am 19.05.17 um 02:27 schrieb bartc: So I need msbuild. (This is getting more and more like the Tutti Frutti sketch in that Marx Bros film...) Install MSBUILD. Start a new console. Type msbuild; nothing. In fact I can't find any trace of it. Eventually track it down to inside VS directories,

Re: How to install Python package from source on Windows

2017-05-18 Thread Christian Gollwitzer
Am 18.05.17 um 00:21 schrieb Chris Angelico: On Thu, May 18, 2017 at 8:06 AM, Christian Gollwitzer <aurio...@gmx.de> wrote: tcc even has a "JIT-mode" of operation (libtcc). For Tcl, there exists an extension which compiles C code to memory and executes directly from there. The

Re: How to install Python package from source on Windows

2017-05-17 Thread Christian Gollwitzer
Am 16.05.17 um 09:53 schrieb Chris Angelico: On Tue, May 16, 2017 at 5:14 PM, Christian Gollwitzer <aurio...@gmx.de> wrote: More likely would be the option to ship a C compiler with Python written in C. For C++ this is way too big, but a pure C compiler can be as small as 1MB. tcc has a l

Re: How to install Python package from source on Windows

2017-05-16 Thread Christian Gollwitzer
Am 15.05.17 um 23:58 schrieb Chris Angelico: On Tue, May 16, 2017 at 7:01 AM, Deborah Swanson wrote: But I'm a little more mystified that official Python builds are leaning on Visual C++ (and that's what the crutch comment was primarily aimed at). You seem to be of

Re: Looping [was Re: Python and the need for speed]

2017-04-18 Thread Christian Gollwitzer
Am 18.04.17 um 08:21 schrieb Chris Angelico: On Tue, Apr 18, 2017 at 4:06 PM, Christian Gollwitzer <aurio...@gmx.de> wrote: Am 18.04.17 um 02:18 schrieb Ben Bacarisse: Thanks (and to Grant). IO seems to be the canonical example. Where some languages would force one to writ

Re: Looping [was Re: Python and the need for speed]

2017-04-18 Thread Christian Gollwitzer
Am 18.04.17 um 02:18 schrieb Ben Bacarisse: Thanks (and to Grant). IO seems to be the canonical example. Where some languages would force one to write c = sys.stdin.read(1) while c == ' ': c = sys.stdin.read(1) Python opts for while True: c = sys.stdin.read(1) if c !=

Re: Python and the need for speed

2017-04-14 Thread Christian Gollwitzer
Am 13.04.17 um 15:20 schrieb Marko Rauhamaa: Not sure if this is still valid: Still today Flash RAM cells built in SSDs have a limited lifespan. Every write (not read) cycle or better every erasure wears a memory cell and at some time it will stop working.

Re: Python and the need for speed

2017-04-11 Thread Christian Gollwitzer
Am 10.04.17 um 02:21 schrieb Gregory Ewing: Heck, you can write an exec() function for C if you really want. Run the C compiler in another process, dynamically load the object file and call it. Doing that would be very inefficient, but it wouldn't slow down the rest of your C code. Actually,

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-02 Thread Christian Gollwitzer
Am 01.04.17 um 19:38 schrieb Steve D'Aprano: ^home^steve^document.txt I'm sure I'd get used to it in a few years... Next: convince keyboard manufacturers to move the caret from SHIFT-6 to a plain, unshifted key. Buggared if I'm going to hit shift every time I want to use an absolute path...

Re: Who are the "spacists"?

2017-03-18 Thread Christian Gollwitzer
Am 18.03.17 um 01:52 schrieb Mikhail V: So Python supports both spaces and tabs for indentation. I just wonder, why not forbid spaces in the beginning of lines? How would one come to the idea to use spaces for indentation at all? In the Python world it is the opposite - spaces are preferred

Re: The ternaery operator

2017-03-16 Thread Christian Gollwitzer
Am 16.03.17 um 04:12 schrieb Stefan Ram: The syntax a if c else b looks as if Guido made it intentionally ugly so that it will not be used? [...] . But now Guido has invented something totally new. Why? The rationale can be read in PEP 308:

Re: how to embed non-tkinter VLC player into grid of tkinter with python?

2017-03-16 Thread Christian Gollwitzer
Am 16.03.17 um 05:40 schrieb Ho Yeung Lee: we have many TV that would like to be monitored, how to embed non-tkinter VLC player into grid of tkinter with python? below code can embeded xterm but not for VLC player import vlc from Tkinter import * import os root = Tk() for r in range(2):

Re: Manual parameter substitution in sqlite3

2017-03-02 Thread Christian Gollwitzer
Am 28.02.17 um 18:28 schrieb Skip Montanaro: Most of the time (well, all the time if you're smart), you let the database adapter do parameter substitution for you to avoid SQL injection attacks (or stupid users). So: curs.execute("select * from mumble where key = ?", (key,)) If you want to

Re: scrivere file

2017-02-12 Thread Christian Gollwitzer
Am 12.02.17 um 22:07 schrieb BartC: On 12/02/2017 20:38, Christian Gollwitzer wrote: Am 12.02.17 um 21:19 schrieb Paolo: Buonasera, è da un pò che sto cercando come esercizio di scrivere un file al contrario. Mi spiego meglio ho un file con N righe e vorrei scriverne un altro con gli stessi

Re: scrivere file

2017-02-12 Thread Christian Gollwitzer
Am 12.02.17 um 21:19 schrieb Paolo: Buonasera, è da un pò che sto cercando come esercizio di scrivere un file al contrario. Mi spiego meglio ho un file con N righe e vorrei scriverne un altro con gli stessi dati ma la 1° riga deve diventare l' ultima. Es. file di partenza riga1 riga2 riga3 riga4

Re: Python3.6 tkinter bug?

2017-01-31 Thread Christian Gollwitzer
Am 01.02.17 um 00:02 schrieb MRAB: On 2017-01-31 22:34, Christian Gollwitzer wrote: .!frame.!checkbutton .!frame.!checkbutton2 .!frame2.!checkbutton .!frame2.!checkbutton2 Perhaps someone who knows Tcl and tk can tell me, but I notice that in the first example, the second part of the widget

Re: Python3.6 tkinter bug?

2017-01-31 Thread Christian Gollwitzer
Am 31.01.17 um 20:18 schrieb George Trojan - NOAA Federal: Selection of button 'A' also selects button 'C'. Same goes for 'B' and 'D'. I noticed that widget names have changed, which likely leads to the cause: /usr/local/Python-3.5.1/bin/python3 foo.py .140182648425776.140182647743208

Re: Overriding True and False ?

2017-01-30 Thread Christian Gollwitzer
Am 31.01.17 um 04:27 schrieb Ian Kelly: On Jan 30, 2017 6:07 PM, "Steve D'Aprano" wrote: Hey Ian, Your news reader or mail client has stopped quoting the text you are quoting, so it appears as if you have written it. See:

Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2017-01-25 Thread Christian Gollwitzer
Am 25.01.17 um 10:18 schrieb Peter Otten: hmmeeranrizv...@gmail.com wrote: Hello Guys, Here i am creating a entry box with some text,i need to hide the text when i click on it. search.bind("", clear_search) This is the correct answer for a mouse click. The typical use case (disappearing

<    1   2   3   4   5   6   >