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
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(
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:
> > > > > > >
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
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
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
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
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):
>
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
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
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
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
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
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
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
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
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
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,
>
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
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
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
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
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
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.
___
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
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
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
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
Is there any sample code to draw 3D using Tkinter?
Thanks,
Linda
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
What does
Pythonw -i test.py -i
do in Mac machine?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
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
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
> 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
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
>
>
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
> > 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
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
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
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
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
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?
>
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
Is that possible to open two Tkinter from one python shell?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
> >&
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)
>
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
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
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
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
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
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
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
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
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@
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]
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
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
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
___
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
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
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
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
> >
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
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
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
is there any tool like "run line or selection" in Pythonwin?
Thanks!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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
what does 2 mean in %2.4f ?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
69 matches
Mail list logo