Technical_13

Untitled

Sep 16th, 2021
646
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. file1 = 'files/abc_xyz.py'
  2. file2 = 'files/def/abc_xyz.py'
  3.  
  4. result1 = file1.split( '.' )[ 0 ].split( '/' )[ 1 ]
  5. if result1.find( '_' ) != -1:
  6.     result1 = result1.split( '_' )[ 1 ]
  7. result2 = file2.split( '.' )[ 0 ].split( '/' )[ 1 ]
  8. if result2.find( '_' ) != -1:
  9.     result2 = result2.split( '_' )[ 1 ]
  10.  
  11. print( '"'+result1+'" and "'+result2+'"' )
RAW Paste Data