list_text = """-347 a negative number
-100 another negative number
-25 and again, a negative number
17 some text
25 foo bar
100 two same texts
100 two same texts (almost)
350 a positive number"""
list1 = list_text.split('\n')
list1.sort(key=lambda x: (int(x.split()[0]), x.split(' ', 1)))
Alphanumeric sorting in Python and negative numbers