Mar-30-2017, 12:09 PM
Mar-30-2017, 05:28 PM
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:
Error:text=input("enter your text: ")
File "<string>", line 1, in <module>
NameError: name 'cvfret' is not defined
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:
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 ???
Error:text=input("enter your text: ") File "<string>", line 1, in <module> NameError: name 'cvfret' is not defined
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.
Mar-31-2017, 07:27 AM
It's not more complex than C/C++.
In Python 2 input() is evaluated as valid Python code. For example:
https://docs.python.org/2/library/functions.html#input
In Python 2 input() is evaluated as valid Python code. For example:
first_name = input(First name: ") First name: Victor
Error:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'Victor' is not defined
It's obvious that I didn't define a variable called 'Victor' and I've got an error. From the documentation:Quote:input([prompt])
Equivalent to eval(raw_input(prompt)).
This function does not catch user errors. If the input is not syntactically valid, a SyntaxError will be raised.
Other exceptions may be raised if there is an error during evaluation.
https://docs.python.org/2/library/functions.html#input
Mar-31-2017, 10:34 AM
(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
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.
Then he write code for Python 3.x.
Set up Interpreter to point to python 3.