Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to flash my SD card on my Mac and receive an error message in the Terminal:

Command entered:

sudo python raspiwrite.py

Response:
  File "raspiwrite.py", line 177
    else
       ^
SyntaxError: invalid syntax

I downloaded the necessary files from github/exaviorn/RasPiWrite.

Any ideas?

share|improve this question

closed as not constructive by Breakthrough, Brad Patton, 8088, Nifle, Ƭᴇcʜιᴇ007 Apr 28 '13 at 14:41

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

The else statement in line 177 is missing a colon.

Open raspiwrite.py in TextEdit, scroll down to line 177, add a colon after else, and save the edited file.

Alternatively, you can download my fixed version from Github.

I've submitted a pull request to the original author to fix the script.

share|improve this answer
    
Unfortunately it does not work, I receive another error: File "raspiwrite.py", line 275 SDsnip = SD.replace(' ', '')[:-1] ^ IndentationError: expected an indented block –  Pete Apr 27 '13 at 14:18
    
pushed another commit that should fix this; does it work now? –  ncdownpat Apr 27 '13 at 20:05
    
No, it now works better but I receive the message: No, I now receive the message: Checking for updates... Traceback (most recent call last): File "raspiwrite.py", line 440, in <module> checkforUpdate() File "raspiwrite.py", line 68, in checkforUpdate dom = parseString(data) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/‌​minidom.py", line 1924, in parseString File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/‌​expatbuilder.py", line 940, in parseString File –  Pete Apr 28 '13 at 9:45
    
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/dom/‌​expatbuilder.py", line 223, in parseString xml.parsers.expat.ExpatError: not well-formed (invalid token): line 15, column 59 --> What am I doing wrong? Thanks! –  Pete Apr 28 '13 at 9:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.