Re: Output showing "None" in Terminal

2020-08-24 Thread Py Noob
Thank you for the clarification. What I'm trying to achieve here are: User be able to choose miles or kilometers to convert. When selected (mi/km), prints out the user input and the answer. km to mi = km/1.609 mi to km = mi*1.609 Thank you again! On Mon, Aug 24, 2020 at 1:41 PM Calvin Spealman

Training Review: Computational Thinking for Problem Solving

2020-08-24 Thread dn via Python-list
Many of us learn Python by memorising code-constructs and their use. Even over-coming this learning-curve is but a small portion of becoming a competent coder or programmer. The challenges of learning how to construct an algorithm, and/or how to analyse a real-world problem to produce a soluti

Re: There is LTS?

2020-08-24 Thread 황병희
Léo El Amri writes: > On 24/08/2020 04:54, 황병희 wrote: >> Hi, just i am curious. There is LTS for *Python*? If so, i am very thank >> you for Python Project. > > Hi Byung-Hee, > > Does the "LTS" acronym you are using here stands for "Long Term Support" ? > > If so, then the short answer is: Yes, k

Re: Program chaining on Windows

2020-08-24 Thread Rob Cliffe via Python-list
On 24/08/2020 19:54, Terry Reedy wrote: On 8/23/2020 3:31 AM, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, Please don't use 'DOS box' for Windows Command Prompt or other Windows consoles for running Windows programs from a command line.  DOSBox is

Re: Output showing "None" in Terminal

2020-08-24 Thread 2QdxY4RzWzUUiLuE
On 2020-08-24 at 06:12:11 -0700, Py Noob wrote: > i'm new to python and would like some help with something i was working on > from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is > my code and the terminal is showing the word "None" everytime I execute my > code. > if sel

Re: Program chaining on Windows

2020-08-24 Thread Rob Cliffe via Python-list
On 24/08/2020 13:20, Eryk Sun wrote: You can work with job objects via ctypes or PyWin32's win32job module. I can provide example code for either approach. No need, I'm already convinced that this is not the way for me to go. from the DOS prompt, it works as expected. You're not running D

Re: Output showing "None" in Terminal

2020-08-24 Thread Random832
On Mon, Aug 24, 2020, at 09:12, Py Noob wrote: > Hi! > > i'm new to python and would like some help with something i was working on > from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is > my code and the terminal is showing the word "None" everytime I execute my > code. Th

Re: Output showing "None" in Terminal

2020-08-24 Thread Calvin Spealman
How are you actually running your code? "None" is the default return value of all functions in Python. But, the interpreter is supposed to suppress it as a displayed result. As a side note, both your km_mi() function and the line "answer = km_mi" are certainly wrong, but it is not clear what you

Re: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Chris Angelico
On Tue, Aug 25, 2020 at 6:30 AM Schachner, Joseph wrote: > > Another suggestion: If your Python code only references few things outside > of itself, make a simulated environment in Python on your PC, so that you can > run your embedded code after importing your simulated environment, which >

RE: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Schachner, Joseph
Another suggestion: If your Python code only references few things outside of itself, make a simulated environment in Python on your PC, so that you can run your embedded code after importing your simulated environment, which should supply the functions it expects to call and variables it expe

ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-24 Thread Samuel Marks
After a discussion on #python on Freenode, I'm here. The gist of it is: > Falc - Signature of method 'Pharm.foo()' does not match signature of base > method in class 'Base' What's the right way of specialising the children and leaving the Base pretty much empty? Specifically I want: • All imple

Output showing "None" in Terminal

2020-08-24 Thread Py Noob
Hi! i'm new to python and would like some help with something i was working on from a tutorial. I'm using VScode with 3.7.0 version on Windows 7. Below is my code and the terminal is showing the word "None" everytime I execute my code. Many thanks! print("Conversion") def km_mi(): return an

Re: Program chaining on Windows

2020-08-24 Thread Terry Reedy
On 8/23/2020 3:31 AM, Rob Cliffe via Python-list wrote: On WIndows 10, running Python programs in a DOS box, Please don't use 'DOS box' for Windows Command Prompt or other Windows consoles for running Windows programs from a command line. DOSBox is program for running (old) DOS programs writ

Re: Issue in installing Python (Windows 10)

2020-08-24 Thread Terry Reedy
On 8/23/2020 12:39 PM, Debasis Chatterjee wrote: I started off by using "python-3.8.5.exe". 32-bit Windows installer? Windows version might be relevant. I use "Run as Administrator" option to click this (provide my local-admin username/pwd). After this, I see python shell available. But

Re: Program chaining on Windows

2020-08-24 Thread Michael Torrie
On 8/24/20 1:30 AM, Rob Cliffe via Python-list wrote: >> Hmm. Python isn't really set up to make this sort of thing easy. > I guess this sentence pretty well answers my whole post. :-( After reading Eryk Sun's posts, it doesn't appear that Python is the issue here, but rather Windows does not make

ANN: Version 0.1.6 of sarge (a subprocess wrapper library) has been released.

2020-08-24 Thread Vinay Sajip via Python-list
Version 0.1.6 of Sarge, a cross-platform library which wraps the subprocess module in the standard library, has been released. What changed? - - Fixed #44: Added an optional timeout to Command.wait() and Pipeline.wait(), which   only takes effect on Python >= 3.3. - Fixed #47: Added

Re: Program chaining on Windows

2020-08-24 Thread Eryk Sun
On 8/24/20, Rob Cliffe wrote: > > Are you suggesting something I could do in Python that would achieve my > aim of *replacing* one program by another No, it's not possible with the Windows API. Implementing POSIX exec would require extensive use of undocumented NT runtime library functions, syste

Re: Embedded python: How to debug code in an isolated way

2020-08-24 Thread Eko palypse
Thank you very much for your interest in my little problem. > When the app calls into python does the event loop of the gui block? Yes, the cpp app calls a callback function from the embedded python interpreter synchronously. > When you print does that trigger the event loop to run in a nested

Re: Program chaining on Windows

2020-08-24 Thread Rob Cliffe via Python-list
On 24/08/2020 00:57, Chris Angelico wrote: On Mon, Aug 24, 2020 at 9:51 AM Rob Cliffe via Python-list wrote: Let me describe my actual use case. I am developing a large Python program (in Windows, working in DOS boxes) and I constantly want to modify it and re-run it. What I have been doing

Re: Program chaining on Windows

2020-08-24 Thread Rob Cliffe via Python-list
On 24/08/2020 00:08, Eryk Sun wrote: For Windows, we need to spawn, wait, and proxy the exit status. Sorry, I understand very little of this.  Here's where I get stuck:     (1) "*spawn*": I see that there are some os.spawn* functions.  I tried this:     # File X1.py     import os, sys    

Re: Program chaining on Windows

2020-08-24 Thread Chris Angelico
On Mon, Aug 24, 2020 at 5:30 PM Rob Cliffe wrote: > > On 24/08/2020 00:57, Chris Angelico wrote: > > 2) The same thing but entirely within Python. Instead of importing > > modules, manually load them and exec the source code. (No relation to > > the process-level exec - I'm talking about the exec

Re: There is LTS?

2020-08-24 Thread Léo El Amri via Python-list
On 24/08/2020 04:54, 황병희 wrote: > Hi, just i am curious. There is LTS for *Python*? If so, i am very thank > you for Python Project. Hi Byung-Hee, Does the "LTS" acronym you are using here stands for "Long Term Support" ? If so, then the short answer is: Yes, kind of. There is a 5 years maintena