Discuss Scratch

wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

Is it possible to send information to the request template without the scratch project requesting it?
wvzack
Scratcher
500+ 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)

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)
nexoalex
Scratcher
79 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
wvzack
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!
oh and i tried changing the directory but it still has the same error
a_person31415
Scratcher
7 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…
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)

fiosjeofo
Scratcher
12 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.
fiosjeofo
Scratcher
12 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
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
500+ 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!
wvzacktest
Scratcher
15 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
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

I am also getting a weird response back to the scratch project as i am getting what i am supposed to get but also an error here is something i got
 ('1', 'dollars has been given to ', 'yiuyiy')Error: Check the Python console 
The first part is exactly what i am supposed to get but the last part is not!
TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

in the future, asyncio will be introduced to this library's cloud requests framework to improve resource efficiency

TimMcCool
Scratcher
100+ posts

scratchattach - A Scratch API wrapper (Python)

wvzacktest wrote:

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
you probably need to
update scratchattach to the latest version
wvzack
Scratcher
500+ posts

scratchattach - A Scratch API wrapper (Python)

TimMcCool wrote:

wvzacktest-snip-[/quote wrote:

you probably need to
update scratchattach to the latest version
I did that and when I run
pip3.11 show scratchattach
it says im on version 1.7.3

Last edited by wvzack (May 26, 2024 19:54:32)

cs845962
Scratcher
10 posts

scratchattach - A Scratch API wrapper (Python)

Hello there! I just started with Scratchattach and have a basic level of python experience, but when I run the import scratchattach and session code in my program, the python shell returns that in cloud.py module, line 2, it can't locate the module named websocket. Does anyone know where I can download these modules? Are they supposed to be build into python and did my python version get corrupted? Or is there a general python library that I am supposed to get? Any help is much appreciated! Thank you!

Powered by DjangoBB