On Wed, 23 Jun 2010 23:47:55 +0100, rantingrick rantingr...@gmail.com
wrote:
On Jun 23, 4:43 pm, Rhodri James rho...@wildebst.demon.co.uk
wrote:
And how exactly does your example express itself in a more
syntactically-correct linear-flow than the two code snippets i
provided earlier
was like that once. In the 1970s, all you could return was
an int or a float. But that got fixed.
Strangely, these facts are not unconnected.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
another artistic interpretation of a photograph of your
code :-), then I'd go with Matt's analysis. This will give you a
NameError for fws_last_col if tracker.hasFWS() happens to return False for
all students.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org
version of Python are you using?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
. Basically, try a
few different editors out and see what style you like.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
until it's actually used.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
. The answers
to all your questions are section 9 of the tutorial.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
...@gnudebst:~$ HELLO=world
rho...@gnudebst:~$ echo $HELLO
world
rho...@gnudebst:~$ export HELLO
rho...@gnudebst:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
import os
os.environ['HELLO']
'world'
--
Rhodri
a lot. It seemed time to
be a little sharper in the hope that learning might emerge.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
that is not is a single operator, *not* the concatenation
of is and not. Your last test is probably not checking what you think
it is :-)
3 is (not None)
False
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
...
@classmethod
def from_list(cls, lst):
return cls(lst[0], lst[1], lst[2])
vect = [1,2,3]
myvec = Vector.from_list(vect)
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
namespaces are implemented with dictionaries. The distinction you're
missing is that lists and dictionaries are mutable, while booleans aren't;
you can change the contents of a dictionary, but you can't change the
'contents' of a boolean.
--
Rhodri James *-* Wildebeeste Herder to the Masses
that.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
it would be
mod.config.x.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
to this object and cannot be
rebound.' That would cover most of the cases people care about, and the
gotchas are essentially the same as with default arguments.
But yes, it would require new syntax.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo
browser.
It's been working fine for me, using Opera on Window and Ubuntu, for the
last week or so.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
you mean
FrameFormat.XUnion.subSample = 0
FrameFormat.XUnion.binning = 0
instead?
FrameFormat.flagsX = 0
FrameFormat.YUnion = 0
Ditto here?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
actually installed it yet. Check the Sage website, which has
plenty of documentation, and try to figure out where you left the path on
whichever method you used.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
tutorial. However, now all I can find is more complex games using
Pygame. Can anyone help me out here?
Try the numbered worksheets from the Livewires course:
http://www.livewires.org.uk/python/home They are aimed at 12-15 year
olds, but an 11 year old should be able to cope.
--
Rhodri
doubt it.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
thank you for breaking the minimal threading that can be
inferred from titles if the list reflector adds stuff unexpectedly.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 09 Feb 2011 01:59:46 -, David Robinow drobi...@gmail.com
wrote:
On Tue, Feb 8, 2011 at 5:03 PM, Rhodri James
rho...@wildebst.demon.co.uk wrote:
On Tue, 08 Feb 2011 12:18:50 -, przemol...@poczta.fm wrote:
On Tue, Feb 08, 2011 at 10:16:42PM +1100, Ben Finney wrote:
Either
and Python nuances that I need to be up to speed on.
On the whole, I'd forget about VB and start with the tutorial at
www.python.org.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
twenty times bigger?
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 15 Feb 2011 07:06:35 -, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Sun, 13 Feb 2011 23:42:06 +, Rhodri James wrote:
On Fri, 11 Feb 2011 02:08:01 -, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Thu, 10 Feb 2011 15:48:47 +
for it to discourage overly long lines.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 21 Feb 2011 01:41:12 -, Richard D. Moores rdmoo...@gmail.com
wrote:
On Sun, Feb 20, 2011 at 16:31, Rhodri James
rho...@wildebst.demon.co.uk wrote:
On Sat, 19 Feb 2011 23:56:45 -, Richard D. Moores
rdmoo...@gmail.com
wrote:
Vista
Python 3.1.3
I can't figure out how
the current PATH setting (in the lower half of the
dialog) to add ;C:\python27 to the end. Obvious, isn't it :-/
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
typed.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
think what you
meant was something like this:
class NewClass(BaseClass):
def __init__(self, a, b, c, d, new):
super(NewClass, self).__init__(a, b, c, d)
self.new = new
# etc
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman
._parent = obj
1. Please don't top-post, it really doesn't help legibility.
2. This is an artist's impression of a photograph of a greek translation
of your code. I wouldn't use it as a reference for anything except how
to terminally confuse yourself.
--
Rhodri James *-* Wildebeeste Herder
and discard the --
* bare - (if not the argument to some option): halt command-line
processing but keep the - (append it to parser.largs)
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
whatever object data[0] gives
you exactly like any other use of that type of object. If it
gives you a dictionary, you can write:
data[0]['spam'] = moist and delicious
and so on.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
, list slicing is another copy operation,
so you're going to run into exactly the same set of problems.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
is
varying algorithms, which are rarely going to reuse standalone code.
They still need to deal with case-insensitive strings, though.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
these then be fair encodings?
is a 'yes'. Any disagreement?
I'm probably being rather thick, but aren't you saying here
Assuming that the answer to this question is 'yes', is the
answer to this question 'yes'?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman
', 'T200', 'pn123', 'sn222'
'aaa.222', 'T300', 'pn123', 'sn222'
you want to keep:
'aaa.111', 'T100', 'pn123', 'sn111'
'aaa.222', 'T300', 'pn123', 'sn222'
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
no carrots.
Not if you need onions but not carrots it isn't!
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
this is anything to do with the
regular expression? It looks more like it's complaining about
what you've typed in at the console.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
already succeeded with!
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
arrows like = or
- collide with different comparators. About all that's left
that even vaguely implies assignment is ~, and it's no better.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
:
DoSomething._CMD_DICT[cmd](self)
except KeyError:
print Foul! Foul, I say!
END CODE
To be honest, the getattr approach is probably as easy to follow
and less prone to forgetting to update the dictionary.
--
Rhodri James *-* Wildebeeste Herder to the Masses
sorry, but while I'm mildly positive towards the proposal (and more
so towards Aaron's decorator), I don't buy this argument at all. What
is broken about your editor's global search-and-replace function that
makes it usually useless for making these name changes?
--
Rhodri James *-* Wildebeeste
'scene'.
m += scene
m += '\div'
print m
I'm seeing nothing here that should produce an error message that
has anything to do with NoneType. Any chance of (a) a more accurate
code sample, (b) the traceback, or (c) sample data?
--
Rhodri James *-* Wildebeeste Herder to the Masses
On Wed, 06 May 2009 04:59:59 +0100, Gabriel Genellina
gagsl-...@yahoo.com.ar wrote:
En Tue, 05 May 2009 22:35:08 -0300, Rhodri James
rho...@wildebst.demon.co.uk escribió:
On Tue, 05 May 2009 21:43:16 +0100, bearophileh...@lycos.com wrote:
wolfram.hinde...:
It is easy to change all
On Wed, 06 May 2009 23:33:20 +0100, Luis Alberto Zarrabeitia Gomez
ky...@uh.cu wrote:
Quoting Rhodri James rho...@wildebst.demon.co.uk:
So the answer to my question would be nothing?
Indeed, there is nothing broken with the search and replace feature of
his editor. When he is copying
that with regular expressions, you'll
have to parse your way through the input string counting
open and close parentheses as you go.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
if you don't want to do things its way,
but it does at least make parameter handling in a user-friendly way
easy.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
collected.
What framework are you writing your game in? Pygame has
facilities for handling this sort of thing fairly
straightforwardly.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
come
across anything like this.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 11 May 2009 22:59:43 +0100, Tobiah t...@tobiah.org wrote:
On Mon, 11 May 2009 00:48:25 +0100, Rhodri James wrote:
On Mon, 11 May 2009 00:06:34 +0100, Tobiah t...@tobiah.org wrote:
[Snippety snip]
I wanted the bullets to be responsible for destroying themselves, but a
little
On Mon, 11 May 2009 08:39:48 +0100, Tobias Weber t...@gmx.net wrote:
In article mailman.5400.1242000728.11746.python-l...@python.org,
Rhodri James rho...@wildebst.demon.co.uk wrote:
What on earth are you talking about? '#' has its own key on a UK layout
Not on Apple keyboards
' substitution, so you'll just get a string
representation of your dictionary. You could play around with
defining your own custom Template class, but it's probably not
worth the effort.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
?
==
Take a look at the split() command.
I think you will find you need one var on the left side for each piece
on the right.
Given that he's immediately indexing the split results, that's irrelevant.
There's no point in even guessing with out the traceback.
--
Rhodri James
it later.
In general, don't make something an attribute if you know you're never
going to reuse it.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 14 May 2009 17:49:33 +0100, norseman norse...@hughes.net wrote:
Rhodri James wrote:
On Wed, 13 May 2009 23:08:26 +0100, norseman norse...@hughes.net
wrote:
Evan Kroske wrote:
I'm working on a simple file processing utility, and I encountered a
weird error. If I try to get
.
3) Fix it yourself.
The beauty of Python is that 3) isn't all that hard!
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
with them:
x = {Some text to parse {as well as an aside} and so on}
Parsing is not an entirely trivial subject, particularly when users
can futz about with the strings you're parsing. That's one reason there
are so many lexers and parsers out there!
--
Rhodri James *-* Wildebeeste Herder
the tutorial.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
property?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
a list with strings, but to keep you
day data in numeric form and use that to slice with, and for that
enums will greatly help you keep things clear. However, whether that's
worth doing or not depends on the bigger picture, and you haven't
told us anything that would help us figure that out.
--
Rhodri
list, but I can't off-hand think of a view method
that won't.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
a feature?
Feature. You're blaming 'get' for doing exactly what it said it would,
both in returning None and not gratuitously altering the dictionary.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
why you aren't using ffmpeg directly.
This program is for my friend and he needs it ready preety quick.
Aha. Ahahahahahahahaha.
Ahem.
Sorry, but pretty quick and ffmeg don't go together well in
my experience.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org
doing this a lot (as you imply) then it's going to be horribly
inefficient, since you're doing an extra two (or more) O(n) searches
for every row.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
in the standard library
documentation should make things clearer.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
* characters long. It's re.sub (in common with the rest of the
re module functions) that chooses to interpret the backslash specially.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
common code in the
outer loop accessing the shared variables.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
interfaces with two different
specs. Why are you expecting them to have the same effect?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
at the end of the PAR. Yes, this does make it very easy for the
freshly-enabled careless programmer to introduce deadlocks and
never realise it.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
that you aren't doing (which it does, but
you override __missing__() so it never notices that it doesn't have
a default_factory). You get away with it here, but it's not a good
habit to get into.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 May 2009 15:47:49 +0100, walterbyrd walterb...@iname.com
wrote:
On May 21, 9:44 pm, Rhodri James rho...@wildebst.demon.co.uk
wrote:
Escaping the delimiting quote is the *one* time backslashes have a
special meaning in raw string literals.
If that were true, then wouldn't r'\b
a video from, I could try it.
You seem to have emailed me directly, not the list. I've copied this
back to the list so Emile can see it too.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
anything
and may cost you instead.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 23 May 2009 18:19:11 +0100, Joel Ross jo...@cognyx.com wrote:
Now I can move onto next one.
Except that you still have the interesting issue that your environment
isn't responding to '\r' correctly, which worries me rather. Or did
you never test that?
--
Rhodri James *-* Wildebeeste
On Sat, 23 May 2009 22:05:10 +0100, walterbyrd walterb...@iname.com
wrote:
On May 22, 12:22 pm, Rhodri James
How do you know how a string object is going to be treated by any
given function? Read the Fine Manual for that function.
So am I to understand that there is no consistency
://docs.python.org/reference/lexical_analysis.html#literals
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
(Ubuntu Linux). It must be something
to do with the context you're calling the code in. Are you checking
the output before the program has finished running or something?
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
is to change the outer quotes to double-quotes, but it
annoys me when I have to change my code to appease a tool.
It's the separate python-mode that gets this (and much else) wrong.
The Python mode that Ubuntu packages with emacs 22.2.1 works just
fine.
--
Rhodri James *-* Wildebeeste Herder
On Wed, 27 May 2009 16:56:12 +0100, Bruno Desthuilliers
bruno.42.desthuilli...@websiteburo.invalid wrote:
Rhodri James a écrit :
On Tue, 26 May 2009 14:22:29 +0100, Roy Smith r...@panix.com wrote:
My pet peeve is syntax-aware editors which get things wrong. For
example,
the version
On Thu, 28 May 2009 06:24:56 +0100, Paul Rudin paul.nos...@rudin.co.uk
wrote:
Rhodri James rho...@wildebst.demon.co.uk writes:
The feature that caused me to uninstall python-mode.el was its
bloody-minded determination to regard '_' as a word character,
something which caused me more typing
meaningful
name for it, but I don't know the context you're working in).
In real code I would use regular expressions rather than
`startswith` and the equality because they cope more easily
with tabs, newlines and other 'invisible' whitespace.
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http
On Fri, 29 May 2009 13:10:47 +0100, Rhodri James
rho...@wildebst.demon.co.uk wrote:
current_name = dummy
Gah! I meant, of course,
current_name = 'dummy'
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
of your code this is a wild guess, but have
you used `type` as a variable? If you have, that would mask the builtin
name `type`, and would give you this error assuming `type` contains an
integer.
Moral: don't use builtin names for variables.
--
Rhodri James *-* Wildebeeste Herder to the Masses
.
continue
values.append(float(words[i+2]))
mean = sum(values)/len(values)
should do the job.
You don't need the second strip(),
words = line.split()
should be sufficient.
(And we're back to the 'naked' bit again...)
--
Rhodri James *-* Wildebeeste Herder to the Masses
--
http
seeing all of your
posts twice, from two different addresses. This is a little confusing,
to put it mildly, and doesn't half break the threading.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
if you say more than just it
crashes.
What's the traceback?
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
paranoid when it comes to whitespace.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
toothpick syndrome. Python
accepts both single and double quotes to help avoid creating something
so unreadable: use them.
3. matchobject.group(n) returns a string, not an int or float.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
for is self-
improvement books for a software engineer.
In that case The Mythical Man-Month (Brooks) is a must.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
been
given several possibilities, the correct answer might well
be don't do that at all :-)
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
in which we
were talking (and denotational semantics is a branch of category theory,
which is not specific to computer science if you don't mind). If None
is nothing, then it can't be a string, int, float or anything else,
because they're all something.
--
Rhodri James *-* Wildebeest Herder
(pointing to the end of *print*) if I cut and paste
the program exactly into a Python shell, presumably because the
shell gets unhappy about having more command input when it
wants to be executing the while loop. Does this match what
you see?
--
Rhodri James *-* Wildebeest Herder to the Masses
, it doesn't matter
how much you practice it you'll still be no good at good practice in
practice. Practically speaking, that is :-)
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 14 Jun 2009 10:43:30 +0100, Lawrence D'Oliveiro
l...@geek-central.gen.new_zealand wrote:
In message mailman.1510.1244832141.8015.python-l...@python.org, Rhodri
James wrote:
2. That output string has severe leaning toothpick syndrome. Python
accepts both single and double quotes
On Mon, 15 Jun 2009 01:33:50 +0100, Lawrence D'Oliveiro
l...@geek-central.gen.new_zealand wrote:
In message mailman.1565.1245019944.8015.python-l...@python.org, Rhodri
James wrote:
On Sun, 14 Jun 2009 10:43:30 +0100, Lawrence D'Oliveiro
l...@geek-central.gen.new_zealand wrote:
In message
that it is a problem,
whichever of the many possible 'it's you're talking about. So far,
the question Why would I want to use this? What's the use case?
has gone unanswered, and I'm sure I'm not the only baffled by it.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman
into the habit of doing that, especially for personal use.
--
Rhodri James *-* Wildebeest Herder to the Masses
--
http://mail.python.org/mailman/listinfo/python-list
301 - 400 of 855 matches
Mail list logo