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
dustry
geeking moron's need to computer-sciency speak with implementation
infatuation. And in part it came to that really because they are
comparative morons.
for a more sincere, detailed account, please see:
http://xahlee.org/perl-python/re-write_notes.html
Thanks.
Xah
[EMAIL PROTEC
Apparently i tried it before posting
eval '3'
and got misleading errors because i forgot the parenthesis...
This is a easy one to find in the doc...
The unhelpful doc organization and past experiences confounded this
case.
Thanks.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
i wanted to find out if Python supports eval. e.g.
somecode='3+4'
print eval(somecode) # prints 7
in the 14 hundred pages of python doc, where am i supposed to find this
info?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
e.org/perl-python/re-write_notes.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
how can i define a function with variable parameters? For example,
f(a) would return [a]
f(a,b) would return [a,b]
f(a,b,...) would return [a,b,...]
One solution is of course to make the argument as a list. i.e.
f([a,b,...])
but are there other solutions?
Xah
[EMAIL PROTECTED]
∑ http
l in processing tree structures, such as XML and many other things
spurn from it today.
Disclaimer: this project is not affiliated with Wolfram Research Inc.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
if i have
mytext.replace(a,b)
how to find out many many occurances has been replaced?
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
approved by Wolfram Research Incorporated.)
The first argument of Table function in Mathematica (mma) is a
expression. Most other languages cannot have such symbolic expressions.
In Perl, a string is choosen instead as the experssion, and it is being
evalutade later as code. This may not be a practical choice but anyway
it's just a exercise. Each other language should choose appropriate
design for this emulation...
Perl, Python, Java solutions will be posted by me in the coming days.
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
sions archived here:
http://xahlee.org/tree/tree.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
Dear functional programers,
i run services called a-python-a-day and a-java-a-day, where each day i
give a tip or snippet of code in these languages, also as a way for me
to learn these languages
along
with its 40 or so methods and other things.
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html (local copy)
---
to be continued...
This is part of an installment of the article
“What are OOP's Jargons and Complexities”
by Xah Lee, 20050128. The full text is at
http://xahle
argons and Complexities”
by Xah Lee, 20050128. The full text is at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
© Copyright 2005 by Xah Lee. Verbatim duplication of the complete
article for non-profit purposes is granted.
The article is published in the following newsgroups:
comp.lang.c,c
ment of the article
“What are OOP's Jargons and Complexities”
by Xah Lee, 20050128. The full text is at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
© Copyright 2005 by Xah Lee. Verbatim duplication of the complete
article for non-profit purposes is granted.
The article is publish
are usually treated as a special method at the
language level, its concept and linguistic issues is a OOP machinery
complexity, while the Accessor concept is a OOP engineering complexity.
-
to be continued tomorrow.
This is part of an installment of the article
“What are OOP's Jargons and
/writ/jargons.html
Xah
[EMAIL PROTECTED]
∑ http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
of static versus instance members, is one complexity arising
out of OOP.
--
to be continued tomorrow.
This is part of an installment of the article
“What are OOP's Jargons and Complexities”
by Xah Lee, 20050128. The full text is at
http://xahlee.org/Periodic_dosage_dir/t2/oop.html
What are OOP's Jargons and Complexities
Xah Lee, 20050128
The Rise of Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncomm
What are OOP's Jargons and Complexities
Xah Lee, 20050128
The Rise of Classes, Methods, Objects
In computer languages, often a function definition looks like this:
subroutine f (x1, x2, ...) {
variables ...
do this or that
}
In advanced languages such as LISP family, it is not uncomm
nline
http://documents.wolfram.com/mathematica/
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
sa wrote:
> xah:
>
> i've provided k implementations here:
>
> http://www.nsl.com/k/xah.k
>
> of a dozen or so of the functions in your toolkit. many are trivial,
> since they&
e not expected to be exemplary. These
are exercises for all, also as a intro to functional programing to
industry programers. Also, later on there will be non-trivial problems.
# -*- coding: utf-8 -*-
# Python
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
import math;
def Range(iMin, iMax
Here's the Python solution.
--
# -*- coding: utf-8 -*-
# Python
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
# implementation note: When iStep is a decimal, rounding error
# accumulates. For example, the last item returned from
# Range(0,18,0.3) is 17.7 not 18. A remedy
Here's the Perl code.
--
#! perl
# http://xahlee.org/tree/tree.html
# Xah Lee, 2005-05
#_ Range _ _ _ _
=pod
B
Range($iMax) generates the list [1, 2, ... , $iMax].
Range($iMin, $iMax) generates the list [$iMin, ... , $iMax].
Range($iMin, $iMax, $iStep)
, 6.5, 6.8]
Range( 5, -4, -2); # returns [5,3,1,-1,-3]
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
n't a solution.
can this be done in Python?
or, must the args be changed to a list?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
, either personally or as part of the
Python collective, to behave properly.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
Newsgroups: comp.lang.python
From: Ron Adam <[EMAIL PROTECTED]> - Find messages by this author
Date: Sat, 07 May 2005 20:23:35 -0400
Local: Sat,May 7 2005 8:23Âpm
Su
Today we'll be writing a function called Range. The Perl documentation
is as follows.
Perl & Python & Java Solutions will be posted in 48 hours.
This is Perl-Python a-day. See
http://xahlee.org/web/perl-python/python.html
Xah
[EMAIL PROTECTED]
â http
Today we'll be writing a function called Range. The Perl documentation
is as follows.
Perl & Python & Java Solutions will be posted in 48 hours.
This is Perl-Python a-day. See
http://xahlee.org/web/perl-python/python.html
Xah
[EMAIL PROTECTED]
â http
x module is at:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
See also: Responsible Software Licensing
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
erratum:
the correct URL is:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
is archived at:
http://xahlee.org/perl-python/re-write_notes.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
â
--
http://mail.python.org/mailman/listinfo/python-list
s to be classified according to some Python idiosyncrasies or
categorization by some forced âcomputer scienceâ outlook.
The complete rewritten doc is here:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html
-
There were more issues and notes... but this will be it for today.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
Dear Steve Holden,
the rewrite of the regex doc is instigated by your offer.
it is published and announced here on April 18th. If you deem it
proper, paypal me. It will be to your credit and easier to incorporate
into the main doc.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http
I have produced my doc.
( http://xahlee.org/perl-python/python_re-write/lib/module-re.html )
isn't there a hundred dollars due to me?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html
Steve Holden wrote:
> Xah Lee wrote:
> [mountains of irrelevant drivel which no
send your feedbacks to Steve Holden. (http://www.holdenweb.com/)
If he deem it proper, he will paypal me $100 bucks, and you can thank
him for the instigation and betterment of the Python doc.
Meanwhile, feel free to incorporate my edits into python doc.
Xah
[EMAIL PROTECTED]
â http
WRITERS or NEED EXAMPLE HERE.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
suppose the same for
groupindex() )
thanks.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
t by null bytes here? Unprintable chars?? and the "\number"
is meant to be decimal? and in what encoding?
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
how to represent the unicode "em space" in regex?
e.g. i want do something like this:
fracture=re.split(r'\342371*\|\342371*',myline,re.U)
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
--
http://mail.python.org/mailman/listinfo/python-list
the doc is talking about?
But, can this doc be (re-)written effectively and easily so that any
programers needn't do trial'n'error post-reading?
The answer to the questions are resounding yeses, you fucking asses.
paypal me a hundred dollars and i'll rewrite the whole re doc in a f
can any GNU person or emacs coder answer this?
specifically: why does what-cursor-position give incorrect answer.
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html â
Xah Lee wrote:
> I found the problem now. (after some one hour debug time) Python
> didn't have pro
ursor position and the
char's ascii code, says the EOL is ascii 10 when it is in fact ascii
13. Fuck the irresponsible fuckhead who is responsible for this.
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/
Xah Lee wrote:
> Why is
happen.
findreplace = [
(ur'',
ur'''tt
'''),
]
...
inF = open(filePath,'rb')
s=unicode(inF.read(),'utf-8')
inF.close()
for couple in findreplace:
outtext=s.replace(couple[0],couple[1])
s=outtext
outF = open(temp
ing
needs to be Python-as-is, as opposed to computer science framework.
I'll might have to give more details in the future, but I've made some
headway in this respect before; peruse:
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org
2]:
result.sort(lambda x,y: cmp(float(x[dir[0]]),
float(y[dir[0]])) )
else:
result.sort(lambda x,y: cmp(float(x[dir[0]]),
float(y[dir[0]])), None, True )
return result
m = [
[3, 99, 'a'],
[2, 77, 'a'],
[1, 77, '
Better:
there is a Python, pithy
mighty, lissome, and tabby
algorithms it puffs
conundrums it snuffs
and cherished by those savvy
there is a camel, kooky
ugly, petty, ungainly
hacking it supports
TIMTOWTDI it sports
and transports DWIM-wit's fancy
Xah
[EMAIL PROTECTED]
â http://xahle
umm... looks like it should've been:
Comparison can be chained, and is equivalent to a sequence of
comparisons with âandâ in between. For example, âxhttp://xahlee.org/
Terry Reedy wrote:
> >Comparisons can be chained, and is evaluated from left to right. For
> >example, x < y <= z is equivalent t
there is a Python, pithy
mighty, lissome, and tabby
algorithms it puffs
tim-toady it engulfs
and sways universality
there is a camel, lanky
ugly, petty, ungainly
foolhardy comports
hacking it supports
and toadies eunuch's fancy
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more
common and does not indicate
incompetence), being aware of it helps greatly in its exposition.
This and past critics on Python documentation and IT doc in general is
archived at
http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
Xah
[EMAIL PROTECTED]
â http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
Today we'll write a program that can sort a matrix in all possible
ways.
Here's the Perl documentation. I'll post a Perl and Python version in 2
days.
---
sort_matrix( $matrix, [[$n1, $stringQ, $directionQ], [$n2, $stringQ,
$directionQ], ...]) sorts a matrix by $n1 th column then $n2 th.
Combo114.py
Genpair114.py
Here're the files: del_dup.zip
-
to get the code and full detail with latest update, please see:
http://xahlee.org/perl-python/delete_dup_files.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Claudio Grondi wrote:
> >> I'
Fuck google incorporated for editing my subject name without
permission.
and fuck google incorporated for editing my message content without
permission.
http://xahlee.org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http
, '|', name(x,'-')
--
http://xahlee.org/perl-python/unicodedata_module.html
anyone wants to supply a Perl version?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Brian McCauley wrote:
> Xah Lee wrote:
>
> > i don't know what's the state of Perl's unicode.
>
> perldoc perlunicode
--
http://mail.python.org/mailman/listinfo/python-list
how do i get a unicode's number?
e.g. 03ba for greek lowercase kappa? (or in decimal form)
Xah
Xah Lee wrote:
> python has this nice unicodedata module that deals with unicode
nicely.
>
> #-*- coding: utf-8 -*-
> # python
>
> from unicodedata import *
>
> # each u
27;s unicode. Is there something
similar?
--
this post is archived at
http://xahlee.org/perl-python/unicodedata_module.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
"released ..." indicates the doc or the doc and the
software?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
e program.
a absolute requirement in this problem is to minimize the number of
comparison made between files. This is a part of the spec.
feel free to write it however you want. I'll post my version in a few
days.
http://www.xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
Nevermind. I was thinking too much. :) Thanks.
Xah
Peter Hansen wrote:
> Xah Lee wrote:
> >>def myFun(var):
> >> return var+1
> >>globe = 0
> >>globe = myFun(globe)
> >
> > this is intriguing. How does it work?
> > not a rhetoric
>def myFun(var):
> return var+1
>globe = 0
>globe = myFun(globe)
this is intriguing. How does it work?
not a rhetorical question, but where in the python doc can i read about
it?
thanks.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python
nutshell, these people are spreading
untruths and indirectly are causing massive harm in the computing
industry. People, we need to stop it. This each of us can do by not
accepting their attitudes or behavior. In online forums, work place,
conventions, conversations etc., raise questions or otherwi
Truely superb!
Thanks!
Xah
[EMAIL PROTECTED]
http://xahlee.org/
[EMAIL PROTECTED] wrote:
> Xah Lee <[EMAIL PROTECTED]> wrotE:
>
> > i have a bunch of files encoded in GB18030. Is there a way to
convert
> > them to utf16 with python?
>
> You will need CJKCod
ython doc is quite stilted. Where in the python doc is a programer
supposed read about how the package/module system in Python works?
(besides the tutorial that touches it)
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
i have a bunch of files encoded in GB18030. Is there a way to convert
them to utf16 with python?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
if i understand correctly, forms such as
(lambda x,y:x+y)(a,b)
can only be gained thru experience? and not documented directly
anywhere in the official docs?
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
PS sorry for the rude remarks out of nowhere.
Xah
--
http://mail.python.org/mailman/listinfo/python-list
n throughly brainwashed by
imperative shits. (and these morons don't even know it)
i'll explain the ins and outs of expressions of functions some other
day.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
once i have a expresson of a function, how to apply it to arguments?
e.g. if i have
lambda x,y:x+y
i have to applied it to a,b in my code.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
t in range(s)
@for a in partiSet[t]
@for b in partiSet[s]]
@
@ll=( [[9,1],[5],[2,8,7]])
@t=genpair(ll)
@t2=genpair2(ll)
@if (t.sort()==t2.sort()): print 'yay'
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
]]
(we do not assume the given set has order, so the result is not
ordered.)
Perl code and Python code will be posted in 2 days.
This is brought to you by the perl-python community. To subscribe, see
http://xahlee.org/perl-python/python.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir
org/UnixResource_dir/writ/responsible_license.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
Xah Lee wrote:
> folks:
>
> when using google to post a reply, it sometimes truncates the subject
> line. i.e. [perl-python] is lost. This software error is obvious,
rate a law suit and if such company do not take software
correctness seriously, we must punish them.
Please spread this awareness.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
guages
are hardware-centric), as opposed to algorithm math concepts.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
is there a way to write a expression of a function with more than 1
argument?
e.g., i want a expression that's equivalent to
def f(x,y)
return x+y
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
lee.org/perl-python/gen_parti_by_equiv.html
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
the predicate given. For example, in the given
example, it tells us that the 2nd, 3rd, 4th elements are equivalent.
And they are equivalent measured by the predicate function given, which
basically tests if their last item are the same integer. (note that if
we want to view the result as indexes, then it is 1-based index. i.e.
counting starts at 1.)
PS if you didn't realize yet, nested lists/dictionaries in perl is a
complete pain in the ass.
PS note that the code "sub {$_[0]->[3] == $_[1]->[3]}" is what's called
the lambda form, in Perl.
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-list
rsions from Reinhold Birkenfeld, the one using graphs by bearophile
...
since many of you have already collected and tested these... i wonder
if anyone'd be interested to put together all the (working) code in a
single message? (or even a webpage.)
thanks.
Xah
[EMAIL PROTECTED]
http
| 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]
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:
&
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
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
-python/python.html ==
Xah
[EMAIL PROTECTED]
http://xahlee.org/PageTwo_dir/more.html
--
http://mail.python.org/mailman/listinfo/python-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
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
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
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.
> ©
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
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
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
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
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
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
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
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
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
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
;
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
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
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
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
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
401 - 500 of 529 matches
Mail list logo