omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    How do we use raw_input()?

    Pythonista
    rawinout
    3
    5
    4159
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NickAtNight
      NickAtNight last edited by

      I don't see a raw_input() command.

      Input() works.

      But how do I use raw_input()

      1 Reply Last reply Reply Quote 0
      • abcabc
        abcabc last edited by

        raw_input() was renamed to input() in Python v3.x
        http://stackoverflow.com/questions/10885537/raw-input-has-been-eliminated-from-python-3-2

        1 Reply Last reply Reply Quote 0
        • NickAtNight
          NickAtNight last edited by

          Ah, ok.

          Was that when the also started requiring () with print statements?

          uj_jonas 1 Reply Last reply Reply Quote 0
          • uj_jonas
            uj_jonas @NickAtNight last edited by

            @NickAtNight Yes. In Python 3 print is a function.
            If you want to run your script to run in Python 2 you could add
            #! python2 at the top of your script like this:

            #! python2
            
            var = raw_input('using raw_input()')
            print 'python 2 print'
            

            You can also test your script in Python 2 by holding down the play button and choosing "Run with Python 2.7"

            1 Reply Last reply Reply Quote 0
            • NickAtNight
              NickAtNight last edited by

              Cool. Thank you

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors