I have what I think is a very simple question. I have a Python script
that I found that I want to tweek a little bit. All I want to do is
add in a validator to make sure a value has been keyed into the imput
box.
The code currently is...
while yourguess != mynum:
tries = tries + 1
vinjvinj wrote:
> I'm building an application with cherrypy and have started using
> decorators quite extensively. A lot of my exposed functions look like:
>
> @expose
> @startTransactrionAndBuildPage
> @partOfTabUi(tabId)
> @convert(arg1=int, arg2=str)
> def do_main_page(self, arg1, arg2):
>
How do you prevent getting the following error when you hit the RETURN
key on an empty INPUT prompt from windows?
If I am at the Interactive Window and I type in: input("blah"), I get
an input dialog. If I then hit ENTER w/o keying in a value I get the
following error. WHY
SyntaxError: unex
[EMAIL PROTECTED] wrote:
[...]
> But I would like to change it to be something like
>
> while yourguess != mynum:
>
> tries = tries + 1
> yourguess = input("Your guess? ")
>
> if len(yourguess)==0:
> continue
[...]
> But this throws the following error and I h
That works, thanks. Can you tell me why the differences exist?
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote
> You should always quote enough of the previous poster's message to give
> context. Messages sometimes go missing in Usenet, and people won't have
> the foggiest idea what you are talking about.
one would think that given how many Pythoneers we now have working
for google,
Dennis Lee Bieber wrote:
> On Sat, 11 Mar 2006 13:30:43 +1100, Tim Churches
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > Would it be possible to rename "Cheese Shop" as "Bright Side of Life"?
> >
> I think I'd prefer "The Larch"...
>
> Or just "SPAM" ( Python
In article <[EMAIL PROTECTED]>,
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sat, 11 Mar 2006 13:30:43 +1100, Tim Churches
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > Would it be possible to rename "Cheese Shop" as "Bright Side of Life"?
> >
> I think I'd
Bryan Olson wrote:
> Try "rawinput()" instead.
or, less likely to give a NameError,
raw_input()
--
http://mail.python.org/mailman/listinfo/python-list
Methinks you are confused about the structure of your program.
If we write the program out in plain English in the form of a recipe,
it should look something like this:
1. Get input.
2. Check to see if they guessed right.
3. If not, go back to 1.
This structure hints at an infinite loop. The bre
On Sat, 11 Mar 2006 01:05:48 -0800, ctilly wrote:
> That works, thanks. Can you tell me why the differences exist?
For those who have just joined us, "that" is using raw_input() instead of
input().
I don't know why input() is the equivalent of eval(raw_input(prompt)), but
it is. Presumably Guid
Folks,
I'm running into the following issue. A staticmethod of a class seems
not to be accepted as a special class method of the class object
itself. For example:
class Foo(object):
def __len__(): return 2
__len__ = staticmethod(__len__)
print len(Foo)
>>>
Traceback (most recent c
Steven D'Aprano wrote:
> I don't know why input() is the equivalent of eval(raw_input(prompt)), but
> it is. Presumably Guido thought it was a good idea at the time.
possibly inspired by ABC's "READ" and "READ RAW" commands:
http://homepages.cwi.nl/~steven/abc/qr.html
--
http://mail.py
Warby wrote:
> ...and I forgot to mention that the output of grep and diff is far more
> understandable in the absence of block comments!
Which is why people do this /anyway/. (Kind of makes block comments
pointless, doesn't it?
/* This is a
* really
* really
* long
* block comment */
--
h
I use python in Windows XP platform. I find that if I write a .py file
in a directory, such as windows desktop, in which a file named
'ticket.txt' is located:
f=open("\ticket.txt")
print f.read()
In IDLE, this py file work all right. But if I launch python
interpretor in the command shell like th
BartlebyScrivener wrote:
> Gau,
>
> This prints the names of the columns in my database.
>
> # Modification of
> # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/389535
> # Instructions for customizing are at:
> # http://www.egenix.com/files/python/mxODBC.html
>
> import mx.ODBC.Windows
Lonnie Princehouse wrote:
> You really want to use the value calculated for the i_th term in the
> (i+1)th term's evaluation.
It may sometimes be necessary to recalculate the average for every iteration
to avoid error accumulation. Another tradeoff with your optimization is
that it becomes har
I use python on Windows XP platform. I find that if I write a .py file
in a directory, such as windows desktop, in which a file named
'ticket.txt' is located:
f=open("ticket.txt")
print f.read()
In IDLE, this py file work all right. But if I launch python
interpretor in the command shell like th
"Sullivan WxPyQtKinter" wrote:
> I use python in Windows XP platform. I find that if I write a .py file
> in a directory, such as windows desktop, in which a file named
> 'ticket.txt' is located:
>
> f=open("\ticket.txt")
> print f.read()
"\t" is a tab character:
>>> print '\ticket.txt'
Sorry, I mistyped the line. In the program it IS:
f=open("ticket.txt"), no '\' included.
--
http://mail.python.org/mailman/listinfo/python-list
On 10 Mar 2006 21:12:57 -0800
[EMAIL PROTECTED] wrote:
> How can I put multiple condition in if statement?
> I try this, but I can't get that to work.
>
> if ( (str != " ") && (str != "") ):
if s!=' ' and s!='':
1) logical operators are words
2) don't overload standard type names
this is actual
[EMAIL PROTECTED] wrote:
> How do you prevent getting the following error when you hit the RETURN
> key on an empty INPUT prompt from windows?
>
> If I am at the Interactive Window and I type in: input("blah"), I get
> an input dialog. If I then hit ENTER w/o keying in a value I get the
> followi
[EMAIL PROTECTED] wrote:
> class Foo(object):
> def __len__(): return 2
> __len__ = staticmethod(__len__)
> print len(Foo)
> >>>
> Traceback (most recent call last):
> File "C:/Dokumente und Einstellungen/All Users/Dokumente/foo.py",
> line 4, in ?
> print len(Foo)
> TypeErro
"Sullivan WxPyQtKinter" wrote:
> In IDLE, this py file work all right. But if I launch python
> interpretor in the command shell like this:
>
>
> C:\Documents and Settings\Xiaozhong Zheng>python "C:\Documents and
> Settings\Xiaozhong Zheng\Desktop\t.py"
>
> The interpretor would not find the file.
Hi,
First some introduction, my name is Bertrand Mansion, I am still
learning Python and I am new to this list. I have been developping
websites since 1995 and I use PHP since 1999. I have been contributing
to open source projects in the PHP and Apple Objective-C Cocoa
framework community. I studi
Steven D'Aprano wrote:
> On Fri, 10 Mar 2006 15:13:07 +0100, robert wrote:
>
>
>>Hello,
>>
>>I want to put (incrementally) changed/new files from a big file tree
>>"directly,compressed and password-only-encrypted" to a remote backup
>>server incrementally via FTP,SFTP or DAV At best within
In very rare cases a program crashes (hard to reproduce) :
* several threads work on an object tree with dict's etc. in it. Items
are added, deleted, iteration over .keys() ... ). The threads are "good"
in such terms, that this core data structure is changed only by atomic
operations, so that t
Tim Churches wrote:
> Would it be possible to rename "Cheese Shop" as "Bright Side of Life"?
Well, you could replay the conversation I gave as an example elsewhere
to see if it sounds ridiculous or not, but what we've encountered here
is the problem of whether something should be given a distincti
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
> Is a copy.deepcopy ( -> "cPickle.dump(copy.deepcopy(obj),f)" ) an
> atomic opertion with a guarantee to not fail?
>
> Or can I only retry several times in case of RuntimeError? (which would
> apears to me as odd gambling; retry how often?)
For an intermediate solution, I'm playing roulette
robert wrote:
>
>> Is a copy.deepcopy ( -> "cPickle.dump(copy.deepcopy(obj),f)" ) an
>> atomic opertion with a guarantee to not fail?
>>
>> Or can I only retry several times in case of RuntimeError? (which
>> would apears to me as odd gambling; retry how often?)
>
>
> For an intermediate so
Em Sáb, 2006-03-11 às 12:49 +0100, robert escreveu:
> Meanwhile I think this is a bug of cPickle.dump: It should use .keys()
> instead of free iteration internally, when pickling elementary dicts.
> I'd file a bug if no objection.
AFAICS, it's a problem with your code. You should lock your objec
On Sat, 11 Mar 2006 11:46:24 +0100, robert wrote:
>> Sounds like a job for any number of already existing technologies, like
>> rsync (which, by the way, already uses ssh for the encrypted transmission
>> of data).
>
> As far as I know, rsync cannot update compressed+encrypted into an
> existing
my question is as title!
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
"ygao" wrote:
> my question is as title!
my answer as code:
>>> s = "g"
>>> t = ""
>>> s[0:0+len(t)] == t
True
>>> s[1:1+len(t)] == t
True
--
http://mail.python.org/mailman/listinfo/python-list
Blackbird wrote:
> By "cargo cult programming", do you mean actually *running* the code?
no, I mean basing your mental model of something on distant observations
of superficial (or accidental) artifacts (like the perceived similarity between
the output from repr() and the raw string literal synta
On Sat, 11 Mar 2006 13:37:05 +0100, Fredrik Lundh wrote:
> "ygao" wrote:
>
>> my question is as title!
>
> my answer as code:
>
s = "g"
t = ""
s[0:0+len(t)] == t
> True
s[1:1+len(t)] == t
> True
Or in other words, imagine that Python is walking the string looking to
match
I see. I once was a VB programmer. In VB, the current directory is
always set to where the module locates before it runs.
--
http://mail.python.org/mailman/listinfo/python-list
robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:
[cut]
I don't know what's your code like, but a similar error occurred in some of
my software and it was my fault indeed. I think you should either use a
lock, or implement a deepcopy method of your own.
--
EleSSa
Paul Boddie wrote:
> Tim Churches wrote:
> > Would it be possible to rename "Cheese Shop" as "Bright Side of Life"?
>
> Well, you could replay the conversation I gave as an example elsewhere
> to see if it sounds ridiculous or not, but what we've encountered here
> is the problem of whether someth
I see. I once was a VB programmer. In VB, the current directory is
always set to where the module locates before it runs.
--
http://mail.python.org/mailman/listinfo/python-list
> Huh? You think a competent sys admin can't learn enough Python to hack
> your pickled file?
>
> Binary configs only keep out legitimate users who don't have the time or
> ability to learn how to hack the binary format. Black hats and power users
> will break your binary format and hack them anywa
* Bertrand Mansion (2006-03-11 10:23 +)
> I will go straight to the point, I don't like the new Python.org
> website.
Well, I like it.
> I didn't like the old one neither.
Yeah, the old one was a mess.
> The new one is not better nor worse than the old one, it's just a
> different shell. Bu
>> Why is the first uglier than the second?
YES THATS THE POINT. PYTHON CAN BE USED JUST LIKE A CONFIG FILE.
and if your users did
timeout = "300"
instead of
timeout = 300
then either your config parser must be uber-smart and all-knowing, and
check the types of key-value pairs, or your server wou
In article <[EMAIL PROTECTED]>,
"Jonathan Gardner" <[EMAIL PROTECTED]> wrote:
> Warby wrote:
> > ...and I forgot to mention that the output of grep and diff is far more
> > understandable in the absence of block comments!
>
> Which is why people do this /anyway/. (Kind of makes block comments
>
On 3/11/06, Thorsten Kampe <[EMAIL PROTECTED]> wrote:
> There have recently been threads here about the website. Maybe the
> discussion there gives you some information needed:
>
> *
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/f4c1585fe379d8ad/11fd0062787e374c?tvc=2&q=g
Michal Kwiatkowski a écrit :
> Bruno Desthuilliers napisał(a):
>
>>>Let me understand it clearly. If I change __class__ of an object,
>>>existing attributes (so methods as well) of an object are still
>>>accessible the same way and don't change its values. Only resolution of
>>>attributes/methods
Bertrand> 1. Who is maintaining python.org ?
Start with mail to [EMAIL PROTECTED]
Bertrand> 2. Where is the site code/design available ?
It's in Subversion. Start here:
http://psf.pollenation.net/
Bertrand> 3. Is the last redesign a solo or a community effort ?
Small communi
Steven D'Aprano wrote:
> Let me see if I understand you.
>
> On the remote machine, you have one large file, which is compressed and
> encrypted. Call the large file "Archive". Archive is made up of a number
> of virtual files, call them A, B, ... Z. Think of Archive as a compressed
> and encryp
"gangesmaster" wrote:
> > Binary configs only keep out legitimate users who don't have the time or
> > ability to learn how to hack the binary format. Black hats and power users
> > will break your binary format and hack them anyway.
>
> then you dont know what pickle is. pickle code is NOT python
Felipe Almeida Lessa wrote:
> Em Sáb, 2006-03-11 às 12:49 +0100, robert escreveu:
>
>>Meanwhile I think this is a bug of cPickle.dump: It should use .keys()
>>instead of free iteration internally, when pickling elementary dicts.
>>I'd file a bug if no objection.
>
>
> AFAICS, it's a problem w
[EMAIL PROTECTED] a écrit :
> Hi,
>
> How can I put multiple condition in if statement?
With "and"s and "or"s.
>
> I try this, but I can't get that to work.
>
> if ( (str != " ") && (str != "") ):
FWIW, I would not hope a type to be equal to a string !-)
> Any help is appreciated.
"doesn'
EleSSaR^ wrote:
> robert si è profuso/a a scrivere su comp.lang.python tutte queste
> elucubrazioni:
>
> [cut]
>
> I don't know what's your code like, but a similar error occurred in some of
> my software and it was my fault indeed. I think you should either use a
> lock, or implement a deepcop
Alan Franzoni wrote:
> FLTK was interesting but seems to lack maintenance and support,
Looking at the News section of the project's home page, I can see
that updates were few and far between in 2004 and 2005, but the
action seems to have picked up again since:
http://pyfltk.sourceforge.net/#ne
gangesmaster wrote:
>>Huh? You think a competent sys admin can't learn enough Python to hack
>>your pickled file?
>>
>>Binary configs only keep out legitimate users who don't have the time or
>>ability to learn how to hack the binary format. Black hats and power users
>>will break your binary forma
gangesmaster enlightened us with:
> YES THATS THE POINT. PYTHON CAN BE USED JUST LIKE A CONFIG FILE.
AND CAN ALSO BE MISUSED AND HARDER TO USE THAN A SIMPLE CONFIG FILE.
Get it into your thick head that you're plain wrong here.
Sybren
--
The problem with the world is stupidity. Not saying there
"gangesmaster" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> aah. you all are too stupid.
-1 QOTW.
--
rzed
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 11 Mar 2006 16:09:22 +0100, robert wrote:
>> Lastly, have you considered that your attempted solution is completely the
>> wrong way to solve the problem? If you explain _what_ you are wanting to
>> do, rather than _how_ you want to do it, perhaps there is a better way.
>
> So, there seem
On Sat, 11 Mar 2006 05:49:38 -0800, gangesmaster wrote:
>>> Why is the first uglier than the second?
> YES THATS THE POINT. PYTHON CAN BE USED JUST LIKE A CONFIG FILE.
>
> and if your users did
> timeout = "300"
> instead of
> timeout = 300
>
> then either your config parser must be uber-smart a
http://www.python.org/community/pycon/dc2004 seems to have vanished...
--
http://mail.python.org/mailman/listinfo/python-list
I wouldn't want to sound like I'm criticizing other people's work.
To those who offered their time to create this site, which is quite an
improvement over the old one, thank you!
However, I like the idea of a contest. Both for the site and for the
logo.
Perhaps something cool could come up from th
> > YES THATS THE POINT. PYTHON CAN BE USED JUST LIKE A CONFIG FILE.
>
> AND CAN ALSO BE MISUSED AND HARDER TO USE THAN A SIMPLE CONFIG FILE.
> Get it into your thick head that you're plain wrong here.
comp.lang.python sure isn't what it used to be :-(
--
http://mail.python.org/mailman/listi
Can someone post a link or email me an image of the old Python logo?
I'd like to save a copy of it, I rather liked it - very retro.
--
http://mail.python.org/mailman/listinfo/python-list
"Spinchange" wrote:
> Can someone post a link or email me an image of the old Python logo?
> I'd like to save a copy of it, I rather liked it - very retro.
the dot matrix logo ?
you can get a copy from this page:
http://pydotorg.dyndns.org:8000/PythonOrg.html
--
http://mail.python.org
For the same reason as
>>> "".count("")
1
>>> "ab".count("")
3
This is counting slice positions, which is one more that the length of the
string.
--
http://mail.python.org/mailman/listinfo/python-list
Em Sáb, 2006-03-11 às 04:25 -0800, ygao escreveu:
> my question is as title!
> thanks!
Forget it. Just look:
$ python2.4 -mtimeit '"g".count("")'
100 loops, best of 3: 0.516 usec per loop
$ python2.4 -mtimeit 'len("g")+1'
100 loops, best of 3: 0.26 usec per loop
--
"Quem excele em empr
Steven D'Aprano wrote:
> On Sat, 11 Mar 2006 16:09:22 +0100, robert wrote:
>
>
>>>Lastly, have you considered that your attempted solution is completely the
>>>wrong way to solve the problem? If you explain _what_ you are wanting to
>>>do, rather than _how_ you want to do it, perhaps there is a
robert <[EMAIL PROTECTED]> wrote:
...
> 99.99% no. I would have to use a lock everywhere, where I add or remove
> something into a dict or list of the struct. Thats not the purpose of
> big thread locks. Such simple operations are already atomic by the
> definition of Python - and thanks to the
Just wrote:
> In article <[EMAIL PROTECTED]>,
> Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>> On Sat, 11 Mar 2006 13:30:43 +1100, Tim Churches
>> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>>> Would it be possible to rename "Cheese Shop" as "Bright Side of Life"?
>> I
I've only been goofing around with Python for about a month now, but
already I am in love.
I never get that feeling -- so common with Java -- that I'm swimming
upstream, struggling to force the language to do what I want.
Python makes it feel effortless and easy.
--
http://mail.python.org/mailman
Andrew> http://www.python.org/community/pycon/dc2004 seems to have
Andrew> vanished...
Andrew,
Try here:
http://us.pycon.org/zope/original/pycon/pastevents/dc2004
I found it by going to http://www.python.org/community/pycon/ then clicking
the 2004 link in the Past Conferences secti
I like cheeseshop just fine, but have been a Monty Python fan since
they appeared on the CBC in, I think, 1969. I'm one of those people who
is always surprised when a MP bon mot is greeted with confusion and the
suspicion that I have finally lost my mind altogether. So...
If we are moving to the s
Hi All,
Wondering if a tool exists to generate "cross reference" documentation
for Python code bases?
Particularly after something like phpxref -
http://phpxref.sourceforge.net/ : written in Perl, scans a bunch of
PHP scripts and generates HTML output that allows you to see all the
classes / meth
Hallöchen!
"Michael Tobis" <[EMAIL PROTECTED]> writes:
> [...]
>
> Pythons build no nests. Their eggs are found in coils. coil.python.org
> ?
Better eggs.python.org. Would support the spread of the new file
format, too.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
I'm confused ... and need some advice
Here is what I want to do:
I have a number of files, mostly text files formatted using Markdown
syntax but also pdfs and other types of files, that are stored in a
folder hierarchy and I want to develop a web application where I can
brows, view and search the
On Mar 11, 2006, at 11:21 AM, Peter Otten wrote:
> Am Freitag, 10. März 2006 19:38 schrieben Sie:
>
item = mylist.pop(random.randint(0,len(mylist)))
>>>
>>> This is broken because randint(a, b) may return b.
>>> I prefer randrange(len(mylist)) over randint(0, len(mylist)-1) as
>>> a fix.
>
Luis M. González wrote:
> I wouldn't want to sound like I'm criticizing other people's work.
> To those who offered their time to create this site, which is quite an
> improvement over the old one, thank you!
>
> However, I like the idea of a contest. Both for the site and for the
> logo.
> Perhap
Terry Reedy wrote:
> "P Boy" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>> Has anyone yet written a program to grab C struct declaration from the
>>> .h
>>> to produce code like
>>>
>>> # Overlay configuration
>>> class OverlayStoreConfig(ctypes.Structure):
>>> _fields_ =
> Try here:
>
> http://us.pycon.org/zope/original/pycon/pastevents/dc2004
>
I see summaries of the paper, but when I follow the link for the papers
themselves, it leads to the same dead end.
--
http://mail.python.org/mailman/listinfo/python-list
Luis M. González wrote:
> I wouldn't want to sound like I'm criticizing other people's work.
> To those who offered their time to create this site, which is quite an
> improvement over the old one, thank you!
>
> However, I like the idea of a contest. Both for the site and for the
> logo.
> Perhap
On Sat, 11 Mar 2006 12:00:26 -0600,
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I believe the plan is to move most/all the PyCon-related stuff to the
> pycon.org domain, though I'm not certain about that.
No, that's not the plan. The PSF doesn't own the domain, and I want
the data to
On Sat, 11 Mar 2006 16:50:26 +1100,
richard <[EMAIL PROTECTED]> wrote:
> So I did what people always do in this situation, I asked Barry Warsaw to
> name. it. And he did, "Cheese Shop". I liked the name, so it was done. When
> the new pydotorg machines went live last year, so too did the n
<[EMAIL PROTECTED]> wrote:
> Sorry for responding to my own post.
>
> I think I understand the original statement now. What you are really
> saying is that there is a pool of Python float objects (which can, at
> different times, wrap different values) which can grow but never
> decrease in size
In article <[EMAIL PROTECTED]>,
Alex Martelli <[EMAIL PROTECTED]> wrote:
><[EMAIL PROTECTED]> wrote:
>>
>> I think I understand the original statement now. What you are really
>> saying is that there is a pool of Python float objects (which can, at
>> different times, wrap different values) which
On 3/11/06, Steve Holden <[EMAIL PROTECTED]> wrote:
> "A competition" sounds like a wonderful idea, but suppose there were to
> be one, and a winner were to be declared, where do we go from there to
> get the winning design up on a server behind www.python.org?
That's not the problem IMO.
Before
Alex Martelli napisał(a):
> First, let's forget legacy-style classes, existing only for backwards
> compatibility, and focus on new-style ones exclusively -- never use
> legacy classes if you can avoid that.
Ok, let's cover only new-style classes in our discussion.
I've read your comments and am
Harry Fuecks wrote:
> Hi All,
>
> Wondering if a tool exists to generate "cross reference" documentation
> for Python code bases?
>
> Particularly after something like phpxref -
> http://phpxref.sourceforge.net/ : written in Perl, scans a bunch of
> PHP scripts and generates HTML output that allo
Hi there,
Jumping until blue a écrit :
> I have a number of files, mostly text files formatted using Markdown
> syntax but also pdfs and other types of files, that are stored in a
> folder hierarchy and I want to develop a web application where I can
> brows, view and search these files. The docu
Bertrand Mansion wrote:
> On 3/11/06, Steve Holden <[EMAIL PROTECTED]> wrote:
>
> > "A competition" sounds like a wonderful idea, but suppose there were to
> > be one, and a winner were to be declared, where do we go from there to
> > get the winning design up on a server behind www.python.org?
>
Hi. I'm reworking a little app I wrote, in order to separate the data
from the UI. As a start, I wanted to create a iron-clad data recepticle
that will hold all the important values, and stand up to being queried
by various sources, perhaps concurrently. In all likelihood, the app
will never need a
I think a logo contest is a good idea, and I am already working on my
entry.
I could also imagine a stylesheet contest.
The issue is who does the judging and what are the criteria.
Steve, what you say is true. Possibly people who are experienced in
making a six page site for their aunt's caterin
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote:
> class C(object):
> __dict__ = {}
>
> obj = C()
> obj.a = 7
> obj.__dict__ = {}
> print object.__getattribute__(obj, '__dict__')
> print object.__getattribute__(C, '__dict__')
> print obj.a # => 7 !!!
>
> First print returns "{}" and the second
robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:
> own deepcopy: thus, do you already know if the existing deepcopy has the
> same problem as cPickle.dump ?(as the problem araises rarely, it is
> difficult for me to test it out)
I don't know the exact specs
robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:
[cut]
P.S.
I'm very bad at threaded programming. Please verify any of my suggestions
^_^
--
EleSSaR^ <[EMAIL PROTECTED]>
--
Togli .xyz dalla mia email per contattarmi.
--
http://mail.python.org/mailman/listinfo/
When debugging using 'print' statement, I usually want to print some
important values together with the function name as the context of the
values printed out. So my hope is that I could get the name of the
function.
Since every function object actually has a private __name__ attribute
that gives
There's nothing really *broken* jumping out at me. The last three
methods (set_value, set_data, and clear_data) probably don't need a
mutex, since they will each have their own frame, and the operations
are atomic. If that makes no sense, Google for "Python GIL" ;). If you
just returned a value fro
mwt enlightened us with:
> I'm reworking a little app I wrote, in order to separate the data
> from the UI.
Good idea.
> As a start, I wanted to create a iron-clad data recepticle that will
> hold all the important values, and stand up to being queried by
> various sources, perhaps concurrently.
On 11 Mar 2006 11:52:35 -0800, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> Em, why not IYO? Because you will implement it however advanced the
> design might be as part of your Python exercises?
Look at the current code, there is nothing to implement. Most of the
work to be done is related to prese
A.M. Kuchling wrote:
> On Sat, 11 Mar 2006 16:50:26 +1100,
> richard <[EMAIL PROTECTED]> wrote:
>> So I did what people always do in this situation, I asked Barry Warsaw to
>> name. it. And he did, "Cheese Shop". I liked the name, so it was done. When
>> the new pydotorg machines went live l
Sullivan WxPyQtKinter wrote:
> So how
> could I refer to the function object per se, in the body of the
> function itself?
>
>
I don't believe you can easily get at the function object, but you can get
at the code object which also has a name (which will be the same as the
function's name unles
1 - 100 of 156 matches
Mail list logo