Discuss Scratch

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)

mariosonic387903 wrote:

can u all shut up and leave me alone
what did we do
BreadcatGames
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

mariosonic387903 wrote:

can u all shut up and leave me alone
you 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
bigspeedfpv
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

What python compiler should i use on my computer
interpreter
just use the official one (cpython) here
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

bigspeedfpv wrote:

wvzack wrote:

What python compiler should i use on my computer
interpreter
just use the official one (cpython) here
which version (python 64 bit, python, idle python, idle python 64 bit)
ajskateboarder
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

What python compiler should i use on my computer
Pyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.

wvzack wrote:

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)

ajskateboarder wrote:

wvzack wrote:

What python compiler should i use on my computer
Pyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.

wvzack wrote:

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
i already have it my problem is that i cant make working forever loops
GIitchInTheMatrix
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

ajskateboarder wrote:

wvzack wrote:

What python compiler should i use on my computer
Pyjion, obviously. In case you didn't know, Python isn't (necessarily) compiled, but rather interpreted.

wvzack wrote:

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
i already have it my problem is that i cant make working forever loops
Although i use a different enviorment, this should work:
while True:

Last edited by GIitchInTheMatrix (April 25, 2023 18:19:54)

wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

this is all that happens
ajskateboarder
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

this is all that happens
You 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>
bigspeedfpv
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

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>
you don't? you just use comment.CommentID, comment.Content?
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

bigspeedfpv wrote:

wvzack wrote:

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>
you don't? you just use comment.CommentID, comment.Content?
wait realy thx so much
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

bigspeedfpv wrote:

wvzack wrote:

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>
you don't? you just use comment.CommentID, comment.Content?
sorry but can you elaborate
ajskateboarder
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

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’: }]
f8erhf4ervjfwbjfwurfwiesijbrufiehwiubiubfiubfbug4w848v It's called JSON
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 ☠
DifferentDance8
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

Knightbot63 wrote:

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 ☠
install pipx, then do:
pipx install scratchattach
Really the only difference is that it makes a virtual environment, which in my eyes I see as good!
Knightbot63
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

DifferentDance8 wrote:

(#1644)

Knightbot63 wrote:

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 ☠
install pipx, then do:
pipx install scratchattach
Really the only difference is that it makes a virtual environment, which in my eyes I see as good!
Thanks
ajskateboarder
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

Knightbot63 wrote:

I am not sure if it's just me or the installation won't work.
https://assets.scratch.mit.edu/get_image/.%2E/390f3742f561c9cb9f3f9f9e3fec82ad.png
What on god's green earth happened to pip ☠

Powered by DjangoBB