Is Leo better than Vim and emacs?

2008-04-09 Thread wang frank
Hi, Thanks for developing Leo. I have been using Vim for long time to write code. Is it a good time to switch to Leo? what is the advantage of Leo against vim and emacs? Thanks Frank _

calling system command in window is very slow in python 2.5.1

2008-01-03 Thread wang frank
Hi, I am running a python script that will change the attribute of a directory and its subdiretory by command: os.system(chmod -R .) or os.system(attrib -R * /S) Both commands chmod and attrib run quite fast in dos command shell. However, inside python, they are very slow and I

how to pass parameter to a python script when running it in the interactive shell?

2007-12-05 Thread wang frank
Hi, I am debugging a python script which takes a set of paramters. In the regular shell, I type: myscript.py --cl --cs 5 --ce 6 --bw 7 --set 1 However I want to debug the code in the interactive python shell, I do not know how to run it. I know that execfile(myscript.py) will run the

RE: Anyone knows how to use xemacs with ipython or python on WinXP? [phishing][html-removed]

2007-11-19 Thread wang frank
I did not byte-compile the python-mode.el. Does this change anything? I still cannot get the ipython commad prompt. Thanks Frank Subject: RE: Anyone knows how to use xemacs with ipython or python on WinXP? [phishing][html-removed] Date: Mon, 19 Nov 2007 15:57:59 -0500 From: [EMAIL

Anyone knows how to use xemacs with ipython or python on WinXP?

2007-11-17 Thread wang frank
Hi, I am struggling to make the ipython or python works in xemacs. I have been seraching on the internet for a solution for one day. I have put python-mode.el and ipython.el in the load-path and in the xemacs I type: M-x load library ipython. Then M-x py-shell. However, I could not get the

Need to help to parse the matlab log file.

2007-10-26 Thread wang frank
I have a big log file generated by matlab. Here is a copy of part of it. I want to write a function to parse some results. For example, if I want to get the results of BandWidth and freq_offset_in_KHz, the function will print all lines with contain them as : BandWidth = 10

RE: parsing the output from matlab

2007-10-25 Thread wang frank
to the forum today. Frank Date: Tue, 23 Oct 2007 10:08:28 -0400From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: parsing the output from matlab On 10/22/07, wang frank [EMAIL PROTECTED] wrote I have a big log file generated from matlabe, for each variable, it print the name of the variable

parsing the output from matlab

2007-10-22 Thread wang frank
Hi, I have a big log file generated from matlabe, for each variable, it print the name of the variable and an empty line and then the value. such as: x1 = 0.1 y = 7 z = 6.7 x1 = 0.5 I want to use python to parse the file and selectively print out the vairable

how to convert string to number?

2007-10-16 Thread wang frank
Hi, I have struggling to efficiently convert a string list to number. Here is my problem. I have a file that contains lines such as: data_1 1 1 2 3.5 After I read the data from the file by using readlines(), each line contains a string. I use the re moduel to split the line into

RE: how to convert string to number?

2007-10-16 Thread wang frank
It seems that I have problem with the python-list, so I resend this. Thanks Frank From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: how to convert string to number?Date: Tue, 16 Oct 2007 18:15:06 + Hi, I have struggling to efficiently convert a string list to number. Here is my problem. I

RE: how to convert string to number?

2007-10-16 Thread wang frank
Hi, Tim, Thanks for your help. For some reason, I only get your reply from the forum. This is not a homework problem since I have left the school long time ago. I am new to Python and find it very interesting so I decided to try to port a big project from matlab to python. To prove the

how to rerun a function after edit it?

2007-10-10 Thread wang frank
Hi, I am looking for a way to rerun functions after I changed them. This is very critical during the development stage. Currently I have to quit python and restart the python to run the functions. I found the reload function. But it needs the module name. In my case, I import the module

RE: Launch file from Python

2007-10-10 Thread wang frank
I have tried to use os.system to run an application inside python on ms-window. However, the applicaion will grap the python and I could not do anything inside python shell unless I quit the application. Are there any way to avoid this? so I can still type command in python shell. Here is the

RE: module confusion

2007-10-03 Thread wang frank
Hi, I am moving from Matlab to Python+numpy+scipy. In Matlab you can use function dec2bin, hex2dec, dec2hex bin2dec functions to convert decimal to binary and heximal etc. Before I try to implement my own function in Python, I want to know whether in Python such functionalities are already

function to convert data into binary, hex and back.

2007-10-03 Thread wang frank
From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: module confusionDate: Wed, 3 Oct 2007 17:14:19 + Hi, I am moving from Matlab to Python+numpy+scipy. In Matlab you can use function dec2bin, hex2dec, dec2hex bin2dec functions to convert decimal to binary and heximal etc. Before I try to

RE: module confusion

2007-10-03 Thread wang frank
Sorry for the wrong title of this email. Please ignore this email. I have resend the question with correct title. Thanks frank From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: RE: module confusionDate: Wed, 3 Oct 2007 17:14:19 + Hi, I am moving from Matlab to Python+numpy+scipy. In

Where to put the import command in the file?

2007-10-02 Thread wang frank
Hi, I am writing Python script now. The project will grow bigger in future. I need to import some packages for several functions, such as numpy. Where is the best plalce to put the import numpy command? Is it fine to put on the first line in the file? Is it better to put it into each

how to install numpy and scipy on debian?

2007-10-01 Thread wang frank
Hi, I need to help to install these two packages on debian. I want to know what packages do I need to? I have installed fftw3,fftww2, sfftw2, atlas. Did I miss anything? In what way I can install an optimized numpy and scipy, since my project is very big and speed is important. Thanks

Speed of Python

2007-09-07 Thread wang frank
Hi, While comparing the speed of octave and matlab, I decided to do a similar test for python and matlab. The result shows that python is slower than matlab by a factor of 5. It is not bad since octave is about 30 time slower than matlab. Here is the result in matlab: Elapsed time is

Re: Speed of Python

2007-09-07 Thread wang frank
of Python Date: Fri, 07 Sep 2007 17:19:02 - On Sep 7, 12:42 pm, wang frank [EMAIL PROTECTED] wrote: Here is the bench1.py: import math def bench1(n): for i in range(n): for j in range(1000): m=j+1 z=math.log(m

Re: Speed of Python

2007-09-07 Thread wang frank
] To: python-list@python.org Subject: Re: Speed of Python Date: Fri, 07 Sep 2007 19:27:45 - On Sep 7, 2:37 pm, wang frank [EMAIL PROTECTED] wrote: I am not familiar with python, so I just simply try to reproduce the same code in python. Seems almost correct, but from what I guess of MatLab

Re: Speed of Python

2007-09-07 Thread wang frank
frank [EMAIL PROTECTED] Subject: Re: Speed of Python Date: Fri, 7 Sep 2007 16:49:05 -0500 On 9/7/07, wang frank [EMAIL PROTECTED] wrote: Hi, Here is the matlab code: function [z]=bench1(n) for i=1:n, for j=1:1000, z=log(j); z1=log(j+1); z2=log(j+2); z3

Re: Speed of Python

2007-09-07 Thread wang frank
2007 22:59:26 +, wang frank wrote: I also have tried to use numpy to speed it up. However, surprisingly, it is slower than the pure python code. Here is the code: import numpy arange=numpy.arange nlog=numpy.log def bench6(n): for i in xrange(n): for j in xrange(1000

Tkinter or wxpython?

2007-08-02 Thread wang frank
Hi, I want to build a GUI to execut python script. I found TKinter and wxpython. Which one is easier for a newbie? and which one is better? Thanks Frank _ 豪華!大リーグ観戦ツアーや高級外車が当たるスペシャルキャンペーンをお見逃しな く

A newbie question

2007-05-21 Thread wang frank
Hi, I am trying to write a python class with a new data type such as: class Cc14: def __init__(self, realpart, imagpart): self.r=realart self.i=imagpart def __add__(self,x): return self.r+x,r, self.i+x.i If I have x=Cc14(4,5)

Re: A newbie question

2007-05-21 Thread wang frank
@python.org Subject: Re: A newbie question Date: 21 May 2007 16:22:06 -0700 On May 21, 6:04 pm, wang frank [EMAIL PROTECTED] wrote: Hi, I am trying to write a python class with a new data type such as: class Cc14: def __init__(self, realpart, imagpart): self.r

how to use private method in a class

2007-05-21 Thread wang frank
method? Thanks Frank From: wang frank [EMAIL PROTECTED] To: python-list@python.org Subject: A newbie question Date: Mon, 21 May 2007 23:04:06 + Hi, I am trying to write a python class with a new data type such as: class Cc14: def __init__(self, realpart, imagpart

how to find a lable quickly?

2007-05-04 Thread wang frank
Hi, I am a new user on Python and I really love it. I have a big text file with each line like: label 3 teststart 5 endtest 100 newrun 2345 I opened the file by uu=open('test.txt','r') and then read the data as xx=uu.readlines() In xx, it contains the list of each

Do I have to quit python to load a module?

2007-05-04 Thread wang frank
Hi, When I edit a module, I have to quit python and then restart python and then import the module. Are there any way to avoid quit python to load an updated module? When I am debugging a module code, I need to constantly make changes. It is not convenient to quit and reload. Thanks Frank