The module string has a function called translate. I tried to find the
source code for that function. In:
C:\Python24\Lib
there is one file called
string.py
I open it and it says
"""A collection of string operations (most are no longer used).
Warning: most of the code you see here isn
On Sat, 19 Nov 2005 23:30:32 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] writes:
>> Thanks Diez and Peter,
>> Just what I was looking for. In "Library Reference" heading
>> 3.11.1 Types and members
>> Running this yields the result
>>
>> cap(s, n)
>
>You've now got three so
On Sun, 20 Nov 2005 03:36:43 GMT, james t kirk <[EMAIL PROTECTED]> wrote:
>I'm writing a wrapper class to handle the line merging and filtering
>for a log file analysis app
>
>The problem I'm running into is that the StopIteration exception
>raised when the wrapped file goes past EOF isn't causing
Peter Hansen <[EMAIL PROTECTED]> writes:
> Steven D'Aprano wrote:
>> Dealing with numeric literals with lots of digits is
>> a real (if not earth-shattering) human interface problem: it is hard for
>> people to parse long numeric strings.
>
> I'm totally unconvinced that this _is_ a real problem,
On Sun, 20 Nov 2005 16:10:58 +1100, Steven D'Aprano wrote:
> def get_line(filename, token):
> """Returns the next line following a token, or None if not found.
> Leading and trailing whitespace is ignored when looking for
> the token.
> """
> fp = file(filename, "r")
> for
On Sun, 20 Nov 2005 12:28:07 +0800, Xiao Jianfeng wrote:
> Let me introduce my problem I came across last night first.
>
> I need to read a file(which may be small or very big) and to check line
> by line
> to find a specific token, then the data on the next line will be what I
> want.
>
>
Xiao Jianfeng wrote:
> Steven D'Aprano wrote:
>
>
>>On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote:
>>
>>
>>
>>
>>>I have some other questions:
>>>
>>>when "fh" will be closed?
>>>
>>>
>>
>>When all references to the file are no longer in scope:
>>
>>def handle_file(name):
>> fp =
Christian Convey <[EMAIL PROTECTED]> writes:
> I've got a program that (ideally) perpetually monitors sys.stdin for
> lines of text. As soon as a line comes in, my program takes some
> action.
> The problem is, it seems like a very large amount of data must
> accumulate on sys.stdin before even my
On Sat, 19 Nov 2005 22:51:04 -0500, Mike Meyer wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>> Brackets include:
>>
>> parentheses or round brackets ( )
>> square brackets [ ]
>> braces or curly brackets { }
>> chevrons or angle brackets â© âª
>>
>> The symbols for chevrons are not avail
Roy Smith <[EMAIL PROTECTED]> writes:
> Mike Meyer <[EMAIL PROTECTED]> wrote:
>> I've seen at least one language (forget which one) that allowed such
>> separators, but only for groups of three.
> That seems a bit silly. Not all numbers are naturally split into groups of
> three. Credit card num
Christian Convey wrote:
> Hello,
>
> I've got a program that (ideally) perpetually monitors sys.stdin for
> lines of text. As soon as a line comes in, my program takes some
> action.
>
> The problem is, it seems like a very large amount of data must
> accumulate on sys.stdin before even my first
[EMAIL PROTECTED] writes:
> Thanks Diez and Peter,
> Just what I was looking for. In "Library Reference" heading
> 3.11.1 Types and members
> Running this yields the result
>
> cap(s, n)
You've now got three solutions. They'll work fine most of the time,
but can't be trusted in general. Bindin
Gustav Hållberg wrote:
> I tried finding a discussion around adding the possibility to have
> optional underscores inside numbers in Python. This is a popular option
> available in several "competing" scripting langauges, that I would love
> to see in Python.
>
> Examples:
> 1_234_567
> 0xdead_
Steven D'Aprano wrote:
>On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote:
>
>
>
>> I have some other questions:
>>
>> when "fh" will be closed?
>>
>>
>
>When all references to the file are no longer in scope:
>
>def handle_file(name):
>fp = file(name, "r")
># reference to file
james t kirk wrote:
> I'm writing a wrapper class to handle the line merging and filtering
> for a log file analysis app
>
> The problem I'm running into is that the StopIteration exception
> raised when the wrapped file goes past EOF isn't causing the second
> for loop to stop.
Admiral Kirk,
The
[EMAIL PROTECTED] writes:
> I've seen this construct in a script
[x.capitalize() for x in ['a','b', 'c']]
> ['A', 'B', 'C']
> I tried to find a description of this in "Library Reference" but
> couldn't find it. Could somebody direct me where this type of construct
> is described.
As others ha
Mike Meyer <[EMAIL PROTECTED]> wrote:
> I've seen at least one language (forget which one) that allowed such
> separators, but only for groups of three.
That seems a bit silly. Not all numbers are naturally split into groups of
three. Credit card numbers are (typically) split into groups of fou
Hello,
I've got a program that (ideally) perpetually monitors sys.stdin for
lines of text. As soon as a line comes in, my program takes some
action.
The problem is, it seems like a very large amount of data must
accumulate on sys.stdin before even my first invocation of readline()
returns. This
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Sat, 19 Nov 2005 13:08:57 -0500, Peter Hansen wrote:
>> Umm... in other words, "the underscore is under-used so let's assign
>> some arbitrary meaning to it" (to make the language more like Perl
>> perhaps?).
>
> +1
>
> I *really* don't like the id
On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote:
> I have some other questions:
>
> when "fh" will be closed?
When all references to the file are no longer in scope:
def handle_file(name):
fp = file(name, "r")
# reference to file now in scope
do_stuff(fp)
return fp
f
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Brackets include:
>
> parentheses or round brackets ( )
> square brackets [ ]
> braces or curly brackets { }
> chevrons or angle brackets â© âª
>
> The symbols for chevrons are not available on common keyboards, are not
> available in ordinary ASCII,
hi, does anyone know of a library that can query domain registry or any
site that provide information to such an activity? as i want to build a
simple domain name searching program for my own benefit.. thanks alot :D
--
http://mail.python.org/mailman/listinfo/python-list
Decorate any function with @aboutme(), which
will print the function name each time the function is called.
All the 'hello' stuff is in the aboutme() decorator code.
There is no code in the decorated functions themselves
doing anything to telling us the function name.
# The decorator
def aboutme
I'm writing a wrapper class to handle the line merging and filtering
for a log file analysis app
The problem I'm running into is that the StopIteration exception
raised when the wrapped file goes past EOF isn't causing the second
for loop to stop. Wrapping the second for loop in a try/except claus
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> That's a tad unfair. Dealing with numeric literals with lots of digits is
> a real (if not earth-shattering) human interface problem: it is hard for
> people to parse long numeric strings.
There are plenty of ways to make numeric literals easier to rea
[EMAIL PROTECTED] wrote:
>newer python should use "for x in fh:", according to the doc :
>
>fh = open("your file")
>for x in fh: print x
>
>which would only read one line at a time.
>
>
>
I have some other questions:
when "fh" will be closed?
And what shoud I do if I want to explicitly clos
KvS <[EMAIL PROTECTED]> wrote:
> Thanks a lot for all the answers. After rereading everything said here
> today it's become more clear to me what you guys are telling me and
> I'll actively try to forget about "from ... import *" ;).
I commend you for your decision. It's a construct that I somet
Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>, I mumbled:
> .
> .
> .
> >Pyro might be perfect. My own instinct is to start even more
> >primitively, with a minimal asynchat client and server. I've
> >l
Neil Hodgson wrote:
>To me, most uses of path.py are small incremental improvements over
> os.path rather than being compelling. Do a number of small improvements
> add up to be large enough to make this change?
If the number of small improvements is large enough then, as with other
such
Anton Vredegoor <[EMAIL PROTECTED]> wrote:
...
> Suppose I grant all your theories about optimal marketing strategies.
> This still doesn't account for the way the market is behaving *now*. It
> isn't in any way logical or optimal. For example in Holland (where I
> live) complete governmental de
Steven D'Aprano wrote:
> Dealing with numeric literals with lots of digits is
> a real (if not earth-shattering) human interface problem: it is hard for
> people to parse long numeric strings.
I'm totally unconvinced that this _is_ a real problem, if we define
"real" as being even enough to jiggl
In article <[EMAIL PROTECTED]>, I mumbled:
.
.
.
>Pyro might be perfect. My own instinct is to start even more
>primitively, with a minimal asynchat client and server. I've
>looked through the *Cookbook*, and see that it does
On Sun, 20 Nov 2005 08:42:48 +1100 (EST), Ben Finney <[EMAIL PROTECTED]> wrote:
>Bengt Richter <[EMAIL PROTECTED]> wrote:
>> On Sat, 19 Nov 2005 11:10:42 +1100 (EST), Ben Finney <[EMAIL PROTECTED]>
>> wrote:
>> >Bengt Richter <[EMAIL PROTECTED]> wrote:
>> >> If [an enumeration has a fixed sequenc
On Sun, 20 Nov 2005 01:39:04 +, Steve Holden wrote:
> Steven D'Aprano wrote:
> [...]
>> Likewise, base conversion into arbitrary bases is not, in my opinion,
>> common enough a task that support for it needs to be built into the syntax
>> for literals. If somebody cares enough about it, write
O/S: Win2K
Vsn of Python:2.4
Based on a search of other posts in this group, it appears as though
os.environ['PATH'] is one way to obtain the PATH environment variable.
My questions:
1) is it correct that os.environ['PATH'] contains the PATH environment
variable?
2) are there other ways to obtain
On Sun, 20 Nov 2005 08:56:33 +1100, Ben Finney wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>> On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
>> > Is there any difference between a Python immutable value, and a
>> > constant? I suppose "constant" also implies that the *name* binds
>>
Steven D'Aprano wrote:
> That's a tad unfair. Dealing with numeric literals with lots of digits is
> a real (if not earth-shattering) human interface problem: it is hard for
> people to parse long numeric strings. In the wider world outside of IT,
> people deal with long numeric digits by grouping
Steve Holden wrote:
> Being European myself I am well aware of the notational differences of
> the different locales, and I am perfectly happy that users can enter
> numbers in their preferred format when they execute a program.
>
> However, I am not happy about the idea that a program source woul
Steven D'Aprano wrote:
[...]
> Likewise, base conversion into arbitrary bases is not, in my opinion,
> common enough a task that support for it needs to be built into the syntax
> for literals. If somebody cares enough about it, write a module to handle
> it and try to get it included with the Pyth
On Sat, 19 Nov 2005 13:08:57 -0500, Peter Hansen wrote:
> Umm... in other words, "the underscore is under-used so let's assign
> some arbitrary meaning to it" (to make the language more like Perl
> perhaps?).
+1
I *really* don't like the idea of allowing underscores in numeric
literals. Firstl
Peter Hansen:
> Compelling to whom? I wonder if it's even possible for Guido to find
> compelling anything which obsoletes much of os.path and shutil and
> friends (modules which Guido probably added first and has used the most
> and feels most comfortable with).
To me, most uses of path.
[EMAIL PROTECTED] wrote:
> I dislike embedding code or html in each other, apart from the
> 'impurity' of mixing code and user interface it makes them inseparable.
>
> Using templates means that the code can work with different templates,
> and this should be seamless, it also means that different
> Is there a way to create a button in either pygame or livewires, that is
> able to be clicked and when clicked sends a command to restart the program?
>
You could try something like this using pygsear
(http://www.nongnu.org/pygsear/)
The button can call either start() which just makes
a new G
Peter Hansen wrote:
> Kent Johnson wrote:
>> import path
>> files = path.path(pathToSearch).walkfiles(filename)
>
> A minor enhancement (IMHO) (though I certainly agree with Kent's
> recommendation here): since there is nothing else of interest in the
> "path" module, it seems to be a fairly com
I meant that it is not strictly necessary to use templates in
Karrigell, although you can use Cheetah if you want.
I'm not used to templates mainly because I'm familiar with the way PHP
works and, for simple dynamic sites like those I work on, this is the
simpliest approach.
Another reason is that
Steven Bethard wrote:
> Thanks for double-checking this for me. I looked at expand_tabs, and
> it's part of the definition of the TextWrapper class, which is not
> actually used by textwrap.dedent(). So I think the textwrap.dedent()
> expanding-of-tabs behavior is still basically undocumented.
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
> > Is there any difference between a Python immutable value, and a
> > constant? I suppose "constant" also implies that the *name* binds
> > unchangeably to a particular value. Is that meaningful?
>
[EMAIL PROTECTED] wrote:
> Steve Holden wrote:
[...]
>>I really wouldn't want it to become possible to write Python code in one
>>locale that had to be edited before the numeric literals were valid in
>>another locale. That way madness lies.
>
> That is the fact, from the very beginning. 1.234 str
Bengt Richter <[EMAIL PROTECTED]> wrote:
> On Sat, 19 Nov 2005 11:10:42 +1100 (EST), Ben Finney <[EMAIL PROTECTED]>
> wrote:
> >Bengt Richter <[EMAIL PROTECTED]> wrote:
> >> If [an enumeration has a fixed sequence], what is more natural
> >> than using their index values as keys to other ordered i
> No templates, no python-like or special languages, only pure and simple
> python.
> You can embedd python into html or, if it better suits your programming
> style, you can embed html into python. Why don't you give it a try?
I dislike embedding code or html in each other, apart from the
'impu
Okay, thank you. This worked very well.
--
http://mail.python.org/mailman/listinfo/python-list
OK that worked really well. In particular, the "lastindex" property of
the match object can be used to tell exactly which group matched,
without having to sequentially search the list of groups.
In fact, I was able to use your idea to cobble together a poor man's
lexer which I am calling "reflex"
NEVERMIND. My friend pointed out that I am simply hitting the wrong
URL when trying to "test" whether I am logged in or not. The correct
one is: http://www.dpreview.com/forums/editprofile.asp
But I still have one question, if anyone knows -- why is it that when I
print out the headers on my req
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> > Stefan Rank wrote:
> >
> >>The other idea of teaching int() about separator characters has
> >>internationalis/zation issues:
> >>In many European countries, one would naturally try::
> >>
> >> int('500.000,23')
> >>
> >>instead of::
> >>
> >>
Thanks Diez and Peter,
Just what I was looking for. In "Library Reference" heading
3.11.1 Types and members
I found the info about the method you described. I also made a little
function to print out not just the name of the function but also the
parameter list. Here it is
# fname.py
im
Peter Hansen wrote:
> Steven Bethard wrote:
>
>> Note that even though the tabs are internal, they are still removed by
>> textwrap.dedent(). The documentation[1] says:
>
> ...
>
>> So it looks to me like even if this is a "feature" it is undocumented.
>> I'm planning on filing a bug report,
[EMAIL PROTECTED] wrote:
>>I want to do the same thing in Python/Tkinter:
>>
>> # Wait for network to recognize the workstation:
>> while os.system("slist") != 0:
>> self.notify["fg"] = randcolor()
>> # how do I refresh label l3 at this point?
>>
On 19 Nov 2005 05:29:07 -0800
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote:
> If I have the Vector class below, is there a means by
> which I can have the following behaviour
>
>
> >>>A = Vector(1, 2)
> >>>print A
> (1, 2)
> >>>A = 0
> >>>print A
> (0, 0)
As has already been mentioned, "A = 0" re
[EMAIL PROTECTED] wrote:
[edited slightly]
> def cap():
> print "the name of this function is " + "???"
> cap ()
sys._getframe() would help you here:
>>> import sys
>>> sys._getframe()
>>> def f():
... global x
... x = sys._getframe()
...
>>> f()
>>> x
>>> dir(x)
[..., 'f_bu
[EMAIL PROTECTED] wrote:
> Look at the code below:
>
> # mystringfunctions.py
>
> def cap(s):
> print s
> print "the name of this function is " + "???"
>
> cap ("hello")
>
>
> Running the code above gives the following output
>
> >>>
> hello
> the name
[EMAIL PROTECTED] wrote:
> Steven D'Aprano:
>>Perhaps Python should concatenate numeric literals at compile time:
>>123 456 is the same as 123456.
>
> I think using the underscore it is more explicit:
> n = 123_456
>
> Alternatively the underscore syntax may be used to separate the number
> from
Roy Smith>We already have a perfectly good syntax for entering octal
and hex integers,
There is this syntax:
1536 == int("600", 16)
that accepts strings only, up to a base of 36.
There are the hex() and oct() functions.
There is the %x and %o sintax, that isn't easy to remember.
There are the 0x60
Joey C. wrote:
> Hello.
> I'm writing a program that creates a series of batch operations to
> convert movies to be used on iPodLinux. The programs that do the
> encoding and conversions are seperate from mine and all mine does is
> use os.system() to call the program.
>
> However, it needs to ge
Look at the code below:
# mystringfunctions.py
def cap(s):
print s
print "the name of this function is " + "???"
cap ("hello")
Running the code above gives the following output
>>>
hello
the name of this function is ???
>>>
I would like the output
Tony wrote:
> If I'd like to learn Python for web-development, what are the options
> available?
>
> Thanks. tony
Nov 18th:
http://groups.google.co.uk/group/comp.lang.python/browse_frm/thread/c23b12dc0edf8af0/19f859dc43c77ac1#19f859dc43c77ac1
Gerard
--
http://mail.python.org/mailman/listinfo
To provide some feedback:
As Grant Edwards posted in this list, I was running my code inside of
IDE that replaces sys.stdin with some other. While running the program
from a shell prompt, everything goes fine.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
On Sunday 20 November 2005 00:24, Tony wrote:
> If I'd like to learn Python for web-development, what are the options
> available?
>
> Thanks. tony
A nice framework is CherryPy: http://www.cherrypy.org
or Turbogears, which is based on CherryPy: http://www.turbogears.org/
Michael.
--
http://mail.
If I'd like to learn Python for web-development, what are the options
available?
Thanks. tony
--
http://mail.python.org/mailman/listinfo/python-list
Looks OK to me. Just tried on my network - works with no exceptions
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the feedback, people.
I actually only need the "bar" part (instance methods). I added the "foo"
part to generalize the question without really thinking it through first.
Still, it has gotten me more information than I ever imagined. So thanks
again.
g
--
http://mail.python.org/m
Hello.
I'm writing a program that creates a series of batch operations to
convert movies to be used on iPodLinux. The programs that do the
encoding and conversions are seperate from mine and all mine does is
use os.system() to call the program.
However, it needs to get an input file and an output
Attacked is a piece of code which first hits the login page
successfully and receives back login cookies. But then when I attempt
to hit a page which is restricted to logged in users only, I fail.
That seems to be because I am not successfully re-attaching the cookies
to the header portion of the
Just try it, it is not that hard ... ;-)
/Jean Brouwers
PS) Here is what happens on Linux:
$ limit vmemory 1
$ python
...
>>> s = file().readlines()
Traceback (most recent call last):
File "", line 1 in ?
MemoryError
>>>
--
http://mail.python.org/mailman/listinfo/python-l
On 19 Nov 2005 07:06:30 -0800, [EMAIL PROTECTED] wrote:
>I've seen this construct in a script
>
[x.capitalize() for x in ['a','b', 'c']]
>['A', 'B', 'C']
>
>I tried another myself
>
[x+1 for x in [1,2,3]]
>[2, 3, 4]
>
>Apparently you can do
>[function(x) for x in list]
>
>I tried to
[EMAIL PROTECTED] wrote:
> Stefan Rank wrote:
>
>>The other idea of teaching int() about separator characters has
>>internationalis/zation issues:
>>In many European countries, one would naturally try::
>>
>> int('500.000,23')
>>
>>instead of::
>>
>> int('500,000.23')
>
>
> That is why I sai
On Sat, 19 Nov 2005 14:12:25 GMT, "guy lateur" <[EMAIL PROTECTED]> wrote:
>Hi all,
>
>Suppose you have this class:
>
>class foo:
>def bar():
>
>Suppose you also have the strings "foo" and "bar". How can you obtain the
>function foo.bar()?
>
>Surely somebody knows..
>
Sorry, clean forgot about
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
>
> TIA,
> g
>
>
Would that do?
>>> class foo:
@staticmeth
Terrance N. Phillip wrote:
> In VB, an easy way I indicate progress is something like
> do while
> lblNotify.foreground = randomcolor
> lblNotify.refresh <---
>
> loop
>
> I want to do the same thing in Python/Tkinter:
>
> #
[EMAIL PROTECTED] wrote:
> Alternatively the underscore syntax may be used to separate the number
> from its base:
> 22875 == 22875_10 == 595b_16 == 123456_7
> But probably this is less commonly useful (and not much explicit).
We already have a perfectly good syntax for entering octal and hex
int
This type of construct seems to be called "list comprehension".
Googling for
Python "list comprehension"
gives a lot of hints that describe the construct.
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 19 Nov 2005 14:12:25 GMT, "guy lateur" <[EMAIL PROTECTED]> wrote:
>Hi all,
>
>Suppose you have this class:
>
>class foo:
>def bar():
>
>Suppose you also have the strings "foo" and "bar". How can you obtain the
>function foo.bar()?
Why don't you type these things into an interactive py
Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] a écrit :
> > Is there a function/class/module/whatever I can use to
> > look at objects? I want something that will print the object's
> > value (if any) in pretty-printed form, and list all it's attributes
> > and their values. And do all that rec
Bruno Desthuilliers wrote:
> [EMAIL PROTECTED] a écrit :
> > Is there a function/class/module/whatever I can use to
> > look at objects? I want something that will print the object's
> > value (if any) in pretty-printed form, and list all it's attributes
> > and their values. And do all that rec
I've seen this construct in a script
>>> [x.capitalize() for x in ['a','b', 'c']]
['A', 'B', 'C']
I tried another myself
>>> [x+1 for x in [1,2,3]]
[2, 3, 4]
>>>
Apparently you can do
[function(x) for x in list]
I tried to find a description of this in "Library Reference" but
couldn't find it.
Thank you Don, thank you David,
I was convinced that there must be a simple solution at hand. A dummy
widget!
It does work to my needs. Don's ScrollToolView is very interesting
though not yet the right tool for my actual application, but I've got
some more ideas for long winter nights ...
All
In VB, an easy way I indicate progress is something like
do while
lblNotify.foreground = randomcolor
lblNotify.refresh <---
loop
I want to do the same thing in Python/Tkinter:
# Wait for network to recognize the workstat
Sybren Stuvel wrote:
> [EMAIL PROTECTED] enlightened us with:
> > Of course, also support the locale variant where the meaning of ","
> > and "." is swapped in most European countries.
>
> This is exactly why I wouldn't use that notation. What happens if it
> is hardcoded into the source? I mean,
[EMAIL PROTECTED] enlightened us with:
> Of course, also support the locale variant where the meaning of ","
> and "." is swapped in most European countries.
This is exactly why I wouldn't use that notation. What happens if it
is hardcoded into the source? I mean, that's what we're talking about.
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
getattr helps. However, your example won't work: it misses either a
sta
Bruno Desthuilliers enlightened us with:
> (Carl's top-post corrrected. Carl, please do not top-post)
If you correct people and ask them to alter their posting style, at
least make sure you post in a proper way. Snip what you're not
directly referring to, so people don't have to scroll in order to
f = getattr(obj,"bar")
f()
guy lateur wrote:
> Hi all,
>
> Suppose you have this class:
>
> class foo:
> def bar():
>
> Suppose you also have the strings "foo" and "bar". How can you obtain the
> function foo.bar()?
>
> Surely somebody knows..
>
> TIA,
> g
--
http://mail.python.org/mailman
Hi all,
Suppose you have this class:
class foo:
def bar():
Suppose you also have the strings "foo" and "bar". How can you obtain the
function foo.bar()?
Surely somebody knows..
TIA,
g
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 19 Nov 2005 21:45:40 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Fri, 18 Nov 2005 14:32:46 +1100, Ben Finney wrote:
>
>> Is there any difference between a Python immutable value, and a
>> constant? I suppose "constant" also implies that the *name* binds
>> unchangeably to a parti
Ross Reyes wrote:
> When I use readlines, what happens if the number of lines is huge?I have
> a very big file (4GB) I want to read in, but I'm sure there must be some
> limitation to readlines and I'd like to know how it is handled by python.
readlines itself has no limitation, but it reads
Gerard Flanagan wrote:
> If I have the Vector class below, is there a means by which I can have
> the following behaviour
>
A = Vector(1, 2)
print A
> (1, 2)
A = 0
that operation rebinds A; it doesn't affect the Vector instance in any way.
more here:
http://effbot.org/zone/pyth
Gerard Flanagan wrote:
> Hello
>
> If I have the Vector class below, is there a means by which I can have
> the following behaviour
>
>
>
A = Vector(1, 2)
print A
>
> (1, 2)
>
A = 0
print A
>
> (0, 0)
>
> If there is such a means, will it still work with the __slots__
> attr
Hello
If I have the Vector class below, is there a means by which I can have
the following behaviour
>>>A = Vector(1, 2)
>>>print A
(1, 2)
>>>A = 0
>>>print A
(0, 0)
If there is such a means, will it still work with the __slots__
attribution uncommented?
Thanks
class Vector(object):
#__s
Alex Martelli wrote:
> Money is made in many ways, essentially by creating (perceived) buyer
> advantage and capturing some part of it -- but market segmentation is
> just one of many ways. IF your predictions are ENORMOUSLY better than
> those the competition can make, then offering for free "s
Thanks a lot for all the answers. After rereading everything said here
today it's become more clear to me what you guys are telling me and
I'll actively try to forget about "from ... import *" ;).
--
http://mail.python.org/mailman/listinfo/python-list
Steve wrote:
> AJAX works because browsers can execute javascript. I don't know of a
> browser that can execute python. Basically your stuck with java or
> javascript because everything else really isn't cross platform
Don't jump to conclusions...
http://dwahler.ky/python/
If you really, really
1 - 100 of 116 matches
Mail list logo