I test my script just printing return value of .split:
for f in os.listdir():
f_name, f_ext = os.path.splitext(f)
print(f_name.split('-'))
and it shows me what I'd like to see - lists with 3 strings in each.
['Earth ', ' Our Solar System ', ' #4']
['Saturn ', ' Our Solar System ', ' #7']
['The Sun ', ' Our Solar System ', ' #1']
However, when I'm trying to store it in 3 different variables:
for f in os.listdir():
f_name, f_ext = os.path.splitext(f)
f_title, f_course, f_num = f_name.split(' - ')
it gives me an error:
f_title, f_course, f_num = f_name.split('-')
^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 1)
I'd appreciate any help on this! Thanks!