Hey guys, I was wondering if there is a way to include other python programs in your python program. Sorry if there is another thread about this I looked and was unable to find one.
Matt Tacular 0 Unverified User
Recommended Answers
Jump to PostHere is an example ...
# save this code as dec2bin.py so you can access the function decimal2binary() # in other Python programs def decimal2binary(n): '''convert decimal (base 10) integer n to binary (base 2) string bStr''' bStr = '' if n < 0: raise ValueError, "must …
Jump to PostI put an example up at:
http://www.daniweb.com/techtalkforums/post223717-58.htmlThis one uses the option menu within a infinite while loop with a quit option to break out of the loop. The games are called with functions.
Instead of functions you can use execfile("mygame.py") to execute external Python …
All 8 Replies
a1eio 16 Junior Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Matt Tacular 0 Unverified User
Matt Tacular 0 Unverified User
Confucius 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Matt Tacular 0 Unverified User
a1eio 16 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.