imer: all mention of real person are opinion only.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
rgb wrote:
> > i'm looking for something example based... for senior professional
> > programers who may want to pickup some elisp for practical macro.
>
> Unfortunately the path
the Journey of Foreign Characters thru Internet
Xah Lee, 20051101
There's a bunch of confusions about the display of non-ascii characters
such as the bullet "•". These confusions are justifiable, because the
underlying stuff is technology, computing technologies, are in a laymen
s
Python Doc Problem Example: gzip
Xah Lee, 20050831
Today i need to use Python to compress/decompress gzip files. Since
i've read the official Python tutorial 8 months ago, have spent 30
minutes with Python 3 times a week since, have 14 years of computing
experience, 8 years in mathema
[EMAIL PROTECTED] wrote:
«I want to read a little bit about sorting in Python (sorted() and
method sort()). But I can't seem to find anything in the documentation
at the homepage?»
if you want some detailed account on the sort method, see:
http://www.xahlee.org/perl-python/sort_list.html
Newsgroups: comp.lang.perl.misc
From: "Veli-Pekka Tätilä"
Date: Sat, 5 Nov 2005 17:25:35 +0200
Subject: Re: Python doc problem example: gzip module (reprise)
Xah Lee wrote:
> Today i need to use Python to compress/decompress gzip files.
> However, scanning the doc after 20 se
Recommended:
Sophie's World, by Jostein Gaarder, 1995.
http://en.wikipedia.org/wiki/Sophie%27s_World
http://www.amazon.com/gp/product/0425152251/
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Source Documentation is of Low Quality
http://xahlee.org/UnixResource_dir/writ/gubni_papri.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Post-modernism, Academia, and the Tech Geeking fuckheads
• the Sokal Affair
http://en.wikipedia.org/wiki/Sokal_Affair
• SCIGen and World Multi-Conference on Systemics, Cybernetics and
Informatics
http://pdos.csail.mit.edu/scigen/
• What are OOP's Jargons and Complexities, Xah Lee
utionary outrageous $free$ lies, why should we fault
Pretty Home Page?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
d list is', Dumper [EMAIL PROTECTED];
# to extrat element from nested list,
$c = $b[2]->[1];
print '$b[2]=>[1] is', $c;
# the syntax of nested lists in perl is quite arty, see
# perldoc -t perldata
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
# here's a while statement in python.
a,b = 0,1
while b < 20:
print b
a,b = b,a+b
---
# here's the same code in perl
($a,$b)=(0,1);
while ($b<20) {
print $b, "\n";
($a,$b)= ($b, $a+$b);
}
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
i'm using groups-beta.google.com to post python code.
Is there a way to stop google from messing with my format? it seems to
have eaten the spaces in my python code.
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
thing that
prevents google from reformating the post.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
---
Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to [EMAIL PROTECTED]
if you are reading it on a web page, program examples may not run
because they've been changed by yahoo.com or google.co
ython a-day mailing list at
. http://groups.yahoo.com/group/perl-python/
. to subscribe, send an email to [EMAIL PROTECTED]
. if you are reading it on a web page, program examples may not run
. because html conversion often breaks the code.
.
. Xah
. [EMAIL PROTECTED]
. http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
examples may not run because
© groups.google.com changes the post slightly.
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
does anyone know why the Python mode in emacs uses spaces for first
level indentation but one tab for second level?
i'm using emacs 21.3.50.1.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
el, 2 tabs.
©
© who the fuck coded the python mode in emacs? fuckhead please peruse:
© http://xahlee.org/UnixResource_dir/writ/responsible_license.html
©
© PS Thanks for the tip on (setq-default indent-tabs-mode nil).
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/mor
s of a copy of
© # the list returned by fib(5), so that
© # Dumper can print it.
© # see Òperldoc -t perldataÓ or perlref
© # for unix-styled technicalities.
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
ay mailing list at
© http://groups.yahoo.com/group/perl-python/
© to subscribe, send an email to
© [EMAIL PROTECTED] if
© you are reading it on a web page,
© program examples may not run because
© html conversion often breaks the code.
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageT
errata:
* the variables in the perl section should be declared inside the
subroutine.
* the @_[0] should've been $_[0]
thanks for Dave Cross for pointing them out.
* the Mathematica Apply should be Select...
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
erratum:
the Mathematica Apply should've been Select.
...
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
erratum:
the Mathematica Apply should've been Select.
...
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
© use Data::Dumper qw(Dumper);
© print Dumper \%a;
©
© # the syntax of keyed list in Perl is too complex
© # to be covered in a short message.
© # see "perldoc perldata" for an unix-styled course.
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
print Dumper [&mymodule::f1(7)];
©
© # this is about the simplest way
© # to write a modlue in perl and
© # calling its function.
© # for an inscrutable treatment,
© # see "perldoc perlmod"
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/more.html
--
http://mail
Python has iteritems() and enumerate() to be used in for loops.
can anyone tell me what these are by themselves, if anything?
are they just for idiom?
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
erl-python-subscribe @ yahoogroups.com if
© you are reading it on a web page,
© program examples may not run because
© html conversion often breaks the code.
©
© Xah
© [EMAIL PROTECTED]
© http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
its morons.) All it take is some simple
principles outlined above.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
nically
# depending on some predefined
# variables...) The f they call "file handle".
# ... see
# perldoc -tf open
# to begin understanding.
Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an ema
my books are moronic because they assumed
the general readers are morons.
PS Another illustrative case is the official Java Tutorial. Python
tutorial is to the point on the whole. The Java Tutorial is completely
asinine. Chalking up to rocket sciences every chance with unhelpful and
misleading driv
reference
(or a package name, for class
methods) as the first argument.
Good luck.
Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to perl-python-subscribe @ yahoogroups.com
if you are reading it on a web
ml conversion often breaks the code.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
doc/2.3.4/tut/node11.html
# in Python terminal, type help() then
# topic CLASSES to read about existing
# datatypes as classes, and classes in
# Python
# try to write a class with one data of
# integer and two functions, one
# increases it by 1, one decreases it by
# 1. note: inside a class definiti
ext=$ARGV[0];
$rtext=$ARGV[1];
$infile = $ARGV[2];
$outfile = $ARGV[3];
open(F1, "<$infile") or die "Perl fucked up. Reason: $!";
open(F2, ">$outfile") or die "Perl fucked up. Reason: $!";
while ($line = ) {
chomp($line);
$line =~ s/$stext/$rtext/g;
prin
is there a syntax to comment out a block of code? i.e. like html's
or perhaps put a marker so that all lines from there on are ignored?
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
ter
# function purely functional. (it relies
# on the $_) And the filter function
# must come in certain order. (for
# example, the above program won't work
# if g is moved to the bottom.) ...
# the quality of modules in Perl are
# all like that.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
for those interested, i've created a webpage for these perl-python
daily tips. The url is:
http://xahlee.org/perl-python/python.html
Thanks to those who have made useful comments. They will be
assimilated.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
> Hey all, I have
ethods and other things.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html
Tomorrow i shall cover more manmade jargons and complexities arising
out of the OOP hype, in particular Java.
instantiation
initializer, constructor, assessor
access level specifier
abstract class and abstract methods
instance methods and class methods
interface, inheritance, polymorphism.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
me discussion of the plethora of Perl mail modules and their
short-cummings, see http://alma.ch/perl/mail.htm
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
in Python, is there a way to quote a string as to avoid escaping ' or "
inside the string?
i.e. like Perl's q or qq.
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
ne fileFilterQ to set which file will be checked or
skipped.
to do:
* in the report, print the strings that are changed, possibly with
surrounding lines.
* allow just find without replace.
* add the GNU syntax for unix command prompt.
* Report if backup directory exists already, or provide togg
no"}
if ( $text =~ [EMAIL PROTECTED]@) { print 'yes'} else {print "no"}
# for detail of its much ado about nothing nature,
# see perldoc perlre
this is perl-python a-day mailing list. To subscribe, see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
;
server = smtplib.SMTP(smtpServer)
server.set_debuglevel(1)
server.sendmail(fromAddr, toAddr, text)
server.quit()
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
st uses. Spending time to read this book of
specialization, from economy perspective, is a waste of time.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
ve perl code. In many perl codes, they sport the Object
Oriented syntax, often concomitantly with a normal syntax version as
well.
this post is from the perl-python a-day mailing list. Please see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
definition with
variable/default parameters is a basic issue a programer wants to know,
and different languages differs very much in how they handle this. This
is what i mean that the language doc should be programing oriented, as
opposed to computer-sciency or implementation oriented...
Xah
[EMAIL
)
-
References:
for a analysis of the same situation in Java, see
http://xahlee.org/java-a-day/assign_array_to_list.html
How to write a tutorial
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Dear Chinook Lee,
Thank you very much. That seems a godsend. I'd like to also thank its
author Richard Gruet.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Chinook wrote:
> ...
> I don't get to the reference docs much. Mostly I use the quick reference
> guide and it's n
Dear Andrea Griffini,
Thanks for explaning this tricky underneath stuff.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Andrea Griffini wrote:
> On Sun, 19 Jun 2005 22:25:13 -0500, Terry Hancock
> <[EMAIL PROTECTED]> wrote:
>
> >> PS is there any difference between
> &
ces:
• for a context of this message, see: http://xahlee.org/tree/tree.htm
• for a exposition of syntax aspects of irregularity of Python's
“list-comprehension”, see
http://xahlee.org/perl-python/list_comprehension.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
i'm tired, but why can't i run:
t='m=3'
print eval(t)
the doc seems to suggest that eval is only for expressions... it says
uses exec for statements, but i don't seem to see a exec function?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
ction is more appropriate.
anyhow, for simplicity, let's start with this simpler spec...
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
ge, so they
share syntax form.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Duncan Booth wrote:
> Xah Lee wrote:
>
> > '''Table(f,[iStart,iEnd,iStep]) returns a list of f applied to the
> > range range(iStart,iEnd,iStep). Example: Table(f,[3,10,2]) returns
&g
der if i can even do it in a few days.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
David Van Horn wrote:
> Xah Lee wrote:
> > here's the Python spec for the Table function:
> ...
> > References:
> >
> > • for a context of this message, see: http://xahlee.org/tre
i have a large number of lines i want to turn into a list.
In perl, i can do
@corenames=qw(
rb_basic_islamic
sq1_pentagonTile
sq_arc501Tile
sq_arc503Tile
);
use Data::Dumper;
print Dumper([EMAIL PROTECTED]);
--
is there some shortcut to turn lines into list in Python?
Xah
[EMAIL
What is Expresiveness in a Computer Language
20050207, Xah Lee.
In languages human or computer, there's a notion of expressiveness.
English for example, is very expressive in manifestation, witness all
the poetry and implications and allusions and connotations and
dictions. There are a m
Most participants in the computering industry should benefit in reading
this essay:
George Orwell's “Politics and the English Language”, 1946.
Annotated:
http://xahlee.org/p/george_orwell_english.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/lis
oriented communist/socialist
nations or sovereignly ruled kingdoms & queendoms.
this post is archived at:
http://xahlee.org/UnixResource_dir/writ/mshatred155.html
© copyright 2003 by Xah Lee.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Jargons of Info Tech industry
(A Love of Jargons)
Xah Lee, 2002 Feb
People in the computing field like to spur the use of spurious jargons.
The less educated they are, the more they like extraneous jargons, such
as in the Unix & Perl community. Unlike mathematicians, where in
mathematics t
Unix, RFC, and Line Truncation
[Note: unix tradition requires that a return be inserted at every 70
characters in email messages or so so that each line are less than 80
characters. Unixers made this as a requirement into an RFC document.]
Xah Lee, 20020511
This truncation of lines business is
's docs, but do not exhibit jargon abuse,
rambling, author masturbation, or hodgepodge as do the OpenSource ones
mentioned above.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
nning, please someone tell me what the fuck is
it talking about?
Fuck the Python programing morons.
Thanks.
I just need to decompress files. Is it:
import gzip;
gzip.GzipFile("/Users/xah/access_log.1.gz");
can someone put a example into that fucking doc so that people don't
have to wad
dule really just want to
compress or decompress a file.
Fuck unix advocates and fuck Perlers and fuck Python morons.
PS For more about Python doc, please see:
http://xahlee.org/perl-python/re-write_notes.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Apache by default uses the following format for date:
30/Aug/2005
is there a module that turn this directly into mmdd?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
reduced to the general public.)
this post is archived at
http://xahlee.org/UnixResource_dir/writ/python_doc.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
On Python's Documentation
Xah Lee, 20050831
I'm very sorry to say, that the Python doc is one of the worst possible
in the industry. I'm very sick of Perl and its intentional obfuscation
and juvenile drivel style of its docs. I always wanted to learn Python
as a replacement of
nothing personal my friend. But just in case you are interested about
getting it:
the question here is about quality of documentation, not about whether
you got it.
http://xahlee.org/UnixResource_dir/writ/python_doc.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Sybren Stuvel wrote:
>
various different logos?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
identity and as well as advertisement.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Steve Holden wrote:
> Xah Lee wrote:
> > i noticed that Python uses various logos:
> >
> > http://python.org/pics/pythonHi.gif
> > http://python.org/pics/PyBanner038.gif
> > http://
does anyone know why the folllowing prints to the screen?
# python
import os
os.system(r"ls")
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
elease at another in a group frenzy?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
do you know what the Muses do when a mortal challenged them?
And, please tell me exactly what capacity you hold under the official
Python organization so that i can calculate to what degree i can kiss
your ass or feign mum of your ignorance.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Steve
Python Doc Problem Example: os.system
Xah Lee, 2005-09
today i'm trying to use Python to call shell commands. e.g. in Perl
something like
output=qx(ls)
in Python i quickly located the the function due to its
well-named-ness:
import os
os.system("ls")
however, according
Xah Lee wrote:
> does anyone know why the folllowing prints to the screen?
> # python
> import os
> os.system(r"ls")
Steve Holden wrote:
> It only prints to the screen when standard output of the invoking
> process is the screen. The sub-process forked by os.system
bin/tail","-n 1","access_log.4"],
stdout=subprocess.PIPE).communicate()[0]
of course, i can try workarounds something like os.system("gzip -d
thiss.gz && tail thiss"), but i wish to know if there's non-hack way to
determine when a system process is
Thanks all.
I found the answer, rather easily.
To make a system call and wait for it, do:
subprocess.Popen([r"/sw/bin/gzip","-d","access_log.4.gz"]).wait();
--
this post is archived at:
http://xahlee.org/perl-python/system_calls.html
Xah
[EMAIL PROTECTED]
a
pure Python solution
inF = gzip.GzipFile(ff, 'rb');
s=inF.readlines()
inF.close()
last_line=s[-1]
and since the log file is 100 megabytes it takes a long time and hogs
massive memory.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.py
isn't there a way to implement tail in python with the same class of
performance?
how's tail implemented?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Fredrik Lundh wrote:
> Fredrik Lundh wrote:
>
> > zcat|tail is a LOT faster.
>
> and here's the "right way
?
i wish to spruce up the rewritten re-module doc
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
with people's help.
if at the end it is good, i hope it can find its way into the official
doc.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
e: my use of OpenSource here does not include people of GNU
community.)
For more about Python Doc problems, see
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
left out.
---
This post is archived at:
http://xahlee.org/perl-python/python_doc_os_path_split.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Xah Lee wrote:
> Python Doc Problem Example
>
> Quote from:
> http://docs.python.org/lib/module-os.path.html
> --
> s
history, social
sciences, and mathematics. Also, study functional programing or hang
out in functional programing communities or hardcore GNU community many
also improve vastly your critical thinking and doc writing abilities.
More about documentation can be found here:
http://www.xahlee.or
ctical variation.
These two contrasting ideas can be easily seen thru Perl vs Python
languages, and as one specific example of their text pattern matching
abilities.
Perl is a language of syntactical variegations. Python on the other
hand, does not even allow changes in code's indentation, bu
is it possible to write python code without any indentation?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
i thought it is trivial for the Python parser to spit out a version
with matching brackets. Similarly, perhaps some opensourcing student
has modified a parser to read in a matching brackets delimited version
of Python.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http
bo ($) {
my $max=$_[0];
my %hh=();
for (my $j=1; $j < $max; ++$j) {
for (my $i=1; $i <= $max; ++$i) {
my $m = (($i+$j)-1)%$max+1;
if ($i < $m){ $hh{"$i,$m"}=[$i,$m];}
}
}
return \%hh;
}
use Data::Dumper;
$Data::Dumper::Indent=0;
pr
range(1,n+1):
©m = ((i+j)-1) % n + 1
© if (i < m):
©result["%d,%d"%(i,m)]=(i,m)
©return result
©
©print combo(4)
So sweet.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
athematica.html
# look for the function named Table.
his is Perl-Python a-day. To subscribe, see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
should be. I'll post Perl and Python codes tomorrow for
those interested. If you are a perl programer, try to code it in
Python. (it's easy.)
This is brought to you by the Perl-Python a-day community. To
subscribe, see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http
on) One must make a copy first, and work with
the copy.
Note also that in Python there's already a function called reduce. (it
is equivalent to Mathematica's Fold.) In Python, looks like user can
over-ride default functions.
This post is archived at
http://xahlee.org/perl-python/pairing_redu
my Python coding is not experienced. In this case, is
ps.pop("%d,%d"%(j[1],k[1]),0) out of ordinary?
if i have long paragraphs of documentation for a function, do i still
just attach it below the fun def?
Xah
Xah Lee wrote:
> here are the answers:
>
> ©Python code.
> ©
ps.pop("%d,%d"%(j[1],k[0]),0)
©return ps
©
©is reduce2 more efficient? It works entirely differently. I'll have
to think about it... besides algorithmic... onto the minute academic
diddling, i wonder if it is faster to delete entries in dict or add
entries...
Xah
[EMAIL
Xah Lee wrote:
> In imperative languages such as Perl and Python and Java, in general
it
> is not safe to delete elements when looping thru a list-like entity.
> (it screws up the iteration) One must make a copy first, and work
with
> the copy.
Correction:
When looping thru a list
Xah Lee wrote:
> In imperative languages such as Perl and Python
> and Java, in general it is not safe to delete
> elements when looping thru a list-like entity.
> (it screws up the iteration) One must make a
> copy first, and work with the copy.
Correction:
When looping thru a l
Xah Lee wrote:
> In imperative languages such as Perl and Python
> and Java, in general it is not safe to delete
> elements when looping thru a list-like entity.
> (it screws up the iteration) One must make a
> copy first, and work with the copy.
Correction:
When looping thru a l
-python/python.html ==
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
version can also use some clean up, or even rewrite as a program
in the Python language proper. Addenda or Errata will be added on this
page.
PS all together there are some 3 or so solutions posted on the
newsgroups. (one by private email) I will have to filter them out and
study them.
Any interesting or important Addenda or Errata will be emailed out
later.
In addition to being archived here:
http://xahlee.org/perl-python/partition_by_equiv.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
break
©if (goto):
©goto=False
©break
©else:
©fin.append(group)
comlete code is at:
http://xahlee.org/perl-python/partition_by_equiv.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailma
on, each number represent a computer file,
there are up to tens of thousands of files, and much less than 0.1% is
same as another, and for files that are same, each equivalent group
number no more than 10 or so.)
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
John Machin wrote:
&
| sets.get(x2, frozenset([x2])))
©for i in newset:
©sets[i] = newset
©
©return [list(aset) for aset in set(sets.itervalues())]
it would be nice if the two working programs do not use some package.
This problem shouldn't need to.
Xah
[EMAIL PROTECTED]
101 - 200 of 529 matches
Mail list logo