Matlab equivalent syntax in Python

Robert Kern robert.kern at
Sat Nov 27 23:38:46 CET 2010

On 2010-11-26 18:23 , Akand Islam wrote:
> On Nov 26, 3:50 pm, Cameron Simpson<c... at>  wrote:
>> On 26Nov2010 13:15, Akand Islam<sohel... at>  wrote:
>> | Thanks for your posting. Like, here is the following Matlab codes
>> | which I am trying to transform into Python. Here you
>> | will find "profile clear, profile on, profile off, profile resume,
>> | profile viewer, and drawnow" syntaxes. So, what will be these
>> | equivalents
>> | in Python?
>> I would start by looking at the "profile" python module:
>> Cheers,
>> --
>> Cameron Simpson<c... at>  DoD#743
>> Their are thre mistakes in this sentence.
>>          - Rob Ray DoD#33333<r... at>
> Dear Cameron Simpson,
> Thanks for co-operation. I have gone through the link, however, I am
> not much clear. Can you please show me some python syntaxes which
> contain Matlab like "profile on.., drawnow.." and so forth?

Perhaps you could explain what those MATLAB commands do. Not everyone here is 
familiar with MATLAB. For the most part, an API like "profile on; profile off" 
is inappropriate for the "profile" Python module. It profiles the times each 
function call takes, not each line. Turning it on and off doesn't make much 
sense. The API described in the above link is better for what it does.

If you want to visualize the profile, you may want to try RunSnakeRun:

If you want line-by-line profiling, you may want to check out my package, 

Again, we don't turn it on and off like you might do in MATLAB. Just follow the 
directions and give up trying to find a correspondence with the MATLAB commands.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-list mailing list