Python source probably
get it from their Linux/FreeBSD/other distribution where such
dependencies are also taken care of for them.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http:/
work just fine as static libraries.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
;Src', 'dlapack_lite.c')
] ]
I tried uncommenting the lines, but no dice.
Also modify the library_dirs_list and libraries_list variables, but keep
these *_lite.c files commented out.
library_dirs_list = []
libraries_list = []
That way, Numeric will just p
or requiring you to follow the GPL terms or
pay for a license. Otherwise, they're probably SOL. If you're
distributing PyQT binaries along with your package, then you should
probably follow the GPL's terms.
IANAL. TINLA.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields
n you need to
run your scripts with pythonw, which will run the framework's
interpreter in such a way that it can communicate with the native window
server. This shouldn't give you the error above, though.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grow
at makes these kinds of
operations simpler.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
for
days, and I'm out of ideas.
I am running OS X v10.3, gcc v3.3, Python v2.3, ScientificPython v2.4.3, and
am attempting to install NumPy 23.7
Did you try to follow my advice from the other thread? What does your
setup.py look like?
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of
ched. They also have
compiled stuff that does not exist in the standard Python distribution.
Back up your data and reinstall the OS.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
ht
Robert Kern wrote:
Justin Lemkul wrote:
Hello all,
I am hoping someone out there will be able to help me. I am trying to
install a program that utilizes NumPy. In installing NumPy, I
realized that I was lacking Atlas. I ran into the following problems
installing Atlas and NumPy, as I
makes you a Python installation under /sw.
But that doesn't solve his problem, which is to restore the
Apple-supplied Python that he deleted.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard
ting the Python that they provide.
Future releases of Python should be easier to install *alongside*
Apple's Python.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
: _ZNK6wxExpr3NthEi
Something has been compiled incorrectly or shared libraries are missing.
In any case, gui_thread probably won't work with wxPython 2.5.
Development on gui_thread has stopped in favor of ipython's threading
support.
http://ipython.scipy.org
http://ipython.scip
on extensions.
If you must use Scons, read
http://www.scons.org/cgi-bin/wiki/PythonExtensions
and use
SharedLibrary(...
SHLIBPREFIX="",
...)
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves o
'wx-config --cppflags --libs') Technique... I'll
> have to ponder using one or the other or both. Hmm
If you're extending wxPython, cannibalize wxPython's build procedure.
Any other way, there madness lies.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
?
Oddly enough, http://docs.python.org/ref/function.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
make step 3 easier in the, hopefully near, future:
http://peak.telecommunity.com/DevCenter/EasyInstall
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
r object can have any number of names
in various scopes or have no name at all. In particular, in your code,
the same list object has 2 names in 2 scopes, "alist" in the global
scope and "list" in afunction's local scope.
alist = range(10)
blist = alist
clist = [alist]
he cut itself, the
value, practically, depends on which end of the branch you're deciding
to approach the point from. It's arbitrary; there's no correct answer;
but signed zeros give a way to express some of the desired, useful but
wrong answers.
And floating point is about nothi
TPJ wrote:
> I've heard about this "EasyInstall" and I like this idea.
>
> If EI becomes a part of Python's standard library, my script will use
> it.
Why wait? Just make it the second thing that the script installs after
Python itself.
--
Robert Kern
[EMAIL PR
le for when this change will take place.
map, filter, and reduce are safe for quite some time.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
world, nothing stops anyone from using their
own extension module implementing map, filter, and reduce if they really
want to. TSBOOOWTDI in the language/stdlib, but it shouldn't stop anyone
from using other ways to do it that aren't in the stdlib if the
tradeoffs are right for them.
--
Ro
n over non-sequence
n is a sequence. *n correctly expands. The error is that 100 is not a
sequence; tuple() requires a sequence or an iterator. tuple(*n) is
equivalent to tuple(100).
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the g
ng.
You need to differentiate
a = b = 1
from
a = b == 1
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
> On Sunday 26 June 2005 06:11 am, Robert Kern wrote:
>
>>Terry Hancock wrote:
>>
>>>On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote:
>>>
>>>>However, then you must forbid a=b=1 for assigning to two variables
>>>
u can see in the datetime documentation, the module was introduced
in Python 2.3. I recommend updating your Python installation.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
a.append(1)
> py> b
> []
> py> a = b = []
> py> a.append(1)
> py> b
> [1]
What you wrote isn't, but what Terry wrote is.
In [1]: a, b = ([],)*2
In [2]: a.append(1)
In [3]: b
Out[3]: [1]
In [4]: a is b
Out[4]: True
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
long release distance) and useful enough to
> be granted a place in the stdlib?
I would like to see the setuptools/PythonEggs/EasyInstall trifecta get
more attention and eyeballs. Once it is mature, I think that it will
obviate the desire for stdlibification of most of the packages being
req
David Bear wrote:
> I was wondering if anyone has implemented the rsync protocol in python.
GIYF.
http://directory.fsf.org/pysync.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Har
r friend.
http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/e9a2237d820a4964
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
The useless code referred to was the list comprehension.
>>> t = tuple([(k,v) for k,v in d.iteritems()])
versus
>>> t = tuple(d.items())
or even
>>> t = tuple(d.iteritems())
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass
; >>> v = 'mystring'
> >>> o.e = v
> setting e to mystring
> >>> o.e
> 'mystring'
> >>>
I think he means something like this:
e = 'i_am_an_attribute'
o.(e) = 10
o.i_am_an_attribute == 10
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
muldoon wrote:
>Now, what forum would you recommend? Any help would be appreciated.
Not here. Beyond that, you're on your own.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richar
quires you to control the imports.
It's a moot point anyways. The current ipython codebase isn't in any
shape to go into the stdlib, and the rewrite hasn't quite begun, yet.
Ask again in a year or two.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass gr
ipcord after the
> counter became zero.
3. Sign up for the Python-tutor list. (Okay, that's not quite "helping
yourself," but it's still good advice, I think).
http://mail.python.org/mailman/listinfo/tutor
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
uch of it the
> "Python way", I suspect. So, I'm wondering if someone would like to show
> me some of the tricks I should have used.
Trick #1:
import matplotlib
;-)
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves
Jan Danielsson wrote:
> Robert Kern wrote:
>>Trick #1:
>>
>>import matplotlib
>
> Oh. :-)
>
> That's a pretty neat trick -- now can you make my embarrassment go away?
>
>I did do a quick search to see if anyone had done anything similar;
>
u (or someone else) may decide later to
subclass it and want to use those features. It's a good habit to get
into even if you don't initially plan on using those features.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams
Jan Danielsson wrote:
> Robert Kern wrote:
> [---]
>
>>It's okay. Just about every Pythonista in the sciences has, at one time
>>or another, started a plotting library. It's a rite of passage. Welcome
>>to the club. :-)
>
>Question: I need to in
between micro-releases (i.e. different z).
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
paulm wrote:
> Hi,
> In perl I can do something like:
>
> $a = 'test string';
> $a =~ /test (\w+)/;
> $b = $1;
> print $b . "\n";
>
> and my output would be "string".
>
> How might this snippet be written in python?
ht
style builds.
>
> How about integrating distutils and PyPI, so that distutils can
> automatically download and install packages that are required by the
> package it's currently installing? In other words, C-Python-AN.
http://peak.telecommunity.com/DevCenter/EasyInstall
--
Robert
ly simplifies certain types of code although the
change does have its transition costs for some specific pieces of older
code like yours.
BTW, you don't want to use the builtin min(). That iterates over the
array as if it were a Python list. Use minimum.reduce().
--
Robert Kern
[EMAIL PR
Roy Smith wrote:
> Terry Hancock <[EMAIL PROTECTED]> wrote:
>
>>One of the strengths of Python has been that the language itself is
>>small (which it shares with C and (if I understand correctly, not being
>>a lisp programmer?) Lisp), but with all the syntax enhancements going
>>on, Python is g
is in Python) modified to use arbitrary file-like storage.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
m('./some --command')
More robust: Use the subprocess module.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
./some --command')'
Read the documentation. os.system() opens up a new shell process. The
command to change directories happens in that shell process, not
python's process.
Try another command.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell wh
27;fr':'la vache brun'}
>
> The language code is always 2 lower case letters.
>
> Many thanks.
translations = [x.strip(" '") for x in line.split('|')]
d = {}
for i in range(0, 2*len(translations), 2):
d[translations[i]] = translations[i+1]
--
27;fr':'la vache brun'}
>
> The language code is always 2 lower case letters.
>
> Many thanks.
Ignore the last message.
translations = [x.strip(" '") for x in line.split('|')]
d = dict(zip(translations[::2], translations[1::2]))
--
Robert K
ut some help, py2exe's
dependency inference won't pick up scipy's subpackages. Please consult
py2exe's documentation on how to force it to include all of scipy and
not rely on the default inference.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass g
Brian van den Broek wrote:
> Well, I found it ironic, but only when you add that the genetic
> algorithm approach came up in the context of a "best fit" problem.
> Survival of the fittest indeed :-)
Optimization codes don't always succeed. What's the irony?
--
one of the first 3rd party modules to come out
for Python 3000 will be such a library.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
ty clear that python is leaving
> its multiparadigmatic origins behind. "do it our way," the pundits are
> effectively saying, "or get out". for my part, i'm getting out.
If that's what you want to do, no one is going to stop you. But please
do it quietly.
--
Rober
s fishy here... whats up?
>
> --python 2.4.1
http://docs.python.org/tut/node16.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
John Roth wrote:
> "Robert Kern" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>map and filter are being removed *because of* list comprehensions. Did you
>>even read Guido's articles about this issue? Your understanding of why
Nathan Pinno wrote:
> Hi all,
>
> What's wrong with the following code? It says there is name error, that
> random is not defined. How do I fix it?
You need to import random.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Ar
Nathan Pinno wrote:
>
> Hi all,
>
> Brief question for anyone who knows the answer, because I don't. Is
> there anyway to make Python calculate square roots?
http://docs.python.org/
There is a search facility.
--
Robert Kern
[EMAIL PROTECTED]
"In
27;println' version IIRC.
>
>He also had a ton of stuff he'd rather see become iterators.
As currently being (re)discussed at tedious length in recent threads
here, changes would will only be realized in Python 3.0 (aka Python 3000
in facetious reference to when we can e
the author had too little
experience, or any number of other things.
(Disclosure: I am now a co-mentor on an unrelated SoC project, but I
wasn't part of the group rating and selecting proposals.)
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
ks, *then* is the time to be having these discussions. Right
now, all we're doing is making each other bitter and angry for no good
reason.
[1] Okay, there was that guy who predicted that list comprehensions and
first-class functions were the next to go. That was new. But als
he last time you posted this question here?
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
27;t think distutils can handle all these, especially the last one,
> so I doubt it's the right tool in your case. I would suggest SCons
> (http://www.scons.org/), a modern make/automake/autoconf replacement
> that uses python for its configuration files instead of yet another
> cryptic hal
n2:'int'>
>
> Even something like:
>
>>>>import Numeric
>>>>a = Numeric.array([1.,2.])
>>>>print type(a),type(min(a))
>
>
>
> does not produce an array.
Hmm, odd. Anyways, follow my advice: use minimum.reduce() a
Dan Bishop wrote:
> There's also the issue of having to rewrite old code.
It's Python 3000. You will have to rewrite old code regardless if reduce
stays.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dre
ave this functionality in
recent releases.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
Matthias R. wrote:
> Unfortunately matplotlib is only a 2D-plotting library.
>
> Do you know another one with 3D-capabilities as well?
There's PyX.
> That would be very nice,
Yes, yes it would.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the gras
nt for these new reports. Any relevant
> information would be appreciated.
I've had intermittent problems on OS X and gcc-4.0 with, well,
everything, Python-related or otherwise. So I ignore it and use gcc-3.3
and g77-3.4 and live happily ever after.
--
Robert Kern
[EMAIL PROTECTED]
Ert Ert wrote:
> Please help me i down loaded python nd itplays on MS-DOS mode and not on
> normal please help
So what's your problem? Please read
http://www.catb.org/~esr/faqs/smart-questions.html
Then reformulate your question so that we can answer it.
--
Robert Kern
[EMAI
or
> "convenient!" are already implemented by some Pythonista(s). Spoils all the
> fun for reinventing the wheel, doesn't it. :)
Doesn't seem to stop most Pythonistas from trying, though. :-)
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows h
uss your module. Formal
announcements once you, e.g. put it on SF should go to c.l.py.announce .
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
of
> said the same thing about *their* language a couple of years ago. I wish
> web pages, like newgroup posts, were dated so one could better trace the
> history of such usages.
Trawling through http://web.archive.org might help.
--
Robert Kern
[EMAIL PROTECTED]
"In
e Numeric distribution and no one has made a
real release since. However, it is still available in CVS.
http://cvs.sourceforge.net/viewcvs.py/numpy/kinds/
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
level-
> from nltk.probability import ConditionalFreqDist
> File "C:\Python24\Lib\site-packages\nltk\probability.py", line 56, in
> -toplevel-
> import types, math, numarray
> ImportError: No module named numarray
Install numarray.
http://www.stsci.edu/resources/s
h based on PyGTK, the other based on wxPython.
>
> I was not successful googling for this one. Would you have an URL handy?
Note the deliberate spelling, and cut-and-paste.
http://home.arcor.de/mulk/projects/mascyma/index.xhtml.de
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hel
(ie : stuffit ):
>-rwxr-xr-x foo.exe
> ZipInfo objects doesn't store informations about rights ?
> (http://www.python.org/doc/current/lib/zipinfo-objects.html#zipinfo-objects)
>
> How can i fix this ?
This is possibly related, I'm not sure:
http://article.
his has any relevance to the problem that you are
seeing.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
Bengt Richter wrote:
> Then googling for mascsyma [sic ;-)] got
I doubt it. ;-)
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
umarray
>
> can you please tell me the cause
I already did. You need to install numarray.
http://www.stsci.edu/resources/software_hardware/numarray
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
> the LGB rule. I thought that s is not accessible from bar, but it is,
> apparently. Why?
Python now has nested scopes.
http://www.python.org/peps/pep-0227.html
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die
(Debian 1:3.3.6-6)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
> >>> t = ('a', 'b', 'c')
> >>> t[1]
> 'b'
> >>>
7;or']
str.capitalize() changes the first character to be uppercase and all
later characters to be lower case. It does not leave the later
characters alone.
In [1]: str.capitalize?
Type: method_descriptor
Base Class:
String Form:
Namespace: Python builtin
Docstring:
t; As I embark on the wonderful language of Python, or there any object
> organizational tools that may help me to keep order?
There's Bicycle Repair Man:
http://bicyclerepair.sourceforge.net/
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are t
nstance which isn't actually needed. It could also
be a classmethod, but since it doesn't actually need any information
from the class to do its work, I find that the extra reminder of
staticmethod helps my brain understand what it's doing.
All told, I'd probably vote -0.5 on a
n [3]: class NewPoint(Point):
...: pass
...:
In [4]: def parseXML(xmlText):
...: return 1, 4
...:
In [5]: p = NewPoint.fromXML('')
In [6]: isinstance(p, NewPoint)
Out[6]: True
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows h
approach. For example:
http://www.jfsowa.com/clce/specs.htm
http://www.ics.mq.edu.au/~rolfs/controlled-natural-languages/
http://www.ifi.unizh.ch/attempto/
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
threaded
form, so you need to provide some context for them to be able to follow
along.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
lt to do so again. Of
course, if you just need *a* Verilog parser, not necessarily one written
by you, you could just email the guy who wrote it and ask him for a
copy. Grep
http://pyparsing.sourceforge.net/
for "Verilog".
--
Robert Kern
[EMAIL PROTECTED]
"In the fields
Joseph Garvin wrote:
> Robert Kern wrote:
>
>>Not everyone is reading this list in a conveniently threaded
>>form
>
> Why not? Just about every modern newsgroup reader and e-mail app has a
> threaded view option.
Good point. Allow me to modify my statement: not
hem may even be called "plot". Which
one are you talking about?
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
s a good place to use eval.
>
> aString = "dothat"
> atuple = (x, y)
>
> If aString is the name of a function in the current module:
>
>globals()[aString](*aTuple)
>
> If aString is a function in another module:
>
>import otherModule
>v
7;).
>
> I am asking if there is some alternative (more pythonic...):
For *this* particular task, certainly. It begins with
import BeautifulSoup
The rest is left as a (brief) exercise for the reader. :-)
As for the more general task of splitting strings using regular
expressions, see r
> Also, I'd like to know if there's a typical format for the help string
> (but in C), compatible with docstring's
> """short desription
>
> long description"""
char *o_count__doc__;
char *o_count__doc__ = "short description\n"
documentation for timeit. It doesn't do what you think it does.
Look at wxTimer instead.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
Tuple-as-arg is probably pretty safe. Tuple-as-keyword, possibly
not-so-much.
> Does anyone use this behaviour, and if so, under what circumstances is it
> useful?
import math
def distance((x1,y1), (x2,y2)):
return math.sqrt((x2-x1)**2 + (y2-y1)**2)
distance(point1, point2)
Per
t is created first, with the old values of a
and b. Then a and b are reassigned. The value of a doesn't change until
*after* a+b is calculated.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
!cat foo.ini
[section1]
foodir: %(dir)s/whatever
dir: foo
In [2]: fn = 'foo.ini'
In [3]: import ConfigParser
In [4]: cfg = ConfigParser.ConfigParser()
In [5]: cfg.read(fn)
Out[5]: ['foo.ini']
In [6]: cfg.set('section1', 'dir', 'anotherdir')
In [7]:
sary.
Allowing generator expressions to forgo extra parentheses where they
aren't required is something different, and in my opinion, a good thing.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
scribe it. I've settled on "Lovecraftian": reading the
code, you can't help but get the impression of writhing tentacles and
impossible angles.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die
o bad designs; we just fix
them later.
In short slogans: Just Do It. Make It Work, Then Make It Right. Refactor
Mercilessly. Do the Simplest Thing That Could Possibly Work.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
--
http://mail.python.org/mailman/listinfo/python-list
--
> "[::-1]" can reverse a string magicly, how did it do it?
The full form would be live[len(live)-1:-1:-1] much like
range(len(live)-1, -1, -1).
[start:stop:step]
step can be negative.
--
Robert Kern
[EMAIL PROTECTED]
"In
form"), I have to put a char in front of
> the string and...:
> ('x'+live)[len(live)+1:0:-1] # --> "evil"
> Is it due to the Python's version (I still have 2.3.4)?
No, it's because I am stupid. There isn't a full form.
live[len(live)::-1] is the clos
301 - 400 of 2667 matches
Mail list logo