#๐Ÿ”’ homework coding project

39 messages ยท Page 1 of 1 (latest)

shut craterBOT
#

@desert oracle

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.

desert oracle
#

I don't know where to put the player assets

#

or any of the image files

drowsy flower
#

I don't use tkinter very much, but it seems like you have your images in a images folder, and your code is running outside of that folder

desert oracle
#

yeah I'm not sure where to put that folder

drowsy flower
#

thus your code is looking for the images outside of the images folder, not inside of it

desert oracle
#

or how to redirect it to the images folder

silk rampart
#

try file="images/player.png"

#

without giving it folder name it'd look at the same folder your .py is

drowsy flower
#

wait a minute... I don't see a player.png in there

desert oracle
#

yeah I haven't added it yet

#

I tried with different images earlier

#

but it was not reading them

#

that's why I have those images already there

#

looks like this in the files

#

I think the folder is in the same directory no?

drowsy flower
#

your code is still looking for the images directly inside of the .venv folder, not in the .venv/images subfolder

desert oracle
#

i see

#

so if I just change the images to the .venv folder we good

silk rampart
#

I think it's looking at folder outside that. The base directory here would be javaproject/

drowsy flower
silk rampart
#

you don't usually put your code inside .venv

desert oracle
#

yeah true

#

ohhh yeah

#

just dragging it into javaproject works just fine

drowsy flower
#

i was about to say, your code is in the .venv folder lol

desert oracle
#

it is lol

silk rampart
#

yea when you do "player.png" it would by default looking at current working directory, which is javaproject/player.png in this case

desert oracle
#

yupyup

#

that makes a lot more sense

#

thanks guys

#

.close

idle abyssBOT
#
Did you mean:
desert oracle
#

!close

shut craterBOT
#
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.