scripting language newbie - compatibility

Andrew Dalke dalke at acm.org
Thu Aug 3 16:10:17 EDT 2000


Kurt Aistinger wrote:
>are python-programs source-compatible, too?

Python, perl and tcl are all "source-compatible", if you make them that
way.  As Grant Edwards pointed out, you can't use a platform specific
library like win32com.  The trickier part is handling things like
file names.  If you are used to one OS like unix, you do things like

  filename = dirname + "/" + name
or
  filename = "%s/%s" % (dirname, name)

However, that won't work under MacOS.  Instead, the platform
generic way to do that is

  filename = os.path.join(dirname, name)

So you can write source-compatible programs, but you have to know
how to do it.

                    Andrew






More information about the Python-list mailing list