out the latest version from Subversion and
give it a whirl.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
them
out and decide their fate? If so, visit
http://wiki.python.org/moin/OrphanedPages
and scroll down to the "P" section.
Thanks,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
quotechar = "'"
reader = csv.reader(open("some.text.file", "rb"), dialect=dialect)
mydict = {}
mylist = []
for row in reader:
numbers = [int(n) for n in row[::2]]
letters = row[1::2]
mydict.update(dict(zip(numbers, letters)))
mylist.append(numbers)
print mydict
print mylist
import os
os.unlink("some.text.file")
displays this:
{1: 'a', 2: 'b', 3: 'a', 5: 'c', 6: 'c', 7: 'b', 8: 'a'}
[[1, 2], [3, 5], [3, 6], [3, 7], [8, 7]]
That seems to be approximately what you're looking for.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Paul> You clearly need something instead of XML.
Amen, brother...
+1 QOTW.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.o
-L/opt/app/g++lib6/python-2.4/lib -L/usr/local/lib
-L/opt/app/nonc++/ncurses-5.5/lib -Wl,-R/opt/app/nonc++/ncurses-5.5/lib
-lncurses -o build/lib.solaris-2.8-i86pc-2.4/_curses.so
Any ideas what's wrong and what I need to do
ed many symbols from
that version. Also, running the unit test seems to hang. It certainly ties
up the xterm.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
vpr> I've been trying to consume the webservices at Amazon using python.
vpr> I have not been able to find a *good* webservices module...
pyamazon.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
do that within a function, which it does do:
pyc.py:2: Local variable (kop) not used
pyc.py:3: Local variable (koi) not used
pyc.py:6: Local variable (koo) not used
At the module level it doesn't know that the suspect object isn't accessed
from another module.
Skip
--
htt
g) does it mean that it tagged Watcher.processUpdate more
than once?
Thanks,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
frac = "." + mat.group(1)
t = t[:-len(frac)]
t = datetime.datetime(*time.strptime(t, format)[0:6])
microsecond = int(float(frac)*1e6)
return t.replace(microsecond=microsecond)
raise
Skip
--
http://mail.python.org/mailman/listinfo/python-list
going into a block of code.
I don't think that's the case here. The types of the arguments to this
particular method are always the same (self and a complex SWIG-wrapped
beast). It's not like I'm passing in floats one time and ints the next.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
rg/lib/string-methods.html>, which does not
>> appear there. That's because it is section 2.3.6.1, and the table of
>> contents only goes to 3 levels.
John> I've found that to be quite irritating as well.
Maybe someone should submit a bug report on SF...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
re Call". You're looking for a remote
object access protocol. As Irmen pointed out, Pyro is one such beast,
though it is limited to use with Python. If you need something that's more
language-independent, you might look at SOAP. Personally, XMLRPC has been
sufficient for me
For XML-RPC are you using sgmlop or some other accelerator? If not, you
might want to consider it.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
d though, a five-second delay for such a small example
doesn't seem to be an XML-RPC problem. A simple round-trip to my XML-RPC
server running on the localhost takes about 5 *milli*seconds. That's with
sgmlop installed, but even without it, I can't imagine it taking more
the service you're connecting is waiting 5 seconds
Fredrik> before it sends the response ? ;-)
Well, yeah I suppose that might have an effect. ;-) I saw your earlier
response about a minute after I responded...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
se that it determines
are referenced? (Yes, I know it's impossible to do this in general. We
have one very restricted exec statement and no eval() calls, so I'm not too
worried about that sort of obfuscation.)
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
dules a and b as a whole program, a.BLUE is unused anywhere in
the program.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
been further optimized in obmalloc. Again, Python
wins. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
t its
type checks are performed at run-time, not at compile-time. If you're
desparate to have some assistance with your code before you run it, check
out pylint and pychecker.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
r Python's readline module. Having fink or Darwin Ports
available is handy for that sort of thing.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
they are importable (e.g. "foobar.py"
instead of "foo-bar.sh").
Skip
--
http://mail.python.org/mailman/listinfo/python-list
msg
print >>sys.stderr
import __main__
print >> sys.stderr, __main__.__doc__.strip()
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Aahz> Taking a look at __slots__ is fine as long as you don't actually
Aahz> use them.
Gabriel> Why?
http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=2#f4ac2dfde
Claudio> such access results in adjusting the time a bit and leads
Claudio> eventually to such problems.
Wouldn't that affect time.time (time since the start of the Epoch), not
time.clock (cpu time used by the current process)?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Aahz> Taking a look at __slots__ is fine as long as you don't actually
Aahz> use them.
Gabriel> Why?
Skip>
http://groups.google.com/group/comp.lang.python/browse_thread/thread/451ad25f9c648404/f4ac2dfde32b16fd?lnk=st&q=Python+__slots__+aahz&rnum=2#f4ac
tform-independent". I suspect you mean
"batteries included". Prior to the release of Python 2.5, no modules to
access SQL databases were distributed with core Python. Starting with 2.5,
sqlite access will be available:
>>> import sqlite3
>>> sqlite3.__fi
7;s in CVS. For my moonlighting job (mojam.com) I
still use 2.3 because that's what /usr/bin/python is on the web server
(which tummy.com administers) and I don't feel like messing with yet another
separate install.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
character:
import csv
class PipeQuote(csv.excel):
quotechar='|'
...
reader = csv.reader(open("somefile", "rb"), dialect=PipeQuote)
for row in reader:
print row
Full documentation is here:
http://docs.python.org/dev/lib/module-c
est you convert your code to use the newer module if possible. If
that's not possible (it's not all that hard - I did it a couple years ago),
try posting a note to [EMAIL PROTECTED] The Object Craft folks are on that
list and may be able to help you out. I think they're he
f possibly many values closest to zero.
charles> How to extend this function to any given value ?
Just subtract that value from all values in the list:
intermed = [(abs(v-x), v) for v in foo]
intermed.sort()
intermed[0][1]
Skip
--
http://mail.python.org/mailman/listinfo/python-list
, 3, -6, 2, 12]
>>> foo.sort(key=abs)
>>> foo
[-1, 2, 2, 3, 5, -6, -7, 12]
(assuming you don't mind reording the list - if you do, then sorted() is
your friend).
Skip
--
http://mail.python.org/mailman/listinfo/python-list
fferences do creep into the Python level and can be
subtle to discover.
In short, it takes a fair amount of work to move from one version to
another.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ug, you may be forced to upgrade at an
inopportune time.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
tobiah> So now it works, but it is still strange about the absent
tobiah> defaults.
The csv.Dialect class is essentially pure abstract. Most of the time I
subclass csv.excel and just change the one or two things I need.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
licting it on our users and
developers, precisely because I have confidence that it only contains bug
fixes. Since probably 2.2.1 there have been no new features in any micro
releases that I can recall and, up to this point at least, no regressions in
my experience. Micro updates seem like a
metaperl> I am hoping for something that can create database deltas.
What is a database delta? I know about SELECT, CREATE, INSERT, UPDATE,
joins, normalization, etc, but have never heard this term before.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
7;t require any
Cliff> special support from the language or driver. Usually you simply
Cliff> SELECT from the stored procedure.
In a stored procedure you can execute multiple SELECTs. On the receiving
end you need some way to distinguish each result set.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
frames have mode 'P'.
What have I missed?
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
le-threaded apps (that is, the
common case). Maybe more effort should have been put in at that time to
improve performance, but that didn't happen. Much more water has gone under
the bridge at this point, so extracting the GIL from the core would be
correspondingly more difficult
provements per hour of discussion about removing
the GIL? ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Richard> It would probably be easier to find smarter friends than to
Richard> remove the GIL from Python.
And if the friends you find are smart enough, they can remove the GIL for
you!
Skip
--
http://mail.python.org/mailman/listinfo/python-list
against your own code base.
All these steps are necessary to some degree, though one person doesn't have
to do all four steps for any given bug fix. Any help you can give would be
appreciated.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Andre> This seems to be an important issue and fit for discussion in the
Andre> context of Py3k. What is Guido's opinion?
Dunno. I've never tried channeling Guido before. You'd have to ask him.
Well, maybe Tim Peters will know. He channels Guido on a fairly
Python developers didn't pick up on the issue is not
surprising. I'm not sure how many of them are (py)sqlite users, probably
relatively few.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
nd responses
matt> would it be efficient in a multithreaded sense. Always listen
matt> while another thread sends responses?
Should be no problem. For all practical purposes the GIL is a problem only
if your code is CPU-bound.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
format your rant as a documentation bug report on
SourceForge:
http://sourceforge.net/projects/python
If you mention specific sqlite documentation urls you think should be
referenced in the pysqlite docs it would make it easier to accept.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
o == DotGnu?
(I'm on Mac OS X in case that matters.)
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
author or an experienced
Fie>user. Unfortunately a mail to author returned as
Fie>undeliverable.
Have you considered VTK and/or MayaVi?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Cedric> Why is the ScannerCommand object being created with a scanList
Cedric> that contains the data that was in the previously created
Cedric> ScannerCommand object?
Your scanList attribute is defined at the class level and is thus shared by
all ScannerCommand instanc
ous code, (no assignment
to self.scanList in __init__), references to self.scanList would search
first in the instance dict for a "scanList" key, then failing to find
anything there, search the class's dict and find its "scanList" key.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
idn't exit. (I had to "raise SystemExit" to exit.)
Is this a known problem? Is it a Mono thing or an IronPython thing? Any
workaround?
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
l free to try it out and add a review comment.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ess the white text on the white background
prevented the Mono developers from seeing that the editing characters were
self inserting. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
lock() * 1000)
or
int(time.time() * 1000)
?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Edward> I am wondering whether anyone knows of a static source-code
Edward> analyzer for Python, kinda like a static pychecker.
Pychecker v2 was supposed to use source analysis instead of importing the
modules.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ltiple threads they can't share connections.
>> My gut feeling is to use threads (note: each transaction is finite,
>> so the process/thread die fairly quickly).
Bryan> Go with your gut. Python threads are reasonably portable, and
Bryan> work well on modern MS
it says that if MySQLdb.threadsafety == 1 it's not safe to
share connections.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
27;t share them among processes either, so I don't see
Bryan> any advantage either way on that.
Sure, but its difficult to do so. With threads it's trivial to share a
connection and wind up getting bitten in the butt.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Way off-topic for Python, but can someone tell me what encoding was used in
this web page:
http://www.loppen.dk/side.php?navn=getin
I'm guessing ISO-8859-15, but the page doesn't indicate and it's none of the
ones available in Safari.
Thanks,
Skip
--
http://mail.pyt
006, 9, 15)
Is there some way to get pyExcelerator from doing this conversion and
instead return dates as strings? If I'm reading an arbitrary worksheet and
don't know which columnn might be a date, it's kind of hard to guess.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
skip> Doing a little date math I come up with a base date of
skip> approximately (though not quite) 1900-01-01:
...
Reading the code in BIFFRecords.py I saw this docstring:
This record specifies the base date for displaying date values. All
dates are stored as
out.
I'm up for reading a good rant. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
l the decorators.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
choose from. I don't know why Safari didn't display it properly the first
time. It eventually did.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
interesting (and rather long-lived):
http://mail.python.org/pipermail/python-dev/2004-October/049534.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
thread late. Note that access() doesn't do what you
want unless your real and effective user ids are the same. Granted, that's
the case most of the time, but not always...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ix and Windows,
they'll get burned and just have to reproduce your investigative work to
figure out what happened.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Duncan> ... but it does seem odd as it provides a way of verifying the
Duncan> existence of files when you can't list the directory.
What's odd about security bugs in Windows?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
r types like integers and dictionaries and
Matthew> lists, but not for much else.
Matthew> Any thoughts?
Sure, if you want to save and restore objects, pickle or marshal them.
Don't rely on repr().
Skip
--
http://mail.python.org/mailman/listinfo/python-list
e a good place to start:
http://www.programmableweb.com/
Skip
--
http://mail.python.org/mailman/listinfo/python-list
x27;06:20:20'
Which, alas, will lose any subsecond resolution:
>>> str(datetime.timedelta(seconds=0.1))
'0:00:00.10'
Skip
--
http://mail.python.org/mailman/listinfo/python-list
diffuser> This site and webpage in particular doesn't open. I tried that
diffuser> too before posting my question.
Well, it is SourceForge. They are known for flakiness. Just keep trying.
If you never fail to open the tutorial, drop me a note and I'll send you a
copy
Carsten> Yes, he is an idiot. Good call on CC'ing your assessment to
Carsten> him. :)
Steve knows it's good to be subtle with these guys. ;-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
as a place to report problems.
--
Skip Montanaro - [EMAIL PROTECTED] - http://www.mojam.com/
"In China today, Bill Gates is Britney Spears. In America today, Britney
Spears is Britney Spears - and that is our problem." Thomas L. Friedman in
"The World is Flat"
--
http://mai
rameter in
your call to create a reader object?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtklabel.html
and the Pango markup language:
http://www.moeraki.com/pygtkreference/pygtk2reference/pango-markup-language.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
re
using other than "Solaris 10". There are several different desktop
environments available. On my machine I have "Common Desktop Environment",
"Java Desktop System, Release 3" (really, it's mostly Gnome) and "Open
Windows". I imagine how you mak
you got to the point
where you have something like 30 minutes of work and two minutes of rest you
no longer get much, if any, benefit from it.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Diez> I bought a TouchStream keyboard and could recommend it - but
Diez> unfortunately they are out of business.
Is this what you're referring to?
http://www.fingerworks.com/ST_product.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
walter> If so, I doubt there are many.
You're kidding, right?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
3-5 new postings per week.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
bisect...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
) which should be able to read your old file and dump you a new one.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
the
insertion point (depending on which search method you call) to determine if
the item you're searching for is in the list.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
t it should be documented
elsewhere. Hmmm... It would be interesting if we had a buildbot which
through a series of slightly twisty C macros built an interpreter that
eliminates the free list altogether to make sure nothing depends on its
presence or size.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
would normally
expect that you could program in multiple languages. Still, at my current
job we are a C++ & Python shop. I can still write C okay, but my boss would
probably rightly never assign a C++ task to me.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
print "abandon ship!"
Skip
--
http://mail.python.org/mailman/listinfo/python-list
d at all (dir, help, exit, quit,
copyright, credits, license, maybe vars). They shouldn't be considered
special in code written to be used in non-interactive contexts.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Exception, and convenience builtins like exit and license. If
you make that distinction and only really worry about consistency within the
fundamental builtins I think you'll be on more solid ground.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ate='NOW', subject=%s, talktext=%s"
" where msgno=%s",
(self.components.TextField1.text,
self.components.TextArea1.text,
self.myamsgno))
Skip
--
http://mail.python.org/mailman/listinfo/python-list
prolonged keyboard use may
result in injury".
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Claes> calculating the difference between two dates in seconds
>>> import datetime
>>> now1 = datetime.datetime.now()
>>> # dum dee dum ...
... now2 = datetime.datetime.now()
>>> now2-now1
datetime.timedelta(0, 12, 781540)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
e and have
the make dependencies set up properly, the -jN flag (for N = 2 or 3) may
speed things up.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
vedran> Can you tell me one simple python phone module ...
What is a "phone module"? Does it manipulate phone numbers, map phone
numbers to locations, place phone calls, handle phone calls?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik> http://en.wikipedia.org/wiki/JAPH
That's an interesting JAPH written with only punctuation...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
jim> where can I find a free decompile that I can run in windows xp
Kind of dated perhaps, but google for "decompyle".
Skip
--
http://mail.python.org/mailman/listinfo/python-list
aahz> Anyone else getting "Python-related" spam? So far, I've seen
aahz> messages "from" Barry Warsaw and Skip Montanaro (although of
aahz> course header analysis proves they didn't send it).
I blacklisted Barry long ago. He's probabl
steve> http://wiki.python.org/moin/Java_Scripting
>>
>> Renamed to "JavaScripting".
>>
>> Skip
Rob> So nobody around here has heared of that other language called
Rob> JavaScript then ?
Rob> Perhaps &q
uted code that's been stable for a looong time. I
have no idea why I might have written it that way. Brain fart I suppose. I
only noticed my mistake a couple months ago during a trip into the
containing function for some other stuff. Man, was I embarrassed...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
301 - 400 of 2037 matches
Mail list logo