according to the author this very simple script should run, but when I try to run it I get this error
“There’s an error in your program EOL while scanning string literal”
Here’s the script
#linuxversion.py
#Have user input version and print response
name = raw_input("What Linux release do you use?”)
print “I also like”, name, ” – Linux rules!”
Dunno why you got that, but copy/pasting yours didn’t work … the guy had inserted non ASCII characters, because he want YOU to type in the text.
This should work
#linuxversion.py
#Have user input version and print response
name = raw_input("Which Linux release do you use ? ")
print "I also like", name, "- Linux rules!"
Bung that in a file called linuxversion.py … place it in your home folder, and run:
python linuxversion.py
ALWAYS type it up yourself, rather than copy/paste
#!/usr/bin/env python3
#linuxversion.py
#Have user input version and print response
name = input("Which Linux release do you use ? ")
print ("I also like", name, "- Linux rules!")
Yeah typing the code in manually sorted it and it works fine
You're using idle right ? .. not idle3
I have 2 entries for IDLE in my menu…IDLE & IDLE (using python-2.7), I’ve just been using IDLE
Can anyone suggest any online Python tutorials for the completely clueless
The only programming experience I have is many years ago I wrote some very simple programs in BASIC using a ZX Spectrum and I enjoyed doing it but that was a very simple language to understand, I wrote a game for my daughter to play (Who was around 5 or 6 at the time) and I want to see if i can recreate it in Python
Python is the closest language to BASIC without any doubt, it can be as simple or as complex as your want it to be!
You need to be aware that Python 2 & Python 3 are quite different, and are NOT compatible. My advice would be to forget Python 2, and focus on Python 3 as that is the future.
Thanks for your advice and the link, I’ll check it out later when I get home, I’m currently following a tutorial from a book titled “Python For The Absolute Beginner” and already I’ve managed to write this amazing program that prints “Hello World” on the screen,
Yeah it is a lot like BASIC as I remember so I’ll keep plugging away, it can be frustrating when you run a module and get a syntax error and can’t figure out what it is, but I suppose if it was easy it wouldn’t be worth doing
a programming section on this site would be helpful but there probably wouldn’t be enough people programming to justify it
Sorry I never knew that section existed, you’re right about the traffic last post was about 3 months ago, but if I keep up this Python thing I’m sure I could keep it busy