Python Forum
splitting dirs into variables?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
splitting dirs into variables?
#1
Hey guys,

I have grouped files which meets some requirements and i have it stored, but now i don't know how to seperate them from each other.

#loop through collected in the list "for profile" files and "taxcheck" files
for x in prof_list, taxc_list:
    if country1 == country2:
        paired_country_directory = x
        test = paired_country_directory[2]
        print(test)
Output:
C:\Users\user\Desktop\Tax scripts\2020\Hungary\ICS\Work\Hungary profile inflation 2020.xls C:\Users\user\Desktop\Tax scripts\2020\Hungary\ICS\Hungary_taxcheck_20.xlsm
I wonder how can i split them into variables, so it would be equal as below:

ForProfile_file = C:\Users\user\Desktop\Tax scripts\2020\Hungary\ICS\Work\Hungary profile inflation 2020.xls
TaxCheck_file = C:\Users\user\Desktop\Tax scripts\2020\Hungary\ICS\Hungary_taxcheck_20.xlsm
Reply


Messages In This Thread
splitting dirs into variables? - by zarize - Jul-15-2020, 11:57 AM
RE: splitting dirs into variables? - by palladium - Jul-15-2020, 12:19 PM
RE: splitting dirs into variables? - by zarize - Jul-15-2020, 12:30 PM
RE: splitting dirs into variables? - by DeaD_EyE - Jul-15-2020, 01:18 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020