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 Posthmm, what do you mean by include? you can import into your programs using:
import 'module name'
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 …
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.