Re: Run a package from the command line without launching a notebook?
- To: mathgroup at smc.vnet.net
- Subject: [mg111763] Re: Run a package from the command line without launching a notebook?
- From: Armand Tamzarian <mike.honeychurch at gmail.com>
- Date: Thu, 12 Aug 2010 05:32:00 -0400 (EDT)
- References: <i3to16$sb7$1@smc.vnet.net>
On Aug 11, 3:46 am, Garapata <warsaw95... at mypacks.net> wrote: > Hi everyone, > > I run Mathematica on a Mac (Snow Leopard). > > I need to run a package from the command line without launching a > notebook. > > First, I created a notebook with four cells: > > Needs["myPackages`myPackage`"] > connectionInfo = {"databaseDriver", "databaseLocation", "username", > password"}; > workFlow[connectionInfo]; > Quit[] > > All pretty simple: > > Needs[] loads a package that I've placed in an ExtraPackages > subdirectory. > connectionInfo gives database connection parameters. > workFlow[] runs some code and writes to the data base. > Quit[] should exit the kernel > > This all works fine running in a notebook. > > I took the notebook, made each cell an initialization cell, and saved > it as a package, > "myAutoRun.m" > > I researched the documentation, the internet, and this forum and found > that MathKernel should start the Mathematica Kernel on Mac OS X > > But now I don't know what I need to do in the terminal window to > launch the kernel and run the package. > > I don't know my way around a terminal window or command prompt, so I'd > appreciate as explicit instructions as possible (especially defining > file paths and changing directories if I need to do so). > > Thanks everyone, > G http://library.wolfram.com/infocenter/MathSource/7590/ cheers Mike