I thought I saw a package that would create a DOM from html, with
allowances that it would do a "best effort" job to parse
non-perfectly formed html.
Now I can't seem to find this... does anybody have a recommendation
as to a good package to look at?
Many TIA!
Mark
--
http://
Mark Harrison <[EMAIL PROTECTED]> wrote:
> Now I can't seem to find this... does anybody have a recommendation
> as to a good package to look at?
Ahh, it's BeautifulSoup...
Thanks All!!
--
http://mail.python.org/mailman/listinfo/python-list
Exception, e:
self.exception(e)
Please help,
Mark Fink
--
http://mail.python.org/mailman/listinfo/python-list
Alan, Kent, many thanks this really helped!
But there is still a problem I guess with inheritance. I use the java
testsuit supplied with the original to test the server. If I use the
Java FitServer the testsuite can be completed. I commented everything
out from my class and it does not work??
Thats
I observed something strange when I tried to compile the jython class:
D:\AUT_TEST\workspace\JyFIT\fit>jythonc JyFitServer.py
processing JyFitServer
Required packages:
fitnesse.util
java.io
java.net
fitnesse.components*
Creating adapters:
Creating .java files:
JyFitServer module
Jy
with the
inheritanc construct and that this implementation path would always be
so slow. On the other hand would a 100% Jython solution be faster?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
I try to port a server application to Jython. At the moment I use
Jython21\Lib\socket.py
Currently I do face problems with casting the string "localhost" to the
desired value:
D:\AUT_TEST\workspace\JyFIT>jython fit/JyFitServer2.py localhost 1234
23
['fit/JyFitServer2.py', 'localhost', '1234', '23']
thanks to the help of this group I moved a tiny step forward. Obviously
it is not possible to resolve name localhost:
Type "copyright", "credits" or "license" for more information.
>>> import socket
>>> s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(localhost, 8080)
Traceback (in
the method besides rewriting the Java class or is this
approach really doomed?
Cheers,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
tput.flush()
sys.stdout.write("http request sent\n")
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
Hi there,
I have a source file FailFixture.py in the folder
D:\AUT_TEST\workspace\JyFIT\testutil. Now I want to import the file
with "import testutil.FailFixture". Unfortunately I could not figure
out how to set this up. I am convinced that
"D:\AUT_TEST\workspace\JyFIT" should be included in the p
I used send instead. This should work.
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
or maybe thre is an easier graphics package to use
that is already inside python.
i'm a beginner. thanks.
mark
--
http://mail.python.org/mailman/listinfo/python-list
i should have mentioned that i am on
linux
and using python 2.4. my apologies.
- Original Message -
From:
MARK
LEEDS
To: [email protected]
Sent: Friday, February 24, 2006 10:00
PM
Subject: mimicing pg 398 of practical
python
I am trying to
i'm pretty much
a python beginner so can anyone recommend a plooting package in python ( simple
foating numbers that makes lines or dots with a yaxis and an an
xaxis. i don't need fancy drawings ) that is a built in module in
python ? i am using python 2.4 in linux if that matters.
thanks
I was trying to understand the concept of
python looking for modules in sys.path.
So, as it said in "Beginning Python", I went into
my .bashrc file and did
export PYTHONPATH=$PYTHONPATH:~/mytemp
then, i typed pprint.pprint(sys.path) and it
worked.
it was in there
!
ample code that i could use as a
template.
i've spent 2 days, going through numpy, scipy,
pytrix etc and i still
can't figure it out. thanks.
mark
--
http://mail.python.org/mailman/listinfo/python-list
be somewhat religiously
inclined.
BTW, abuse reports filed with [EMAIL PROTECTED] amongst other
places.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
== Posted via Newsfeeds.Com - Unlimited-Uncen
media4sale.com offers innovative and quality media, CD/DVD packaging and
other computer accessories at the best prices. We pride ourselves in
service, quality and commitment and are certain that our standards will
exceed expectations.
http://www.media4sale.com
http://w
some basic examples out there.
Cheers.
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
>for more details.
>
>* Various other fixes for obscure bugs, but all of which caused reported
>IPython crashes. Details in Changelog.
>
>
>Enjoy, and as usual please report any problems.
>
>Regards,
>
>Fernando.
>
>
>
Hi All,
Fernando, if I may ask, as I'm a Fedora3 user. You mention that there
are RPMs for FC3, for Python2.3, 2.4. I'm new to Python. Is IPython
built into FC3s Python or is it a stand-alone program.? Sorry for
troubling you with this. Cheers.
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
Mark Sargent wrote:
>Fernando Perez wrote:
>
>
>
>>Hi all,
>>
>>I've just made the 0.6.14 release of IPython, mostly to fix the
>>inevitable bugs reported after the .13 one (though one big improvement
>>sneaked by).
>>
>>IPython's
oof', 'on', 'a', 'hot', 'tin']
>>> for x in hotcat[:]:
... if x == 'roof': hotcat.insert(6,x)
... hotcat[x:len(x)] = []
...
Traceback (most recent call last):
File "", line 3, in ?
TypeError: slice indices must be integers
I feel I'm close to it.
Cheers.
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
t call last):
File "", line 3, in ?
TypeError: list indices must be integers
How do I get that x to be an integer b4 it is entered into the indice.?
Cheers.
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>On Thu, 02 Jun 2005 16:12:44 +0900, Mark Sargent
><[EMAIL PROTECTED]> declaimed the following in
>comp.lang.python:
>
>
>
>>How do I get that x to be an integer b4 it is entered into the indice.?
>>Cheers.
>>
>>
>
>if I understand the OP correctly, he wants to *move* the "roof" to the
>end of the string.
>
>
correct...
>try:
>hotcat.remove("root")
>hotcat.append("root")
>except ValueError:
>pass
>
>is most likely the fastest way to do that.
>
>
>
>
>
will give it a blast...thanx
>
>
>
Cheers.
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
>what does [hotcat[1]] do.?
>
>
>
ah, quite simple really, adds roof to the end of hotcat...thanx..
Mark Sargent.
--
http://mail.python.org/mailman/listinfo/python-list
Martin Franklin wrote:
> Mark Light wrote:
> > Hi,
> >I have a Pmw.Counter widget and I would like to add a command
> > that is called on pressing either the up or down arrows (the
> > command will be the same for both). I have managed to do this
c "import script"
old
[4] C:\ex>script
old
[5] C:\ex>echo print "new" > script.py
[6] C:\ex>script
old
[7] C:\ex>python -c "import script"
new
[8] C:\ex>script
new
Even though script.py contains new (line 5), script in line 6 runs the .pyc
generated by line 3.
To fix this problem, put .py and .pyw extenstions ahead of .pyc and .pyo in
PATHEXT.
Hope this helps,
Mark
--
http://mail.python.org/mailman/listinfo/python-list
tring into characters and use a FSM,
but it seems that's not very pythonesqe.
@rv@ 2 @db.locks@ @//depot/hello.txt@ @mh@ @mh@ 1 1 44
@pv@ 0 @db.changex@ 44 44 @mh@ @mh@ 1118875308 0 @ :@@: :: @
(this is from a perforce journal file, btw)
Many TIA!
Mark
--
Mark Harrison
Pixar Animation S
Paul McNett <[EMAIL PROTECTED]> wrote:
> Mark Harrison wrote:
> > What is the best way to process a text file of delimited strings?
> > I've got a file where strings are quoted with at-signs, @like [EMAIL
> > PROTECTED]
> > At-signs in the string are represen
Well, I know I'm preaching to the converted - but Python rocks.
I've been enchanted by the siren calls of Scheme, Lisp and Forth, but in
the end, I find Python much easier. I even tried a little bit of Tcl.
To give a bit of context ... I have recently switched from Windows to OS
X and Linux. I
Steve Howell wrote:
> --- Mark Carter <[EMAIL PROTECTED]> wrote:
>
>> Well, I know I'm preaching to the converted - but
>> Python rocks.
>> [...]
>
> A few questions from the choir:
>
> As a recent newcomer to the language, did you
> encount
> When using a source like this on line 5:
>
> source = [r'C:\test\test 2\\']
>
> which has a space in the title, the program will not work.
Try wrapping that argument in double quotes when you build the command
--
http://mail.python.org/mailman/listinfo/python-list
Josiah Carlson wrote:
> Mark Carter wrote:
>> Not that I'm particularly knowledgeable about language design issues,
>> but maybe closures and slightly different scoping rules would be nice.
>
> Python has had closures for years.
I just looked up
http://ww
Alex Martelli wrote:
> Mark Carter <[EMAIL PROTECTED]> wrote:
> Yes, GMP is a pain to compile (especially on Mac OS X), but I believe
> Just mentioning this in case you want to give Scheme another chance
Thanks. I'll take a look at it.
I think I've decided to finish of
Alex Martelli wrote:
> Josiah Carlson <[EMAIL PROTECTED]> wrote:
>
>>> pitfall of Python is knowing whether an operation is destructive or not.
>> If it returns None, it probably changes the content of an object.
>
> A reasonable heuristic, but with lots of exceptions, alas:
> somedict.get(so
walterbyrd wrote:
> Anything else? Finance? Web-analytics? SEO? Digital art?
I played with NodeBox a little while ago:
http://nodebox.net/code/index.php/Home
"NodeBox is a Mac OS X application that lets you create 2D visuals
(static, animated or interactive) using Python programming code and
ex
Thomas Jollans wrote:
> Broadly speaking, everyone who uses python programs in it and may thus be
> considered a "programmer".
A woman from a job agency 'phoned me up the other day, and asked me if I
was any good with "algortihms". I told her that all programs are
algorithms, so the question
with Numpy.
Regards
Mark Westwood
PS 13x13 isn't a large matrix !
On Jun 6, 12:10 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> I'm using numpy to calculate determinants of matrices that look like
> this (13x13):
>
> [[ 0. 1. 1. 1. 1. 1.
"人言落日是天涯,望极天涯不见家" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Please see the follow code, I can not catch the exception " IOError"
raised from shutil.copyfile() , why?
try:
if (DEST_TYPE & TYPE_FTP):
fn = oname
Hi Dan
FWIW I'd use logrotate for this.
Regards
Mark Westwood
On Jun 7, 11:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> What's the best way to run either an entire python process or a python
> thread every N days. I'm running Python 2.4.3 on Fedor
Neil Cerutti wrote:
> The underlying problem, of course, is the archaic flat-file
> format with fixed-width data fields. Even the Department of
> Education has moved on to XML for most of it's data files,
:(
I'm writing a small app, and was wondering the best way to store data.
Currently the fi
elf.arg2 = arg2
class MyHandler(SocketServer.StreamRequestHandler):
def handle(self):
print self.server.arg1
print self.server.arg2
if __name__ == '__main__':
srv = MyServer(('',5000),MyHandler,123,456)
srv.serve_forever()
--Mark
--
http://mail.python.org/mailman/listinfo/python-list
I hesitate to ask, but ...
I'm using Ubuntu Feisty:
* Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
* SQLite version 3.3.13
Suppose I run the following program:
import sqlite3
conn = sqlite3.connect('example')
c = conn.cursor()
# Create
David Wahler wrote:
> On 6/17/07, mark carter <[EMAIL PROTECTED]> wrote:
>> Anyone else getting these problems?
>
> See http://www.python.org/dev/peps/pep-0249/ (emphasis mine):
>
>.commit()
OK, I tried that, and I appear to be cooking. The funny thing is, I
co
7stud wrote:
> On Jun 17, 7:16 am, mark carter <[EMAIL PROTECTED]> wrote:
>> David Wahler wrote:
>>> On 6/17/07, mark carter <[EMAIL PROTECTED]> wrote:
>>>> Anyone else getting these problems?
>>> Seehttp://www.python.org/dev/peps/pep-0249/(em
Carsten Haese wrote:
> On Sun, 2007-06-17 at 07:43 -0700, 7stud wrote:
>> Please report the whole docs as a bug.
>
> I imagine the author appreciates constructive criticism. This is not
> constructive criticism.
>
> In other words: Pointing out specific shortcomings and ways to correct
> them, su
This is a wxPython question.. the wxPython group is pretty much
inactive.
I have an MDI parent frame and child frame set up. In the child frame,
I want to use part of the frame to display the output from a .py that
is mainly matplotlib (a graph) in a section of the frame. How can I
get it to autom
How do I transfer the file name which is input in one .py (an MDI
parent frame in wxPython) to another .py (an MDI child frame)? The
parent gets the file name from the user via a file select dialog, but
the child frame is the one that needs to know what file it is working
with.
Thanks
--
http://
for
'program transformation' and follow some of the links.
Good luck !
Mark Westwood
On 26 Jun, 12:06, DavidM <[EMAIL PROTECTED]> wrote:
> On Tue, 26 Jun 2007 11:11:39 +0100, Robin Becker wrote:
> > I have seen this sort of evolution strategy in the past and it's ve
syco
on my computer), please visit the homepage at:
http://mark.dufour.googlepages.com
I could really use some help in pushing Shed Skin forward. Please try
the latest release and send in bug reports, or join the project via
the homepage.
Thanks,
Mark Dufour.
On 3/31/07, Mark Dufour <[EM
e, and compile this into an extension
module or separate program.
Look at Shed Skin as something that allows you to write fast extension
modules in pure Python, not as something that can convert arbitrary
Python programs.
Thanks,
Mark Dufour.
--
"One of my most productive days was thr
> **weights_array(randomizing_counter) = small_randomized_int
>
> The starred line is the one getting the error message: "SyntaxError:
> can't assign to function call"
>
> Now, I do understand what this means. I'm trying to assign to a
> function instead of the value that the function shoul
On Jul 1, 3:30 pm, "Sönmez Kartal" <[EMAIL PROTECTED]> wrote:
"Emacs is the best for anything for me."
Me too.
Also, as pointed out by some others, a debugger is not really all that
necessary for an interpreted language like Python.
> > Hi,
> > For experienced with Pyhton users, which developing
practically no help at
all).
>But there is such a large gap betwixt the
>twain that such dreaming is but an excercise in fantasy (there's
>always pypy).
yes, pypy will solve all problems, including world hunger ^^
thanks,
mark dufour - shed skin author
--
http://mail.python.org/mailman/listinfo/python-list
ey appear and don't need to store
them all at once, then it's significantly faster (on my machine) if
you replace the line subset = subset ^ d[i & -i] with an in-place
update: subset ^= d[i & -i].
Mark
--
http://mail.python.org/mailman/listinfo/python-list
k would spontaneously spoil, among other anomalies.
>
> For these reasons, you might propose a "quit" keyword.
>
> James
>
You know, some answers simply *must* be saved for posterity
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Python author and trainer Mark Lutz will be teaching another
3-day Python class at a conference center in Longmont, Colorado,
on June 11-13, 2007.
This is a public training session open to individual enrollments,
and covers the same topics as the 3-day onsite sessions that Mark
teaches, with
5, 6])
[4, 5, 6]
>>> c = a + b
>>> print b.vals
[5, 7, 9]
Something like
def __add__(self, other):
return Vector(x + y for x, y in zip(self.vals,
other.vals))
might work better. Similarly for the __sub__ method.
Have you considered using numpy?
Mark
--
http://mail.python.org/mailman/listinfo/python-list
rmally.
>
> Where is the problem here?
> Thanks in advance.
>
You might want to check out pychecker.py. Its output:
Processing Script1...
Warnings...
Script1.py:1: Imported module (glob) not used
Script1.py:1: Imported module (string) not used
Script1.py:9: Local variable (alllines) not used
Script1.py:20: (str) shadows builtin
You've replaced the built-in function str with the return value of
DoTestTime().
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
htm
for our take on this one.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
Hello!
I am a Uni student and for a project in Information Systems Security due
in just under two weeks, I have tried to make a Python version of the
Biham / Anderson Tiger Hash function. I have put the original C source
and my two files Tiger.py and doHash.py on my website:
http://www.users.on.n
On May 20, 5:02 pm, Bruno Desthuilliers
>Ruby is probably far better than Python at sys-admin tasks.
Why, pray tell? I don't know much about Ruby, but I know that Python
is the language that Gentoo uses for package management, which
certainly qualifies as a sys-admin task.
--
http://mail.pytho
y. Any suggestions would be greatly appreciated.
>
> ~Sean
>
Just rename the file. We've used that technique in a similar application at
my work for years where a service looks for files of a particular extension
to appear in a directory. When the service sees a file, in renames it to a
different extension and spins off a thread to process the contents.
-Mark T.
--
http://mail.python.org/mailman/listinfo/python-list
l RSI)
-add more tests to unit.py
Thanks,
Mark Dufour.
--
"One of my most productive days was throwing away 1000 lines of code"
- Ken Thompson
--
http://mail.python.org/mailman/listinfo/python-list
Without wishing to start a flame war, is there a way to do this in Python?
>
> Regards, John
> --
> War is God's way of teaching Americans geography
> Ambrose Bierce (1842 - 1914)
>>> 'test\ntest2.\ntest3\ntest4.\ntest5'.split('.\n')
['test\ntest2', 'test3\ntest4', 'test5']
-Mark T.
--
http://mail.python.org/mailman/listinfo/python-list
thers.
But since there are now so many values, you'd again have problems
detecting any bias.
Steven Holden wrote:
> Frankly I don't think you need to worry.
What he said.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 24, 9:30 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> x = floor((n/2**53)*7)
>
> will produce 0, 1, 3 and 5 with probability (2**53//7+1)/2**53, and 2,
> 4 and 6 with probability (2**53//7)/2*53.
Oops---I lied; I forgot to take into account the rounding implicit
> a="01397256359210100534+42050-102800FM-15+1198KAIA"
>>> print "%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s" %
(a[0:4],a[4:10],a[10:15],a[15:19],a[19:21],a[21:23],a[23:25],
a[25:27],a[27],a[28:34],a[34:41],a[41:46],a[46:51],a[51:])
which result
On Aug 28, 10:03 am, [EMAIL PROTECTED] wrote:
> Is there an int/long related bug lurking in locale?
Looks like this has already been reported:
See http://bugs.python.org/issue1742669
Mark
--
http://mail.python.org/mailman/listinfo/python-list
2 both end up being 2),
but there's only one integer n for which abs(n) == 0.
One possible fix: do
x = randint(0, 10) - randint(0, 10)
x = abs(x) - (x<0)
This collapses -1 and 0 to 0, -2 and 1 to 1, etc.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
> One possible fix: do
>
> x = randint(0, 10) - randint(0, 10)
> x = abs(x) - (x<0)
>
> This collapses -1 and 0 to 0, -2 and 1 to 1, etc.
Or a slightly simpler formula that ends up producing the same
distribution:
x = min(randint(0, 10), randint(0, 10))
Mark
--
h
turning off gcc's optimiser with the -O0 flag, the C version is still
>
> > 100 times quicker.
Well, for one thing, you're creating half a million xrange objects in
the course of the search. All the C code has
to do is increment a few integers.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 2, 12:55 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Mark Dickinson <[EMAIL PROTECTED]> wrote:
> > Well, for one thing, you're creating half a million xrange objects in
> > the course of the search. All the C code has
> > to do is increment a few integers
single
machine instruction.
Mark
Code and timings: (Python 2.5.1/G4.)
def test():
solutions = [0] * 1000
for a in xrange(1, 1000):
for b in xrange(1, 1000 - a):
for c in xrange(1, 1000 - a - b):
if a*a + b*b == c*c:
solutions[a+b+c
Python author and trainer Mark Lutz will be teaching another
3-day Python class at a conference center in Longmont, Colorado,
on October 23-25, 2007.
This is a public training session open to individual enrollments,
and covers the same topics as the 3-day onsite sessions that Mark
teaches, with
I feel that Python lacks one useful data structure: an ordered
dictionary.
I find such data structures v. useful in C++. I know that in Python
the sort function is v. fast, but often I prefer never to sort but
simply to use an ordered data structure in the first place.
(I'm aware that for ordered
On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> On Sep 12, 2:42 pm, Steven D'Aprano <[EMAIL PROTECTED]
>
> cybersource.com.au> wrote:
> > On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote:
> > In fact, I'm not sure what people me
On 12 Sep, 15:04, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> On Sep 12, 3:54 pm, Mark Summerfield <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]>
>
> > Actually I meant by key order, so insertio
On 13 Sep, 00:03, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Mark Summerfield <[EMAIL PROTECTED]> writes:
> > I feel that Python lacks one useful data structure: an ordered
> > dictionary.
> > Do other Python programmers feel this lack? Is this worth a PEP?
>
a random
> experience database for a game. What would be necessary to do so?
Look into the random module (http://docs.python.org/lib/module-random.html)
random.choice selects a random item out of a sequence
random.shuffle shuffles a sequence randomly
random.random gives a random floating point
Should the above be considered a bug, or is Python not
expected to honour signs of zeros? I'm working in a situation
involving complex arithmetic where branch cuts, and hence signed
zeros, are important, and it would be handy if the above code could be
relied upon to do the right thing.
Mar
On Mar 11, 12:13 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Dan Bishop" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | On Mar 11, 9:31 am, "Mark Dickinson" <[EMAIL PROTECTED]> wrote:
> | > I get the follow
SVC (every platform C compiler has its own set
> > of gimmicks for "dealing with" these things).
Understood. Platform dependent is fine. But does this really excuse
results
like the following?
>>> from math import atan2
>>> x = -0.; print atan2(0., -1.)
-3.14159
build the
> bytecode you need.
Yup: the workaround seems to be as simple as replacing all occurrences
of -0.0 with -(0.0). I'm embarrassed that I didn't figure this out
sooner.
>>> x, y = -(0.0), 0.0
>>> x, y
(-0.0, 0.0)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
r "license" for more information.>>>
> 0.0,-0.0
> (0.0, -0.0)
> >>> -0.0,0.0
>
> (-0.0, 0.0)
>
> so it seems to be very specifically a 2.5 problem.
I've filed a bug report (bug #1678380) and got an impressively
quick response from MvL. It l
problems above surfaced.
By the way, I don't suppose that anybody would be interested in
a rewritten cmath for Python 2.6? It wouldn't be hard for me to
rewrite what I already have in C, and add suitable documentation
and tests.
Mark
--
http://mail.python.org/mailman/listinfo/python-list
hon's svn).
It does, and all tests pass. (Still on OS X 10.4.8/PowerPC; I'll
test
it tomorrow on my Linux machine at work.)
Mark
--
http://mail.python.org/mailman/listinfo/python-list
else:
h[x+y] = 1
for x in e:
for y in r:
sch += h.get(-(x+y),0)
print sch
print time.clock() - t
Thanks,
Mark Dufour (Shed Skin author - send me bug reports!)
--
http://mail.python.org/mailman/listinfo/python-list
e.next and placed in
node, also losing the original value of node.
-Mark T.
>
> as
> node = node.next = nextnode
>
> only to discover that Python performs chained assignments
> backwards compared to other languages, i.e. left-to-right
> instead of right-to-left. From the user
of y there.
>
>
> Alex
This is interesting:
>>> class Test(object):
... def __getattribute__(self,n):
... print 'reading',n
... return object.__getattribute__(self,n)
... def __setattr__(self,n,v):
... print 'writing',n,v
... return object
I don't think you can get around some overhead with the objects.
However, in terms of generally efficiency not specifically related to
object instantiation, you should look into xreadlines().
I'd suggest doing the following instead of that while loop:
for line in open(sys.argv[1]).
time units"
open() iterator -> 0.41 "time units"
--
Mark Nenadov -> skype: marknenadov, web: http://www.marknenadov.com
-> "They need not trust me right away simply because the British say
that I am O.K.; but they are so ridiculous. Microphones everywhere
and planted
Yep, I agree! once I've got this done I'll be back to trawling the
tutorials.
Life never gives you the convenience of learning something fully
before having to apply what you have learnt ;]
Thanks for the feedback and links, I'll be sure to check those out.
Mark.
On Mar 26, 12:
with
> Shed Skin CVS at least:
after optimizing dicts a bit for Shedskin 0.0.21 (http://
mark.dufour.googlepages.com), the speedup for this program is now
about 16.5 times for the same test.
Thanks,
Mark Dufour (Shed Skin author - send me bug reports!)
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 26, 12:59 pm, "Erik Johnson" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > OK...
> > I've been told that Both Fortran and Python are easy to read, and are
> > quite useful in creating scientific apps for the number crunching, but
> > then
On Mar 27, 12:55 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
> Mark Morss wrote:
>
> > Maybe somebody reading this will be able to convince me to look again
> > at Numpy/Scipy, but for the time being I will continue to do my
> > serious numerical computation in Fortran.
port foo"
will import the foo.py in foo_fake directory before the one in the local
directory.
# unverified code
import sys
sys.path.append(0,'foo_fake') # add foo_fake to front of path
import foo
foo.bar()
execfile('testee.py')
sys.path.pop(0) # remove foo_fake
reload(foo)
foo.bar()
execfile('testee.py')
-Mark
--
http://mail.python.org/mailman/listinfo/python-list
x();
> }
> popMatrix();
>
> The curly brackets have no functional meaning but increase the
> readability significantly.
You are e. e. cummings, and I claim my £5.
--
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
Every 10 years we say t
4001 - 4100 of 5833 matches
Mail list logo