Mar-30-2017, 12:09 PM
It will be less confusing if you keep an open terminal and test the script there.
Trouble when entering the number
|
Mar-30-2017, 12:09 PM
It will be less confusing if you keep an open terminal and test the script there.
You are right. With terminal it is different. I repeat the two correct lines that work with the terminal but not with myCharm:
text=input("enter your text ") print("you entered: ", text)Here is what the interpreter of myCarm says: Do you think I must delete all myCharm and then reinstall the same ???Moderator Kebap: added code and error tags
Mar-30-2017, 05:31 PM
I am sure that PyCharm can't be so inconvenient but I don't use it so can't provide a solution for your question. It's too complicated for me
![]()
Mar-30-2017, 09:59 PM
(Mar-30-2017, 05:28 PM)sylas Wrote: You are right. With terminal it is different. I repeat the two correct lines that work with the terminal but not with myCharm: It seems like you are using a version of python 2.x so please change input() into raw_input().
Mar-31-2017, 06:00 AM
You are right Mr Kebab ! Thank you. Maybe python is more complex than C++. It's Ok with the text, but nobody told me if it is normal that the cursor appears inside the output area with text input, but not with the number input.
It's not more complex than C/C++.
In Python 2 input() is evaluated as valid Python code. For example: first_name = input(First name: ") First name: Victor It's obvious that I didn't define a variable called 'Victor' and I've got an error. From the documentation:Quote:input([prompt]) https://docs.python.org/2/library/functions.html#input (Mar-31-2017, 06:00 AM)sylas Wrote: Maybe python is more complex than C++. It's Ok with the text, but nobody told me if it is normal that the cursor appears inside the output area with text input, but not with the number input. It's not python complexity here. These are issues from pyCharm. There are other python IDEs as well, if you want to look.
Apr-02-2017, 05:48 AM
Since myCharm is not correct I tried my old vim with success. The first line must be: #!/usr/bin/python3. Other good news: Code::Blocks has plugins for python.
Apr-02-2017, 06:17 AM
A lot of talk about myCharm?? what is it?
I use PyCharm, and have done so for three years without a single incident. I suspect that you don't have it set up correctly. I tried using code blocks (which I always used for C) without much success for python. If indeed you are using myCharm, dump it and load PyCharm
Apr-02-2017, 07:32 AM
There is no problem with PyCharm other than that sylas has it setup to point to python 2.x.
Then he write code for Python 3.x. Set up Interpreter to point to python 3. |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Eliminate entering QR - Whatsapp web automated by selenium | akanowhere | 1 | 4,013 |
Jan-21-2024, 01:12 PM Last Post: owalahtole |
|
problem in entering address of a file in input | akbarza | 0 | 1,459 |
Oct-18-2023, 08:16 AM Last Post: akbarza |
|
syntaxerror when entering a constructor | MaartenRo | 2 | 2,706 |
Aug-03-2020, 02:09 PM Last Post: MaartenRo |
|
How to Stop Sentinel Value from Entering Final Output | ZQ12 | 3 | 4,602 |
Nov-11-2019, 07:25 AM Last Post: perfringo |
|
Error when entering letter/character instead of number/integer | helplessnoobb | 2 | 9,687 |
Jun-22-2019, 07:15 AM Last Post: ThomasL |
|
Program not entering if statement on false. | Scottx125 | 4 | 4,036 |
Nov-12-2018, 06:30 PM Last Post: Scottx125 |
|
Entering an expression with "input" command | johnmnz | 3 | 4,379 |
Sep-01-2017, 05:20 PM Last Post: metulburr |