On 30. 04. 20 1:21, Adam Williamson wrote:
I have this in my PATH (called pkgname):#!/usr/bin/python3 import fileinput for line in fileinput.input(): print('-'.join(line.split('-')[:-2]))how about: print(line.rsplit("-", 2)[0])
That's indeed probably nicer. -- Miro Hrončok -- Phone: +420777974800 IRC: mhroncok _______________________________________________ devel mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
