MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cool FTP implementation with "minimal" Python

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119461] Re: Cool FTP implementation with "minimal" Python
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 5 Jun 2011 07:02:09 -0400 (EDT)
  • References: <isd0rh$1mb$1@smc.vnet.net>

On 04/06/2011 11:19, McHale, Paul wrote:
> I enjoy using Mathematica, but as with any language they can't do everything.  Nor should they.  Here is a way I implemented quick FTP get routine.
>
> Mathematica code:
> Note:  All communication to python program is through command line parameters.
> Returns {Success} or {Failure}
> ----------------------------------------------------------------------
>
> SetDirectory[NotebookDirectory[]];
> mFileList=ReadList["!c:\\python27\\python.exe "<>  NotebookDirectory[]<>  "FtpPutFile.py 192.168.192.201 /Test/Coms Test.bin",Record]
> ----------------------------------------------------------------------

>
> Anyone else have cool and easy ways to extend Mathematica (Stay in Mathematica longer :) )?  So far Python called this way has been a great way to accomplish some interesting things including sending and receiving small Ethernet commands.

I can't quite understand why you would want to extend Mathematica in 
this particular way, unless perhaps you had not realised that the 
Mathematica Fourier command uses the FFT algorithm if the data length is 
a power of two.

More generally, most of my extensions happen via J/Link and Java, which 
gives a very clean interface. It is also possible in 8.0 to call C code 
in a DLL directly (i.e. with no inter-process overhead) and although I 
have not made use of this yet, this feature obviously has interesting 
possibilities.

David Bailey
http://www.dbaileyconsultancy.co.uk



  • Prev by Date: Re: FindCurvePath causes a crash
  • Next by Date: Re: problems with strings mixed into notebook cells
  • Previous by thread: Re: Cool FTP implementation with "minimal" Python
  • Next by thread: Re: Cool FTP implementation with "minimal" Python