Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- mariosonic387903
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
can u all shut up and leave me alone

- silvxrcat
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
can u all shut up and leave me alonewhat did we do
- BreadcatGames
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
can u all shut up and leave me aloneyou should unfollow this thread so you don’t get messages. And also be more respectful.
Last edited by BreadcatGames (April 25, 2023 16:27:19)
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
What python compiler should i use on my computer
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
What python compiler should i use on my computerPyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.
which version (python 64 bit, python, idle python, idle python 64 bit)Just click the yellow button on this page and it should download a relevant installer for your architecture. Python comes with IDLE on Windows by default
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
i already have it my problem is that i cant make working forever loopsWhat python compiler should i use on my computerPyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.which version (python 64 bit, python, idle python, idle python 64 bit)Just click the yellow button on this page and it should download a relevant installer for your architecture. Python comes with IDLE on Windows by default

- GIitchInTheMatrix
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
Although i use a different enviorment, this should work:i already have it my problem is that i cant make working forever loopsWhat python compiler should i use on my computerPyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.which version (python 64 bit, python, idle python, idle python 64 bit)Just click the yellow button on this page and it should download a relevant installer for your architecture. Python comes with IDLE on Windows by default
while True:
Last edited by GIitchInTheMatrix (April 25, 2023 18:19:54)
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
this is all that happensYou should use a proper editor like Python IDLE or Visual Studio Code (or Codium)
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
probully super simple but i cant find a way to use the “split()” (really i dont care if it uses split or something else as long as it works) to separate the value of user.comments(limit=1, page=1) into usable stuff like one var named “comment_id” and one named “comment_content” ect. ect..
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
PS C:\Users\chwyn\.vscode>
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
PS C:\Users\chwyn\.vscode>
- bigspeedfpv
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
probully super simple but i cant find a way to use the “split()” (really i dont care if it uses split or something else as long as it works) to separate the value of user.comments(limit=1, page=1) into usable stuff like one var named “comment_id” and one named “comment_content” ect. ect..you don't? you just use comment.CommentID, comment.Content?
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
PS C:\Users\chwyn\.vscode>
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
wait realy thx so muchprobully super simple but i cant find a way to use the “split()” (really i dont care if it uses split or something else as long as it works) to separate the value of user.comments(limit=1, page=1) into usable stuff like one var named “comment_id” and one named “comment_content” ect. ect..you don't? you just use comment.CommentID, comment.Content?
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
PS C:\Users\chwyn\.vscode>
- wvzack
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
sorry but can you elaborateprobully super simple but i cant find a way to use the “split()” (really i dont care if it uses split or something else as long as it works) to separate the value of user.comments(limit=1, page=1) into usable stuff like one var named “comment_id” and one named “comment_content” ect. ect..you don't? you just use comment.CommentID, comment.Content?
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
PS C:\Users\chwyn\.vscode>
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
probully super simple but i cant find a way to use the “split()” (really i dont care if it uses split or something else as long as it works) to separate the value of user.comments(limit=1, page=1) into usable stuff like one var named “comment_id” and one named “comment_content” ect. ect..f8erhf4ervjfwbjfwurfwiesijbrufiehwiubiubfiubfbug4w848v It's called JSON
instead of [{'CommentID': ‘265564665’, ‘User’: ‘__boat__’, ‘Content’: ‘/comment info’, ‘Timestamp’: ‘2023-04-26T01:39:56Z’, ‘hasReplies?’: True, ‘Replies’: }]
You should really go to PyHelp, you should never use str.split to parse JSON
Use json.loads, it's in the standard library:
import json json_string = "[{'CommentID': '265564665', 'User': '__boat__', 'Content': '/comment info', 'Timestamp': '2023-04-26T01:39:56Z', 'hasReplies?': True, 'Replies': [{'CommentID': '265575353', 'User': 'wvzack', 'Content': '@__boat__ i will run the code', 'Timestamp': '2023-04-26T03:22:53Z'}]}]" # parse the text and get the first item (it's a list) item = json.loads(json_string)[0] # print the values of CommentID and Content using *bracket* notation print(item["CommentID"], item["Content"])
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I am not sure if it's just me or the installation won't work.

I had done sudo apt install python3-scratchattach but it says no software called scratchattach. And it says that I can override this but I can risk breaking my PC ☠

I had done sudo apt install python3-scratchattach but it says no software called scratchattach. And it says that I can override this but I can risk breaking my PC ☠
- DifferentDance8
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I am not sure if it's just me or the installation won't work.install pipx, then do:
I had done sudo apt install python3-scratchattach but it says no software called scratchattach. And it says that I can override this but I can risk breaking my PC ☠
pipx install scratchattach
- Knightbot63
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
(#1644)ThanksI am not sure if it's just me or the installation won't work.install pipx, then do:
I had done sudo apt install python3-scratchattach but it says no software called scratchattach. And it says that I can override this but I can risk breaking my PC ☠Really the only difference is that it makes a virtual environment, which in my eyes I see as good!pipx install scratchattach
- ajskateboarder
-
Scratcher
1000+ posts
scratchattach - A Scratch API wrapper (Python)
I am not sure if it's just me or the installation won't work.What on god's green earth happened to pip ☠
https://assets.scratch.mit.edu/get_image/.%2E/390f3742f561c9cb9f3f9f9e3fec82ad.png
