Discuss Scratch

nexoalex
Scratcher
67 posts

scratchattach - A Scratch API wrapper (Python)

Blackout32 wrote:

ScratchcatandGobo wrote:

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!
here I can help you further once you start making it. I done something like that before.
I think if he's storing user data it would be better for him to make an sqlite database
ctype for server tkinter for server management
XMate-Tech
Scratcher
23 posts

scratchattach - A Scratch API wrapper (Python)

I can't use it, please help!


***************************************************
Welcome to my signature….

“XMate”
_____________
A twelve year old coding professional who got hooked back in 2021, in his first account.
He now owns a Youtube Channel where he's posting Scratch tutorials and hacks.
_____________

I am now trying different things outside of Scratch, but don't worry! I do post games.

_____________

-XMate
12 June, 2024
(Signature Last Updated)20.png
XMate-Tech
Scratcher
23 posts

scratchattach - A Scratch API wrapper (Python)

please make a YT tutorial on scratchattach…


***************************************************
Welcome to my signature….

“XMate”
_____________
A twelve year old coding professional who got hooked back in 2021, in his first account.
He now owns a Youtube Channel where he's posting Scratch tutorials and hacks.
_____________

I am now trying different things outside of Scratch, but don't worry! I do post games.

_____________

-XMate
12 June, 2024
(Signature Last Updated)20.png
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!

I think you can male an SQLite database, as said in another quote above. The reason is that webpages cannot display anything that is not HTML and so will probably not display your database or do anything with it unless you use Flask or another Python Framework.
_________________
Fishhoue's Signature
print(“FishHoue”)
_NovaNebula_
Scratcher
1000+ posts

scratchattach - A Scratch API wrapper (Python)

Oh, this is actually pretty cool. Is there a full list of everything it can access?

wvzack
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

Is it possible to send information to the request template without the scratch project requesting it?

Likes: Programing (python scratch Lua c++ I am bad at c++ a) Aiviation (B787 Queen of the sky F35) Mountain Biking and Messing around with computers (not a gamer at all)
My projects I am most happy with also the few “polished games I have:
wvzack
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

Also I suspect that this is because the servers are not working properly or python its self but when i try and login through scratch attach I get
 partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)
File "C:\Users\ehidDocuments\python banking\requests.py", line 4, in <module>
session = scratch3.login("wvzack", "#####################")
^^^^^^^^^^^^^^
File "C:\Users\jdwk\Documents\python banking\requests.py", line 1, in <module>
import scratchattach as scratch3
AttributeError: partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)

if i try using scratchattach in a different directory it does not create this error.

Thanks!

Last edited by wvzack (May 25, 2024 22:22:45)


Likes: Programing (python scratch Lua c++ I am bad at c++ a) Aiviation (B787 Queen of the sky F35) Mountain Biking and Messing around with computers (not a gamer at all)
My projects I am most happy with also the few “polished games I have:
TheCommCraft
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

(#2467)
Is it possible to send information to the request template without the scratch project requesting it?
No, but there is another python library that can do something like that (which I can't mention)

Random Project

spamton.gif





























DUNGEON_EXPLORATION_03_02_23_01
COMPILED VERSION FOR HIGHER SPEED
nexoalex
Scratcher
67 posts

scratchattach - A Scratch API wrapper (Python)

guys i only have disco** to auth on free hosting websites but https://panel.sillydev.co.uk/'s only free node shut down any alternatives
TheMobileGames
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

nexoalex wrote:

guys i only have disco** to auth on free hosting websites but https://panel.sillydev.co.uk/'s only free node shut down any alternatives

I’m trying to use danbot.host

—————————— —————————— —————————— —————————— ——————————
A way to make any game easily mobile (no remixing needed): https://scratch.mit.edu/discuss/topic/733837
My mobile engine (use to add buttons/controls to a game): https://scratch.mit.edu/projects/778848092/
—————————— —————————— —————————— —————————— ——————————
wvzack
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

Also I suspect that this is because the servers are not working properly or python its self but when i try and login through scratch attach I get
 partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)
File "C:\Users\ehidDocuments\python banking\requests.py", line 4, in <module>
session = scratch3.login("wvzack", "#####################")
^^^^^^^^^^^^^^
File "C:\Users\jdwk\Documents\python banking\requests.py", line 1, in <module>
import scratchattach as scratch3
AttributeError: partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)

if i try using scratchattach in a different directory it does not create this error.

Thanks!
oh and i tried changing the directory but it still has the same error

Likes: Programing (python scratch Lua c++ I am bad at c++ a) Aiviation (B787 Queen of the sky F35) Mountain Biking and Messing around with computers (not a gamer at all)
My projects I am most happy with also the few “polished games I have:
a_person31415
Scratcher
3 posts

scratchattach - A Scratch API wrapper (Python)

cool!
but I found out that it can be dangerous, like hacking cloud of other games
Blackout32
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!

I think you can male an SQLite database, as said in another quote above. The reason is that webpages cannot display anything that is not HTML and so will probably not display your database or do anything with it unless you use Flask or another Python Framework.
_________________
Fishhoue's Signature
print(“FishHoue”)
I'd probably also recommend PocketBase. Really great UI for managing databases and ships with sqlite by default (which you can hook up to python/scratchattach)


Sid72020123
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

wvzack wrote:

Also I suspect that this is because the servers are not working properly or python its self but when i try and login through scratch attach I get
 partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)
File "C:\Users\ehidDocuments\python banking\requests.py", line 4, in <module>
session = scratch3.login("wvzack", "#####################")
^^^^^^^^^^^^^^
File "C:\Users\jdwk\Documents\python banking\requests.py", line 1, in <module>
import scratchattach as scratch3
AttributeError: partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)

if i try using scratchattach in a different directory it does not create this error.

Thanks!

Just don't name your Python file with something like “scratchattach.py” or “requests.py” or any other library scratchattach uses.
Renaming the file will fix the issue…

Sid72020123
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

_NovaNebula_ wrote:

Oh, this is actually pretty cool. Is there a full list of everything it can access?
check the documentation on github: https://github.com/TimMcCool/scratchattach/wiki

Last edited by TimMcCool (May 26, 2024 08:48:32)


Developer of scratchattach, the most popular Python Scratch API wrapper
fiosjeofo
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

ScratchcatandGobo wrote:

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!
here I can help you further once you start making it. I done something like that before.
I knew how to do that, but thanks anyway! I found a new module called shelve that does it for you.

when green flag clicked
forever
keep coding
have fun
scratch on!
end
define scratch(attach v)
(is cool v)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<(hi)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
fiosjeofo
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

FishHoue wrote:

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!

I think you can male an SQLite database, as said in another quote above. The reason is that webpages cannot display anything that is not HTML and so will probably not display your database or do anything with it unless you use Flask or another Python Framework.
_________________
Fishhoue's Signature
print(“FishHoue”)
please can someone help me make an sqlite database (or mysql) because it's not really something i've done before

when green flag clicked
forever
keep coding
have fun
scratch on!
end
define scratch(attach v)
(is cool v)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<(hi)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
FishHoue
Scratcher
16 posts

scratchattach - A Scratch API wrapper (Python)

fiosjeofo wrote:

FishHoue wrote:

fiosjeofo wrote:

Hi! Does anyone know how to store data on python locally (like with a file) because this will be useful to make a data-storing project that saves the user's data. Thanks!

I think you can male an SQLite database, as said in another quote above. The reason is that webpages cannot display anything that is not HTML and so will probably not display your database or do anything with it unless you use Flask or another Python Framework.
_________________
Fishhoue's Signature
print(“FishHoue”)
please can someone help me make an sqlite database (or mysql) because it's not really something i've done before
I'm not sure I know how to do that, although I am only 2 grades/years away from learning SQLite databases.
I'll try to do make a starting database though.
_________________
Fishhoue's Signature
print(“FishHoue”)
wvzack
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

Sid72020123 wrote:

wvzack wrote:

Also I suspect that this is because the servers are not working properly or python its self but when i try and login through scratch attach I get
 partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)
File "C:\Users\ehidDocuments\python banking\requests.py", line 4, in <module>
session = scratch3.login("wvzack", "#####################")
^^^^^^^^^^^^^^
File "C:\Users\jdwk\Documents\python banking\requests.py", line 1, in <module>
import scratchattach as scratch3
AttributeError: partially initialized module 'scratchattach' has no attribute 'login' (most likely due to a circular import)

if i try using scratchattach in a different directory it does not create this error.

Thanks!

Just don't name your Python file with something like “scratchattach.py” or “requests.py” or any other library scratchattach uses.
Renaming the file will fix the issue…
Thanks I suspected it was something like this!

Likes: Programing (python scratch Lua c++ I am bad at c++ a) Aiviation (B787 Queen of the sky F35) Mountain Biking and Messing around with computers (not a gamer at all)
My projects I am most happy with also the few “polished games I have:
wvzacktest
Scratcher
9 posts

scratchattach - A Scratch API wrapper (Python)

So I am getting a error when I use user.does_exist() even though it is a command and I have checked everything with pip3.11 show scratchattach and scratchattach is on version 1.7.3. Here is the part of my code where i am using it:

@client.request
def pay(to, amount): #called when client receives request
user = scratch3.get_user(to)
if not user.does_exist() == True:
return("account", to, "does not exist. You have been refunded.")

return_value = main.pay_user(client.get_requester(), to, amount)

return return_value #sends back balance to the Scratch project

and here is the error I am getting:
Caught error in request 'pay' - Full error below
Traceback (most recent call last):
File "c:\Users\###\AppData\Local\Programs\Python\Python311\Lib\site-packages\scratchattach\_cloud_requests.py", line
61, in call_request
output = req_obj["on_call"](*arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\####\Desktop\python_banking\cloud handeler.py", line 23, in pay
if not user.does_exist() == True:
^^^^^^^^^^^^^^^
AttributeError: 'User' object has no attribute 'does_exist'

Thanks

Powered by DjangoBB