Re: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread Dieter Maurer
Chris Angelico wrote at 2023-5-26 18:29 +1000: > ... >However, if you want to change the wording, I'd be more inclined to >synchronize it with float(): > float("a") >Traceback (most recent call last): > File "", line 1, in >ValueError: could not convert string to float: 'a' +1 -- https://m

Re: Module error

2023-05-26 Thread MRAB
On 2023-05-27 01:30, giuseppacef...@gmail.com wrote: I have reinstalled python which reinstalls pip. I have added the path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still get the error below. Could

FW: Module error

2023-05-26 Thread giuseppacefalu
Directory of C:\Users\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.1 1_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts 05/26/2023 07:57 PM . 05/26/2023 04:03 PM .. 05/26/2023 04:07 PM 108,469 f2py.exe 05/26/2023 04:03 PM

FW: Module error

2023-05-26 Thread giuseppacefalu
The directory is empty after issuing the command: Directory of C:\Users\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.1 1_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts 05/26/2023 07:57 PM . 05/26/2023 04:03 PM .. 05/26/2023 04:07 PM

Module error

2023-05-26 Thread giuseppacefalu
I have reinstalled python which reinstalls pip. I have added the path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still get the error below. Could you help me with this please? Traceback (most rece

RE: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread avi.e.gross
Roel, In order for the code to provide different error messages, it needs a way to differentiate between circumstances. As far as the int() function is concerned, it sees a string of characters and has no clue where they came from. In Python, int(input()) just runs input() first and creates a

Re: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread MRAB
On 2023-05-26 09:29, Chris Angelico wrote: On Fri, 26 May 2023 at 17:56, Roel Schroeven wrote: Kevin M. Wilson's post "Invalid literal for int() with base 10?" got me thinking about the use of the word "literal" in that message. Is it correct to use "literal" in that context? It's correct in s

Re: Does os.path relpath produce an incorrect relative path?

2023-05-26 Thread Eryk Sun
On 5/26/23, cactus wrote: > > Surprisingly (for me at least) the alternative provided by the pathlib > module 'relative_to' method doesn't provide for full relative path > computation. I was expecting this would offer everything that os.path > offers but it doesn't in this case. Starting with Py

Re: Does os.path relpath produce an incorrect relative path?

2023-05-26 Thread cactus
On Thursday, 25 May 2023 at 17:57:21 UTC+1, MRAB wrote: > On 2023-05-25 16:53, Eryk Sun wrote: > > On 5/25/23, BlindAnagram wrote: > >> > >> vcx_path = 'C:\\build.vs22\\lib\\lib.vcxproj' > >> src_path = 'C:\\lib\\src\\' > >> rel_path = '..\\..\\..\\lib\\src' > >> > >> [snip] > >> > >> The fi

Re: Invalid literal for int() with base 10?

2023-05-26 Thread Keith Thompson
Keith Thompson writes: > "Kevin M. Wilson" writes: >> Ok, I'm not finding any info. on the int() for converting a str to an >> int (that specifies a base parameter)?! > > https://docs.python.org/3/library/functions.html#int [...] Or `print(int.__doc__)` at a Python ">>>" prompt, or `pydoc int` (

Re: Invalid literal for int() with base 10?

2023-05-26 Thread Grant Edwards
On 2023-05-26, Grant Edwards wrote: > On 2023-05-25, Kevin M. Wilson via Python-list wrote: > >> Ok, I'm not finding any info. on the int() for converting a str to >> an int (that specifies a base parameter)?! > > Where are you looking? > > https://docs.python.org/3/library/functions.html#int

Re: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread Roel Schroeven
Op 26/05/2023 om 10:29 schreef Chris Angelico: However, if you want to change the wording, I'd be more inclined to synchronize it with float(): >>> float("a") Traceback (most recent call last): File "", line 1, in ValueError: could not convert string to float: 'a' I was looking for other Va

Re: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread Chris Angelico
On Fri, 26 May 2023 at 17:56, Roel Schroeven wrote: > > Kevin M. Wilson's post "Invalid literal for int() with base 10?" got me > thinking about the use of the word "literal" in that message. Is it > correct to use "literal" in that context? It's correct in something like > this: > > >>> int('inv

"Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread Roel Schroeven
Kevin M. Wilson's post "Invalid literal for int() with base 10?" got me thinking about the use of the word "literal" in that message. Is it correct to use "literal" in that context? It's correct in something like this: >>> int('invalid') Traceback (most recent call last):   File "", line 1, in

Re: Invalid literal for int() with base 10?

2023-05-26 Thread Roel Schroeven
Op 25/05/2023 om 23:30 schreef Kevin M. Wilson via Python-list: Ok, I'm not finding any info. on the int() for converting a str to an int (that specifies a base parameter)?! The picture is of the code I've written... And the base 10 paradigm involved?? years = int('y') # store for calculationVa