Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
Banner by NFlex23
Welcome to the official PyHelp forum, the Scratch's first Python help forum!
In this forum you can ask for questions on how to use Python, and I (And other people too) will try to help!
Tips:
Other useful Python libraries:
FAQ:
Helper list:
Links and urls
Welcome to the official PyHelp forum, the Scratch's first Python help forum!
In this forum you can ask for questions on how to use Python, and I (And other people too) will try to help!
Tips:
- Code: You can use this code in the forums to make your Python code have colors and make it easier to understand!
Start your lines with:
[code=py]
print("Your code should go here")
print("Make sure everything goes here!")
Close it with:
[/code] - Help. You can ask to be a helper to help me manage the forum, and help other people! Even if you're not a helper, feel free to try to help!
- Don't be shy! Make sure to ask all your questions!
- Be patient. It might take me a while to answer, don't worry, I'll make sure to check all of the posts, if I don't reply in a few days and you see me answering other posts, I probably missed your post, so please bump it and I'll reply!
- Don't spam. This is annoying for people who are looking for answers, so please don't do it. The same thing for blockspamming and bumping, only bump your post if I don't reply
- Have fun! Last, but not least, this forum was made to help people learning Python to improve their knowledge, so make sure to have all the fun you can!
- Python3 - IDLE - A very simple, but useful, code editor for beginners who are starting to learn Python! It is the official Python code editor, so I recommend it a lot for starters!
- PyCharm - A very useful code editor for those who have more experience, it has a very good debugger and grammar corrector, and it keeps track of your variables and makes suggestions! I don't think beginners will find this features useful, because it is more designed for intermediate-advanced coder, so if you are on that level, make sure to check it out! I highly recommend it!
- Replit - It is pretty similar to the official editor, it is commonly used for code hosting (For example to make servers in Scratch, check the Scratch connection libraries) and to make code with other people!
- VS code - It is almost like PyCharm, one of the most useful functions is that you can code in other coding languages and you can also can share your code, it also has a very good debugger!
- Scratch Connect - by @Sid72020123
- Scratch Attach - by @TimMcCool
Other useful Python libraries:
FAQ:
- Q: Can I be a helper?
A: Please tell your experience/IDE's/Programming Languages/An example program - Q: Why isn't my library (E.g. ScratchAttach) not working?
A: Make sure that your library is on your computer by typing the same command pip install scratchattach into your terminal (If your IDE has one, use it, not the shell) and if it says that it's already in your computer, contact the PyHelp forum here! Also, if you're trying this:That won't work, you have to type the pip command on your terminal.pip install scratchattach import scratchattach as scratch3 scratch3.login("Joshisaurio", "123blahBlahBlahMypasswordlol(Not my real password)")
Still having trouble? Post your question in this forum!
Helper list:
- @Joshisaurio - PyCharm, Replit, Github - Current owner of the forum
- @bluepig600
- @applejuiceproduc - Replit, VS code
- @mybearworld - VS code
- @Dinosu - PyCharm, Replit
- @ScratchTheCoder12345 - PyCharm, Replit
- @MonkeyBean2
- @rewamd
- @Sid72020123
- @rishi272011 - VS code
- @arinjadhao - PyCharm, Replit, Github
- @What_do_we_do_now - Replit
Links and urls
Last edited by Joshisaurio (June 23, 2023 20:53:03)
- kccuber
- Scratcher
1000+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
Duplicate of https://scratch.mit.edu/discuss/topic/7934/
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
https://scratch.mit.edu/discuss/topic/7934/No, one's just for discussing, this is especifically to ask help. Besides, if you post there it would be Necroposting, since it's from 2013… I feel we just need a newer one that focuses on helping people Duplicate of
- Paddle2See
- Scratch Team
1000+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
https://scratch.mit.edu/discuss/topic/7934/Well, that's the general Python topic. It could include providing help - but perhaps it makes sense to break help off into it's own topic? Particularly if the help topic were designed just for giving help and had a nice index to helpful resources on the first post or something? Just brainstorming here Duplicate of
Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.
This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)
;
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
AaAaAaAa OMG it's a ST member AAAAAAAAAAAA lol yeahhttps://scratch.mit.edu/discuss/topic/7934/Well, that's the general Python topic. It could include providing help - but perhaps it makes sense to break help off into it's own topic? Particularly if the help topic were designed just for giving help and had a nice index to helpful resources on the first post or something? Just brainstorming here Duplicate of
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- WindowsNTPowershell
- Scratcher
4 posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
ayyy I use replit and code there
- mmm2k
- Scratcher
19 posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
This is very, very helpful!!
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- bluepig600
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
May I be a helper?
#imwithukraine
I used to work at
78CH3'S EVERYTHING SHOP
YOUR ORDERS, OUR SERVICE!
Go check us out!
(I feel bad for not being active there so I'm leaving this advert for the shop.)
Credit for the banner goes to @just-there
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- mzarony0
- Scratcher
48 posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
How can I make python itself create a new variable?
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
It's easy to play any musical instrument: all you have to do is touch the right key at the right time and the instrument will play itself.have a nice day
-Bach
- Dinosu
- Scratcher
82 posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
How can I make python itself create a new variable?
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
I don't think this is possible, but if you want to do something like that, you should use a list. For instance, if you wanted x to be 1, x1 to be 2, and x2 to be 3, you could create a list that looks like this:
my_list = [1, 2, 3]
To add a new item, such as 4, to the list, you could do
my_list.append(4)
And to get the n-th item of the list, you could do this:
my_list[n]
I recommend referring to this website for more help.
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
I think there's no function to do that right now, I think you CAN do something similar with functions, but you can't do something like that with variables. An easy workaround is to use a dictionary: How can I make python itself create a new variable?
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
Values = {} for i in range(0, 10): #The 10 is an example, you can use the amount of variables that you want Values["x"+ str(i)] = "Value" #The "x" + str(i) adds them up, so if i = 2, it will make a key named x2 #To access your dictionary's keys, you can do this: Values[x2] #This is an example #To view everything, type this in: Values #To add a value, do this: Values["KeyName"] = "Value"
Last edited by Joshisaurio (June 29, 2022 01:46:56)
- Joshisaurio
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
- Pau-pauMarcos
- Scratcher
55 posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
PyHelp ForumLOL
Welcome to the official PyHelp forum, the Scratch's first Python help forum!
In this forum you can ask for questions on how to use Python, and I'll try to help!
Tips:
- Code: You can use this code (Without the #) in the forums to make your Python code have colors and make it easier to understand!
#Start your lines with: #[code=py] print("Your code should go here") #Close it with: #[/code]
- Help. You can ask to be a helper to help me manage the forum, and help other people! Even if you're not a helper, feel free to try to help!
- Don't be shy! Make sure to ask all your questions!
- Be patient. It might take me a while to answer, don't worry, I'll make sure to check all of the posts, if I don't reply in a few days and you see me answering other posts, I probably missed your post, so please bump it and I'll reply!
- Don't spam. This is annoying for people who are looking for answers, so please don't do it. The same thing for blockspamming and bumping, only bump your post if I don't reply
- Have fun! Last, but not least, this forum was made to help people learning Python to improve their knowledge, so make sure to have all the fun you can!
Code editor list:
- PyCharm
- Replit
Helper list:
Hello Everybody! My Name Is Pau-pauMarcos, I am A Youtuber/Scratcher/Actor !!! I Like Making Scratch Projects During My Free Time! If You Have Anything To ask About me, Don't Hesitate To Message My Help Center @Pau-pauMarcoshelpcen ! Scratch On!
- applejuiceproduc
- Scratcher
1000+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
Can I help
A signature
- rishi272011
- Scratcher
100+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
This could be the code you were thinking about if you are using dictionaries: How can I make python itself create a new variable?
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
#creating an empty dictionary variables = {} #creating a variable to find out number of dictionary entries num = 0 #creating a function to add vars to dict def create_var(varname, value): variables[varname] = value def delete_var(varname): try: variables.pop(varname) except KeyError: return("variable not found") if True == True:#change this condition to whatever condition you need create_variable("x" + str(num), randint(1, 10))#change the randint to whatever value needed num += 1 #
- mybearworld
- Scratcher
1000+ posts
PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |
(#13)The currently given answers are good and should definetely be used instead of this one, but if you really want that literally:
How can I make python itself create a new variable?
ex. every time I press ‘x’, it automatically creates a new var like x, x1, x2, x3 etc. and I don't have to manually type
x=1
x1=1
x2=1
etc.
Thanks!
for i in range(10): exec(f"x{i} = {i}") print(x8) print(x3)
Signatures are the only place where assets links still work.
- Discussion Forums
- » Advanced Topics
- » PyHelp - The official Scratch Python help forum | Ask, help, discuss, & more! | +800 posts! |