"", line 1
sort([[1,2,3],["ABC"],['Z','A'], X(), 4)
^
SyntaxError: invalid syntax
Care to give an actual example?
--
\"I went to the hardware store and bought some used paint. It |
`\ was in the shape of a house." -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
quot; -- Groucho Marx |
`\ |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
e,
and get the lines back again later from your version control system.
--
\ "I am an optimist. It does not seem too much use being anything |
`\ else." -- Winston Churchill |
_o__)
Fredrik Lundh <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
>
> > My preferred answer:
> >
> > if m:
> > print line,
> >
> > and get the lines back again later from your version control system.
>
> switching debugging stateme
to success in life: 1. Don't tell people everything |
`\ you know." -- Sassan Tat |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
[Please don't top-post replies. I've corrected it in this post.]
Wijaya Edward <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > Wijaya Edward <[EMAIL PROTECTED]> writes:
> > > How can we print out the hidden character like "\n", "\r
#x27;re not here to do your homework
assignments.
--
\ "It is seldom that liberty of any kind is lost all at once." |
`\ -- David Hume |
_o__) |
Ben Finne
Fulvio <[EMAIL PROTECTED]> writes:
> ***
> Your mail has been scanned by InterScan MSS.
> ***
Please stop sending messages with obnoxious headers like this.
--
http://mail.python.org/mailman/listinfo/python-list
Fulvio <[EMAIL PROTECTED]> writes:
> ***
> Your mail has been scanned by InterScan MSS.
> ***
Please stop sending messages with obnoxious headers like this.
--
http://mail.python.org/mailman/listinfo/python-list
long! Mind if I sign it now and read it |
_o__) later?" -- http://www.achewood.com/ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
little kid we had a sand box. It was a quicksand |
`\box. I was an only child... eventually." -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
, your system may become |
`\ unstable." -- Microsoft, Windows 95 BSOD message |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"If you get invited to your first orgy, don't just show up |
`\ nude. That's a common mistake. You have to let nudity |
_o__) 'happen.'" -- Jack Handey |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
200610.html#e20061022T192641>
--
\ "Immorality: The morality of those who are having a better |
`\ time." -- Henry L. Mencken |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
what else you can do with them.
--
\ "A free society is one where it is safe to be unpopular." -- |
`\ Adlai Ewing Stevenson |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"Peter Decker" <[EMAIL PROTECTED]> writes:
> On 10/26/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> > There is always the option to not send messages to this list using
> > that mail server. I don't care what option is taken, so long as
> > the us
Ben Finney <[EMAIL PROTECTED]> writes:
> The 'read' method of the resulting file object will return the
> contents of the file. You may also want to read the documentation of
> thile objects to see what else you can do with them.
And ith you couldn't underthtand my
mptom that arises from people who are first advised to
introduce tests to their code, though.
--
\ "If you ever catch on fire, try to avoid seeing yourself in the |
`\mirror, because I bet that's what REALLY throws you into a |
_o__)
that boolean contexts can interpret as "false"?
Perhaps allowing (but not requiring) an iterator object to grow a
'len' method is the simplest way.
--
\ "I like my dental hygenist, I think she's very pretty; so when |
`\I go to have my teeth cleaned, while I
; class, since the instance name will make
its meaning clear, and other instances don't need to share any
behaviour or semantics.
--
\ "There is no reason anyone would want a computer in their |
`\ home." -- Ken Olson, president, chairman and founder of |
_o__)Digital Equipment Corp., 1977 |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Fulvio <[EMAIL PROTECTED]> writes:
> On Friday 27 October 2006 06:48, Ben Finney wrote:
> > There is always the option to not send messages to this list using
> > that mail server
>
> Once again sorry for that. I'll take action to switch to another
> mailserver
[EMAIL PROTECTED] (Aahz) writes:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> >Use a unique do-nothing object, defined at the module level so
> >callers can easily get at it [...]
> >
> >GLOBAL = object()
> >
> >def insert_ids(ids=GLOBAL):
&g
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Friday 27/10/2006 11:40, Aahz wrote:
> > Ben Finney wrote:
> > >GLOBAL = object()
> > >
> > >def insert_ids(ids=GLOBAL):
> > >if ids is GLOBAL:
> > >ids = g
uot; -- |
`\ Vroomfondel, _The Hitch-Hiker's Guide To The Galaxy_, Douglas |
_o__)Adams |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"Michael B. Trausch" writes:
> Ben Finney wrote:
> > Jean-Paul Calderone <[EMAIL PROTECTED]> writes:
> >
> >> 1) Write unit tests for your code. Keep writing unit tests until
> >> you have some that _don't pass_. Then fix your code so that
nction type. Define
a class that has a '__call__' attribute, make an instance of that, and
you'll be able to access attributes and call it like a function.
--
\ "Writing a book is like washing an elephant: there no good |
`\place to begin or end, and it's hard to keep track of what |
_o__) you've already covered." -- Anonymous |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
#x27;ll need to rewrite it
so it does what you're actually trying to do.
Again, please make sure you work on these problems yourself; your
assessment should not be testing your ability to ask on the internet
for assistance.
--
\ "All good things are cheap; all bad are very dear.&
--
\ "For of those to whom much is given, much is required." -- |
`\ John F. Kennedy |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
really want that,
you could subclass 'enumerate', but it seems the above function does
what you want.
--
\"I installed a skylight in my apartment. The people who live |
`\ above me are furious!" -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney <[EMAIL PROTECTED]> writes:
> >>> print enumerate("ABCDE")
>
> >>> print list(enumerate("ABCDE"))
> [(0, 'A'), (1, 'B'), (2, 'C'), (3, 'D'), (4, 'E')]
>
&
problems with the same thinking we used |
`\ when we created them." -- Albert Einstein |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
e_name, 'r')
exec module_file in module.__dict__
return module
--
\ "A celebrity is one who is known by many people he is glad he |
`\ doesn't know." -- Henry L. Mencken |
_o__)
on't have the commitment for that. What if I were to C-x C-v
a few different ones instead?
--
\"If you continue running Windows, your system may become |
`\ unstable." -- Microsoft, Windows 95 BSOD message |
_o__)
"Steven D'Aprano" <[EMAIL PROTECTED]> writes:
> On Tue, 31 Oct 2006 11:00:52 +1100, Ben Finney wrote:
>
> > If you want a solution that gives you an actual module object,
> > here's what I use:
> >
> > def make_module_from_file(mo
er OS
errors?
--
\"We have to go forth and crush every world view that doesn't |
`\ believe in tolerance and free speech." -- David Brin |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
exist"
> print f
Except that there are other conditions than "File doesn't exist" that
can cause an 'open' to fail.
--
\"If you continue running Windows, your system may become |
`\ unstable." -- Microsoft, Windows 95 B
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > > You could try to read the file, if that fails it doesn't exist:
> >
> > Except that there are other c
icate they shouldn't be re-bound.
--
\ "Everything you read in newspapers is absolutely true, except |
`\for that rare story of which you happen to have first-hand |
_o__) knowledge." -- Erwin Knoll |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
147483647
--
\ "Laugh and the world laughs with you; snore and you sleep |
`\ alone." -- Anonymous |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
anyone's interested.
Yes please.
--
\ "The opposite of a correct statement is a false statement. But |
`\ the opposite of a profound truth may well be another profound |
_o__) truth." -- Niels Bohr |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
time and you see somebody else |
`\ flying forward into the future, it's probably best to avoid eye |
_o__) contact." -- Jack Handey |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
man of value." -- Albert Einstein |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
instead of just the one list.
This is one of the many reasons why Python's built-in composite types
are so useful. A group of semantically-related values can be passed as
a single composite value.
--
\ "I hope that after I die, people will say of me: 'That guy sure |
`\ owed me a lot of money.'" -- Jack Handey |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
fool you. He really is an idiot." -- Groucho Marx |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
64624.html>
A search for the separate terms "python iteration variable scope" will
turn up more.
--
\ "The best way to get information on Usenet is not to ask a |
`\question, but to post the wrong information." -- Aahz |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
t's been altered.
--
\ "I have a large seashell collection, which I keep scattered on |
`\the beaches all over the world. Maybe you've seen it." -- |
_o__) Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > If you pass a *mapping* of the
> > "I-might-want-to-add-more-in-the-future" values, then you get both
> > explicit *and* expandable, without an arbitrary unneeded sequence.
>
> Do you m
ought a self learning record to learn Spanish. I turned it |
`\on and went to sleep; the record got stuck. The next day I |
_o__)could only stutter in Spanish." -- Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
stance between two points is under |
`\ construction." -- Noelie Alito |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
quot; -- Charles A. |
`\ Beardsley |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > Steve Holden <[EMAIL PROTECTED]> writes:
> >> Java is horrible, Oython is not.
> > Is that the predecessor to Python, the one that could only be
> > expressed in vowel noises?
> >
&
Contract, sir, and the Piano is yours." |
`\ Ray: "Sheesh! This is long! Mind if I sign it now and read it |
_o__) later?" -- http://www.achewood.com/ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
quot; -- Unix Programmer's Manual, 2nd Ed., 12-Jun-1972 |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
e world is either a madman or an economist." -- Kenneth |
_o__) Boulding |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
|
`\ trifling exception, is composed of others." -- John Andrew |
_o__) Holmes |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
for exactly the reason you state.
--
\"To me, boxing is like a ballet, except there's no music, no |
`\choreography, and the dancers hit each other." -- Jack Handey |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
ngtest/>
--
\ "A free society is one where it is safe to be unpopular." -- |
`\ Adlai Ewing Stevenson |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
specifiers; it
just wants a string expression. It's the formatting operator, '%',
that looks for them.
http://docs.python.org/lib/typesseq-strings.html>
--
\ "When I was little, my grandfather used to make me stand in a |
`\ closet for five minutes without moving. He said it was elevator |
_o__) practice." -- Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"John Machin" <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > You're printing a string, and never using that 'row' parameter.
>
> If that is so, why is he getting that message "TypeError: format
> requires a mapping"?
No idea. Probab
umber of
characters, even though it is affected when they change.
--
\ "I bought a self learning record to learn Spanish. I turned it |
`\on and went to sleep; the record got stuck. The next day I |
_o__) could only stutter in Spanish." -- Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
ed.'" -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
\ "It is the mark of an educated mind to be able to entertain a |
`\ thought without accepting it." -- Aristotle |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
enumber, in_line)
out_file.write(out_line)
This also means you're one easy step away from padding the line number
to a minimum width::
out_line = "%06d:: %s" % (linenumber, in_line)
--
\ "I must say that I find television very educational. The minute |
`\ somebody turns it on, I go to the library and read a book." -- |
_o__) Groucho Marx |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"Steven D'Aprano" <[EMAIL PROTECTED]> writes:
> On Fri, 17 Nov 2006 14:18:12 +1100, Ben Finney wrote:
>
> > The function call syntax doesn't allow a space between the
> > function name and the opening parenthesis.
>
> Are you sure?
Are you kid
"Prediction is very difficult, especially of the future." -- |
`\Niels Bohr |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Max M <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > "anya" <[EMAIL PROTECTED]> writes:
> >
> >
> >>Acctualy there is a solution:
> >>see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473810
> >
> >
w', 'u'], ['e', 'i'], ['r', 'o'], ['t', 'p']]
>>> print pileshuffle(deck, 3)
[['q', 'r', 'u', 'p'], ['w', 't', 'i'], ['e', 'y&
who do. And for the people who like country music, |
_o__) denigrate means 'put down'." -- Bob Newhart |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
http://www.gnu.org/software/emacs/>
--
\ "A child of five could understand this. Fetch me a child of |
`\ five." -- Groucho Marx |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
rint filename
result_00123.txt
--
\"When you go in for a job interview, I think a good thing to |
`\ ask is if they ever press charges." -- Jack Handey |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"Gerard Flanagan" <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > pile_index = 0
> > for card in deck:
> > piles[pile_index].append(card)
> > pile_index = (pile_index + 1) % numpiles
> >
>
> no ne
s the action of the thinking |
_o__) power called an idea" -- Thomas Jefferson |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
cribing the
behaviour you want from your program.
--
\ "The only tyrant I accept in this world is the still voice |
`\ within." -- Mahatma Gandhi |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
it look round?" Eccles: "Yes, but I don't think it saw me." |
_o__) -- The Goon Show, _Wings Over Dagenham_ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
n ends. This greatly aids the
person reading the program: they have fewer things to concentrate on
at any point in your program.
--
\ "For every complex problem, there is a solution that is simple, |
`\neat, and wrong." -- Henry L. Mencken |
_o__)
perty, it is the action of the thinking |
_o__) power called an idea" -- Thomas Jefferson |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
omes from |
`\ bad judgement." -- Frederick P. Brooks |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
ut that author in future, while still
preserving their copyright.
--
\"I was in the grocery store. I saw a sign that said 'pet |
`\ supplies'. So I did. Then I went outside and saw a sign that |
_o__) said 'compact cars'." -- Steven Wright |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
chosen the Expat
license as being acceptable; use that, and you grant all the rest
without even mentioning it.
--
\ "[On the Internet,] power and control will shift to those who |
`\ are actually contributing something useful rather than just |
_o__)
posters on this thread and encourage you to
consider using the standard 'unittest' module, and recommend 'nose'
for test discovery and execution:
http://somethingaboutorange.com/mrl/projects/nose/>
--
\ "Unix is an operating system, OS/2 is half an operating system, |
`\
--
\ "A lot of people are afraid of heights. Not me, I'm afraid of |
`\widths." -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
-- Emo Philips |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
bruno at modulix <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> (snip)
> > if __name__ == "__main__":
> > test_funcs = [x for name, x in globals()
> > if name.startswith("test") and hasattr(x, "__call__"
"Johann C. Rocholl" <[EMAIL PROTECTED]> writes:
> Ben Finney schrieb:
> > Simplify. Please don't attempt to write yet another set of license
> > terms without expert legal assistance. You've already chosen the
> > Expat license as being acceptable; u
|
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
return int_val
Adjust for whatever algorithm you want to use. Consult a book of
algorithms if you want a better implementation than my off-the-cuff
brute-force approach.
--
\ "Remorse: Regret that one waited so long to do it." -- Henry |
`\L. Mencken |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
they avoid." -- Soren Aabye Kierkegaard |
_o__) (1813-1855) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
"Serge Orlov" <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > That's a large part of my question. How can I lay out these
> > modules sensibly during installation so they'll be easily
> > available to, but specific to, my application?
>
>
John Machin <[EMAIL PROTECTED]> writes:
> On 15/06/2006 10:31 AM, Ben Finney wrote:
> > If you want a special interpretation of the value, you'll have to
> > calculate it.
> >
> > Example assuming you want a one's-complement interpretation::
>
>
the object is to preserve them, |
_o__) it is no longer so." -- Voltaire, _Dictionnaire Philosophique_ |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
can be used with those from the standard library.
--
\ "There is no reason anyone would want a computer in their |
`\ home." -- Ken Olson, president, chairman and founder of |
_o__)Digital Equipment Corp., 1977 |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney <[EMAIL PROTECTED]> writes:
> [EMAIL PROTECTED] writes:
> > I am new to Python and am working on my first program. I am trying
> > to compare a date I found on a website to todays date. The problem I
> > have is the website only shows 3 letter month name and
Ambrose Bierce |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
, and decode
the data to Unicode from that encoding.
--
\ "Man cannot be uplifted; he must be seduced into virtue." -- |
`\ Donald Robert Perry Marquis |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
ld safe for our children, but not |
`\our children's children, because I don't think children should |
_o__) be having sex." -- Jack Handey |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
response. This is of even greater assistance to the blind, who then
have just the necessary context to understand the current message.
http://en.wikipedia.org/wiki/Top_posting>
--
\ "We are not gonna be great; we are not gonna be amazing; we are |
`\gonna be *amazingly* amazi
tes would copulate with anything that moved, but I |
`\never saw any reason to limit myself." -- Emo Philips |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
EP 8) instances are named with all lower case, either joinedwords or
separate_by_underscores.
--
\"Crime is contagious ... if the government becomes a |
`\lawbreaker, it breeds contempt for the law." -- Justice Louis |
_o__)
result = -1
return result
--
\ "Ours is a world where people don't know what they want and are |
`\willing to go through hell to get it." -- Donald Robert Perry |
_o__) Marquis |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
" -- |
`\ Henry L. Mencken |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
2101 - 2200 of 4138 matches
Mail list logo