On Tue, 14 Jun 2005 12:49:27 +0200, Peter Maas <[EMAIL PROTECTED]>
wrote:
> > Depends if you wanna build or investigate.
>
>Learning is investigating.
Yeah, after thinking to this phrase I've to agree.
Sometimes learning is investigating, sometimes it's
building. Since I discovered programming I'
Hope someone can help with a problem I'm having.
A python program I wrote terminates with the following traceback.
*** start traceback ***
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.4/atexit.py", line 22, in _run_exitfuncs
func(*targs, **kargs)
Hello.,
Does the python compiler provide an option to generate a .pyo(optimized byte
code file) from a .py (source file)?
For generating .pyc I know that I only have to pass the source file name as
an argument to py_compile.py.
But for generating .pyo, I could not find anything.
Any clues/help w
I think using __new__ when a plain old factory method would
work is horrible. But I am not saying that there no use cases for
__new__. I used it once, when I wanted a class working
for the final user as a factory function. I just wrote the class in
lower case and gave it a custom __new__ method.
The automatic reply to this e-mail which you should have
received in response to your e-mail to [EMAIL PROTECTED] has not been defined.
Please contact [EMAIL PROTECTED] for assistance.
--
http://mail.python.org/mailman/listinfo/python-list
Quoth "John Roth" <[EMAIL PROTECTED]>:
...
| str() should be something that's meaningful to a human being when
| it's printed or otherwise rendered.
I can't believe how many people cite this explanation - meaningful,
friendly, pretty to a human being. What on earth does this mean,
that couldn't b
Yes, factory methods, exactly. If I had a base class ImageReader with
children JpegReader and TIFFReader, I will probably add two factory
methods ImageReader.makeJpegReader and ImageReader.makeTIFFReader, I
will not override ImageReader.__new__
to return sometimes JpegReader instances and sometimes
Terry Hancock wrote:
> Of course, since children are vastly better at learning
> than adults, perhaps adults are stupid to do this. ;-)
Take learning a language. I'm learning Swedish. I'll
never have a native accent and 6 year olds know more
of the language than I do. But I make much more
compl
Eduardo Biano wrote:
> def foo(request):
> ans01 = request.get_form_var("ans01")
> if ans01 == 4:
> ans_1 = 1
> return ans_1
ans01 will be a string ("4"), not an int (4).
--
http://mail.python.org/mailman/listinfo/python-list
Hello, I am sending this out again in hopes that someone will
have some meaningful comments on FSM (finite state machine)
modules avaliable for Python. Hope to get a reply or two
this time. Thanks.
Leonard J. Reder wrote:
I have been searching on the web for a specific Python
implementation of
Hi,
I have a problem making conditional testing (if) of a
form variable "ans01"(refer generated error). When the
form variable is tested (if) by a called function
(foo) the value of "ans01" is not properly
represented.
def foo(request):
ans01 = request.get_form_var("ans01")
if ans01 =
Leif K-Brooks wrote:
> Mark Harrison wrote:
>
>>What is the best way to process a text file of delimited strings?
>>I've got a file where strings are quoted with at-signs, @like [EMAIL
>>PROTECTED]
>>At-signs in the string are represented as doubled @@.
>
>
import re
_at_re = re.compile
Well everything was working in this mail sending script until. . .this:
Traceback (most recent call last):
File "mailvar.py", line 27, in ?
sendToMe(subject, body)
File "mailvar.py", line 8, in sendToMe
send(me, me, subject, body)
File "mailvar.py", line 16, in send
msg = MIMEText(bod
I tried the first part and works like a charm. I will read the post
you cited.
Thanks,
--
John
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any UML tools that is able to take UML and generate Python codes?
Cheers
Maurice
--
http://mail.python.org/mailman/listinfo/python-list
Cappy2112 wrote:
> This is great, but it might be worth finding out what the other IDE's
> can do first, as well as their weaknesses.
>
> Eric3 seems to be the most popular & powerfull. Uop until recentluy, it
> onluy works on Linux, but has been compiled & runnin on Windows, to
> some degree of s
Robert Kern wrote:
> Marc 'BlackJack' Rintsch wrote:
>>It's fast enough to open the file and read the meta-data. The OP wants to
>>decode the actual pixels.
>
> Okay.
>
> In [12]: %time d = img.getdata()
> CPU times: user 0.31 s, sys: 1.43 s, total: 1.73 s
> Wall time: 6.19
And for comparison:
What do you mean by decode the pixels? If there's some image
processing that needs to be done, or if you want to view, brighten, or
print or something, then there are ways of doing it that will be as
fast as can be. If stepping through the pixels to do your own math
is what you want, then maybe
On Thu, 16 Jun 2005 09:36:56 +1000, John Machin wrote:
>> like this ?
>
> No, not like that. The OP said that an embedded @ was doubled.
you are right, sorry :)
anyway, if @@ -> @
an empty field map to what ?
--
http://mail.python.org/mailman/listinfo/python-list
Mark -
Let me weigh in with a pyparsing entry to your puzzle. It wont be
blazingly fast, but at least it will give you another data point in
your comparison of approaches. Note that the parser can do the
string-to-int conversion for you during the parsing pass.
If @rv@ and @pv@ are record type
Mark Harrison wrote:
> What is the best way to process a text file of delimited strings?
> I've got a file where strings are quoted with at-signs, @like [EMAIL
> PROTECTED]
> At-signs in the string are represented as doubled @@.
>>> import re
>>> _at_re = re.compile('(?>> def split_at_line(line):
Ok, I finally got it working! I just did these two commands:
$export mysqlclient=mysqlclient
$export mysqlstatic=True
Thanks for all the help everyone.
-Greg
On 6/14/05, Gregory Piñero <[EMAIL PROTECTED]> wrote:
> One other note, the few searches I've made that seem somewhat relevant
> talk a
John Heasly wrote:
> Given:
> [{"mugshot": "nw_gradspeaker4_0608", "width": 67.0, "height": 96.0}, \
> {"mugshot": "nw_gradspeaker2_0608", "width": 67.0, "height": 96.0}, \
> {"freehand": "b1.developreport.0614", "width": 154.0, "height":
> 210.0}, \
> {"graphic": "bz_cafep
Consider reading this post. It highlights how to do what you want:
http://mail.python.org/pipermail/python-win32/2002-April/000322.html
Chad
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
John Henry
Sent: Wednesday, June 15, 2005 3:21 PM
To: python-list@
I am trying to get & set the properties of a widget's parent widget.
What I have works, but seems like a long way around the block. First I
get the widget name using w.winfo_parent(), then i convert the name to a
reference using nametowidget().
self.nametowidget(event.widget.winfo_parent())
The first part is easy. I will have to think about the second part. To
find an opened copy of Word and switch focus to it do the following:
from win32com.client import Dispatch
word = Dispatch('Word.Application')
wdWindowStateNormal = 0
if len(word.Documents):
word.Activate()
if word.WindowSta
Paul McNett <[EMAIL PROTECTED]> wrote:
> Mark Harrison wrote:
> > What is the best way to process a text file of delimited strings?
> > I've got a file where strings are quoted with at-signs, @like [EMAIL
> > PROTECTED]
> > At-signs in the string are represented as doubled @@.
>
> Have you taken
Nicola Mingotti wrote:
> On Wed, 15 Jun 2005 23:03:55 +, Mark Harrison wrote:
>
>
>>What's the most efficient way to process this? Failing all
>>else I will split the string into characters and use a FSM,
>>but it seems that's not very pythonesqe.
>
>
> like this ?
No, not like that. The
Mark Harrison wrote:
> What is the best way to process a text file of delimited strings?
> I've got a file where strings are quoted with at-signs, @like [EMAIL
> PROTECTED]
> At-signs in the string are represented as doubled @@.
>
> What's the most efficient way to process this? Failing all
> el
On Wed, 15 Jun 2005 23:03:55 +, Mark Harrison wrote:
> What's the most efficient way to process this? Failing all
> else I will split the string into characters and use a FSM,
> but it seems that's not very pythonesqe.
like this ?
>>> s = "@[EMAIL PROTECTED]@@[EMAIL PROTECTED]"
>>> s.split
On 15 Jun 2005 14:13:09 -0700, chris <[EMAIL PROTECTED]> wrote:
> We have a number of TestCase classes that have multiple test methods.
> We are interested in removing any of the individual test methods on the
> fly (dynamically, at runtime, whatever).
Here's a simple approach imitating NUnit's Ca
You could use regular expressions... it's an FSM of some kind but it's
faster *g*
check this snippet out:
def mysplit(s):
pattern = '((?:"[^"]*")|(?:[^ ]+))'
tmp = re.split(pattern, s)
res = [ifelse(i[0] in ('"',"'"), lambda:i[1:-1], lambda:i) for i in
tmp if i.strip()]
Nicolas Fleury wrote:
> Ron Adam wrote:
>
>> It occurred to me (a few weeks ago while trying to find the best way
>> to form a if-elif-else block, that on a very general level, an 'also'
>> statement might be useful. So I was wondering what others would think
>> of it.
>
> But the feature i
Mark Harrison wrote:
> What is the best way to process a text file of delimited strings?
> I've got a file where strings are quoted with at-signs, @like [EMAIL
> PROTECTED]
> At-signs in the string are represented as doubled @@.
Have you taken a look at the csv module yet? No guarantees, but it m
What is the best way to process a text file of delimited strings?
I've got a file where strings are quoted with at-signs, @like [EMAIL PROTECTED]
At-signs in the string are represented as doubled @@.
What's the most efficient way to process this? Failing all
else I will split the string into char
Terry Hancock wrote:
> On Wednesday 15 June 2005 03:57 am, Fredrik Lundh wrote:
>
>>where your "abnormal behaviour" is, of course, the expected
>>behaviour. if you insist on looking at things the wrong way,
>>things will look reversed.
>
> Unfortunately, the converse is true, too: no matter how
Hi Jeff,
Thanks for your help. Although I haven't confirmed this, I think you
just hit my nail on the head. I thought os.system was like a totally
separate process though, i.e nothing is shared. not the usual fork()
call within the program.
Regards,
Huy
Jeff Epler wrote:
> When using os.syst
Ron Adam wrote:
> It occurred to me (a few weeks ago while trying to find the best way to
> form a if-elif-else block, that on a very general level, an 'also'
> statement might be useful. So I was wondering what others would think
> of it.
But the feature is already there:
for x in :
BLO
Does anybody know how to find an opened copy of Word and switch focus
to it, wait until Word is closed, before continuing my Python script?
I tried to search for the answer from Google and nothing stands out.
Running under Windows XP.
Thanks,
--
John
--
http://mail.python.org/mailman/listinfo/
> > Oh well, I guess it's a bit late to try to rename the Computer
> > Science discipline now.
> The best I've heard is "Informatics" -- I have a vague impression
> that this is a more European name for the field.
The word "Informatics" had been invented by a Soviet computer scientist
Andrey Ersh
We have a number of TestCase classes that have multiple test methods.
We are interested in removing any of the individual test methods on the
fly (dynamically, at runtime, whatever).
We currently have an "isSupported" method in the TestCase classes that
return a bool by which the greater test harn
"Jan Danielsson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sorry, but I Just Don't Get It. I did search the 'net, I did read the
> FAQ, but I'm too dumb to understand.
>
> As far as I can gather, __str__ is just a representation of the
> object. For instance:
>
> class Serv
Terry Hancock ha scritto:
>
> It's the reverse-translation from the French "Informatique".
Or maybe the italian Informatica...
--
Renato
Usi Fedora? Fai un salto da noi:
http://www.fedoraitalia.org
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
> "Plants consume CO2 and make O2"
>
> Well, yes, but they also consume O2, just like animals. *On balance*,
> the statement is *usually* true. But most plants would probably
> die in a pure-CO2 environment (unless they can drive the atmosphere
> to a better composition fas
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Robert Kern
> wrote:
>
>>PyPK wrote:
>>
>>>One reason why I don't want to use PIL is it seems very slow for tiff
>>>images of very large sizes(2400x4800). So I am looking for a better
>>>tool than does the right job faster.
>>
>>This isn't
In <[EMAIL PROTECTED]>, Robert Kern
wrote:
> PyPK wrote:
>> One reason why I don't want to use PIL is it seems very slow for tiff
>> images of very large sizes(2400x4800). So I am looking for a better
>> tool than does the right job faster.
>
> This isn't fast enough?
>
> In [8]: %time img2 = Im
I will be out of the office on June 16, to return on June 17. I will reply to
your message at that time.
Catherine Kostyn
Transportation Planner
Indianapolis MPO
200 E. Washington St., Ste. 1821
Indianapolis, IN 46204
(317)327-5142
--
http://mail.python.org/mailman/listinfo/python-list
Lothat <[EMAIL PROTECTED]> wrote:
> No test with or without any " let the IIS execute python scrits as cgi.
> Http Error code is 404 (but i'm sure that the file exists in the
> requested path).
Have you checked the security restrictions? IIS6 has a new feature
whereby script mappings are disabled
Terry Hancock <[EMAIL PROTECTED]> wrote:
> is the statement "Viruses are made of DNA" true, or false?
False. Viruses were made of Word macros :-)
--
http://mail.python.org/mailman/listinfo/python-list
Jan Danielsson wrote:
> Sorry, but I Just Don't Get It. I did search the 'net, I did read the
> FAQ, but I'm too dumb to understand.
Say we define a string "s" as follows:
>>> s = 'hello'
If we print "s", we see its string form (__str__):
>>> print s
hello
However, if we just examine "s",
Hello All,
I'm relatively new to Python programming but have been working on this
problem for a little bit now ... I initially began writing UNIX scripts
in Python and thought it was the greatest because I could do the
following very easily :
pswwaux = os.popen( "ps wwaux | grep /usr/sbin/httpd"
Peter Otten wrote:
> Change the above function to
>
> def callback(text=text):
> self.pressed(text)
argh!
--
http://mail.python.org/mailman/listinfo/python-list
Jp Calderone wrote:
> On Wed, 15 Jun 2005 16:38:32 +0100, Robin Becker <[EMAIL PROTECTED]> wrote:
>
>>Michael Hoffman wrote:
>>.
>>
>>>Well, you could use python -u:
>>>
>>
>>unfortunately this is in a detached process and I am just reopening stdout
>>as an ordinary file so another process can
Fredrik Lundh wrote:
> Ron Adam wrote:
>
>
>>So the (my) confusion comes from the tendency to look at it in terms of
>>overall program flow rather than in terms of the specific conditional
>>logic.
>>
>>In a for loop the normal, as in terminating normally, behavior of a loop
>>is one where the lo
On Wednesday 15 June 2005 08:06 am, Sébastien Boisgérault wrote:
> Jan Danielsson a écrit :
> >However, I don't understand what __repr__ should be.
> It is an *exact* (if possible) description of the object's content,
> nicely packaged into a string.
However, this is often not the case. Freque
Fredrik Lundh wrote:
> note that you're assigning all buttons to the same instance variable, so
> even if the above did work, it would always return a plus.
>
> since the command callback doesn't know what widget it was called
> from, you need to create a separate callback for each widget. here'
On Wednesday 15 June 2005 03:57 am, Fredrik Lundh wrote:
> where your "abnormal behaviour" is, of course, the expected
> behaviour. if you insist on looking at things the wrong way,
> things will look reversed.
Unfortunately, the converse is true, too: no matter how twisted
an idea is, you can ma
> Yes, both the sun and the moon have gravitational fields which affect
> tides. But the moon's gravitational field is much stronger than the
sun's,
> so as a first-order approximation, we can ignore the sun.
Here we are experiencing further small lie which found its way
into a text written by a
Meeting Tonight!
Python Interest Group In Princeton (PIGIP -- http://www.pigip.org)
PIGIP will hold its sixth meeting on Wednesday June 15, 2005 at the
Lawrenceville Library. We don't have a formal topic, but Jon will
show off using Archetypes in Plone for easy content managemen
This is great, but it might be worth finding out what the other IDE's
can do first, as well as their weaknesses.
Eric3 seems to be the most popular & powerfull. Uop until recentluy, it
onluy works on Linux, but has been compiled & runnin on Windows, to
some degree of success.
QTDesigner is pretty
On Wednesday 15 June 2005 05:13 am, Peter Hansen wrote:
> I also see nothing to suggest that if the moon and the sun were removed
> from the picture, there would be much in the way of tides at all. (The
> page you quoted says the sun has about 46% the effect of the moon which,
> if true, means
Many thanks Jeff!!!
This is what should be in the TK docs. Your example was very clear.
And now I've learned some new stuff... :)
For my project, I needed to add three pieces of data per link like
this:
text.insert(Tkinter.END, "link", ("a", "href:"+href,"another:This Is
More Data", "last:and one
On Tuesday 14 June 2005 08:12 am, Magnus Lycka wrote:
> Oh well, I guess it's a bit late to try to rename the Computer
> Science discipline now.
Computer programming is a trade skill, not a science. It's like
being a machinist or a carpenter --- a practical art.
Unfortunately, our society has a v
(Sorry for that other post of mine. I don't know what went wrong)
Don't get me wrong - your project is pretty interesting and you can
certainly get valuable experience from it - but to be better than the
competition you need to be better than the competition.
--
http://mail.python.org/mailman/li
On Tuesday 14 June 2005 10:21 am, Scott David Daniels wrote:
> > Oh well, I guess it's a bit late to try to rename the Computer
> > Science discipline now.
> The best I've heard is "Informatics" -- I have a vague impression
> that this is a more European name for the field.
It's the reverse-transl
root wrote:
> Hello all
>
> I am currently developing a new WYSIWYG RAD tool for python.
> There are screenshots and a small video demo on the site.
> Please visit at http://www.geocities.com/visualfltk
>
> Cheers
> JMan
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday 14 June 2005 02:12 pm, Andrew Dalke wrote:
> Teaching kids is different than teaching adults. The
> latter can often take bigger steps and start from a
> sound understanding of logical and intuitive thought.
> "Simple" for an adult is different than for a child.
Of course, since childr
Gurus,
I am still doing my baby steps in the wonderful world of python (so
far, so good).
However, I am quite familiar with sockets. There is a socket option
called
SO_REUSEADDR that your server should call to fix this problem.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Thanks for all the help guys... I'm a bit confused as to the inner
> workings of the Tkinter system (I'm both a Python and a GUI n00b). I was
> hoping that by slapping the x on button python was doing some cool
> dynamic variable creation (i.e. creating 9 variables with
In article <[EMAIL PROTECTED]>,
Jan Danielsson <[EMAIL PROTECTED]> wrote:
> Sorry, but I Just Don't Get It. I did search the 'net, I did read the
> FAQ, but I'm too dumb to understand.
>
>As far as I can gather, __str__ is just a representation of the
> object.
No, it is not. It is a con
Paul McGuire wrote:
> Be careful, Kent. You may get tagged as "the new pyparsing guy." :)
Yeah, I was a little surprised I beat you to that one :-)
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Based on the location where the user clicked, you can find the
associated tags. Then you must loop through them to find the one that
gives the "href" value.
Jeff
:r /tmp/link.py
import Tkinter
app = Tkinter.Tk()
text = Tkinter.Text(app)
text.pack()
def click(event):
#this doesn't work
Sibylle Koczian wrote:
> David Van Mosselbeen schrieb:
>>
>> Thanks for support.
>> I have read the refered page you show above. I try some piece of code
>> that im have copy and paste it into a blank file that i give the name
>> "ip_adress.py" to test it.
>>
>>
>> THE SOURCE CODE :
>>
Irmen de Jong wrote:
> Patrick Down wrote:
>> My understanding is that the upcoming Civilization IV will have python
>> scripting.
>>
>
> Also, alledgedly the new BattleField II uses Python in a way...
> because I heard that you had to comment out a certain line
> in a certain .py file to remove
I've been hacking around this for a few days and have gotten close to
what I want... but not quite...
The TKinter Docs provide this example:
# configure text tag
text.tag_config("a", foreground="blue", underline=1)
text.tag_bind("a", "", show_hand_cursor)
text.tag_bind("a", "", sho
Title: Tkinter Question
Thanks for all the help guys… I'm a bit confused as to the inner workings of the Tkinter system (I'm both a Python and a GUI n00b). I was hoping that by slapping the x on button python was doing some cool dynamic variable creation (i.e. creating 9 variables with 1 loop
huy wrote:
> Hi,
>
> I'm using cherrypy to provide a user interface for users to start a
> linux server program eg. os.system("nohup myserver.py &"). The problem
> is that if I stop cherrypy server and restart, I get the "Address
> Already In Use" problem until I stop myserver.py. Can someone s
On Wed, 15 Jun 2005 16:38:32 +0100, Robin Becker <[EMAIL PROTECTED]> wrote:
>Michael Hoffman wrote:
>.
>>
>> Well, you could use python -u:
>>
>
>unfortunately this is in a detached process and I am just reopening stdout
>as an ordinary file so another process can do tail -F on it. I imagine th
Thanks, Chad. That works.
--
John
--
http://mail.python.org/mailman/listinfo/python-list
Jan Danielsson wrote:
> Sorry, but I Just Don't Get It. I did search the 'net, I did read the
> FAQ, but I'm too dumb to understand.
>
> As far as I can gather, __str__ is just a representation of the
> object. [snip]
> However, I don't understand what __repr__ should be.
__repr__ shouldn't b
Michael Hoffman wrote:
.
>
> Well, you could use python -u:
>
unfortunately this is in a detached process and I am just reopening stdout
as an ordinary file so another process can do tail -F on it. I imagine ther
ought to be an os dependant way to set the file as unbuffered, but can't
reme
Be careful, Kent. You may get tagged as "the new pyparsing guy." :)
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
Yah! Finally, I got the thing to work. Here is how I did it.
/* import the module that holds the base class */
PyObject *base_module = PyImport_ImportModule("module_name");
if (!base_module) return;
/* get a pointer to the base class */
PyObject *base_class = PyMapping_GetItemString(
Threee related announcements :
rest2web - latest update adds support for multiple translations
firedrop2 - new documentation and updated reST support
textmacros - the textmacros module is now available separrately, useful
for systems like docutils
First of all my all new `Firedrop2 Section`__ [
Riccardo Galli wrote (approximately):
> I need a class to behave as a factory method for its children so that I could
> inherit
> from it and still use it as a factory.
Several others suggest you probably don't want to do this; I concur.
Separating the factory from the interface (I presume you
Robin Becker wrote:
> I recently tried to create a line flushing version of sys.stdout using
>
> class LineFlusherFile(file):
> def write(self,s):
> file.write(self,s)
> if '\n' in s:
> self.flush()
>
> but it seems that an 'optimization' prevents the overriden wri
Uzytkownik "Philippe C. Martin" <[EMAIL PROTECTED]> napisal w
wiadomosci news:[EMAIL PROTECTED]
> app = MyApp(False)
> app.MainLoop()
>
> will keep wxWidgets from using its own window.
>
>
that's it ! Thanks a lot :)
--
http://mail.python.org/mailman/listinfo/python-list
Returning instances of some other class is not so horrible. They're
called FactoryMethods usually.
An example is when you have a polymorphic tree of image file reader
objects, and you open an image file, it might return a JpegReader
which ISA ImageReader or a TIFFReader which also ISA ImageReader
[Michele Simionato]
> Having a class that returns instances of some other class is horrible,
> [...] don't do it!
Unusual, granted. Horrible, why?
I found useful, sometimes, (ab)using Python syntax for representing data
having more or less complex structure. More than once, it spared me the
tr
I recently tried to create a line flushing version of sys.stdout using
class LineFlusherFile(file):
def write(self,s):
file.write(self,s)
if '\n' in s:
self.flush()
but it seems that an 'optimization' prevents the overriden write method from
being used. I had
Basically __repr__ should return a string representaion of the object,
and __str__ should return a user-friendly pretty string. So maybe:
class Person:
...
def __repr__(self):
return '' % (self.name, self.age, self.sign)
def __str__(self):
return self.name
See this for a bett
Riccardo Galli wrote:
> Hi all.
> It's easier if I show an example first.
>
> Say I have
>
> class A(object):
> def speak(self): print 'A!'
>
> class B(object):
> def speak(self): print 'B!'
>
> I also have a factory function like this.
>
> def foo(kind,*args,**kwds):
>if kind=='a'
Well, It means that eval(repr(x)) == x if at all possible.
Basically:
repr('abc') -> 'abc'
str('abc') -> abc
You'll notice that 'abc' is a valid python expression for the string,
while abc is not a valid string expression.
Andreas
On Wed, Jun 15, 2005 at 02:46:04PM +0200, Jan Danielsson wrote:
>
Errata:
>>> str(0.1)
'0.1'
>>> str("it's a bad idea")
"it's a bad idea"
>>> repr(0.1)
' 0.10001'
>>> repr("it's a bad idea")
'"it\'s a bad idea"'
SB
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> Roy Smith wrote:
> > Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> >
> > >High and low tides aren't caused by the moon.
> >
> >
> > They're not???
>
> Nope. They are mostly caused by the continents. If the
> Earth was completely covered by ocean, th
Jan Danielsson a écrit :
> Sorry, but I Just Don't Get It. I did search the 'net, I did read the
> FAQ, but I'm too dumb to understand.
>
>As far as I can gather, __str__ is just a representation of the
> object.
... yep, and this representation is built for human eyes. Don't
worry too much if
Sorry, but I Just Don't Get It. I did search the 'net, I did read the
FAQ, but I'm too dumb to understand.
As far as I can gather, __str__ is just a representation of the
object. For instance:
class ServerConnection:
def __str__(self):
buf = "Server: " + self.name + "\n"
buf +
When using os.system(), files that are open in the parent are available
in the child, as you can see here in Linux' listing of the files open by
the child program:
[EMAIL PROTECTED] jepler]$ python -c 'f = open("/tmp/test", "w"); print
f.fileno(); import os; os.system("ls -l /proc/self/fd")'
3
to
On Wed, 15 Jun 2005 10:27:19 +0100, James <[EMAIL PROTECTED]> wrote:
>If you're thinking of things like superstrings, loop quantum gravity
>and other "theories of everything" then your friend has gotten
>confused somewhere.
More likely I was the one that didn't understand. Reading
what wikipedia
[EMAIL PROTECTED] wrote:
> I'm sure there must be a way to do this, but I can't figure it out for
> the life of me... I'm writing a program where I would like to use a
> button's text field as part of an if statement. I set up my button like
> this:
>
> i = [ "7", "8","9", "/", "4", "5", "6", "*"
1 - 100 of 119 matches
Mail list logo