-1

I am trying to run this python script:

https://gist.githubusercontent.com/nk9/b150542ef72abc7974cb/raw/4a1e249976c6c330116fc068fb7001e3443c5b8d/largestFiles.py

but for some reason it contains a bunch of illegal characters and gives this error:

C:\tools\inspect>python largestFiles.py
  File "largestFiles.py", line 28
    print "Finding objects larger than {}kB\u2026".format(args.filesExceeding)
                                            ^
SyntaxError: invalid syntax

If I remove those illegal characters I still get:

C:\tools\inspect>python largestFiles.py
  File "largestFiles.py", line 28
    print "Finding objects larger than {}".format(args.filesExceeding)
                                         ^
SyntaxError: invalid syntax

Any ideas?

I am running it on windows 8 using python 3.4

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
u123
  • 15,603
  • 58
  • 186
  • 303
  • use `{0}`, instead of `{}` – YOU Apr 14 '15 at 13:03
  • 2
    Please don't change the question after you've received answers. If you have a new question, ask it (or, better yet, and as you failed to do before asking this question, **do some research first**). – jonrsharpe Apr 14 '15 at 13:05

1 Answers1

0

As print is function in python 3 you need to put your string in parenthesis. https://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function

>>> print ("Finding objects larger than kB\u2026")
Finding objects larger than kB…
Mazdak
  • 105,000
  • 18
  • 159
  • 188