Gary Herron said unto the world upon 30/12/05 08:03 PM:
> newbie wrote:
>
>
>>Hello,
>>
>>I have questions about global variables in OOP (in general) and Python
>>(in specific). I understand (I think) that global variables are
>>generally not a good idea. However, if there are variables that nee
I have a class:
class ServerThreadManager(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
# and a bunch of constructor statements
def run(self):
self.ReqHandlingLoop()
# and a bunch of other methods
ServerObj = ServerThreadManager()
pr
Mark Dickinson wrote:
> Here's a variant of André's brilliant idea that's
> 119 characters long, and fully printable:
>
> j=''.join;seven_seg=lambda z:j(j(' _ | |_ _|_|'
> [ord('^r|=Zm.:v\r'[int(a)])%u*2:][:3]for a in z)
> +"\n"for u in(3,7,8))
You have an escaped CR (\r) as the last character
Mike,
I'm trying to figure out dictionaries using the documentation. Clicking
on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is
that the documentation for the dictionary type? If so, I do not see an
"append" or "add" or "insert" method defined in the list of methods on
that p
[EMAIL PROTECTED] wrote:
> I have a class:
>
> class ServerThreadManager(threading.Thread):
> def __init__(self):
> threading.Thread.__init__(self)
> # and a bunch of constructor statements
>
> def run(self):
> self.ReqHandlingLoop()
>
> # and a bunch of other
Using py2exe, I can convert a GUI Application with PythonCard to a
standalone windows program, and it works.
Then I try another GUI Toolkit named Wax, implement a GUI App, it
works. And I convert that app by py2exe. But this time, when run, it
show a messagebox that says:
"""
This application req
[EMAIL PROTECTED] writes:
> I'm trying to figure out dictionaries using the documentation. Clicking
> on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is
> that the documentation for the dictionary type? If so, I do not see an
> "append" or "add" or "insert" method defined in th
On Fri, 30 Dec 2005 18:56:47 -0800, techiepundit wrote:
> Mike,
>
> I'm trying to figure out dictionaries using the documentation. Clicking
> on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is
> that the documentation for the dictionary type? If so, I do not see an
> "append"
On Fri, 30 Dec 2005 20:00:51 -0500, Mike Meyer wrote:
>> The other way I thought of is to create a separate class that consists
>> of the variables and to use the
>>
>> from import *
>>
>> in all of the files (namespaces) where it is needed.
>
> Except for one detail, this is a Pythonesque meth
> as great as mod_python is, there are lots of restrictions and
> limitations to what youc an do with it because of limitations of apache
> itself, and I am refereing to apache 2.x as well as 1.x, like others
> are saying if you don't need apache specific things it will just be one
> more thing to
if i use the code below to write a list to a file
list = (food, price, store)
data.append(list)
f = open(r"test.txt", 'a')
f.write ( os.linesep.join( list ) )
it outputs to a file like this
apple
.49
star market
and i want it to do
apple, .49. star market
any ideas
--
http://mail.python.or
if i use the code below to write a list to a file
list = (food, price, store)
data.append(list)
f = open(r"test.txt", 'a')
f.write ( os.linesep.join( list ) )
it outputs to a file like this
apple
.49
star market
and i want it to do
apple, .49. star market
any ideas
--
http://mail.python.or
I was playing around with simple memoization and came up with something
like this:
_cache = {}
def func(x):
global _cache
if _cache.has_key(x):
return _cache[x]
else:
result = x+1 # or a time consuming calculation...
_cache[x] = result
return result
w
30 Dec 2005 20:22:52 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> if i use the code below to write a list to a file
>
> list = (food, price, store)
> data.append(list)
> f = open(r"test.txt", 'a')
> f.write ( os.linesep.join( list ) )
>
>
> it outputs to a file like this
>
> apple
> .49
> star m
i want them to be on the same line when they are written to the file.
right now they are written like this:
food
price
store
i want them to be written like this
food price store
how do i do that?
--
http://mail.python.org/mailman/listinfo/python-list
iclinux wrote:
> Using py2exe, I can convert a GUI Application with PythonCard to a
> standalone windows program, and it works.
> Then I try another GUI Toolkit named Wax, implement a GUI App, it
> works. And I convert that app by py2exe. But this time, when run, it
> show a messagebox that says:
30 Dec 2005 20:44:29 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> i want them to be on the same line when they are written to the file.
> right now they are written like this:
>
> food
> price
> store
>
> i want them to be written like this
>
> food price store
>
> how do i do that?
>
>>> prin
On Fri, 30 Dec 2005 20:22:52 -0800, homepricemaps wrote:
> if i use the code below to write a list to a file
>
> list = (food, price, store)
Why are you shadowing the built in type list? This is bad practice. Sooner
or later you will do this:
list = [1, 2, 3]
something = process(list)
... lots
Steven D'Aprano wrote:
> I was playing around with simple memoization and came up with something
> like this:
>
> _cache = {}
> def func(x):
> global _cache
> if _cache.has_key(x):
> return _cache[x]
> else:
> result = x+1 # or a time consuming calculation...
>
Steven D'Aprano wrote:
> I was playing around with simple memoization and came up with something
> like this:
>
> _cache = {}
> def func(x):
> global _cache
> if _cache.has_key(x):
> return _cache[x]
> else:
> result = x+1 # or a time consuming calculation...
>
Steven D'Aprano wrote:
> I was playing around with simple memoization and came up with something
> like this:
>
> _cache = {}
> def func(x):
> global _cache
> if _cache.has_key(x):
> return _cache[x]
> else:
> result = x+1 # or a time consuming calculation...
>
Just a added note,that these routines will access any storage drive
that is mounted under Windows. The Scsi Pass Through layer maps all
Pcmcia,IDE,andSCSI drives to use SCSI commands. This allows a user to
access all these interfaces with a common command set.
Sam Schulenburg
--
http://mail.pyth
never mind i figured out what you were saying,. worked like a
charm!
thanks for your help.
yaffa
--
http://mail.python.org/mailman/listinfo/python-list
Crutcher <[EMAIL PROTECTED]> wrote:
...
> Except that there is some niggling edge case dealing with variables
> which have been marked 'global'. It seems that if a compiled chunk of
> python contains a 'global VAR' statement, anywhere, then that VAR, and
> only that VAR, will bypass the subclass
Does anyone know of a photo gallery implemented in python? Preferably one as featureful as those used at kde-look.org and art.gnome.org?Thank you.
-- As a boy I jumped through Windows, as a man I play with Penguins.
--
http://mail.python.org/mailman/listinfo/python-list
101 - 125 of 125 matches
Mail list logo