Python questions from beginner
I'm thinking about rewriting an MS Access db I wrote years ago into a stand-alone Python app.
Other than a college class called "Intro to C++" (console only, with OOP concepts) and the Access db itself, I have no experience, so I need to ask if the basis for my decision to go with Python is correct. Is it true that:
1) Python is relatively easy to pick up?
2) Python apps can run as "portable" (ie from one directory, no registry needs, nothing needs to be pre-installed on a Windows PC) as long as I us开发者_开发技巧e an embedded db?
Python is widely considered an easy language to learn, being simple and readable. For easy running of Python on any Windows PC I recommend Portable Python (other platforms such as Macs and Linux distros typically come with Python, so there's usually no need for such measures there). For running a pre-made, pre-package app with its own sqlite
database, I recommend pyInstaller, which is also cross-platform.
Python is like the game Go, the rules are easy, but it's hard to master. You'll get started easily, but if you wind up using it as an interpreted version of VB, or C, you'll be missing much of the point.
More to the point, if your Access application is UI-centric, Python is not necessarily the natural platform to port it to. Python does not specialize, or particularly excel, in building UIs and there's no "visual"-style application builder (that I know of) as in Access.
If your application is more oriented towards reading, manipulating, and writing data, however, Python is ideal.
1) Yes, if you grasped the material in your intro to C++ class you should be able to pick up the basics of Python without too much trouble
2) It can be. There's Py2Exe which can include the necessary python files to run standalone. Otherwise Python will need to be installed.
to answer your questions:
1) yes, it is relatively easy to pick up. however, as @Larry mentions, it still takes time and experience to master. i've been using it for 14 straight years, and i still feel like i know less than half of everything out there. of course, the Python universe continues to expand every day, so that may be the cause. :-)
2) Python is indeed portable, but as @Alex mentions, only POSIX systems (i.e., Mac OS X, Linux, *BSD, etc.) come with Python installed while PCs require a download, thus making PortablePython an option for moving around a directory tree which can be used for development. More specifically, you can use PyInstaller (multi-platform) or py2exe (PCs only; py2app is a Mac equivalent) to generate standalone executables that can be distributed to computers that don't require Python to already be installed.
To develop apps for MS Access, you will likely need to download the Python Extensions for Windows package (win32all) and use a COM interface. (Although I do not have an example of an Access app in my Python book, I do have COM client Python examples interacting with Word, Excel, PowerPoint, and Outlook in Chapter 23 of Core Python Programming.) A more modern alternative is to use IronPython on the .NET or Mono platforms. As far as UI stuff goes, win32all also gives you access to creating MFC apps.
Python is easy to pick up, yes. That doesn't mean you master it as easily :)
You can use Portable Python if on Windows (or even py2exe) for the portability part, and perhaps Dabo will be close enough to Access for the database+GUI part.
精彩评论