I am new to python and using Classes so please be patient. I have file made up of classes that look like :
<code>class education_info:
def __init__(self, level, institution, field, graduation_year, score):
self.level = level
self.institution = institution
# More declarations
class Resume:
def __init__(self, name, email, current_position, mobile, summary, education_info):
# Initialize the resume object with user information
self.summary = level
self.education = education_info()
</code>
<code>class education_info:
def __init__(self, level, institution, field, graduation_year, score):
self.level = level
self.institution = institution
# More declarations
class Resume:
def __init__(self, name, email, current_position, mobile, summary, education_info):
# Initialize the resume object with user information
self.summary = level
self.education = education_info()
</code>
class education_info:
def __init__(self, level, institution, field, graduation_year, score):
self.level = level
self.institution = institution
# More declarations
class Resume:
def __init__(self, name, email, current_position, mobile, summary, education_info):
# Initialize the resume object with user information
self.summary = level
self.education = education_info()
My main.py is :
<code>from Classes import resume_builder #Classes is directory of resume_builder.py
import streamlit as st
def get():
education_info.level = st.text_input(
"Enter education level (e.g., Graduation(UG/PG), High School): ", key=counter)
# More code
return resume_builder.Resume(name, email, current_position, mobile, summary, education)
</code>
<code>from Classes import resume_builder #Classes is directory of resume_builder.py
import streamlit as st
def get():
education_info.level = st.text_input(
"Enter education level (e.g., Graduation(UG/PG), High School): ", key=counter)
# More code
return resume_builder.Resume(name, email, current_position, mobile, summary, education)
</code>
from Classes import resume_builder #Classes is directory of resume_builder.py
import streamlit as st
def get():
education_info.level = st.text_input(
"Enter education level (e.g., Graduation(UG/PG), High School): ", key=counter)
# More code
return resume_builder.Resume(name, email, current_position, mobile, summary, education)
When running main.py I get error
, line 108, in get
return resume_builder.Resume(name, email, current_position, mobile, summary, education)
^^^^^^^^^
NameError: name ‘education’ is not defined.
Pylint is also stating that education_info is not defined. I have looked online and and ChatGPT to see how to incorporate one class into another and then import that file but no answers solve this problem. Any guidance much appreciated.