0

I'm trying to get an image to show on the screen. I have the image file and code file in the same folder. I tried using the image file name and it said that there is no such file or directory. How do I do that?

3
  • Can you post some code examples along with the error? Commented Mar 27, 2020 at 2:19
  • 2
    How exactly did you try it? Please, provide a minimum reproducible example Commented Mar 27, 2020 at 2:19
  • well that depends on your code.. each package does it diffrently Commented Mar 27, 2020 at 2:44

1 Answer 1

1

I think you should try to write absolute path. you can use following code

import os
path = os.getcwd()

abs_path = path + img_name
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.