In most, but not all cases, it is entirely possible to write programs to be compatible with both python 2.7 and 3.x. The caveat of this is library availability however. If you use a library for your application that is not available for the other version of Python then you are fairly out of luck. This is actually the primary reason 2.x is still around. Many of the modules people rely on simply haven't been converted.

So if you are certain that the libraries you use are available in both versions then you will probably be fine. You of course still need to confirm for yourself that it runs on both however as there are many tiny stupid things that can stop the program from working on both cleanly.

On the commercial side here, if you are actually selling an app you probably aren't going to distribute as plain source code anyway though. You would use some program like py2exe or cxfreeze or py2app or whatever to package the program for whatever platform you were targeting (if people wanted to extract your source code they probably would succeed though but it would be a deterrent). This case would also require you to test and confirm functonality.