[Tutor] about random seed

2006-09-02 Thread linda.s
I read something about random.seed() but still confused. i can understand random.random() but it is very hard for me to understand random.seed(0... can anyone explain an example? Thanks a lot! Linda ___ Tutor maillist - Tutor@python.org http://mail.pyth

Re: [Tutor] about random seed

2006-09-02 Thread linda.s
On 9/2/06, Bob Gailer <[EMAIL PROTECTED]> wrote: > linda.s wrote: > > I read something about random.seed() but still confused. i can > > understand random.random() but it is very hard for me to understand > > random.seed(0... can anyone explain an example? >

Re: [Tutor] about tkinter

2006-09-05 Thread linda.s
On 8/9/06, Alan Gauld <[EMAIL PROTECTED]> wrote: Linda, > Is that possible to open two Tkinter from one python shell? Tkinter is a python module. You can't really open a Tkinter, you can only import the module. What you can do is write a Tkinter application with multiple windows. You can have

Re: [Tutor] about tkinter

2006-09-05 Thread linda.s
On 9/5/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > Hi Linda, > > >> Can you be clearer about what exactly you want to do? > >> > > I want to open two windows with one having the blue triangle and the > > other one having the red triangle (the code is attached). I can not > > figure out how to use t

[Tutor] about assert

2006-09-13 Thread linda.s
Python manual has a very brief introduction of "assert" statements. It is very difficult for me to understand it. Can anyone give me an example? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] folder and module

2006-09-16 Thread linda.s
Hi there, i have test.py under c:\try1\new; I want to import b and b.py is under c:\trytry. How to do it? Also, I import c and c.py is in the desktop folder but no error reported. Why? Thanks, Linda On 9/2/06, linda. s <[EMAIL PROTECTED]> wrote: > I read something about random.seed() but still c

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
> > i have test.py under c:\try1\new; > > I want to import b and b.py is under c:\trytry. How to do it? > > Also, I import c and c.py is in the desktop folder but no error > > reported. > > Python imports modules by looking for them in the folders > listed in the variable sys.path. sys.path gets po

[Tutor] environment variables

2006-09-17 Thread linda.s
Hi there, I found the following paragraph in the web: environment variables on Windows come in two flavors: user variables and system variables. In particular, if there is a system variable PYTHONPATH and you are adding this as a user variable, start with the value in the system variable and add to

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > >> listed in the variable sys.path. sys.path gets populated when > >> Python starts up and includes some standard locations plus > >> any you define in your PYTHONPATH environment variable. > >> > > I checked my PYTHONPATH environment variable > >

Re: [Tutor] folder and module

2006-09-18 Thread linda.s
> Hi Linda, > > what do you get when you try: > > >>> import os > >>> os.getcwd() > > The current working directory is represented in sys.path as the first > element: > > >>> import sys > >>> sys.path[0] > '' > > > Not the most intuitive, perhaps. > > I suspect you are launching your Python env

[Tutor] about mainloop

2006-09-27 Thread linda.s
I comment out root.mainloop() in my windows machine's Python 2.4 IDLE, everything is OK. But if I do the same thing in Mac machine's Python 2.4 IDLE, I can not see any map.Why? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

[Tutor] numpy and python

2006-11-06 Thread linda.s
I use Python 2.4 IDLE to open a py code which import numeric. I have installed both scipy and numpy into my c:\python24. However, it was still reported as: from Numeric import * ImportError: No module named Numeric I got confused... ___ Tutor maillist

Re: [Tutor] numpy and python

2006-11-06 Thread linda.s
On 11/6/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Mon, 6 Nov 2006, linda.s wrote: > > > I use Python 2.4 IDLE to open a py code which import numeric. > > I have installed both scipy and numpy into my c:\python24. However, it > > was still reported as: &g

[Tutor] a line

2006-11-06 Thread linda.s
What does Pythonw -i test.py -i do in Mac machine? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] draw 3D using Tkinter?

2006-11-28 Thread linda.s
Is there any sample code to draw 3D using Tkinter? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Is there any good turtorial about numeric python for beginners?

2006-12-06 Thread linda.s
Is there any good tutorial about numeric python for beginners? I have googled around and many of them are either too old or aims at experienced users... Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] function and module

2006-12-07 Thread linda.s
I am reading a sample code and want to figure out where a function (for instance, abc) is from. There are many lines such as from XXX import * Is there a way not going through all these imported modules to find where the abc is from (by the way, the abc function is not in the current module)? Tha

[Tutor] mlab and numeric

2006-12-07 Thread linda.s
can anyone tell me the relationship between MLab and Numeric? Especially MLab, there is very little information about it. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] RandomArray and numeric

2006-12-25 Thread linda.s
Since RandomArray is with Numeric, why I saw a code has something like: from Numeric import * from RandomArray import * Tks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] idle and version

2006-12-25 Thread linda.s
in my computer, there are python 2.3 and 2.4 Every time I right click a python code and select "edit with IDLE", it goes to python2.4; I am very curious why it does not got to python 2.3 because I set python 23 in my PYTHONPATH in the My Computer - Properties - Advanced - Environment Variables. ___

[Tutor] about array

2006-12-25 Thread linda.s
When I read the following code, I found it was very hard for me to understand the meaning of a[1:3,:-1:2] for a[i,j] for i=1,2 and j=0,2,4; the same as a[::3,2:-1:2] >>> a array([[ 0., 1., 2., 3., 4., 5.], [ 6., 7., 8., 9., 10., 11.], [ 12., 13., 14., 15., 16., 17.], [ 18., 19., 20., 21., 22., 23

[Tutor] code in a folder

2006-12-26 Thread linda.s
I read an example code, with something like: from a.b import * I checked and found a is a folder name and b is python code in that folder. I typed the above code in the IDLE and no error was reported. Why a.b works? ___ Tutor maillist - Tutor@python.org

Re: [Tutor] about array

2006-12-26 Thread linda.s
On 12/26/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "linda.s" <[EMAIL PROTECTED]> wrote > > >>>> a > > array([[ 0., 1., 2., 3., 4., 5.], > > [ 6., 7., 8., 9., 10., 11.], > > [ 12., 13., 14., 15., 16., 17.], > > [ 18., 19., 2

[Tutor] about reload

2006-12-29 Thread linda.s
I read something about reload of modules. #test.py from ABC import M # M is an attribute of Module ABC if I change module ABC, I need import ABC and reload ABC before "from ABC import M" work. in IDLE, I just click F5 and run the code, it works and does not need type anything like "Import ABC", "R

Re: [Tutor] about reload

2006-12-29 Thread linda.s
On 12/29/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > Actually, if you have IDLE in the default setup on Windows and you > > right-click something to edit it, > > IDLE doesn't open a subprocess each time a script is executed, so it > > will keep the imports in between runs of the program. > > Hi Lu

Re: [Tutor] about reload

2006-12-30 Thread linda.s
On 12/30/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > > > I got confused now:-> if IDLE keeps the imports in between runs of the > > program, do I still need import and reload? or click F5 in IDLE is OK? > > > The purpose of import is so that python knows what packages you intend > to use, >

[Tutor] direction and draw

2007-01-21 Thread linda.s
I have a segment (two ending points are A and B) which is 0 degree. How to draw a segment with 10 degrees and 15 in length? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] reassign

2007-04-08 Thread linda.s
Hi, I have a list: [2,5,8,0,1,7] how i can randomly reassign the values to different location in the list? for example: Time 1: [5,2,8,0,1,7] Time 2: [8,0,7,1,5,2] Thanks! Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listin

Re: [Tutor] reassign

2007-04-14 Thread linda.s
I wonder how to use colors from gray to black to represent a group of values from small to large? Thanks, Linda ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] version and path

2007-05-05 Thread linda.s
how to check how many versions of Python i have in my mac machine? also, how to put the path to the version I desire? Thanks a lot! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] version and path

2007-05-14 Thread linda.s
how to check how many versions of Python i have in my mac machine? also, how to put the path to the version I desire? Thanks a lot! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] version and path

2007-05-14 Thread linda.s
On 5/14/07, Tom Tucker <[EMAIL PROTECTED]> wrote: > I would use the traditional Unix find command to find the various > versions installed. > > find / -name "python*" > > > > On 5/14/07, linda.s <[EMAIL PROTECTED]> wrote: > > how to check

[Tutor] hash

2007-07-04 Thread linda.s
what is the use of def __hash__(self)? I can not understand the document. any example? thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] float question

2005-12-19 Thread linda.s
what does 2 mean in %2.4f ? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] float question

2005-12-20 Thread linda.s
On 12/20/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Mon, 19 Dec 2005, linda.s wrote: > > > what does 2 mean in %2.4f ? > > Hello, > > It's a "minimal field width" modifier, according to: > >http://docs.python.org/lib/ty

[Tutor] is there any tool like "run line or selection" in Pythonwin?

2005-12-25 Thread linda.s
is there any tool like "run line or selection" in Pythonwin? Thanks! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python in Mac

2006-02-05 Thread linda.s
I installed python in both Windows and Mac. I am very curious why the installation under Mac take so long time compared to that under Windows. Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] is there any tool like "run line or selection" in Pythonwin?

2006-02-05 Thread linda.s
I installed python in both Windows and Mac. I am very curious why the installation under Mac take so long time compared to that under Windows. Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] installing python on windows and macs

2006-02-06 Thread linda.s
On 2/5/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Sun, 5 Feb 2006, linda.s wrote: > > > I installed python in both Windows and Mac. I am very curious why the > > installation under Mac take so long time compared to that under > > Windows. > > Hi L

Re: [Tutor] installing python on windows and macs

2006-02-06 Thread linda.s
On 2/6/06, Jan Erik Moström <[EMAIL PROTECTED]> wrote: > linda.s <[EMAIL PROTECTED]> 2006-02-06 09:09: > > > Now I tried to install Python 2.4.2; It works fine till "Make > > Install". After I reenter the terminal, I still saw Python 2.3.5 and > >

[Tutor] source file or installer

2006-03-06 Thread linda.s
what are the benefits of building python from source file? any difference if using installer? Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python and R

2006-03-16 Thread linda.s
Is there any good tutorial about using python to call R modules? Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] 3-D

2006-03-23 Thread linda.s
Is there any sample code to draw 3-D axis in Python. That is, we can see X,Y,Z coordinates? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] site-packages

2006-03-25 Thread linda.s
I downloaded some modules and were told to put under *\Python24\Lib\site-packages I use mac machine and run Python 2.4 but why i could not find any folder named Python24. Also, my Mac machine has a default Python 2.3, I do not see any folder named Python2.3 Confused... Linda ___

Re: [Tutor] site-packages

2006-03-25 Thread linda.s
On 3/25/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Sat, 25 Mar 2006, linda.s wrote: > > > I downloaded some modules and were told to put under > > *\Python24\Lib\site-packages > > Hi Linda, > > Out of curiosity, which module? If we're being as

[Tutor] underscore function

2006-04-13 Thread linda.s
I got a sample code and found some function definition looks like def _abc There is one underscore before the function name "abc", what does it mean? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] locations

2006-04-21 Thread linda.s
I have a question. in the LIST M= [[1,1,1,1], [0,1,1,1], [1,1,0,1], [1,1,1,1]] If treat them as the locations of 16 points, I want to generate another list N to hold the corresponding value for each point to its nearest 0. For example:the nearest 0 point to M[0][0] is M[1][0], so N[0][0]=1; M[0][1]

[Tutor] why different

2006-05-05 Thread linda.s
I run a code, which import Numeric module. When I run the code from PythonWin, it is OK. But when I run it from the command line, it reported "Importerror: No Module named Numeric." Why the systems perform differently? Linda ___ Tutor maillist - Tutor@

Re: [Tutor] why different

2006-05-05 Thread linda.s
Run, and type cmd.exe, and in the new windowthat opens type the following command:C:\>echo %PATH%and then right click, select Mark, select the text that was outputtedand press enter to copu it and paste it here also? Lastly, what directory are you running your code from?Regards,Liam ClarkeOn 5/5

Re: [Tutor] why different

2006-05-05 Thread linda.s
You are right. When I switch to python23 folder, it works.On 5/5/06, Danny Yoo <[EMAIL PROTECTED] > wrote:On Fri, 5 May 2006, linda.s wrote:> I have two drives. The python24 is installed in c: and the code is in d: > drive (d:\data).> so what I did is:> d:\data> c:\python24\p

[Tutor] How to import a module which was not in the current working directory?

2006-05-26 Thread linda.s
Hi, How to import a module which was not in the current working directory? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] a question about symbol

2006-05-28 Thread linda.s
When I test the following code, I got something like (use 80 as argument): 80?F=27?C Why '?' appear? # code import string, sys # If no arguments were given, print a helpful message if len(sys.argv)==1: print 'Usage: celsius temp1 temp2 ...' sys.exit(0) # Loop over the arguments for i in

Re: [Tutor] a question about symbol

2006-05-28 Thread linda.s
On 5/28/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Sun, 28 May 2006, linda.s wrote: > > > When I test the following code, > > I got something like (use 80 as argument): > > 80?F=27?C > > Why '?' appear? > > > Hi Linda, > > L

Re: [Tutor] a question about symbol

2006-06-02 Thread linda.s
On 5/28/06, Bob Gailer <[EMAIL PROTECTED]> wrote: > > linda.s wrote: > When I test the following code, > I got something like (use 80 as argument): > 80?F=27?C > Why '?' appear? > > # code > import string, sys > > # If no arguments were giv

[Tutor] trace the changes

2006-07-06 Thread linda.s
I am reading a long python code with many if...then; I wonder whether there is any way to trace the changes of the variables in the code. I can not find debugger tutorial in detail in PythonWin. Thanks for any suggestions. Linda ___ Tutor maillist - Tut

[Tutor] about copy.copy

2006-07-18 Thread linda.s
what is the difference between b and c in the following code? import copy a=[1,4,5] b=a c=copy.copy(a) Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] about copy.copy

2006-07-18 Thread linda.s
6]] >>> c [['a', 2, 3], [4, 5, 6]] On 7/18/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > linda.s wrote: > > what is the difference between b and c in the following code? > #---copyexample.py > import copy > a=[1,4,5] > b=a > c=copy.copy(a) >

Re: [Tutor] about copy.copy

2006-07-20 Thread linda.s
On 7/18/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Tue, 18 Jul 2006, linda.s wrote: > > > But in the following example, a/b/c change and it looks like there is > > no difference. > >>>> a=[[1,2,3], [4,5,6]] > >>>> b=a > >&

[Tutor] about tkinter

2006-08-09 Thread linda.s
Is that possible to open two Tkinter from one python shell? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] where is the function from

2007-10-24 Thread linda.s
How can I know where a function such as abc is from (from which module)? >>> abc ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] about Tix

2007-10-25 Thread linda.s
I run the following code in Python 2.5 and got the error (when I do "import Tix", no error). Traceback (most recent call last): File "2.py", line 54, in tkRoot = Tix.Tk( ) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk/Tix.py", line 210, in __init__ self

Re: [Tutor] about Tix

2007-10-27 Thread linda.s
On 10/26/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > Linda, > > >I run the following code in Python 2.5 and got the error (when I do > > "import Tix", no error). > > Congratulations I think this might just be the first Tix question > on the tutor list! :-) > > > Traceback (most recent call last): >

[Tutor] position

2007-10-27 Thread linda.s
I have a string a= "qq,eee,rrr". >>> a.index(",") 2 It is the position of the first "," in a. Is that possible to find the Nth "," in a if a is a very long string and I need know the position of the Nth ","? Thanks, Linda ___ Tutor maillist - Tutor@pyth

Re: [Tutor] position

2007-10-27 Thread linda.s
On 10/27/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "linda.s" <[EMAIL PROTECTED]> wrote > > >I have a string a= "qq,eee,rrr". > >>>> a.index(",") > > 2 > > It is the position of the first "," in a. &g

[Tutor] repeated times

2007-10-29 Thread linda.s
I want to run an .exe file and get the output many times. Can any one give me an example about how to use python to generate the automatic process? Thanks, Linda ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] repeated times

2007-11-04 Thread linda.s
On Nov 2, 2007 1:03 AM, ALAN GAULD <[EMAIL PROTECTED]> wrote: > > > >I want to run an .exe file and get the output many times. > >> Given that I know that you know about loops I have to > >> ask what you see as the problem? > > > >I want to run it many times and export all the output to a text file

Re: [Tutor] repeated times

2007-11-07 Thread linda.s
On 11/4/07, Aditya Lal <[EMAIL PROTECTED]> wrote: > On 11/4/07, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * linda.s (Sun, 4 Nov 2007 01:39:46 -0800) > > > On Nov 2, 2007 1:03 AM, ALAN GAULD < [EMAIL PROTECTED]> wrote: > > > > > > >

[Tutor] selection

2007-11-15 Thread linda.s
Hi, I wonder how to hold the ctrl key and button-1 to do multiple selection of the following items? Thanks, Linda import Tkinter s = Tkinter.Scrollbar() L = Tkinter.Listbox() s.pack(side=Tkinter.RIGHT, fill=Tkinter.Y) L.pack(side=Tkinter.LEFT, fill=Tkinter.Y) s.config(command=L.yview) L.config(

[Tutor] width

2007-11-15 Thread linda.s
I wonder why the widths are different for the three labels? Thanks, Linda from Tkinter import * root = Tk() w = Label(root, text="Red", bg="red", fg="white") w.pack() w = Label(root, text="Green", bg="green", fg="white") w.pack() w = Label(root, text="Blue", bg="blue", fg="white") w.pack() main