My code works in codecademy, but not in atom


#1

!

I think it has something to do with raw_input function. It gave me an EOF error and I don’t know what that means. The code used is a copy of the solutions from codecademy.


#2

alright, just an idea, but instead of using raw_input, just try using input.

Ex.
x=int(input(“what is your age”))


#3

Save this tiny script, and run it…

import sys
print (sys.version)

If it is 3.x.x, then you must use input() as mentioned above, but you must also use print () with parens since it is a function in Python 3. If it is 2.x.x then use raw_input(). It won’t matter if you use parens on print, but you can for practice.


#4

Tried that but the same error came up


#5

Be sure your code contains only standard quotes " not the fancy kind.


#6


What does the End of file error mean. I googled it, but could not find any relevant information.


#7

It means the line cannot be parsed to the end of line. Try replacing all the quotes with ".

Hold down the ALt key and on your numeric keypad, type 34 then let go of the Alt key.

"

#8

I tried replacing all quotes with ", but the same error shows up. I also don’t have a numeric keypad since i am on a laptop. I tried running the code in repl.it and it works fine in that as well.


#9

Your code appears to be rendering and waiting for input. What have you entered at the prompt?


#10

I can’t input anything in atom since the error shows up


#11

That’s strange. I don’t see anything wrong with the code, and you are running Python 2.7 so raw_input() should work. Just for the sake of trying,

print (eval(input())

then see if you get an input prompt. Try typing something if you do, and Enter.


#12

nope.


#13

Is this because i configured atom wrong. I downloaded this package to help me run the code:beep%20bop


#14

I really know nothing about Atom, so will need to defer this to somebody who does. Sorry I have to bow out.


#15

Yea, same i don’t use atom. But i will look more closely


#16

I think atom has a different compiler than codecademy.


#17

what would you suggest i do ?


#18

I think i know what the problem is guys. Thank you for replying. I think i should use something other than atom to run scripts next time.


#19

a compiler for an interpreted language?

@digitalninja63049, what if you use the python interpreter in the command line to run script? Then you can determine if problem is with atom-runner.


#20

Yes, use sublime text 3 it’s really great for python programming.