ioquatix / script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
http://atom.io/packages/script-runner
Other
62 stars 23 forks source link

syntax error #114

Closed dizzy321 closed 3 years ago

dizzy321 commented 3 years ago

The following excerpt from a code gives me syntax error in atom using script-runner. In Idle it works fine. print (ausgabe, end=' ') syntax error ^

dizzy321 commented 3 years ago

the syntax error is at the = sign

ioquatix commented 3 years ago

Did you select the right language in Atom?

dizzy321 commented 3 years ago

Yes. I am just starting, but i am running python3 as far as I know.

dizzy321 commented 3 years ago

This is the entire code from a python tutorial page:

import random
print("hangman in Python")
woerter = 'Hund Katze Maus Haus raus'.split()
erraten = []
nutzereingabe = ""
fehlversuche  = 7
ratewort = random.choice(woerter)
for buchstaben in ratewort:
    erraten.append('_')
while nutzereingabe != "bye":
    for ausgabe in erraten:
        print (ausgabe, end=' ')
    print()
    nutzereingabe = input("Ihr Vorschlag: ")
    x = 0
    for buchstaben in ratewort:
        if buchstaben.lower() == nutzereingabe.lower():
            print ("Treffer")
            erraten[x] = buchstaben
        x += 1
    print()
    # Kontrolle ob gewonnen
    if '_' in erraten:
        # print('Noch nicht gewonnen')
        fehlversuche -= 1
        if fehlversuche  == 0:
            print("Schade - verloren!")
            break
    else:
        print("Gewonnen, das Wort war: ", ratewort)
        break
dizzy321 commented 3 years ago

ok github doesn't show it correctly. It's under this link at the bottom of the page. https://www.python-lernen.de/hangman-python-programmieren.htm

ioquatix commented 3 years ago

Here is how you format code on github: https://guides.github.com/features/mastering-markdown/

ioquatix commented 3 years ago

Add:

#!/usr/bin/env python3

to the top of your script to tell the editor what language it is.

dizzy321 commented 3 years ago

thank you very much. that did it.