0

I have been trying to learn Python using Al Sweigart's book. Using the Sublime Text 3 I found it hard to run this code which is identical to the code in the book. I have changed the setting over to View > Syntax > Python. The code is:

print ('Hello world!')
print ('What is your name?')
myName = input()
print ('It is good to meet you,' + myName)
print ('The length of your name is:')
print (len(myName))

The console has the following output:

Hello world!
What is your name?

I typed in a name. But nothing happened from then on. Because of two posts on here (Post 1; Post 2), I installed the SublimeREPL package, but I am not entirely sure how to use it and whether it is what I need. I can find the packaged under Tools > SublimeREPL > Python > and then a bunch of versions.

Can someone help? Help is much appreciated.

  • setup python following this tutorial https://www.youtube.com/watch?v=rIl0mmYSPIc – Ghantey Feb 11 '19 at 09:30
  • I wasn't successful on Ubuntu. Am I wrong or has Ubuntu Python pre-installed? –  Feb 11 '19 at 16:14
  • If you are having problem with sublime then its better way to switch to other IDLE like pycharm, notepad ++, etc – Ghantey Feb 12 '19 at 02:13
  • Thanks, but no thanks. I would like to get Sublime Text running, and not switch platforms. But it's nice of you to encourage my problem solving skills. –  Feb 12 '19 at 07:28
  • I wish you have solved your problem by now – Ghantey Feb 12 '19 at 10:55
  • Sublime doesn't let you interact with programs running in the output panel, so your code is likely fine, you just can't run it the way you're trying to. Although you can type whatever you want in the output panel, it doesn't get sent to your running program. You need to run it externally or use a plugin like SublimeREPL that connects the input up for you. – OdatNurd Feb 12 '19 at 23:59
  • Thanks a lot, @OdatNurd. Could you please post your comment as an answer. So that we can close the issue? –  Feb 13 '19 at 14:52
  • I don't think that answers your question because you were already using SublimeREPL (which is the general solution) but your question is more about why SublimeREPL wasn't working for you. – OdatNurd Feb 14 '19 at 19:58

0 Answers0