-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Today (Nov 14, 2005) at 6:10am, Kent Johnson spoke these wise words:
- ->A couple of notes after a quick look:
- ->
- ->- As you note, def check_valid_jump(sel1, sel2) is really ugly. When I have
code like this I look for a way to drive it from a ta
On Mon, 14 Nov 2005, Nathan Pinno wrote:
> Alan and all,
>
> I imported it, but its not there. I tried using the Message one found in it,
> but I got an error message:
> >>> import Tkinter
> >>> tk = Tkinter.Tk()
> >>> Tkinter.Message("Help","Help!")
Hi Nathan,
According to the traceback:
>
Kent Johnson wrote:
>Maybe we should start a thread of favorite addons. For me, Jason Orendorff's
>path module is definitely #1 on the list, probably followed by Fredrik Lundh's
>ElementTree.
>http://www.jorendorff.com/articles/python/path/
>http://effbot.org/zone/element-index.htm
>
>
A wonde
Alan and all,
I imported it, but its not there. I tried using the Message one found in it,
but I got an error message:
>>> import Tkinter
>>> tk = Tkinter.Tk()
>>> Tkinter.Message("Help","Help!")
Traceback (most recent call last):
File "", line 1, in -toplevel-
Tkinter.Message("Help","Help!
> How do I display a changing thing (i.e.. the score of the game) in text? I
> think it has something to do with this key: %, but I forget how to do it.
> Can someone show me how to do it again?
Take a look at the Simple Sequences page on my tutor for examples
of using the % format string operatr
Nathan,
> I am having problems. The latest error message I got was:
>tkMessageBox.showinfo("Hockey",
> NameError: name 'tkMessageBox' is not defined
A NameError means Python doesn't recognise the name.
Usually that's because either you didn't declare the variable or
you forgot to import the
> It's a little confusing for me, are there some special
> programs for reading mailing lists or you use just
> basic mail client ?
Interesting question!
The list comes in many flavours.
The most basic form you just subscribe and it sends you emails which you
read using your normal email client.
> Do I have to initialize TKInter before I can use it, and if so, how would
> I
> go about doing that?
Yes, by calling Tk()
Alan G.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
The interactive intepreter is you friend. Of course I'm using actual
numbers instead of variables for the examples. Let's see
IDLE 1.0.3
>>> "Computer = %1.0d Player = %1.0d" (1,2)
Traceback (most recent call last):
File "", line 1, in -toplevel-
"Computer = %1.0d Player = %1.0d" (1,2)
Hi Nathan,
The interactive interpreter is your friend. I just displayed a simple
dialog without creating a Tkinter App, complete with a mailoop or
anything.
But I won't tell you how... you need to import the module and then use
one of its functions. But you need to try it yourself (be aware t
Hugo and all,
So in order to write what I wanted the correct code would be:
"Computer = %1.0d Player = %1.0d" (a,b)
Am I correct or is this wrong?
Nathan Pinno
-Original Message-
From: Hugo González Monteverde [mailto:[EMAIL PROTECTED]
Sent: November 14, 2005 8:27 PM
To: Nathan Pinno
C
I believe the deal is that it is impossible (or at least extremely
inefficient)to keep track of any places where a mutable object was
hashed at the time of mutating it, so that ALL hashes can be updated.
When the object is immutable, it implies that the hash will not change
unless the id chan
On 15/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
> John,
>
> I learned it from the docs on pythonware.com - the introduction to TKInter -
> Standard Dialogs.
> Since it doesn't exist, how can I show a info box before the main part of my
> program?
Ok, let's see what the pythonware docs say:
h
If you do
File... Save
Then select the location for your file and just give it a name, a '.py'
extension will be added to the file.
It is not in a specific format, it is just a text file with a '.py'
extension. From Explorer you will likely see just the name of the file.
And after you save
John,
I learned it from the docs on pythonware.com - the introduction to TKInter -
Standard Dialogs.
Since it doesn't exist, how can I show a info box before the main part of my
program?
Nathan
Date: Tue, 15 Nov 2005 14:54:15 +1300
From: John Fouhy <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Do I h
Hi Nathan,
It is always better if you include what you're actually trying to do. I
see you included one traceback error, but I see no reference to what
you're coding or any of your code.
In your case , it's likely that you did not import the tkMessageDialog
module or something like this. But
I think so, what I'm doing is opening a text file,
reading line 1 and writing that text to the serial
port. Then read line 2 and so on... So it mimics a
string rather than a list or dictionary. But I would
think this would give you a similiar result. I can try
it to confirm.
Here is the entire c
Hi Nathan,
Take a look at string interpolation in the tutorial. I don't know what
method you're following for learning Python, but I've found the
'official' tutorial a great resource, even when you already know Python,
http://docs.python.org/tut/node9.html#SECTION00910
Nathan
How do I display a
changing thing (i.e.. the score of the game) in text? I think it has something
to do with this key: %, but I forget how to do it. Can someone show me how to do
it again?
Thanks,
Nathan Pinno
___
Tutor maillist - Tutor@python.o
Hugo González Monteverde wrote:
>>Quite often the only answer is "just because". Some features are
>>the way they are because that's Guido's pesonal preference. Others
>>may disagree with him but it's his language and he gets to pick
>>what he thinks is best - the benign dictator syndrome.
>>
> > Quite often the only answer is "just because". Some features are the
> > way they are because that's Guido's pesonal preference. Others may
> > disagree with him but it's his language and he gets to pick what he
> > thinks is best - the benign dictator syndrome.
Hi Hugo,
There are a few lan
On 15/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
>
>
> John and all,
>
> I am having problems. The latest error message I got was:
> Traceback (most recent call last):
> File "D:\Python24\hockey.py", line 19, in -toplevel-
> tkMessageBox.showinfo("Hockey",
> NameError: name 'tkMessageBox'
> Quite often the only answer is "just because". Some features are
> the way they are because that's Guido's pesonal preference. Others
> may disagree with him but it's his language and he gets to pick
> what he thinks is best - the benign dictator syndrome.
There's also the issue that immutabili
John and all,
I am having problems. The latest error message I got was:
Traceback (most recent call last): File "D:\Python24\hockey.py",
line 19, in -toplevel-
tkMessageBox.showinfo("Hockey",NameError: name 'tkMessageBox' is not
defined
What do I have to do in this case?
Nathan Pin
Just to make sure that I understood it right,
Does this snippet mimic the problem that you have? Ive hardcoded "line".
x=
import serial
import time
ser=serial.Serial(0,57600,timeout=0.1)
i=0
line = ["Hi","There","Hans"]
while i <= (len(line)-1):
ser.write(line[i]
oh yeah, i will need this too!
sk
On Mon, 2005-11-14 at 17:04 -0800, Bennett, Joe wrote:
> I have been working with pyserial. One question I have
> is this. I have a loop that writes to the serial port
> and then waits about 500ms and then reads from the
> serial port. The first thing read from t
I have been working with pyserial. One question I have
is this. I have a loop that writes to the serial port
and then waits about 500ms and then reads from the
serial port. The first thing read from the serial port
is ALWAYS the data written to the serial port... I
must be missing something obvious
> Ok. I see something suspicious here. The for loop:
>
> ##
> for l in xx:
> train_tokens.append(l)
> ##
>
> assumes that we get tokens from the 'xx' token. Is this true? Are you
> sure you don't have to specifically say:
>
> ##
> for l in xx['SUBTOKENS']:
> ...
> ##
On Mon, 14 Nov 2005, enas khalil wrote:
> hello all
[program cut]
Hi Enas,
You may want to try talking with NTLK folks about this, as what you're
dealing with is a specialized subject. Also, have you gone through the
tokenization tutorial in:
http://nltk.sourceforge.net/tutorial/tok
Nathan Pinno wrote:
> Hey all,
>
> Do I have to initialize TKInter before I can use it, and if so, how
> would I go about doing that?
>
> Thanks,
> Nathan Pinno
Btw, your question would be a little more user-friendly if you don't
post HTML, and don't post embedded images as well! (Not ever
It's a little confusing for me, are there some special
programs for reading mailing lists or you use just
basic mail client ?
__
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
_
Dear John,
Thanks for your explanation. It is quite amazing, I had completely
misunderstood what the join function was all about. An example in
"Learning Python" which was something like
"".join(L) , had led me to think it was a string
concatenation function that extended the length of a string. E
On 15/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
>
> Hey all,
>
> Do I have to initialize TKInter before I can use it, and if so, how would I
> go about doing that?
Generally, you need to create a Tkinter.Tk object before you create
any other Tkinter objects.
Are you having problems?
--
John
ok, i think i got it. Thanks so much.
let you know how it turns out.
shawn
On Tue, 2005-11-15 at 11:27 +1300, Hans Dushanthakumar wrote:
> Lock() is provided by the threading module.
> see
> http://docs.python.org/lib/module-threading.html
> &
> http://docs.python.org/lib/lock-objects.html
>
>
Hey
all,
Do I have to initialize
TKInter before I can use it, and if so, how would I go about doing
that?
Thanks,
Nathan Pinno
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
hello all when i run the code : # -*- coding: cp1256 -*-from nltk.tagger import *from nltk.corpus import brownfrom nltk.tokenizer import WhitespaceTokenizer # Tokenize ten texts from the Brown Corpustrain_tokens = []xx=Token(TEXT=open('fataha2.txt').read())WhitespaceTokenizer().tokenize(xx)f
Thanks to all those who responded to my plea regarding how
to make my laptop’s bell ring with the print “\a”
command. The secret turned out to be, as a couple of you suggested, that
it won’t work in the Python window environment. It works fine if I
just double click the .py file in Window
Alan Gauld wrote:
>> CheeseShop
>
> New one on me!
CheeseShop is formerly known as PyPI, the Python Package Index. It's a central
repository for Python add-ons.
http://www.python.org/pypi
> If I'm not busy I try to scan c.l.p but mostly its
> just too busy. Nonetheless its my primary source of
Lock() is provided by the threading module.
see
http://docs.python.org/lib/module-threading.html
&
http://docs.python.org/lib/lock-objects.html
Cheers
Hans
-Original Message-
From: nephish [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 15 November 2005 11:23 a.m.
To: Hans Dushanthakumar
Cc:
ok, lock is something you wrote yourself ?
i can't find it in the docs. However, i think i can essentially build
the same thing.
the serial module i use is pyserial. pyserial.sourceforge.net.
the docs are a wee bit on the sparce side. But i think i can pull it
off. Thanks for your help.
shawn
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Alan Gauld
>
>
> I've just added an incomplete draft copy of my latest tutorial topic
> on using the Operating System from Python. The material that's
> there discusses the role of the OS and looks at fi
"Terry Kemmerer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> TurboGears sounds pretty good. But, from the write up, TurboGears
> appears to be for MAC only.
> Or am I misreading the write up?
The writeup I posted was Mac focused but the project itself
is multi platform. The dow
I believe that the drivers take care of that, however, I did use locks to make
sure that there were no conflicts.
In the listener thread I had something along the lines of:
Acquire lock
readline() from the ser port
Release lock
And in the sender thread,
Acquire lock
send msg over ser por
I've just added an incomplete draft copy of my latest tutorial topic
on using the Operating System from Python. The material that's
there discusses the role of the OS and looks at file handling
usng os/os.path/shutil etc.
http://www.freenetpages.co.uk/hp/alan.gauld/tutos.htm
If anyone would like
well thats encouraging, did you have to do anything special to prevent
an error when trying to read or write at the same time
?
thanks
sk
On Tue, 2005-11-15 at 09:29 +1300, Hans Dushanthakumar wrote:
> Ive worked on a similar application. I used one thread to read from the
> serial port and ano
> The main places I hear about new stuff are
> Planet Python
> Python Cookbook
> python-announce
I know of them but rarely look.
> CheeseShop
New one on me!
> The first three have RSS feeds,
But I didn't know that...
> and of course there's comp.lang.python if you have the time for it...
An
TurboGears sounds pretty good. But, from the write up, TurboGears appears to be for MAC only.
Or am I misreading the write up?
Terry
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Mon, 14 Nov 2005 14:42:27 +0100 (MET)
[EMAIL PROTECTED] wrote:
> Hello!
> I want to learn Tkinter and try to build a small File search dialog. Tkinter
> is nice, but here is a problem where I am stuck:
>
> I want to allow the dialog's user to pick a directory. The widget for this
> is tkFileDi
I have spent quite a bit of time looking at TurboGears. I have not used
it in any production sense. Recently, there has developed a new
TurboGears app which you may not have run across yet, but is very
interesting in itself. It's called Catwalk.
http://www.checkandshare.com/catwalk/download.htm
Matt Williams wrote:
> This got me thinking about how we stay up with different, and new,
> python projects. I tend to look at the Daily Python URL, as well as some
> Technorati and del.icio.us tagged sites/blogs. Where else do other
> people look?
One more - Dr Dobbs Python-URL (not the same as D
if you want to copy object just use:
import copy
newobj = copy.deepcopy(objparent)
or just create object which has direct correlation with the parent like:
newobj = objparent
Cheers,
pujo
On 11/14/05, Alan Gauld <[EMAIL PROTECTED]> wrote:
> I want to create a property that will inherit it's val
Ive worked on a similar application. I used one thread to read from the serial
port and another one to handle the writes.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hugo González
Monteverde
Sent: Tuesday, 15 November 2005 7:36 a.m.
To: nephish
Cc:
> I want to create a property that will inherit it's value from the same
> property in it's parent object, but will check it's parent's propety
> everytime it is called. But that can be over-ridden, and I don't have
> to know what the objects parent is.
Ed you are using a lot of OOP terminology h
Matt Williams wrote:
> This got me thinking about how we stay up with different, and new,
> python projects. I tend to look at the Daily Python URL, as well as some
> Technorati and del.icio.us tagged sites/blogs. Where else do other
> people look?
The main places I hear about new stuff are
Planet
Dear Alan,
I haven't used it, but I've looked through it, and it looks v.
interesting. One of the things I like is that it glues lots of different
bits together (I came across it while looking at SQLObject), and so
benefits from their advances.
I was a bit surprised that you hadn't
come across it
* Alan Gauld <[EMAIL PROTECTED]> [051114 09:26]:
> I just stumbled across TurboGears:
>
> http://www.macdevcenter.com/pub/a/mac/2005/11/08/turbogears.html
>
> Its based on CheryPy which consistently gets good reviews but adds SQL
> access and XML templates. Sounds interesting, possibly even a Zo
Yeah, i am using pyserial, i think, in debian its called python serial
and i use import serial to get things going.
Really easy, just wanted to know about this stuff before i start
scrambling this like so many eggs.
i will not be using two different scripts, but likely two threads in the
same scr
Alan Gauld wrote:
> I just stumbled across TurboGears:
>
> http://www.macdevcenter.com/pub/a/mac/2005/11/08/turbogears.html
>
> Its based on CheryPy which consistently gets good reviews but adds SQL
> access and XML templates. Sounds interesting, possibly even a Zope rival
> for the medium size
Hi Nephish,
Are you using pyserial or rolling your own? Normally you can write and
read to the /dev/ttySXX file at the same time; since they're special
files, not ordinary files, the driver handles that.
Handling both writing and reading in your program's flow control is a
wholly different mat
I just stumbled across TurboGears:
http://www.macdevcenter.com/pub/a/mac/2005/11/08/turbogears.html
Its based on CheryPy which consistently gets good reviews but adds SQL
access and XML templates. Sounds interesting, possibly even a Zope rival
for the medium sized as opposed to massive site..
Hey there,
i am developing on a linux computer with the serial module. Now, i
already am able to recieve info from a serial RS232 device and process
everything ok. What i need to do now is write to the serial device, but
i also need to be able to not interrupt the script that is reading fro
->Terry<- wrote:
> Now here is the perhaps silly question. Is
> something like this need to have a license?
> What I mean is, as I play with and improve
> this game and want to share it with others,
> should I choose a license and add the legal
> stuff with the distributed product?
Just a quick no
Hello!
I want to learn Tkinter and try to build a small File search dialog. Tkinter
is nice, but here is a problem where I am stuck:
I want to allow the dialog's user to pick a directory. The widget for this
is tkFileDialog.Directory. But when I start the Directory-Window, it is
possible move the
Benjamin James wrote:
> Hello,
>
> I am looking for some advice about Python resources for the Mac OS X
> (Tiger) platform. I have done some googling and found some good stuff
> (Python IDE, MacPython), Just wondering if there is anything I am
> missing.
You might be interested in PyObjC w
->Terry<- wrote:
> To anyone willing to take the time to have a
> look at the code and offer any advice or
> suggestions, I would be much appreciative.
> I'm looking for code suggestions rather than
> game-play suggestions, although I'm open to
> any help.
A couple of notes after a quick look:
-
> To anyone willing to take the time to have a
> look at the code and offer any advice or
> suggestions, I would be much appreciative.
I'm wondering if you can condense this:
if sel1 == 1 and sel2 == 4: # This seems really ugly...
if state[1] == 1:
return 2
el
Benjamin,
> I am looking for some advice about Python resources for the Mac OS X
Can you tell us what background you have?
Are you a MacOS programmer? Have you used Objective C or Java
to build a Mac application for example? Do you already know Cocoa?
There are loads of general MacOS programm
Hello,
I am looking for some advice about Python resources for the Mac OS X
(Tiger) platform. I have done some googling and found some good stuff
(Python IDE, MacPython), Just wondering if there is anything I am
missing. I tried downloading the activestate python tool, but i cant
seem to i
I want to create a property that will inherit it's value from the same
property in it's parent object, but will check it's parent's propety
everytime it is called. But that can be over-ridden, and I don't have
to know what the objects parent is.
For example:
object.x = 3
object.subobject.x = inh
> I went to the language reference which also seems to indicate I should get
> a
> sound with exactly what the author is saying. The exact line is:
>
> print "\a"
Escape characters are terminal settings so you need to be running in a
terminal.
Start up a command window and run the program ther
Haven't look at the code in detail, but it would be great exercise to
write a web gui for this game like the one for Tick-Tack-Toe.
Any suggestions where to start with something like this?
Johan
PS: Fun to play.
->Terry<- wrote:
>-BEGIN PGP SIGNED MESSAGE-
>Hash: SHA1
>
>
>I have writ
> I’m one of the people new to Python who has started going through a
> beginner’s book to learn the basics of the language (“Python
> Programming for the Absolute Beginner”). In the second chapter the
> author (Michael Dawson) illustrates the use of escape sequences with,
> among other things,
72 matches
Mail list logo