Hack Forums
[Python] [src code]RuntimeError: can't re-enter readline - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] [src code]RuntimeError: can't re-enter readline (/showthread.php?tid=5141259)



[src code]RuntimeError: can't re-enter readline - Un0hex - Jan 20, 2016

Help with the above error ?

I am attempting to make a gui to send email.. and using 'user' which is the email being sent from and 'to' who to send the email to, as raw_input so that I could manually choose and type in my choice..
to = rawinput("select: ") -< example
user = rawinput("select: ") -< example
but everytime I get that error, does Tk has issues with raw_input?
or is there another problem with the code that I am missing out?

please help 😭

here's the code .. am I even doing it right?
pastebin.com/51h2MWdM


p.s I now realized I haven't even stated a message input field as well for this whole thing :<


* - CocoaNut - Jan 21, 2016

Not sure how to fix your error, but why bother GUIs in Python?


* - Un0hex - Jan 21, 2016

(Jan 21, 2016 11:30 AM)CocoaNut Wrote:  Not sure how to fix your error, but why bother GUIs in Python?

Without the gui, the code works properly, as in.. sending the attachments and choosing src and destination, as for why.. well, just wanted to experiment a bit.. do the same thing in graphical , u understand?
tried several ways around this, doesn't work. :$


* - CocoaNut - Jan 21, 2016

(Jan 21, 2016 11:46 AM)Un0hex Wrote:  Without the gui, the code works properly, as in.. sending the attachments and choosing src and destination, as for why.. well, just wanted to experiment a bit.. do the same thing in graphical , u understand?
tried several ways around this, doesn't work. :$

Mhm. What I meant is that Python will never be meant to be used with GUIs and you will get errors like this all the time. Just saying :) 👍

I get that you want to experiment though


* - Un0hex - Jan 21, 2016

(Jan 21, 2016 11:56 AM)CocoaNut Wrote:  Mhm. What I meant is that Python will never be meant to be used with GUIs and you will get errors like this all the time. Just saying :) 👍

I get that you want to experiment though

so give up on attempting gui dev ? 🤝


* - WojeT - Jan 21, 2016

(Jan 21, 2016 11:56 AM)CocoaNut Wrote:  Mhm. What I meant is that Python will never be meant to be used with GUIs and you will get errors like this all the time. Just saying :) 👍

I get that you want to experiment though

This is nonsense, Python is very capable when it comes to GUIs.


The solution to your problem is likely this: http://stackoverflow.com/questions/19842562/python-how-do-i-store-a-text-input-from-the-user-on-tkinter


* - CocoaNut - Jan 21, 2016

(Jan 21, 2016 11:59 AM)Un0hex Wrote:  so give up on attempting gui dev ? 🤝

Never do! ;)

(Jan 21, 2016 12:10 PM)WojeT Wrote:  This is nonsense, Python is very capable when it comes to GUIs.


The solution to your problem is likely this: http://stackoverflow.com/questions/19842562/python-how-do-i-store-a-text-input-from-the-user-on-tkinter

Of course it's possible, but you can't disagree with the fact that Python is a command line based language


* - Un0hex - Jan 21, 2016

(Jan 21, 2016 12:10 PM)WojeT Wrote:  This is nonsense, Python is very capable when it comes to GUIs.


The solution to your problem is likely this: http://stackoverflow.com/questions/19842562/python-how-do-i-store-a-text-input-from-the-user-on-tkinter

Thanks man, I will try it out soon :-))<3


* - WojeT - Jan 21, 2016

(Jan 21, 2016 12:18 PM)CocoaNut Wrote:  Never do! ;)


Of course it's possible, but you can't disagree with the fact that Python is a command line based language

It is not a command line based language, not any more than Java, C, C++ can be called command line based. Python is actually often used for only the GUI, as a front end for a program written in another language, simply because it is easy to do it in Python compared to many other languages.


* - RiperFish - Jan 21, 2016

use wxpython or pyqt, it's more professional :D.


* - Un0hex - Jan 21, 2016

(Jan 21, 2016 01:30 PM)AvAHT{AHR} Wrote:  use wxpython or pyqt, it's more professional :D.

thanks :-) 👍 I'll try it out and we'll see how this works..