-- Forwarded message --
Date: Fri, 7 Apr 2006 21:05:33 -0600
From: Jesse <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Beginner question (variables, namespaces...)
I tried redefining the "higher-order" variables as functions, but it didn't
quite work.
Hi Tutors!
I have a problem that I've solved using Python, and I want to know if
I've done a good job :-)
Here's the problem:
At my work we have a Windows network. On a network drive lives a program
that a couple people need to access (there's a shortcut on each user's
Desktop to the executable).
Kent:
> -Original Message-
> From: Kent Johnson [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 07, 2006 3:59 PM
> To: Carroll, Barry
> Subject: Re: [Tutor] Unittest not running all test cases
>
> Carroll, Barry wrote:
> > Kent:
> >
> > I just rechecked my class names, and there are no du
> > buy_containers = roundup(need/container)
>
>
> Yeah, rather than code these as explicit variables, I'd strongly recommend
> rewriting each of these as functions. Concretely:
>
> def buy_containers(stock, weekly_quota, container):
> return roundup(need(stock, weekly_quota) - extra(stock,
Jesse wrote:
> Why is it that when one variable is assigned a value in terms of
> another variable, assigning a new value to the first doesn't change
> the value of the second? This is giving me a huge headache, since I
> have a bunch of variables defined in terms of one another, and I want
> t
On Fri, 7 Apr 2006, Jesse wrote:
> Why is it that when one variable is assigned a value in terms of another
> variable, assigning a new value to the first doesn't change the value of
> the second?
Hi Jesse,
If you have a "variable" that depends on the values of other parameters,
that's just be
Why is it that when one variable is assigned a value in terms of another variable, assigning a new value to the first doesn't change the value of the second? This is giving me a huge headache, since I have a bunch of variables defined in terms of one another, and I want to be able to dynamically up
Well, thanks very much Kent, Hugo and Danny.
I went with the "never-ending blocking queues" and sentinel data approach.
When running tests with a continual stream of packets being received
3ms apart, CPU usage peaked at 15%, was usually around 7-9%, and when
deployed the packets will separated by
Kent:
I just rechecked my class names, and there are no duplicates. I was
careful to preface all of the classes in testsymc39 with 'C39...', and
used 'S25...' in testsym25. Likewise, the classes in each module have
names that describe the type of data being tested, so names are unique
within eac
Thanks very much all. :) I'll have a crack this afternoon and let you know.
Kent - the increase in the queue size for the socket server is to
allow for any delay in processing packets; it has a default queue size
of 5 and then it starts rejecting packets; more of a safety policy
when reducing CPU
On 7 Apr 2006, [EMAIL PROTECTED] wrote:
> Sorry I didn't make my question clearer. Bascially I
> want to replace this line:
>
> address="64.41.134.60"/>
>
> With:
>
> address="64.41.134.60"/>
>
> So the regex grouping are that I want to keep
> portNumber= and tcpORudp= and replace the values.
>
Carroll, Barry wrote:
> Greetings:
>
> I'm not certain this is the right forum for this question. If not,
please point me to the correct one.
>
> I am using the unittest module to test a package our team is writing.
>
I presently have three modules of test cases and a top level module to
run the
Greetings:
I'm not certain this is the right forum for this question. If not, please
point me to the correct one.
I am using the unittest module to test a package our team is writing. I
presently have three modules of test cases and a top level module to run the
entire suite. The hierarch
On Fri, 7 Apr 2006, Kent Johnson wrote:
> Hugo Gonz�lez Monteverde wrote:
> > You are not using the optional timeout and blocking which 'get' provides (!)
> >
> > Try setting it and see your CPU usage go down. This will implement
> > blocking, and the queue will be used as soon as data is there.
Jerome Jabson wrote:
> Hi Kent,
>
> Sorry I didn't make my question clearer. Bascially I
> want to replace this line:
>
> address="64.41.134.60"/>
>
> With:
>
> address="64.41.134.60"/>
>
> So the regex grouping are that I want to keep
> portNumber= and tcpORudp= and replace the values.
> Wh
Hi Kent,
Sorry I didn't make my question clearer. Bascially I
want to replace this line:
With:
So the regex grouping are that I want to keep
portNumber= and tcpORudp= and replace the values.
Which will be varibles in my code.
The question is more on the string formatting in the
replace. Ho
> Hi,
Hi,
> Can someone explain me function and caller relationship when passing
> arguments?
There is an explanation of this in vitually any tutorial on Python.
Haver you read any of these? Have you any experience in other
languages that we can relate an explanation too?
For example, you co
> My problem now is how do I construct the replace
> statement?
> twork = m_sock.sub('\1 %s \2 %s', % port_num % proto,
> twork)
The format operator takes a tuple:
twork = m_sock.sub('\1 %s \2 %s' % (port_num, proto), twork)
So I removed the comma after the string, used a single percent
operat
Hugo González Monteverde wrote:
> You are not using the optional timeout and blocking which 'get' provides (!)
>
> Try setting it and see your CPU usage go down. This will implement
> blocking, and the queue will be used as soon as data is there.Set
> block
> to True and a timeout if yo
Jerome Jabson wrote:
> Hello,
>
> I'm trying to replace some strings in a line of text,
> using some regex functions. My question is: If there's
> more then one regex grouping I want to replace in one
> line of a file, how can I use the String Formatting
> operator (%s) in two places?
Hi Jerome,
Hello,
I'm trying to replace some strings in a line of text,
using some regex functions. My question is: If there's
more then one regex grouping I want to replace in one
line of a file, how can I use the String Formatting
operator (%s) in two places?
Here's the line it matches in the file:
Her
Carlos Benevides wrote:
> Hi,
>
> Can someone tell me what the r before the expression means, as in
> "re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"?
It is not specific to regular expressions, it is called a raw string.
http://docs.python.org/tut/node5.html
___
josip wrote:
> Can someone explain me function and caller relationship when passing
> arguments?
Hi... what do you mean? Is there something specific you're not getting
if you take a look at:
http://www.ibiblio.org/obp/thinkCSpy/chap03.htm
http://docs.python.org/tut/node6.html#SECTION00660
Liam Clarke wrote:
> Each thread's run() method basically looks like this -
>
> while True:
> try:
> data = self.queue.get(False)
> self.DAO.send_data(data)
> except Empty:
> if self.shutdown:
> pr
On Fri, April 7, 2006 8:23 pm, Carlos Benevides wrote:
> Hi,
>
> Can someone tell me what the r before the expression means, as in
> "re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"?
r is the way of making a string "raw". This means that escape characters
will not be interpreted. Here
Liam Clarke wrote:
> Hi,
>
> I've developed what would be my largest Python app to date. And, going
> from the crude Windows Task Manager, it's trying to use as much CPU
> time as it can get when it's idle.
>
> This, no doub,t is due to my design.
>
> I have an UDP socket server, a packet crunch
Hi,
Can someone tell me what the r before the expression means, as in
"re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"?
I've seen regular expressions both ways, and I've seen them work with or
without the r. Just wondering what it does, or if it makes a difference.
Thanks.
___
Hi, Can someone explain me function and caller relationship when passing arguments? Thanks
How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listin
Hi,
I've developed what would be my largest Python app to date. And, going
from the crude Windows Task Manager, it's trying to use as much CPU
time as it can get when it's idle.
This, no doub,t is due to my design.
I have an UDP socket server, a packet cruncher, and a DAO.
Each resides in it's o
29 matches
Mail list logo