Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » Python programming language
- Reev0102
- Scratcher
1000+ posts
Python programming language
I am aware of that. I am also aware that OK then, and also use .json to parse JSON response and .text for non-JSON responses.
["x"]
- ScratchCatHELLO
- Scratcher
1000+ posts
Python programming language
I am aware of that. I am also aware that OK then, and also use .json to parse JSON response and .text for non-JSON responses.is used to get a part of the JSON.["x"]
because parsing the JSON returns a dict
ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust
Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
- Meowswish55
- Scratcher
100+ posts
Python programming language
Yeah. I hate having to redefine the “if mouse position is within object's borders”.
if you want it to detect clicks, you can use event.pos and have a rect object for the clickable area. then you can use spritecollide to detect whether the rect was clicked on.
Thats what ive been doing.
- ScratchCatHELLO
- Scratcher
1000+ posts
Python programming language
“fun” facts:
since True is 1, (and False is 0)
will print
you can get an overflow error in python in just 17 letters:
also, yes, there is infinity in python
and negative infinity
but only when working with floats
since True is 1, (and False is 0)
print(["a", "b"][True])
b
you can get an overflow error in python in just 17 letters:
int(float("inf"))
and negative infinity
but only when working with floats
Last edited by ScratchCatHELLO (Aug. 10, 2021 23:08:35)
ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust
Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y
- Reev0102
- Scratcher
1000+ posts
Python programming language
Is it possible to set a variable to the contents of a Scratch cloud variable with ScratchClient or something?
- Chiroyce
- Scratcher
1000+ posts
Python programming language
yep, i have some code here Is it possible to set a variable to the contents of a Scratch cloud variable with ScratchClient or something?not tested
""" make sure you have the requests module installed if not, run `pip install requests` in a terminal window """ import requests as req def getValue(varName, projectID): # both args are strings # get the cloud log as json response = req.get(f"https://clouddata.scratch.mit.edu/logs?projectid={projectID}&limit=100&offset=1").json() for i in range(0,100): # loop through every item in the log, as we go from 0 - 100 # we will surely get the LATEST value of the variable if response[i]['name'] == varName: # if we find that an item in the log is related to our variable return response[i]['value'] break
Last edited by Chiroyce (Aug. 11, 2021 15:32:47)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Chiroyce
- Scratcher
1000+ posts
Python programming language
We can! Gimme a sec … What about a regular variable?
You'd have to get it somehow via the project.JSON api, here https://projects.scratch.mit.edu/390546523/
390546523 = project ID
i think you may also need the sprite name for this … not sure since the JSON file has a lot of keys and is confusing
Last edited by Chiroyce (Aug. 11, 2021 16:27:07)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- mybearworld
- Scratcher
1000+ posts
Python programming language
run this in shellimport this
Import this now! You get 5 perks!
- A variable named this.c with the value 97!
- A variable named this.d containing a dictionary of all letters a-z+A-Z with their rot13 counterparts!
- A variable named this.i with the value 25!
- A variable named this.i which is The Zen of Python encoded using rot13!
- Best of all, when importing this, you get The Zen of Python printed in your console for FREE!!!
Last edited by mybearworld (Aug. 12, 2021 13:17:48)
Signatures are the only place where assets links still work.
- Sid72020123
- Scratcher
500+ posts
Python programming language
Python Program to invite your all followers to a studio automatically:
See The code here: https://gist.github.com/Sid72020123/c8293359b57c93ca908cfc246079b02b
See The code here: https://gist.github.com/Sid72020123/c8293359b57c93ca908cfc246079b02b
Last edited by Sid72020123 (Aug. 17, 2021 09:49:31)
Sid72020123
- Reev0102
- Scratcher
1000+ posts
Python programming language
I don't think you should share that. Here's a Python Program to invite your all followers to a studio automatically:-snip-
- Chiroyce
- Scratcher
1000+ posts
Python programming language
I agree - people may abuse it, make sure to license it under the MIT license, remove the code from your forum post, and upload it to GitHub. Only share the link to it on scratch and not the code itself. I don't think you should share that.
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Sid72020123
- Scratcher
500+ posts
Python programming language
DoneI agree - people may abuse it, make sure to license it under the MIT license, remove the code from your forum post, and upload it to GitHub. Only share the link to it on scratch and not the code itself. I don't think you should share that.
Sid72020123
- Chiroyce
- Scratcher
1000+ posts
Python programming language
great! Done
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- devms
- Scratcher
500+ posts
Python programming language
Hi ( I'm currently learning python 3.9) also how can you use python to make websites because I can't find it in any section in the IDE's (I use pycharm community edition 2021.2 and Microsoft visual studio code with python)
Edit: I am asking this question because I saw someone do web development in python
Edit: I am asking this question because I saw someone do web development in python
Last edited by devms (Aug. 21, 2021 08:20:02)
Last edited by devms(May. 15th, 2007, 00:00:00)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
My Scratch Profile
Sadly, my old signature was sent to the shadow realm
My browser / operating system: Windows Vista (NT 6.0), Internet Explorer 7.0, Flash 32 (Release 0)
- Reev0102
- Scratcher
1000+ posts
Python programming language
You can't make websites with Python; to make a website you need to use HTML, CSS and JavaScript. Hi ( I'm currently learning python 3.9) also how can you use python to make websites because I can't find it in any section in the IDE's (I use pycharm community edition 2021.2 and Microsoft visual studio code with python)
- devms
- Scratcher
500+ posts
Python programming language
Oh ok I was asking question because I saw in a yt video about hacking scammers with pythonYou can't make websites with Python; to make a website you need to use HTML, CSS and JavaScript. Hi ( I'm currently learning python 3.9) also how can you use python to make websites because I can't find it in any section in the IDE's (I use pycharm community edition 2021.2 and Microsoft visual studio code with python)
Last edited by devms(May. 15th, 2007, 00:00:00)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
My Scratch Profile
Sadly, my old signature was sent to the shadow realm
My browser / operating system: Windows Vista (NT 6.0), Internet Explorer 7.0, Flash 32 (Release 0)
- -EmeraldThunder-
- Scratcher
1000+ posts
Python programming language
You can use python as a backend for your site and use a framework like Flask or Django.Oh ok I was asking question because I saw in a yt video about hacking scammers with pythonYou can't make websites with Python; to make a website you need to use HTML, CSS and JavaScript. Hi ( I'm currently learning python 3.9) also how can you use python to make websites because I can't find it in any section in the IDE's (I use pycharm community edition 2021.2 and Microsoft visual studio code with python)
Nothing here.
- ScratchCatHELLO
- Scratcher
1000+ posts
Python programming language
You can't make websites with Python; to make a website you need to use HTML, CSS and JavaScript. Hi ( I'm currently learning python 3.9) also how can you use python to make websites because I can't find it in any section in the IDE's (I use pycharm community edition 2021.2 and Microsoft visual studio code with python)
you can use python instead of javascript by using brython, and you can use flask or django (for big projects) with a (no?)SQL database to do a backend
ScratchCatHELLO
I have 5600+ posts, I've been on scratch for 5 1/2 years, I'm a Forum Helper™ and I have a Scratch Wiki account!
I like: Python, CSS, Javascript, Rust
Python 3 Text Adventure
cool new browser game - cursed laughing-crying emoji - Illuminati - you know waterbenders, but do you know stock-imagebenders? - snek - vibin' - Bump song (vevo) - Speed bump - yee - fred - m i c k e y