#๐Ÿ”’ no clue how to run this code

485 messages ยท Page 1 of 1 (latest)

proper sleet
left jasperBOT
#

@proper sleet

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

proper sleet
#

when i run the program and press on start_button which is P it gives me the error

mellow flower
#

what did you name the file?

proper sleet
#

here the video btw where i got the code from
https://www.youtube.com/watch?v=H-LeGwMQtEc&t

I program a Python bot that plays Piano Tiles and its skill shocks me! I tried this program on a piano tiles application as well as two websites, and it performed very well on all of them โšก

Code Bullet made a similar video years ago, and I wanted to see if I had what it takes to match his godly skills. I built a Piano Tiles AI that can play bot...

โ–ถ Play video
solid nacelle
#

whats the folder named

#

can u show ur directory structure

mellow flower
#

^

#

just cloned it and ran it, no errors

twin nebula
#

@proper sleet Did you name your directory the same name as one of the modules the script uses?

proper sleet
proper sleet
twin nebula
#

That's the file name

proper sleet
#

yea

twin nebula
#

It's not a Python thing per se, it's more of a computer thing.

#

Do you know what a folder/directory is?

proper sleet
#

oh

#

ye

twin nebula
#

What is the name of the folder the script is in?

proper sleet
#

is this what your asking??

solid nacelle
#

okay

#

u shouldnt be coding in the downloads folder

#

there are probably more files there

#

that are interfering with ur code

proper sleet
#

oh

solid nacelle
#

make a new folder

proper sleet
#

okokok

#

ok done

#

now i run it and see if it works?

mellow flower
#

yes

proper sleet
#

hmm

proper sleet
solid nacelle
#

did u move it?

proper sleet
#

yes i did

#

i moved it to a folder

mellow flower
#

how did you install python? how did you install pyautogui?

proper sleet
#

in python cmd

mellow flower
#

can you run py -0 in cmd

proper sleet
#

okok

#

uhhh

solid nacelle
#

also

#

can u open command prompt in ur folder

#

and type

#

tree /a

#

and send the output

proper sleet
proper sleet
#

that is a long list

solid nacelle
#

in the folder where ur code is

#

it shouldnt be long

proper sleet
#

give me a min

#

this is going to take a while

#

this is so long D:

#

๐Ÿ˜ญ this is too long

#

the heck?

twin nebula
#

What's too long?

proper sleet
#

tree /a

#

like i cant find anything

twin nebula
#

Are you doing it from inside the folder you created?

proper sleet
#

oh

mellow flower
#

doesnt look like it from that last img

twin nebula
#

๐Ÿ™ƒ

proper sleet
#

oh

solid nacelle
#

u didnt move the code file?

proper sleet
#

no?

#

you said

solid nacelle
#

i asked u to

#

why would i ask u to just make a folder ๐Ÿ’€

solid nacelle
proper sleet
#

i did that i made a new foler and moves the code.py to there?

solid nacelle
#

but it isnt shown in the img

proper sleet
#

let me try again

#

so i go to my folder that i saved my code.py

#

i right click and press on cmd

#

then i typed in tree /a

solid nacelle
#

yes

proper sleet
#

thats it?

#

correct?

mellow flower
#

nobody cares about your username

#

and yes thats correct

proper sleet
#

then

#

uh

#

what next :D

solid nacelle
#

now try running

proper sleet
#

ok

#

its running

#

now when i press P to start

solid nacelle
#

๐Ÿ‘

proper sleet
#

it stoped

solid nacelle
#

error?

proper sleet
solid nacelle
#

can u show the full traceback

#

!traceback

left jasperBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

proper sleet
#

am in visual studio code

#

where do i find this?

solid nacelle
#

in ur terminal

twin nebula
#

Why are you running it in visual studio code?

proper sleet
#

whats wrong with running that??

#

dose it not work properly?

twin nebula
#

I just thought you were trying to run the script from the terminal.

proper sleet
#

oh

#

nop

twin nebula
#

Maybe I misunderstood.

solid nacelle
#

vscode is easier to run with

#

btw

#

when u moved the file

#

did u reopen it in vsc

proper sleet
#

ye

#

i closed program

#

then reopen

solid nacelle
#

and type

#

code .

proper sleet
#

done

solid nacelle
#

now run with that

proper sleet
#

okokok

solid nacelle
#

vscode should have opened

proper sleet
#

yes i did

#

um

#

same thing ๐Ÿ˜”

solid nacelle
#

can u show the full thing

#

pls

#

not just the last line

proper sleet
#

sure

mellow flower
#

the MS version of python

solid nacelle
#

haha

mellow flower
#

is known to cause issues at time

proper sleet
#

o h

mellow flower
proper sleet
#

so unistall vsc?

solid nacelle
#

avg ms experience

solid nacelle
#

u uninstall python

#

from the microsoft store

proper sleet
#

oh okokok

solid nacelle
#

and download from

proper sleet
#

ooh

solid nacelle
proper sleet
#

okokok

#

umm

#

where the unistall button?

#

i went on the ms store and there no unistall button

twin nebula
#

It's in add/remove programs

proper sleet
#

ooh

#

found it

#

and python launcher also?

mellow flower
#

yes

#

just in case

solid nacelle
#

preferably

proper sleet
#

okok :)

#

python is silly

solid nacelle
#

nah

#

microsoft python is silly

proper sleet
#

oki

#

DONE

#

now install the python from website

#

ok now it doing it

#

now i wait :)

#

and then after that test the program and see if it works

#

man python takes long :)

mellow flower
#

long to?

proper sleet
#

its at standrd libarty

#

dont worry i will be right back

#

50% i guess

solid nacelle
#

btw

#

did u add to path

#

while installing

proper sleet
#

i think

proper sleet
#

is that fine?

solid nacelle
#

that isnt what path means

#

๐Ÿ’€

#

by path i mean PATH env variable

proper sleet
#

oh

#

uh

#

am not sure

solid nacelle
#

well

#

can u open cmd

#

and type python

#

without an error

proper sleet
#

yes

#

got no errors

solid nacelle
#

then its in path c:

#

now pip install pyautogui

#

and run ur code

proper sleet
#

in vsc or in the cmd?

#

ah

#

now it gives me this error

buoyant heart
#

pip install it

twin nebula
#

With the new python you'll have to install the modules

#

so pyautogui too

proper sleet
#

oh

#

how do i install them?

twin nebula
#

pip

#

how did you install them before?

proper sleet
#

uh

#

i went to

#

python cmd

#

and typed in pip install pyautogui

mellow flower
#

now do it again.

proper sleet
#

oh

solid nacelle
#

well

#

u r doing it in shell mode

#

u have to do it in CLI

proper sleet
#

oh

#

where i find that?

solid nacelle
#

just the normal cmd prompt

#

type exit()

proper sleet
#

oki

#

that just closed my cmd

#

wait

#

lemmy try again

#

ok now it works

#

i just typed in python then exit() then pip install

#

thats super werid

twin nebula
#

How is that weird?

proper sleet
#

well you have to go to cmd then type in python

twin nebula
#

You ran the REPL, exited, then ran a command in t he prompt

proper sleet
#

then exit out of python

twin nebula
#

no you don't need to do that

proper sleet
#

oh

twin nebula
#

you just need to do pip install whatever

#

nobody told you to do python then exit() then pip install

#

you had to exit() because you were already in python - sockyeh just told you how to get out of there

proper sleet
#

oh

#

ok i downloaded
pip install pyautogui
pip install keyboard
pip install pywin32

#

do i need to restart my pc or i can run the code.py from there?

twin nebula
#

no need to restart

proper sleet
#

okok

#

oh

#

i need 2 more modules

#

give me a sec

#

ok now let me try

#

ah

#

am confused it still giving me error

mellow flower
#

what the hell

proper sleet
#

๐Ÿ˜ญ

mellow flower
#

can you run py -0p in the terminal

proper sleet
#

ok

solid nacelle
#

can u run pip install PyAutoGUI -U --force-reinstall

proper sleet
#

done

mellow flower
#

way

#

wait

proper sleet
#

yea??

mellow flower
#

you installed python from the MS store?

proper sleet
#

no

#

website

mellow flower
#

again?

proper sleet
#

i installed it on the python website

#

not ms

mellow flower
# proper sleet

this is telling us that its running python from the ms store

proper sleet
#

i just unistalled it

#

:p

solid nacelle
#

๐Ÿ’€

mellow flower
#

restart your pc

proper sleet
#

okokok

#

brb

#

back

#

ok

mellow flower
#

okay

#

run py -0p

proper sleet
solid nacelle
#

that was quick

proper sleet
#

done

#

:)

#

yep

solid nacelle
#

where python

mellow flower
#

go to settings > apps > search for python

proper sleet
solid nacelle
#

hmm

solid nacelle
#

well

mellow flower
#

you'll want to uninstall the first one from that list

proper sleet
#

okokok

mellow flower
#

the one with the blue borders

proper sleet
#

yes

#

done

solid nacelle
mellow flower
solid nacelle
#

thats what i thought as well

mellow flower
proper sleet
#

yes :)

#

cuz in 2 months am doing python coding lessons in my tafe :)

#

and if i got any errors cuz of some silly ms store bug

#

๐Ÿ˜ญ

#

i would fail

#

OK ๐Ÿ˜จ

solid nacelle
#

try installing py 3.11 ๐Ÿ‘

proper sleet
#

lets try this again

#

oh

mellow flower
#

at this point i'd wanna anydesk

#

but uninstall 3.12

#

and install 3.11

solid nacelle
#

skemmer

mellow flower
proper sleet
mellow flower
#

oh wait...

mellow flower
mellow flower
proper sleet
#

okok

#

wheres that?

solid nacelle
mellow flower
proper sleet
#

okokok

#

thx

#

:)

solid nacelle
#

i like the .0 at the end

#

its appealing

proper sleet
#

okok

#

add python.exe to path?

#

and custom install?

solid nacelle
#

yes

#

no need for custom

proper sleet
#

okok

#

now i wait :)

#

this has been the most sillyest python experiance ever

solid nacelle
#

python is cool

proper sleet
#

yis

#

but silly if idk what to download ๐Ÿ˜ญ

#

40%

#

50%

#

man this is taking some time

twin nebula
#

but it turns out you didn't uninstall it

#

so that's why its taking so long

proper sleet
#

idk when i install a program like msi after buner it takes a while

#

dont worry it gets there

#

ok uh

#

๐Ÿ’€

#

my pc crashed

#

dont worry back on to installing it

solid nacelle
#

๐Ÿ’€

proper sleet
#

okok its back where it was fewwww

#

hey can i just tell you somthing
(i have autism so i might have trouble understanding things)

#

hope you understand guys

#

almost there

#

:)

#

the setup is done

#

brb then we can get started again

proper sleet
#

ok back let do dis

#

heyya @mellow flower i finished install

mellow flower
#

3.11.x?

proper sleet
#

yep

#

i installed 3.11

mellow flower
#

okay, run py -0

proper sleet
#

okok

proper sleet
#

how do i switch from 3.12 to 3.11?

mellow flower
#

uninstall 3.12

#

for now

proper sleet
#

okokok

proper sleet
mellow flower
#

cool, py -0

proper sleet
#

done ;)

mellow flower
#

cool, go to the folder where code.py is

proper sleet
#

okok

proper sleet
#

oh

#

i got to select interpreter

#

okokok done

#

plz work ๐Ÿ˜จ

#

AHHHHHH got to install all of the modules :3

#

ok

#

lets try this again

#

AH

#

ama reinstall pyautogui

mellow flower
#

what the hell?

proper sleet
mellow flower
#

i really have no clue, it works fine for me locally

#

for the sake of it, run where python

proper sleet
#

got it

mellow flower
proper sleet
#

okok

#

i cant

#

um

mellow flower
#

copy paste the code here

#

!paste

left jasperBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

proper sleet
#

oh okokok

#

here

#

sorry

#

ah

#

what

#

oh nvm

mellow flower
#

hm

#

can you try something

#

or w.e

wild slate
proper sleet
solid nacelle
#

is it still not working?

proper sleet
#

hmmm

#

well

#

i pressed p

#

no errors now

#

but

#

nothings happening

mellow flower
#

do you have the piano window open?

solid nacelle
#

bad code?

proper sleet
#

oh right

#

give me a sec

mellow flower
#

i think the rename probably fixed things

#

pdb seemed to also be importing code.py which cause a circular import, imo

proper sleet
#

now

#

for the big thing

#

how do i use the program ๐Ÿ˜ญ

#

its not working when i press P

mellow flower
#

what do you mean not working?

proper sleet
#

am on a piano title game on the website

#

and when i press P nothing happens

#

like in this video
https://www.youtube.com/watch?v=H-LeGwMQtEc&t
he pressed space to get a window to open

I program a Python bot that plays Piano Tiles and its skill shocks me! I tried this program on a piano tiles application as well as two websites, and it performed very well on all of them โšก

Code Bullet made a similar video years ago, and I wanted to see if I had what it takes to match his godly skills. I built a Piano Tiles AI that can play bot...

โ–ถ Play video
#

but when i pressed space on top and bottom a window dose not pop up :(

#

or if not space then p but i dont understand ๐Ÿ˜ญ

mellow flower
#

i kinda got it working but

#

its not very good

proper sleet
#

oh

proper sleet
mellow flower
#

first press p over top left corner of first square, then bottom right corner and wait

mellow flower
left jasperBOT
#

Source code: Lib/code.py

The code module provides facilities to implement read-eval-print loops in Python. Two classes and convenience functions are included which can be used to build applications which provide an interactive interpreter prompt.

mellow flower
#

this was the issue the entire time

proper sleet
#

oh

mellow flower
#

no clue

proper sleet
#

oh okok

#

ama try it now

#

bruh

#

it didnt even click the notes ๐Ÿ˜ญ

#

it did but could not ๐Ÿ˜ญ

#

wow

mellow flower
#

like i said, not very good

proper sleet
#

sad

solid nacelle
#

500 msgs

#

for such a simple fix

mellow flower
#

ยฏ_(ใƒ„)_/ยฏ

mellow flower
#

told me right away the issue

solid nacelle
#

note to self, dont name the file smth generic

proper sleet
#

hey wait

mellow flower
#

note to self, just clone the damn repo

proper sleet
#

one more thing krrt

#

can you try and run the code on keyboard mode?

mellow flower
#

naw

#

already deleted it.

twin nebula
proper sleet
#

ah okokok

#

thank you very much guys :)

mellow flower
twin nebula
#

same

proper sleet
#

i really apreshiate it :)

mellow flower
proper sleet
#

thank u :)

#

hughugs

#

ok now close it lol

twin nebula
#

You close it by typing !close on a blank line

proper sleet
#

!close

left jasperBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.