I just ran into a curious behavior with small floating points, trying to find
the limits of them on my machine (XP). Does anyone know why the '0.0' is
showing up for one case below but not for the other? According to my tests, the
smallest representable float on my machine is much smaller than 1
Hi Danny,
Thanks for the advice.
> It might be interesting to write a function that takes an arbitrary
> directory, and returns 'True' if that directory is a bottom-level
> directory. Can you write this function?
I've got this:
---
def isBottomDir(path):
for item in os.listdir(path):
On Wed, 8 Feb 2006, Simon Gerber wrote:
> I watch many different TV shows on my PC, as many of us do. But I am
> sick and tired of forgetting which episode I was up to. So, in a
> prodigious effort to avoid ever using, say, a pen, I am working on a
> script to take over some of my brain's memory
G'day Tutors,
I watch many different TV shows on my PC, as many of us do. But I am
sick and tired of forgetting which episode I was up to. So, in a
prodigious effort to avoid ever using, say, a pen, I am working on a
script to take over some of my brain's memory handling. When complete,
I will si
On Tue, 7 Feb 2006, guy wrote:
> I am in the QA field, and am learning Java as well in school but must QA
> jobs today require one to know some scripting language. I do know SQL (Using
> MySQL) and have writing small starting python and java scripts like
> calc.py/java and other print statements
On Tue, 07 Feb 2006 06:02:45 -0500
Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> One way to make this code thread-safe is to use a threading.Condition()
> instead of a boolean variable:
>
> thread 1 does:
>
> self.lock.acquire()
> if condition:
> self.name = 'bob'
> else:
Hello,
My name is Guy and I live in San Francisco, I would like to learn python
ASAP and am looking for a tutor.
I know there are many sites out there that can help me self learn it but I
am out of a job and it looks like if I learn Python as a scripting language
I could speed up the process :-)
I
You might also want to have a look at DABO; I don't know how well it
work on a handheld, though.
http://dabodev.com/about
Matt
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Tue, 7 Feb 2006, Christopher Spears wrote:
> I get it! Have printFood return a string!
>
> def printFood(self):
> return self.food.foodName
Yup. *grin*
Do one more thing though: call the function something other than
'printFood' now, since it clearly isn't doing any printing
I get it! Have printFood return a string!
def printFood(self):
return self.food.foodName
Now I don't get the weird output anymore!
-Chris
--- Danny Yoo <[EMAIL PROTECTED]> wrote:
>
> Hi Chris,
>
> I'm going to be a little insidous and bring some
> ideas from the textbook
> "
Hey Chris, check out this version.
class Food:
def __init__(self, name):
self.name = name
class Customer:
def __init__(self,name):
self.name = name
self.food = None # 0 is for numbers
def placeOrder(self, foodName, employee):
print "%s: Hi %s!" %
Hi Chris,
I'm going to be a little insidous and bring some ideas from the textbook
"How to Design Programs." (http://htdp.org)
Let's annotate each interesting method with what the method expects to
take in, and what it expects to return.
> def placeOrder(self, foodName, employee):
We c
Here is some code I wrote:
class Food:
def __init__(self, name):
Food.foodName = name
class Customer:
def __init__(self,name):
Customer.name = name
Customer.food = 0
def placeOrder(self, foodName, employee):
p
Yeah, looking over it right now as a point of fact.
thanks. Looks like exactly what i need.
cheers
shawn
On Tue, 2006-02-07 at 10:43 -0800, Danny Yoo wrote:
>
> > from the docs, the byte stream is supposed to look like this:
> >
> [problem cut]
> >
> > so. how do i make 200 occupy 4 bytes ?
> from the docs, the byte stream is supposed to look like this:
>
[problem cut]
>
> so. how do i make 200 occupy 4 bytes ?
Hi Nephish,
Have you had a chance to look at the 'struct' module yet?
http://www.python.org/doc/lib/module-struct.html
__
On Tue, 7 Feb 2006, josip wrote:
> I can't solve this, someone please help.
Since this is a homework problem, we're limited in what we can say here.
Can you simplify the problem a bit? Can you write a program that asks for
stars, and just prints out that many stars? That is, ignore for now
In article <[EMAIL PROTECTED]>,
Christopher Spears <[EMAIL PROTECTED]> wrote:
> When I run the program, I get the following error [snip]
The simple mechanical error is that when you're substituting more than
one value, you need to wrap the value list in parens:
print "%s, I want, %s plea
On Tue, 7 Feb 2006, Paul Kraus wrote:
> Anyone know where I can find information about how to embedd mysql into
> a python application. I need my hand held. I have worked with mysql a
> lot. I understand how to use python to manipulate a mysql database. What
> I want to know is how to embedded a
Christopher Spears wrote:
> I'm working on a program where a Customer orders Food
> from an Employee. Here is what I have so far:
>
> class Food:
> def __init__(self, name):
> Food.foodName = name
>
what you want here is 'self.name = name' then in your code later you can do:
Hi to all,
Whenever I try to install python 2.2 and later on Win. 2000
It never properly sets up on the compter. I usually only get
the command section but the IDE never shows up.
Maybe somebody has an idea or a tip as to what`s going on
here.
Cheers Gil
Hi, I am learning Python trought one course. I can't solve this, someone please help. Write a loop that prints 20 characters on the screen. Always 20. But it is made up of stars (*), which are printed first, and exclamation marks (!) that complete the line. Your program will first ask the use
ok, i am stuck again.
from the docs, the byte stream is supposed to look like this:
'S' 'T' 'X' [length indicator] [message type] [message] 'E' 'N' 'X'
the length indicator it says is a four byte integer number of a value N
( N would be how long the message body is )
the message ty
I'm working on a program where a Customer orders Food
from an Employee. Here is what I have so far:
class Food:
def __init__(self, name):
Food.foodName = name
class Customer:
def __init__(self,name):
Customer.name = name
def placeOrder(self
Anyone know where I can find information about how to embedd mysql into a
python application. I need my hand held. I have worked with mysql a lot. I
understand how to use python to manipulate a mysql database. What I want to
know is how to embedded a database into my application.
--
Paul Kraus
Hi Kent,
To answer your first concern, not all changes need to be intercepted
by one the child thread. I have not given out all the details about
the program, but if the parent thread gets certain values from the
database, it will take actions that may affect the child thread other
than just by se
Liam Clarke wrote:
> On 2/7/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
>>Liam Clarke wrote:
>>
>>>Hi all,
>>>
>>>About to embark on my first foray into threading, and rather unsure of
>>>initial approach. I have a basic UDPServer from SocketServer running
>>>using serve_forever(). I'd like to s
Bernard Lebel wrote:
> Hi Kent,
>
> I have put together a little script to give a rough idea about what
> the program does.
>
> http://www.bernardlebel.com/scripts/nonxsi/help/bl_threadtest.py
In this code, there is no guarantee that callMeWhenAttributeChanged()
will see every change to oBernar
Michael Lange wrote:
> I have used a boolean to control access to a variable that is used by two
> threads,
> as in this example:
>
> thread 1 does:
>
> while self.locked:
> pass
> self.locked = 1
> if condition:
> self.name = 'bob'
> else:
> self.name = '
On Mon, 06 Feb 2006 18:34:18 -0500
Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> It sounds like you have some attributes that you are using as flags to
> allow one thread to control another. There are definitely some pitfalls
> here. You probably want to use threading.Condition or Queue.Queue to
29 matches
Mail list logo