0

What is the standard way to begin code in python?

1st Jan 2017, 8:53 PM
Ivan Zhuravel
Ivan Zhuravel - avatar
3 odpowiedzi
+ 2
Depends on what exactly you're making but if it's an runnable application I usually start with something like this: def main(): # my app goes here if __name__ == '__main__': main() This has the benefit of being executable and safe to import for testing if needed.
1st Jan 2017, 9:32 PM
James Durand
James Durand - avatar
0
I want to create a front page for the app, where I can put username in.
1st Jan 2017, 9:59 PM
Ivan Zhuravel
Ivan Zhuravel - avatar
0
I usually mark out the Copyright Status of the document I'm writing, not that anyone is going to read it or anything... but, y'know. I like to be official... a lot... But in all seriousness. I am into text games these days, so I'd have a main title screen in a loop. But I'd define all the 'areas' in def-statements first. :) Good Luck!
1st Jan 2017, 11:04 PM
ghostwalker13
ghostwalker13 - avatar