On 2013-02-15, MRAB wrote:
> On 2013-02-15 16:17, Neil Cerutti wrote:
>> On 2013-02-15, Oscar Benjamin wrote:
>>> if score > best_score or best_score is None:
>>
>> You need the None check first to avoid an exception from the
>> comparison.
>
> Only
larly good example of a Project Euler problem,
you'll need to do some mathematical analysis to improve your
approach, first.
But yeah, do not get in the habit of comparing your times to,
say, C++ programs. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ull poems written
> by computers. Fooled a lot of people.
The painting elephants are trained to paint basically the same
painting over and over. There's not much chance involved.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
hallenge.
http://www.pythonchallenge.com/
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
Disabling gc before exiting might do the trick, assuming you're
assiduously managing other resources with context managers.
gc.disable()
exit()
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
:
>
>
> mtgoxeur 12 24 36
> mtgoxpln 2 4 6
>
> Thanks to anyone that can help
You don't appear to need the csv module at all. You'll just need
the startswith string function.
For more help, please show us some code.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
d["ask"] is not None:
> if not any(str(d["symbol"]) in s for s in string):
Why are you checking d["symbol"] instead of d["currency"]? Maybe
I misunderstood the question.
Test like this for either set or list container type. Use
whichever json field is appropriate:
if d["currency"] not in esclusioni:
> c.writerow([str(d["currency"]),str(d["symbol"]),str(d
> ["bid"]),str(d["ask"]),str(d["currency_volume"])])
>
> esclusioni.close()
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
reverse
after reverse1 is exactly the same. I can now write my recursive
reverse function.
def reverse_any(s):
if len(s) <= 1:
return s
else:
return s[-1] + reverse_any(s[:-1])
Try this exercise with your conversion problem and see if you can
make progress.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
Config:
host = "ftp"
port = 21
proxy = "192.168.0.3:81"
user = "transfers"
password = "secret"
How much to engineer stuff is up to you.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
iciency only.
It can trivially be replaced by filter in all cases (at least in
Python 3), but it saves you from a possibly slow extra function
indirection, and also from needing to define one at all.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
)
> print decode(coded)
> elif response == "0":
> print "Thanks for doing secret spy stuff with me."
> keepGoing = False
> else:
> print "I don't know what you want to do..."
>
> ---
>
> I am
an example of something you tried that didn't work?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
el use the csv module and create the file using the
default 'excel-csv' format. Then load the file using Excel.
Creating an Excel file directly in Python is possible, but I
think it will require use of the Pywin32 extensions.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
basis... more frequently
> if you use Microsoft Windows, tar, non-eight-bit-clean
> transmission methods, or Adobe products, and extremely common
> as soon as you take over someone else's code [1], but
> inevitable even without these stimuli. :)
A pretty funny example of this is
d from them directly using something like xlrd if you
prefer, but I find it pales in comparison. My advice is to avoid
reading the Excel file directly unless you have no other choice.
Happily (for me) I don't know the answer to the second part of
your question.
--
Neil Cerutti
--
http://mail.py
trings in Python, so you need to bind
something to them.
I don't know what the VB syntax above means, but if I pretend
that your string is bound to 'Name':
Name = Name.replace(" - ", "\n")
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-03-19, Ian Kelly wrote:
> On Tue, Mar 19, 2013 at 8:44 AM, Tim Chase
> wrote:
>> On 2013-03-19 14:07, Neil Cerutti wrote:
>>> On 2013-03-18, Ana Dion?sio wrote:
>>> > But I still get the error and I use Excel 2010.
>>> >
>>> >
None, your usual assumptions about focus would
apply, otherwise the user preference overrides it.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-03-26, Dave Angel wrote:
> On 03/26/2013 10:40 AM, Michael Herrmann wrote:
>> On Tuesday, March 26, 2013 3:13:30 PM UTC+1, Neil Cerutti wrote:
>>>
>>>
>>> Have you considered adding a keyword argument to each of your
>>> global functions,
mentioned is to match using a generator function:
def match_each(s, re_seq):
for r in re_seq:
yield r.match(s)
And later something like:
for match in match_each(s, (expression1, expression2, expression3)):
if match:
print(match.groups()) # etc...
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
e final program in small steps.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
e killfiled already. Must be he/she/it is posting
from a different sock puppet.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
His name, in combination with a similarly named
rap artist, breaks most search tools.
My guess is this homework is simply borken.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-01, Steven D'Aprano wrote:
> On Mon, 01 Apr 2013 11:41:03 +0000, Neil Cerutti wrote:
>
>
>> I tried searching for Frost*, an interesting artist I recently learned
>> about.
>
> "Interesting artist" -- is that another term for "wanker&quo
e attribute
> DEFAULTS = {}
> REQUIRED = []
> OPTIONAL = []
> TO_RESOLVE = []
> MIXINS = []
>
> Where every subclass can redefine these attributes to get
> something done automatically by the constructor for
> convenience.
Hopefully someone with experience with them can help you further,
but this seems like a job for a metaclass.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
program.)
>
> Run: python baudotrss.py --help
>
> I'm thinking of switching to Go.
Python programs can be distributed as binary-like packages, e.g.,
www.py2exe.org.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
x27;server_name'), get_backend),
(('Tq', 'Tw', 'Tc', 'Tr', 'Tt'), get_track_info),
]
result = {}
for i, s in enumerate(s.split()):
if i < len(matchers): # I'm not finished writing matchers yet.
key, matcher =
e Stroustrup likes it, and I agree with him that code is
even easier to read that way, especially in hard-copy.
But most tools have not caught up with the idea. I'll switch as
soon as vim supports it.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-06, Roy Smith wrote:
> In article ,
> Neil Cerutti wrote:
>
>> Bjarne Stroustrup likes it
>
> This is supposed to impress me?
Hehe. No! But he's got enough clout to give the notion some
traction.
> Yeah, most of the books I recall that used this wer
;> returned so cannot be iterated upon.
>>
>> Please suggest some way by which it can be made possible to
>> iterate over the dictionary using iterkeys outside the
>> function ?
>
> If you're using Python 3 iterkeys has been renamed keys.
Also, using a dict
still true.
Here's and example.
maximum_games = 4 # You must stop playing after 4 games.
games_played = 0 # Always equals the number of games played
while games_played < maximum_games:
play_game()
# This is where you update games_played to reflect the number
# of games played.
info:"+loc+fname+":\n", os.stat(loc+fname)
>
> But when I look at the file in Finder, destination is smaller
> and even looking at the file (with text editor) file is
> truncated.
>
> What could be causing this?
Could fn be getting some changes written after the copy is made?
Is the file flushed/closed before you copy it?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
urn until that's done.
What command are you using to create the temp file?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
matters, not
> to make lawyers wealthy).
Wishful thinking is the wrong way to approach any legal matter.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ld others use?
>
> inventory_db
>
> The rest should be clear from the context.
How long and descriptive a name is ought to depend on the
wideness of its visibility. n might be acceptable in a short
comprehension, while network_inventory_db_connection might be
apposite for a module-level name.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
he following for loop taking place
somewhere:
for (int i = 2; i <= 0; --i) {
fprintf(a[i]);
}
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-16, Lele Gaifax wrote:
> Neil Cerutti writes:
>
>> Imagine something like the following for loop taking place
>> somewhere:
>>
>> for (int i = 2; i <= 0; --i) {
>> fprintf(a[i]);
>> }
>
> Neil most probably meant
&
should be using one of its subclasses
instead, e.g., BusinessDay, MonthEnd, MonthBegin,
BusinessMonthEnd, etc.
http://pandas.pydata.org/pandas-docs/dev/timeseries.html
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
based_programming.
> You can emulate an OOP system with a prototype-based language.
>
> I highly recommend you read a book on formal programming
> language theory and concepts.
Let me recommend Concepts, Techniques and Models of Computer
Programming, Van Roy and Haridi.
http://www.info.
ions until it actually tries to call
them. At that time, if either one isn't defined properly Python
will raise an exception.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
while True:
try:
e = lst.index(header, b)
except ValueError:
yield lst[b:]
break
yield lst[b:e]
b = e+1
for group in headered_groups([line.strip() for line in open('data.txt')],
"Starting a new group"):
print(group)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ere is a rationale for the change from csv.reader.next
> to csv.reader.__next__.
>
> If next is not acceptable for the version 3 csv.reader, perhaps __next__
> could be added to the version 2 csv.reader, so that the same code can be
> used in the two versions.
>
> This would avoid the kluge I used above.
Would using csv.DictReader instead a csv.reader be an option?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-22, Oscar Benjamin wrote:
> On 22 April 2013 15:24, Neil Cerutti wrote:
>>
>> Hrmmm, hoomm. Nobody cares for slicing any more.
>>
>> def headered_groups(lst, header):
>> b = lst.index(header) + 1
>> while True:
>>
7;DIV')
for rec in reader:
major = rec[majr_index]
rec[div_index] = DIVISION_TABLE[major]
But a csv.DictReader might still be more efficient. I never
tested. This is the only place I've used this "optimization".
It's fast enough. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
n session. It's a mystery why even that program threw an
> error. Regardless, why should that session throw an import
> error in this session? Weird. Any help is appreciated. Thanks,
'Cause Python's import statement looks in the current directory
first for files to import. So yo
nce, but it's usual to call
mainloop of the root window, rather than tkinter.mainloop.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
crash your program. This is
hiding the actual context.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-24, William Ray Wing wrote:
> On Apr 24, 2013, at 4:31 PM, Neil Cerutti wrote:
>
>> On 2013-04-24, William Ray Wing wrote:
>>> When I look at the pool module, the error is occurring in
>>> get(self, timeout=None) on the line after the final else:
>
gt; inaudible.
Well I've never heard either one.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
www.huawei.com.cn/schema/common/v2_1}sepid";)
if sepelem is not None:
sepid = sepid.text
else:
sepid = ''
The empty string works for my purposes. Your script might need
something else.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ade the life of a few of my
coworkers incrementally easier.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-04-29, Neil Cerutti wrote:
> find returns None when it doesn't find what you asked for. So you
> can't check the .text attribute right away unless you want an
> exception thrown. I deal with these annoyances like this:
>
> sepelem =
> content.find("./
s directed.
In any case, on Windows I would normally need to do something
like this instead:
os.execlp('cmd.exe', 'cmd.exe', '/K', 'ping.exe')
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
my number in", tries, "tries"
> else:
> print "\nSorry, you took too many tries to guess my number!"
> raw_input("\n\n Press any key to exit..")
>
> ## Maybe now I can work on a useful project
Not quite yet. Players who guess correctly on the fifth try don't
get credit.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-05-03, John Gordon wrote:
> In Neil Cerutti writes:
>
>> Not quite yet. Players who guess correctly on the fifth try don't
>> get credit.
>
> Are you sure? tries is initialized to zero and isn't
> incremented for the initial guess.
while (numb
t; 2
> 2
>
> Is this available in python?
If you store an item in a one-element list, you can use the list
like a reference, but it's not syntactically transparent.
>>> x = [1]
>>> y = x
Now x and y refer to the same list. Now you can change the
elements in th
shorter than length n."""
t = len(seq)
for i in xrange(n, t+1, n):
print isep.join(map(str, seq[i-n:i]))+rsep,
t = t % n
if t > 0:
print isep.join(map(str, seq[-t:]))+rsep,
That's probably similar to some of the other mostly
non-functional solutions posted.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
s present, you can run a Python script with the
:pyfile command.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
self.name_attrs = attrs
p = MyHTMLParser()
p.feed("""
""")
print repr(p.result)
p.close()
There's probably a better way to search for attributes in attr
than "for attr in attrs", but I didn't think of it, and th
itertool?
Your note me curious enough to re-read the itertools
documentation, and I found the following in 5.16.3 Recipes:
def grouper(n, iterable, padvalue=None):
"grouper(3, 'abcdefg', 'x') --> ('a','b','c'), ('d','e','f'), ('g','x','x')"
return izip(*[chain(iterable, repeat(padvalue, n-1))]*n)
Wish I'd found that yesterday. ;)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
the list belongs together:
>
> Group 1 = 0, 3, 6
> Group 2 = 1, 4, 7
> Group 3 = 2, 5, 8
from itertools import islice
grouped = []
grouped.append(list(islice(t, 0, None, 3))
grouped.append(list(islice(t, 1, None, 3))
grouped.append(list(islice(t, 2, None, 3))
grouped.sort()
This can probably be simplified and generalized, but I'm a novice, and
that's a start.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-08-23, Amanjit Gill <[EMAIL PROTECTED]> wrote:
> you should also include for ostream_operator.
, actually.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ot;list ->", t2.timeit(1000)
print "\nRandom access to item in list/set when item exists"
t1=timeit.Timer("500 in z","z = set(xrange(1))")
t2=timeit.Timer("500 in z", "z = list(xrange(1))")
print "set ->", t1.timeit(1000)
print "list ->", t2.timeit(1000)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-04, Paul McGuire <[EMAIL PROTECTED]> wrote:
> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>> Look at the code again. It's not testing what it says it's
>> testing.
>
> It isnt?
>
r/faqs/smart-questions.html
> Or are you just being plain rude?
> A lack of a response from you implies the latter...
SPOILER SPACE
It was a joke, based on you hiding what you are doing, he decided
to hide the solution to your problem. Get it?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
e_string_fmt():
> out = "cd %s ; %s %d %s %s" % ht
Incidentally, changing the fmt test to be more similar to the
Template version doesn't slow it down much.
def make_string_fmt():
out = "cd %(working_dir)s ; %(ssh_cmd)s %(some_count)d %(some_param1)s"\
"%(some_param2)s" % hd
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-06, hanumizzle <[EMAIL PROTECTED]> wrote:
> On 10/5/06, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>
>> It was a joke, based on you hiding what you are doing, he decided
>> to hide the solution to your problem. Get it?
>
> What if it was for a proprieta
se, perhaps that's the right way to do it in Perl.
A python solution that indexed lists instead of looking up
attributes of objects might be faster.
--
Neil Cerutti
We're not afraid of challenges. It's like we always say: If you
want to go out in the rain, be prepared to
th soldering iron ala Chris Walken. :)
I agree on both points. It's a style issue, and that hidden tests
(taking advantage of how certain objects convert to boolian
values) is harder to read.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
n the original case, I'd agree that "if X.has_key():" is
quite clear, already yielding a boolian value, and so doesn't
need to be tested for if it's False. But I wouldn't like to test
for an empty list or for None implicitly.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-07, MonkeeSage <[EMAIL PROTECTED]> wrote:
>
> On Oct 6, 8:34 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
>> And in the original case, I'd agree that "if X.has_key():" is
>> quite clear, already yielding a boolian value, and so doesn
m all mindboggley. Just when I thought I was starting to
understand how this character encoding stuff works. Are
PythonWin's stdout and stdin implementations is incomplete?
--
Neil Cerutti
A song fest was hell at the Methodist church Wednesday. --Church
Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
''.join(chr(a) for a in range(0xc0, 0xdf)).decode('ISO 8859-1')
# Print it to stdout, converting to the terminal's encoding, replacing
# unprintable characters with '?'.
print some_string.encode(sys.stdout.encoding, 'replace')
--
Neil Cerutti
That&
On 2006-10-11, Martin v. Löwis <[EMAIL PROTECTED]> wrote:
> Neil Cerutti schrieb:
>> I'm all mindboggley. Just when I thought I was starting to
>> understand how this character encoding stuff works. Are
>> PythonWin's stdout and stdin implementations is incom
On 2006-10-12, Paul Rubin wrote:
> Tarjan discovered a guaranteed O(n) algorithm in the 1970's(?)
Huhn! I thought Tarjan was just the big bad evil guy in Bard's
Tale 2 who was creating eternal winter. I'm glad he also
contributed to our stock of *useful* algorithms.
--
Ne
7; right away!
As far as I know, he just forgot to strip out the tab characters
before pasting and posting.
--
Neil Cerutti
We will not have an all volunteer army. We *will* have an all
volunteer army. --George W. Bush
--
http://mail.python.org/mailman/listinfo/python-list
def parseline(line,format):
> xlat = {'x':None,'s':str,'f':float,'d':int,'i':int}
> result = [ xlat[f](w) for f,w in zip(format,line.split())
> if xlat.get(f,None) ]
> if len(result) == 0: return None
> if len
way if I run from IDLE or from the DOS
> command prompt.
I had some fun trying to run Tkinter from from the Python
embedded in Vim. My advice: Do not do that.
--
Neil Cerutti
The majority of time, it seems to be one thing or the other.
--Ron Mercer
--
http://mail.python.org/mailman/listinfo/python-list
free
* Totally configurable.
> Disadvantages:
>
> * No UI builder...for this you can use Glade or maybe Boa Constructor
> * Not many else...none other that I can think of right now, actually
* Totally configurable.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-13, Gerrit Holl <[EMAIL PROTECTED]> wrote:
> On 2006-10-13 16:31:37 +0200, Ahmer wrote:
>> Subject: Best IDE?
>
> cat > foo.py
>
>> How much does it cost?
>
> 0
On Windows this editor is invoked like this:
COPY CON: FOO.PY
HTH! HAND!
--
eriously, the function you called expected a COM object and you
passed it something else. Without seeing more code, it's hard to
be any helpfuller.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ng an error here is unnecessary. I guess that
> the comparison operator decides to convert s2 to a Unicode but
> forgets that I said #coding: iso-8859-1 at the beginning of the
> file.
It's trying to interpret s2 as ascii, and failing, since 129 and
225 code points are out of range.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
complicated calculations:
I'd say the feature is "usable" rather than "useful", like
bitfields in C.
--
Neil Cerutti
Next Sunday Mrs. Vinson will be soloist for the morning service.
The pastor will then speak on "It's a Terrible Experience."
--Church Bulletin Blooper
--
http://mail.python.org/mailman/listinfo/python-list
Check out strxfrm in the locale module.
>>> a = ["Neil", "Cerutti", "neil", "cerutti"]
>>> a.sort()
>>> a
['Cerutti', 'Neil', 'cerutti', 'neil']
>>> import locale
>>> loca
rcus Peanuts (Turkish
Delight for you non-Yanks).
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-17, Ron Adam <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote:
>>> I have several applications where I want to sort lists in
>>> alphabetical order. Most examples of sorting usually sort on
>
n. Even after applying psyco find was
still faster (though I could beat the bisect functions by a
little bit by replacing a divide with a shift).
--
Neil Cerutti
This is not a book to be put down lightly. It should be thrown
with great force. --Dorothy Parker
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-17, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Neil Cerutti wrote:
>> I'm writing an application that needs all internal character data
>> to be stored in iso-8859-1. It also must allow input and output
>&g
re I come from, a portable
filename is only 8 chars long and matches the regex
[A-Z][A-Z0-9]*, i.e., capital letters and numbers, with no
extension. That way it'll work on old DOS machines and on
Risc-OS. Wait... is there Python for Risc-OS?
--
Neil Cerutti
>
> HTH, cu l8r, Edgar.
--
http://mail.python.org/mailman/listinfo/python-list
ot;
It's pity it didn't get called quack typing. One ckecks if
some unknown noun can quack, not if a duck can do something
unknown.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
.
As it is it silently causes interactive applications to
apparently hang forever, and breaks the line-buffering
expectation of non-interactive applications.
If raising the exception is too much to ask, then at least it
should be documented better.
--
Neil Cerutti
The choir invites any mem
On 2006-10-19, Leo Kislov <[EMAIL PROTECTED]> wrote:
> Neil Cerutti wrote:
>> It turns out to be troublesome for my case because the
>> EncodedFile object translates calls to readline into calls to
>> read.
>>
>> I believe it ought to raise a NotImplement
k()-t, 2)
>
> t = clock()
> sgood = set(good)
> for c in data:
> c in sgood
> print round(clock()-t, 2), "\n"
>
> main()
On my Python2.4 for Windows, they are often still neck-and-neck
for len(good) = 26. set's disadvantage of having to be
constructed is heavily amortized over 100,000 membership
tests. Without knowing the usage pattern, it'd be hard to choose
between them.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
\xb6ni'.decode('utf-8') returns a Unicode
> object. With print this is implicitly converted to string. The
> char set used depends on your console
No, the setting of the console encoding (sys.stdout.encoding) is
ignored. It's a good thing, too, since it's pretty flaky. It
On 2006-10-19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Neil Cerutti wrote:
>
>>> Note that 'K\xc3\xb6ni'.decode('utf-8') returns a Unicode
>>> object. With print this is implicitly converted
On 2006-10-19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Neil Cerutti wrote:
>>> Note that 'K\xc3\xb6ni'.decode('utf-8') returns a Unicode
>>> object. With print this is implicitly converted to strin
string')
> invert({1:2, 3:4})
Shoot, now you'll have to remember where in heck you stashed that
function the next time you need to reverse something. ;-)
You'll still be better off in the long run memorizing the slice
notation.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
characters. My current project (an implementation of
the Glk API in Python) would be more troublesome to write if I
had to store all my latin-1 character strings as lists or arrays
of bytes.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-10-19, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> James Stroud wrote:
>
> > without requiring an iterator
>
> can we perhaps invent some more arbitrary constraints while
> we're at it?
No letter G. I don't like them. They wet their nests.
--
t; Wrong newsgroup, then. comp.database.* is right next door...
>
> I know, I'm sorry. It's just that this newsgroup server doesn't
> have any database ngs on it. :(
Try Google Groups for these annoying cases.
--
Neil Cerutti
The audience is asked to remain seated until
401 - 500 of 1188 matches
Mail list logo