[Tutor] Python learning curve

Michael Langford mlangford.cs03 at gtalumni.org
Tue Mar 18 22:19:53 CET 2008

I looked at the Miro gig too. Good luck!

As far as "learn python in 12 days", yes and no.

You can do fantastic things in that time frame with python and the
standard library. I know I had completely written my first code
analysis program in 2004 in that time frame just using this PDF as
reference:  (http://www.diveintopython.org). I see no reason you can't
do that sort of thing.

However, using all these complicated things at the edge of python is
going to be a little tough to come up to speed on that fast, as some
of the bugs you'll suffer in these edge cases will be very hard to
debug without background which you will not have. If it is a "coming
up to speed enough to ask intelligent questions as to why the build is
failing", that's probably doable, as long as they know your

If its being fully functional in a complex build/library environment,
no way that will happen in that time frame, especially without the
ability to sit down next to someone who gets it (which is the problem
with doing their teleworking arrangement for you).

On fixing that last issue, you could invest in Logmein.com or some
CoPilot.com time to get tutelage from their more experienced
developers on the arcane warnings and errors that come out of building
the libraries.

If you're going to try, I suggest you do the following:
1. Build a toy program/text processing utility on the command line
2. Try building a graphical utility using a prebuilt library of their
graphic toolkit
3. Then try to work on the actual code base.


And on whether you do it or not for free....I'd say python is the
language that has the most accessible libraries I've ever seen. I
literally can use any C, C++ or Fortran library with it in a couple
minutes often, a couple hours if more complex. If nothing else you're
going to pick up a very versatile tool, even if you don't get the gig.

On Tue, Mar 18, 2008 at 4:07 PM, TFIA Consulting, Inc.
<wsmith36 at comcast.net> wrote:
> Hi.  I am doing some work for a company that uses Python for their
> application.
> I have never used Python before, but I have programmed for over 35 years,
> maybe 12 languages including 4 assembly level.
> Your site says it should take just a "few days" to learn Python, so I told
> these folks to give me 12 days in case I was stupider than average.
> My question is :  Who is right?  A 'few days', or going thru the docs below?
> (which seems a bit more complex than that).
> Is this REALLY a "few days" task to learn?  Would you agree to guarantee
> coming up to speed in a few days @ no charge?
> Thank you for your advice,
> ...Bill Smith
> Here is their documentation on compiling :
> ==============================================================================
> Building Miro Windows ¶
> This page documents how to build Miro for Windows. We need more brave souls
> willing to help us conquer this platform.
> Getting started ¶
> The supported Windows port of Miro is based on Mozilla XUL and found in the
> source:trunk/tv/platform/windows-xul directory. There's an abandoned
> "native" Windows port in source:trunk/tv/platform/windows don't mess with
> it.
> You may be able to find more information here:
> source:trunk/tv/platform/windows-xul/setup.py
> source:trunk/tv/platform/windows-xul/README
> Question : Why don't you use XUL for all platforms? ¶
> Every couple of weeks someone flames us for not using XUL on all platforms.
> The XUL port of Miro is by far the most complicated and ugliest. XUL doesn't
> really do what we want to do well. It has a lot of "security" restrictions
> that we have to work around. The OS X Cocoa port is simpler, and the GTK/X11
> port is by far the simplest.
> Since we have to embed all sorts of platform specific libraries, XUL's cross
> platformness doesn't make porting to other platforms easier. For example,
> embedding OS X's quicktime in XUL would be a very large project.
> From a UI perspective, we want a native look and feel on all of our
> platforms, except Windows where we think the platform look sucks. A real
> native look and feel would require lots of tweaking for GTK, and isn't even
> possible on XUL/OS X.
> Compilers ¶
> Visual Studio 2003 ¶
> Miro makes heavy use of Python extensions. Python extensions compiled with a
> different compiler than Python itself are not guaranteed to work. Since the
> official Python distribution for Windows is compiled with Microsoft Visual
> C++ 7.1 (AKA Visual C++ .NET 2003), we only support the MSVC++ 7.1 family of
> compilers for official builds. Unfortunately, Microsoft has discontinued the
> no-cost "Visual C++ Toolkit 2003" compiler.
> Miro also depends on Mozilla XULRunner, PyXPCOM, VLC, and other sundries.
> However, building Mozilla on Win32 platforms, much less applying our
> patches, is such a time consuming process that we include pre-built binaries
> for these in source:trunk/dtv-binary-kit.
>  Unless you need to debug issues with Miro's use of Mozilla code, it's
> recommended that you use these binaries. Currently, the binaries included
> are built using Mozilla 1.8 branch.
> MinGW (GCC) ¶
> We've putting together instructions on building Miro with free tools. The
> instructions for doing this are here BuildingMiroWithMinGW. We are working
> hard on improving these instructions. Email us if you're interested in
> taking this on. If you're interested in helping but are getting stuck on
> compiler issues, email us, and we'll do our best to help you. Eventually,
> we'll merge these instructions into this document.
> Getting dependencies and setting up the build environment ¶
> As of version 0.9.6, we will be using Python 2.5. The binary kit now
> contains XULRunner linked against Python 2.5.
> You'll need:
> MSVC++ 7.1 (2003) compiler
> Subversion
> Either install the one from http://tortoisesvn.tigris.org/ or the one that
> comes with cygwin.
> The Windows binary release of Python2.5 from python.org
> I use http://www.python.org/ftp/python/2.5/python-2.5.msi
> PyRex? - http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
> I use
> http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/Pyrex-
> which when untarred is Pyrex-
> Untar the tarball and run python setup.py install.
> Psyco - http://psyco.sourceforge.net/
> I run svn co -r42037 http://codespeak.net/svn/psyco/dist/
> Be sure to run python setup.py install.
> Py2exe - http://www.py2exe.org
> I use
> (http://internap.dl.sourceforge.net/sourceforge/py2exe/py2exe-0.6.6.win32-py2.5.exe
> Null Soft Installer - http://nsis.sf.net/Download
> The latest sqlite3.dll file from SQLite
> I use http://www.sqlite.org/sqlitedll-3_5_2.zip
> Copy the sqlite3.dll file from the SQLite website over the one in your
> python directory (Usually C:\Python25\DLLs). If you forget to do this, on
> certain platforms your build will have this issue.
> http://mail.python.org/pipermail/python-list/2007-June/444281.html
> The Windows SDK 6.1 (for Vista headers)
> http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
> Note: Make sure you use the versions of psyco and pyrex that are
> recommended. If you don't, you may get weird behavior. If you find other
> combinations that work, please let us know by listing them on this wiki or
> sending the working combination to the develop mailing list.
> Install all the requirements. After you do that, set up your PATH, LIB, and
> INCLUDE environment variables so that Python distutils can compile modules.
> It's important to pay attention to the order of the paths in these
> variables. Generally speaking, Windows compilers and tools should be first,
> followed by third party tools with Cygwin (if you use it) going last.
> You'll need to edit your vsvars32.bat to use the updated SDK's LIB and
> INCLUDE environment variables. I use the following lines. You may need to
> modify them to reflect the paths on your system.
> Files\Microsoft Visual Studio 9.0\VC\Include;C:\Program Files\Microsoft
> SDKs\Windows\v6.1\Include;C:\Program Files\Microsoft
> SDKs\Windows\v6.1\Include\gl
> @set LIB=%MSVCDir%\ATLMFC\LIB;%MSVCDir%\LIB;C:\Program Files\Microsoft
> Visual Studio 9.0\VC\Lib;C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib
> It's good to copy this file into your Miro directory and then add your
> Python and subversion directories after the @goto end or at the end of the
> file like this:
> @set PATH=%PATH%;C:\Program Files\subversion\bin;C:\Python25
> Alternatively, you can add c:\Python25\ to the Path environment variable in
> Control Panel -> System -> Advanced tab -> Environment Variables.
> Execute vcvars32.bat in the DOS command prompt to pick up the build
> environment variables.
> Getting the prebuilt dependency kit ¶
> As mentioned above, these instructions assume that you're using our prebuilt
> dependency kit. Simply check it out as dtv-binary-kit in the same directory
> where you checked out DTV and the DTV build script will find the dependency
> kit automatically. If you want to get the DTV source at the same time, the
> easiest way is to check out the entire Miro tree, including Miro, the
> dependency kit, and Broadcast Machine:
> svn co https://svn.participatoryculture.org/svn/dtv/trunk miro
> In case your version of svn isn't validating certificates for some reason,
> our https certificate's fingerprint is
> 53:db:fa:7d:7f:41:33:cb:c3:c3:05:2b:16:0e:a8:37:60:13:07:30
> Note: As of July 28 2006, the dtv-binary and tv repositories account for 146
> MB of the total 186 MB repository.
> Make sure that your path doesn't have any spaces in it. There are bugs in
> python's spawnl that make setup not work if you're in a directory with a
> space in it.
> That will create a directory named 'miro' and create tv and dtv-binary-kit
> (and bmachine for Broadcast Machine) as subdirectories of it.
> On the other hand, if you don't want to use the dependency kit, edit
> platform\windows-xul\setup.py and change the paths in the top section
> according to the instructions. You will still need to check out
> dtv-binary-kit (or browse it online), because it contains patches that will
> need to be applied to some of the dependencies before building.
> Building and Running ¶
> To build Miro as quickly as possible and run it out of the development tree,
> do: This is broken as of 06-06-06. Use bdist_xul_dumb instead for now.
> python setup.py runxul
> Video playback won't work. VLC doesn't know how to find its plugin directory
> when DTV is run this way.
> To build a self-contained, redistributable folder with an actual Miro.exe,
> do:
> python setup.py bdist_xul_dumb
> This creates a directory dist.
> To build a single-file installer, suitable for distribution to end users:
> python setup.py bdist_xul
> This will create something like dist/Miro-<version number>.exe.
> See TestingDtv for the options and environment variables supported, and
> information on the debugging logfile. There is no way to pass command-line
> options in runxul mode, other than to edit setup.py.
> Recompiling Mozilla ¶
> You shouldn't have to do this unless you're debugging Mozilla specific
> issues. The first time, set aside a few days to figure out how to do it.
> Compile Mozilla according to the instructions found here using Mozilla 1.9.
> BuildingXULRunner has Miro specific instructions
> Recompiling Boost ¶
> You shouldn't have to do this unless you're debugging Boost specific issues.
> Download the latest Boost source and the Boost jam utility
> http://superb-east.dl.sourceforge.net/sourceforge/boost/boost_1_33_1.tar.bz2
> http://superb-west.dl.sourceforge.net/sourceforge/boost/boost-jam-3.1.13-1-ntx86.zip
> Extract bjam.exe into c:\mozilla-build\msys\local\bin\
> Open a Mozilla build environment terminal (See BuildingXULRunner)
> Run tar xfvj boost_1_33_1.tar.bz2
> cd boost_1_33_1
> bjam -sTOOLS=vc-7_1 --with-python
> --with-python-root=C:\\mozilla-build\\python25 --with-python-version=2.5
> stage
> Troubleshooting ¶
> Pyrex and psyco ¶
> You need to have the exact versions we've listed above for psyco and Pyrex.
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> _______________________________________________
>  Tutor maillist  -  Tutor at python.org
>  http://mail.python.org/mailman/listinfo/tutor

Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com

More information about the Tutor mailing list