1

Im trying to import a python file into my pycharm program.

The file is in the exact same folder as my pycharm project is. I tried to use :

open("happy_histogram.py","r",encoding="utf-8")

but it fails to work.

Appreciate your help!

1 Answer 1

1

What are you importing the file for? If you're trying to use some functions and other variables in happy_histogram.py you maybe be better importing it using

from happy_histogram import *

But to make your code work, I was able to open a file by taking out the encoding. open("happy_histogram.py", "r") hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.