This forum has been archived. All content is frozen. Please use KDE Discuss instead.

No input promp in kdevelop python

Tags: None
(comma "," separated)
buzzoi
Registered Member
Posts
6
Karma
0

No input promp in kdevelop python

Fri Mar 19, 2021 5:04 pm
Hi, I'm a beginner in python using Kdev on linux. I tried to execute this code:
Code: Select all
nm= input('Enter your name:')
print('Welcome', nm)


Normally it should prompt something asking me the name and so on but nothing comes up:
https://pasteboard.co/JTmxsfo.png

configuration :

https://postimg.cc/k6PXVwVD
buzzoi
Registered Member
Posts
6
Karma
0
buzzoi wrote:Hi, I'm a beginner in python using Kdev on linux. I tried to execute this code:
Code: Select all
nm= input('Enter your name:')
print('Welcome', nm)


Normally it should prompt something asking me the name and so on but nothing comes up:
https://pasteboard.co/JTmxsfo.png

configuration :

https://postimg.cc/k6PXVwVD


OMG nobody here? I've been stuck with this problem for a few days I guess. Help pleaseeeeeee
balenak
Registered Member
Posts
8
Karma
0

Re: No input promp in kdevelop python

Sun Mar 21, 2021 10:58 pm
Hello,
unfortunately I think there is no straight-forward solution, as the "Run" view is output only. But you can just make the script run in external terminal, then it will work. Go into your Launch configuration, and fill the "Script Interpreter" (where now you have "Python3" filled) like this:

konsole --noclose --workdir /home/sajad/projects/Python -e python3

...of course if you have different Terminal emulator that Konsole, then you need to adjust it appropriately, but it should give you an idea :)
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
KDevelop's output view does not support input. It's something a lot of beginners trip upon, but outside of programming tutorials, the amount of applications which need interactive terminal input is really tiny. That's why it is not implemented.

I would recommend to just do this part of your tutorial without using KDevelop's "Run" feature; instead open a terminal emulator and type "python whatever.py".


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]