Hello List
I need to use pylibpcap. I am looking for any documentation at all,
tutorial would be nice.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
e challenge is that I only care about the first four digits of the keyfor the purpose of this match - is there a way to express this? I couldprobably create a wrapper dictionary using just the first four digits ofthe key as they key, and containing the original key:value pair as alist within it, but that s
> ... is the decoding code, it does what you
> describe below. It is adding the zeros back in, that
> is the dst.append('\0')
>
> Kent
Really??? I am a noob, but it looks like it only puts
a \0 at the end if code (the length) is less than 255,
as the if statement is out of the for loop? thi
-- Forwarded message --
Date: Thu, 6 Oct 2005 22:07:50 -0700 (PDT)
From: Mike Cheponis <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Simple Tkinter question
On Thu, 6 Oct 2005, Danny Yoo wrote:
>> from Tkinter import *
>> from time import *
>>
>> def
On Thu, 6 Oct 2005, Mike Cheponis wrote:
> I'm trying to update an Entry's textvariable several times within my
> Button handler, like so:
>
> from Tkinter import *
> from time import *
>
> def my_update():
>for i in range(3):
> tv.set("Now it's %d"%i)
> sleep(1)
>
> root=Tk()
> tv
On Thu, 6 Oct 2005, William O'Higgins Witteman wrote:
> I'm trying to traverse a dictionary looking for partial matches of the
> key, and I'm not sure how. Here's a sample dictionary:
>
> dict = {1234 : value1, 20051234 : value2, 20071234 : value3}
>
> Here's what I'm trying to do:
>
> for
I'm trying to update an Entry's textvariable several times within my Button
handler, like so:
from Tkinter import *
from time import *
def my_update():
for i in range(3):
tv.set("Now it's %d"%i)
sleep(1)
root=Tk()
tv=StringVar()
Entry(textvariable=tv).pack()
tv.set("Initial Value o
William O'Higgins Witteman wrote:
> I'm trying to traverse a dictionary looking for partial matches of the
> key, and I'm not sure how. Here's a sample dictionary:
>
> dict = {1234 : value1, 20051234 : value2, 20071234 : value3}
>
> Here's what I'm trying to do:
>
> for key in dict:
> i
Daniel Watkins wrote:
> Recently, there has been an example of someone importing modules within
> a class definition. eg:
>
> class Exemplar:
> import re
> ...use re...
>
> It seems obvious to me that this is incorrect, though more through
> training than actual observation on my part
I'm trying to traverse a dictionary looking for partial matches of the
key, and I'm not sure how. Here's a sample dictionary:
dict = {1234 : value1, 20051234 : value2, 20071234 : value3}
Here's what I'm trying to do:
for key in dict:
if key == or key == 2005:
do som
> I've just double checked what happens when running the contents of that
> page, and it works as expected (here at least), so I suspect the problems
> you're seeing are simply due to "code being in HTML" issues.
Yeah I was writing as much as I was able on my own rather than
copying/pasting the co
On Friday 07 October 2005 00:13, R. Alan Monroe wrote:
...
> I can see in Pythonwin's debugger that p.boxes['outbox'] fills up with
> the hundred or so messages intended for display, but they never get
> displayed. I suspect an indentation problem, but I can't spot it, even
> stepping through in th
Recently, there has been an example of someone importing modules within
a class definition. eg:
class Exemplar:
import re
...use re...
It seems obvious to me that this is incorrect, though more through
training than actual observation on my part, and it should be:
import re
clas
>> I can see in Pythonwin's debugger that p.boxes['outbox'] fills up with
>> the hundred or so messages intended for display, but they never get
>> displayed. I suspect an indentation problem, but I can't spot it, even
>> stepping through in the debugger.
> I made exactly the same mistake! You hav
R. Alan Monroe wrote:
> I was working through their tutorial:
>
>
>>* http://kamaelia.sourceforge.net/MiniAxon/
>
>
> Chapter 5 claims the output should be:
> Hello World 2
> Hello World 3
> ...
> Hello World 97
> Hello World 98
>
> But mine outputs only:
> Hello World 2
> (no further outp
I was working through their tutorial:
> * http://kamaelia.sourceforge.net/MiniAxon/
Chapter 5 claims the output should be:
Hello World 2
Hello World 3
...
Hello World 97
Hello World 98
But mine outputs only:
Hello World 2
(no further output)
I can see in Pythonwin's debugger that p.boxes['o
Hans Dushanthakumar wrote:
> print outputs the string to the std output (sys.stdout). You could
> redirect the std output to a file instead of the screen as follows, but
> it's a bit clumsy.
>
> TCL provides a more handy way of doing this:
> print $fptr "Hi there"
In Python you can say
print
DUH.. I found the answer
mytest = [name for name in test]
Thanks again..
> > The above four lines could be replaced with a single list comprehension
> > if you like: baseObjectList = [ TPROJ(name) for name in baseList if
> > nameCheck(name) ]
> > http://www.amk.ca/python/2.0/index.html#SEC
> The above four lines could be replaced with a single list comprehension if
> you like: baseObjectList = [ TPROJ(name) for name in baseList if
> nameCheck(name) ]
> http://www.amk.ca/python/2.0/index.html#SECTION00060
>
> Kent
>
BOOOM
Let me pick up my skull fr
print outputs the string to the std output (sys.stdout). You could
redirect the std output to a file instead of the screen as follows, but
it's a bit clumsy.
fptr = open("hans.log", "a+")
import sys
sys.stdout = fptr
print "Hi there"
This will output the string into the file hans.log. However, t
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am going to 'play' with this in IDLE. I have used your tutorial posted on
the Net. Good stuff!!
Thanks for breaking this down into different examples.
You are a great instructor.
From: Danny Yoo <[EMAIL PROTECTED]>
To: Tutor
CC: [EMAIL PROTECTED]
Subject: Re: [Tutor] still not getting 'it'
Eric Walker wrote:
> On Thursday 06 October 2005 12:48 pm, Kent Johnson wrote
> yes, I did remove this from the class. I really didn't need it in there. I
> moved the check outside under the main running function. To check the name
> before I even create the object. The way I had it before it wo
> No the question doesn't seem to simple at all, I appreciate your help. I
> have totally confused myself and I need to start from the beginning to
> sort things out. Thanks for you time and help.
>
> >>>double = 2 * 5
> >>>print 'The sum of 2 times 5 equals', double
> The sum of 2 times 5 equals
On Thursday 06 October 2005 12:48 pm, Kent Johnson wrote
> > class TPROJ:
> > import re
> > import string
>
> Common usage is to put all the imports at the top of the module. There are
> circumstances where you will put them inside a function but not in this
> case.
I moved them all to the
Hi Rosalee,
[Keeping tutor in the conversation. Please make sure you're using the
"Reply-to-All" feature of your email client.]
I'll respond to the message once it reaches the mailing list.
-- Forwarded message --
Date: Thu, 06 Oct 2005 11:49:44 -0700
From: Rosalee Dubberly <[E
Eric Walker wrote:
> Sorry Kent,
> In my haste to just simulate I did make the example with syntax errors. Let
> me
> try this again and I guess your teaching me how to use this mailing list the
> correct way also.
Yes.
> Ok this is the actual code. I am able to get it to run
> from the co
Hi Eric,
Quick comment on the last part of your program:
> try:
> getProjectNames()
> except:
> print "Got an Error"
Don't do that. *grin*
This is considered a misuse of exceptions. As a concrete example, say
that we have a buggy program like this:
##
>>> def showDivisions(n):
Sorry Kent,
In my haste to just simulate I did make the example with syntax errors. Let me
try this again and I guess your teaching me how to use this mailing list the
correct way also. Ok this is the actual code. I am able to get it to run
from the command line.
Thanks kent for your patience
Eric Walker wrote:
> Kent,
> Where I think my problem maybe in how I am running this. I want to eventually
> run from the command line. I started python idle from my linux command line
> and I was cut and pasting from my text file and seeing things work. Now i
> want to run it from the command l
Its working now. the moving of the function outside of the class allows me to
run it from the command line.
Thanks
On Thursday 06 October 2005 11:56 am, Eric Walker wrote:
> Kent,
> I made a correction the func1 I moved out of the class definition since it
> wasn't really a method. so it should
Kent,
Where I think my problem maybe in how I am running this. I want to eventually
run from the command line. I started python idle from my linux command line
and I was cut and pasting from my text file and seeing things work. Now i
want to run it from the command line and its complaining. in m
Eric Walker wrote:
> I have a class I am defining and then I call a function within that class.
> Getting error that function call is not defined. Does the function have to be
> created anywhere within a class or does it have to be defined before the call
> within the class.
Actual code and the
I have a class I am defining and then I call a function within that class.
Getting error that function call is not defined. Does the function have to be
created anywhere within a class or does it have to be defined before the call
within the class.
--
Eric Walker
EDA/CAD Engineer
Work: 208-36
Please take me off of your mailing list.[EMAIL PROTECTED] wrote:
Send Tutor mailing list submissions totutor@python.orgTo subscribe or unsubscribe via the World Wide Web, visithttp://mail.python.org/mailman/listinfo/tutoror, via email, send a message with subject or body 'help' to[EMAIL PROTECTED]Y
Steve Haley wrote:
> A
> couple of folks also mentioned a book, Beginning Python: From Novice to
> Professional. I think I might try that.
There are many good beginner's resources, both on-line and print. Here are a
couple of good lists:
http://wiki.python.org/moin/BeginnersGuide/NonProgrammer
> Hmm, just have to say something about the old days when
> 'carriage return' and 'line feed' really meant something :-)
Yep, and on a teleype were two physically separate keys!
Alan G
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mail
On Wed, 5 Oct 2005, Rosalee Dubberly wrote:
> I am having problems with changing the parameters in my second function.
> I want the second function to run the same as the first, but take
> different parameters. What am I doing wrong
Hi Rosalee,
[First, make sure you're subscribed to Tutor;
38 matches
Mail list logo