Edited by ThePistonDoctor, 07 November 2011 - 04:11 PM.
4 replies to this topic
#1
Posted 02 November 2011 - 11:53 PM
Nevermind - thanks :)
|
|
|
#2
Posted 03 November 2011 - 09:25 PM
edit: removing source
Edited by ThePistonDoctor, 07 November 2011 - 04:10 PM.
#3
Posted 05 November 2011 - 02:22 PM
You could use regular expressions to get all the numbers from the line, or if you know for sure that there will always be n (= 3) numbers in the line, you could write something like that:
number1, number2, number3 = map(int, line.replace(",", "").split(-2:))
Or you could go with your idea, by splitting the line at space, iterating through each element and checking whether it's number or not. You can use isinstance function, or try with exceptions.
A conclusion is where you got tired of thinking.
#define class struct // All is public.
#4
Posted 06 November 2011 - 01:00 AM
edit: removing source
Edited by ThePistonDoctor, 07 November 2011 - 04:10 PM.
#5
Posted 06 November 2011 - 11:39 AM
I guess now you could add some graphical user interface, to make it look shiny. I recommend PyQt, there are many others though but so far I've only worked with this one and it's really nice.
A conclusion is where you got tired of thinking.
#define class struct // All is public.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









