Cannot run python script [duplicate]

2024/11/19 8:34:20

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.pyFile "largestFiles.py", line 28print "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.pyFile "largestFiles.py", line 28print "Finding objects larger than {}".format(args.filesExceeding)^
SyntaxError: invalid syntax

Any ideas?

I am running it on windows 8 using python 3.4

Answer

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…
https://en.xdnf.cn/q/119969.html

Related Q&A

I want to read multiple audio files with librosa and then save it into an empty list

Here id my code . when I append into the array the array remain empty . Please help me where is the mistake. Or tell me some other way also to do thisA = [] # load more files with librosa pathAudio = …

How to db.execute in postgresql using the LIKE operator with variables within flask [duplicate]

This question already has an answer here:CS50: LIKE operator, variable substitution with % expansion(1 answer)Closed 4 years ago.Im trying to get my db.execute to work but encounter a syntax error when…

C, Perl, and Python similar loops different results

I wrote scripts to calculate pi in python, perl and c. They all use the same algorithm (trapezoidal reimann sum of a circle with n subintervals) and the python and perl programs always get the same re…

How to print a single backslash in python in a string? [duplicate]

This question already has answers here:Why do backslashes appear twice?(2 answers)Closed 1 year ago.In python (3x version)\ # this is error no doubt \\ # this prints two backslashes ,i.e., \\ r\ # thi…

Return nested JSON item that has multiple instances

So i am able to return almost all data, except i am not able to capture something like this:"expand": "schema""issues": [{"expand": "<>","id…

What request should I make to get the followers list from a specific profile page

I am trying to get the followers list from this profile, I tried making a GET request using python requests to the API using this request URL but it didnt seem to work, I got a METHOD_NOT_ALLOWED error…

PlayerDB API Post Requests bring 404

I made a little script to get the UUIDs of people who joined my minecraft server, then run them through the PlayerDB API through a post request to: https://playerdb.co/api/player/minecraft/* where the …

How to make changes using Configparser in .ini file persistent

How to modify the .ini file? My ini file looks like this. And i want the format section ini to be changed like this[Space to be replaced with a tab followed by $] Format="[%TimeStamp%] $(%Thre…

How to structure template libraries in a Django project? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.Clo…

Not able to click button with Selenium (Python)

Im trying to click a button using Selenium, but everytime I get the message that it cant find the element. This happens even when I put a time.sleep() in front of it. time.sleep(5)#Click on downloaddow…