On 03/07/13 02:05, Mark Janssen wrote:
Hi all, this seems to be quite stupid question but I am confused..
We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice.
I have a list of bool values True, False (True for up vote, False for
down-vote).. submitted by users.
should I
On 14/05/13 09:34, Citizen Kant wrote:
2013/5/14 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
On Tue, 14 May 2013 01:32:43 +0200, Citizen Kant wrote:
An entity named Python must be somehow as a serpent. Don't forget that
I'm with the freeing up of my memory, now I'm not trying to
On 22/04/13 13:39, RBotha wrote:
I'm facing the following problem:
In a city of towerblocks, Spiderman can
“cover” all the towers by connecting the
first tower with a spider-thread to the top
of a later tower and then to a next tower
and then to yet another tower until he
reaches the end of
On 11/03/13 17:27, Adam Tauno Williams wrote:
Because date/time management in Python is *@*@R*(R *@Y terrible!
Period, full-stop, awful, crappy, lousy, and aggravating. The design is
haphazard and error inducing.
+1
--
djc
--
http://mail.python.org/mailman/listinfo/python-list
On 15/01/13 16:48, Antoine Pitrou wrote:
Steven D'Aprano steve+comp.lang.python at pearwood.info writes:
A programmer had a problem, and thought Now he has I know, I'll solve
two it with threads! problems.
Host: Last week the Royal Festival Hall saw the first performance of a new
logfile by
On 02/01/13 05:20, Ramchandra Apte wrote:
On Tuesday, 1 January 2013 22:55:21 UTC+5:30, Usama Khan wrote:
am just a begginer bro. . jus learnt if elif while nd for loop. .
can u just display me the coding u want. .it could save my time that i have
while searchning SN out. . i will give u that
On 04/12/12 17:18, Alexander Blinne wrote:
Another neat solution with a little help from
http://stackoverflow.com/questions/1701211/python-return-the-index-of-the-first-element-of-a-list-which-makes-a-passed-fun
def split_product(p):
w = p.split( )
j = (i for i,v in
: unorderable types: str() int()
The best I can think of is to split the input sequence into two lists,
sort each and then join them.
--
djc
--
http://mail.python.org/mailman/listinfo/python-list
On 31/10/12 23:09, Steven D'Aprano wrote:
On Wed, 31 Oct 2012 15:17:14 +, djc wrote:
The best I can think of is to split the input sequence into two lists,
sort each and then join them.
According to your example code, you don't have to split the input because
you already have two lists
On 20/10/12 15:18, Grant Edwards wrote:
On 2012-10-20, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
Strangely, we've gone from 80-character fixed width displays to
who-knows-what (if I drop my font size I can probably get nearly 200
characters across in full-screen mode)...
On 21/08/12 12:55, Ulrich Eckhardt wrote:
Am 21.08.2012 10:38, schrieb namenobodywa...@gmail.com:
what is the best way
Define best before asking such questions. ;)
http://matplotlib.sourceforge.net/api/colors_api.html?highlight=colors#matplotlib.colors
matplotlib.colors
A module for
On 19/08/12 15:25, Steven D'Aprano wrote:
Not necessarily. Presumably you're scanning each page into a single
string. Then only the pages containing a supplementary plane char will be
bloated, which is likely to be rare. Especially since I don't expect your
OCR application would recognise many
On 06/08/12 02:27, Steven D'Aprano wrote:
On Sun, 05 Aug 2012 19:12:35 -0400, Roy Smith wrote:
Good lord. I'd rather read C++ than UML. And I can't read C++.
UML is under-rated. I certainly don't have any love of the 47 different
flavors of diagram, but the basic idea of having a common
On 21/12/11 02:13, Ashton Fagg wrote:
I got the impression the OP was learning programming in general (i.e.
from scratch) and not merely learning Python. If this is the case it
shouldn't matter if they're merely learning the concepts as you can
always get up to speed on the differences later
Mensanator wrote:
On Mar 26, 2:44 pm, Phlip phlip2...@gmail.com wrote:
On Mar 26, 6:14 am, Luis M. González luis...@gmail.com wrote:
Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey,
Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc...
Monkeys everywhere.
Antoine Pitrou wrote:
Le Fri, 19 Mar 2010 17:18:17 +, djc a écrit :
changing
with open(filename, 'rU') as tabfile: to
with codecs.open(filename, 'rU', 'utf-8', 'backslashreplace') as
tabfile:
and
with open(outfile, 'wt') as out_part: to
with codecs.open(outfile, 'w', 'utf-8
Ben Finney wrote:
djc slais-...@ucl.ac.uk writes:
I have a simple program to read a text (.csv) file
Could you please:
* simplify it further: make a minimal version that demonstrates the
difference you're seeing, without any extraneous stuff that doesn't
appear to affect the result
Ben Finney wrote:
What happens, then, when you make a smaller program that deals with only
one file?
What happens when you make a smaller program that only reads the file,
and doesn't write any? Or a different program that only writes a file,
and doesn't read any?
It's these sort of
I have a simple program to read a text (.csv) file and split it into
several smaller files. Tonight I decided to write a unicode variant and was
surprised at the difference in performance. Is there a better way?
from __future__ import with_statement
import codecs
def _rowreader(filename,
Brian D wrote:
Here's a simple named group matching pattern:
s = 1,2,3
p = re.compile(r(?Pone\d),(?Ptwo\d),(?Pthree\d))
m = re.match(p, s)
m
_sre.SRE_Match object at 0x011BE610
print m.groups()
('1', '2', '3')
Is it possible to call the group names, so that I can iterate over
them?
New submission from djc dirk...@ochtman.nl:
Sorry to be nitpicking here, but it kind of sticks out when you take your first
look at ssl.py. While PEP 8 only talks about whitespace before the function
call argument list parenthesis, I think this should also go for function
definition. ssl has
Changes by djc dirk...@ochtman.nl:
--
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7730
___
___
Python-bugs-list mailing
djc dirk...@ochtman.nl added the comment:
Thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7730
___
___
Python-bugs-list mailing list
New submission from djc dirk...@ochtman.nl:
http://docs.python.org/library/asyncore.html has this bit (for bind()):
(The format of address depends on the address family — see above.)
The only way this makes sense is if it points back to the family argument
used in the create_socket
djc dirk...@ochtman.nl added the comment:
Awesome, thanks! Will this be ported to the 2.6.x branch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7619
djc dirk...@ochtman.nl added the comment:
Perfect.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7619
___
___
Python-bugs-list mailing list
New submission from djc dirk...@ochtman.nl:
imaplib still calls os.popen2(), which has been deprecated in 2.6. It
should probably use subprocess instead, even in 2.6, IMO.
See http://bugs.gentoo.org/show_bug.cgi?id=282859
--
components: Library (Lib)
messages: 97121
nosy: djc
severity
djc dirk...@ochtman.nl added the comment:
I'd like to commit this, but it would be nice to get a review first:
Index: Lib/csv.py
===
--- Lib/csv.py (revision 76697)
+++ Lib/csv.py (working copy)
@@ -132,6 +132,10
djc dirk...@ochtman.nl added the comment:
Skip, I agree that it's hard to decide if we should have the class write
the header on __init__(). I figured starting off with a method to make
doing it manually is a good start; people can start using that, and if
it's deemed useful we can always add
New submission from djc dirk...@ochtman.nl:
For whatever reason, BadStatusLine tracebacks often don't show the line
passed into them. Given the errr, heavy architecture of httplib, this
makes it pretty bad to debug. It's not clear to me why this is:
Traceback (most recent call last):
File
djc dirk...@ochtman.nl added the comment:
Also, it might be useful here if it showed repr(line) instead of just
line, but that'd just be icing on the cake.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7427
New submission from djc dirk...@ochtman.nl:
a = 'b'
[].index(a)
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: list.index(x): x not in list
This is suboptimal. IMO it would be much more useful if the ValueError
reported the actual value that wasn't in the list
djc dirk...@ochtman.nl added the comment:
FWIW, quickly grepping through the raises of ValueErrors in the 2.6
stdlib doesn't bring up any other usage of repeat-with-fake-variable-x.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
djc dirk...@ochtman.nl added the comment:
I want the actual value in there, though! So I can spot the bug.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7252
New submission from djc dirk...@ochtman.nl:
I have a bug report in the Gentoo tracker
(http://bugs.gentoo.org/show_bug.cgi?id=221183):
This is a rather strange request, but please bear me.
While building Posix module, python checks (among others) for
tmpfile, tmpnam and tmpnam_r
however man
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1537721
___
___
Python-bugs-list mailing list
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6491
___
___
Python-bugs-list mailing list
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6119
___
___
Python-bugs-list mailing list
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1731717
___
___
Python-bugs-list mailing list
in __main__.geohash
***Test Failed*** 1 failures.
(1, 1)
--
djc @work
--
http://mail.python.org/mailman/listinfo/python-list
New submission from djc dirk...@ochtman.nl:
I've got hgweb (the Mercurial web app) crashing on guess_type() in
2.6.2, but not in 2.5.4. I'm passing in a filename like
'/home/djc/src/hg/crew/templates/static/hglogo.png'. Doesn't happen on
the REPL, but happens in side the hg serve web server
djc dirk...@ochtman.nl added the comment:
georg.brandl remarked it might be due to demandimport. That doesn't seem
to be the case:
from mercurial import demandimport
demandimport.enable()
import mimetypes
mimetypes.guess_type('/home/djc/src/hg/crew/templates/static/hglogo.png')
('image/png
djc dirk...@ochtman.nl added the comment:
This could well be due to the SocketServer.ThreadingMixIn that's being
used by the hg serve built-in web server (since it doesn't show on REPL
or, as far as I can see, when used from within Apache + mod_wsgi
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4136
___
___
Python-bugs-list mailing list
djc dirk...@ochtman.nl added the comment:
I'll take a stab at doing it Raymond's way this weekend.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4136
Changes by djc dirk...@ochtman.nl:
--
nosy: +djc
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4753
___
___
Python-bugs-list mailing list
Changes by djc [EMAIL PROTECTED]:
--
nosy: +djc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3187
___
___
Python-bugs-list mailing list
Unsubscribe
Changes by djc [EMAIL PROTECTED]:
--
nosy: +djc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3723
___
___
Python-bugs-list mailing list
Unsubscribe
djc [EMAIL PROTECTED] added the comment:
Would this be solved by issue1424152?
--
nosy: +djc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue648658
Changes by djc [EMAIL PROTECTED]:
--
nosy: +djc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2534
___
___
Python-bugs-list mailing list
Unsubscribe
New submission from djc [EMAIL PROTECTED]:
2to3 fails in recent CPython trunk. This is because lib2to3 got some
merges, but the 2to3 script wasn't updated to match.
lib2to3.refactor.main() now requires a first argument which isn't given
by the 2to3 script.
--
assignee: collinwinter
New submission from djc [EMAIL PROTECTED]:
[EMAIL PROTECTED] tests $ python2.6
Python 2.6a2+ (trunk, Apr 4 2008, 20:21:45)
[GCC 4.1.2 20070214 ( (gdc 0.24, using dmd 1.020)) (Gentoo 4.1.2
p1.0.2)] on linux2
Type help, copyright, credits or license for more information.
import urllib2
try
Changes by djc [EMAIL PROTECTED]:
--
nosy: +georg.brandl -birkenfeld
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2585
__
___
Python-bugs-list mailing list
djc [EMAIL PROTECTED] added the comment:
I'd like this. I had one instance where a number of options where
dynamically added to the OptionParser based on loadable modules, so that
I wanted to dynamically iterate over the Values returned as well.
--
nosy: +djc
New submission from djc:
urllib.quote(['', 'aa'])
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.5/urllib.py, line 1205, in quote
res = map(safe_map.__getitem__, s)
KeyError: ''
I think this is a weird error message to throw. quote() is obviously
(), [])
TypeError: can only concatenate list (not str) to list
--
djc
--
http://mail.python.org/mailman/listinfo/python-list
be the same word in
variant cases
result = sum(r.values(), ())
will do fine and is as simple as I suspected the answer would be.
--
djc
--
http://mail.python.org/mailman/listinfo/python-list
')}
to
('Aslib','ASLIB','JDOC','jdoc')
--
djc
--
http://mail.python.org/mailman/listinfo/python-list
58 matches
Mail list logo