On Fri, Jun 19, 2009 at 12:56 AM, bob gailer wrote:
>
> Luis N wrote:
>>
>> I get an error "TypeError: 'rounding' is an invalid keyword argument
>> for this function" on my list subclass.
>>
>> How might I subclass list without this er
I get an error "TypeError: 'rounding' is an invalid keyword argument
for this function" on my list subclass.
How might I subclass list without this error?
This is the code:
class SeriesList(list):
def __new__(cls, *args, **kwargs):
series_list = list.__new__(cls, *args)
serie
On Dec 16, 2007 10:17 PM, jon vs. python <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> I have a file with this content:
>
> "1
> 1
> 1
> 1
> 1
> 1
> 1
> 2
> 1
> 1"
>
> I wanted a little script that would print the line containing "2" and every
> line containing "1" after it. I've tried this:
>
> >>>
On Dec 14, 2007 12:08 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Luis N wrote:
> > Is there a way to introspect a function or class' required arguments,
> > particularly keyword arguments?
>
> See inspect.getargspec() and formatargspec().
> Look at the sour
Is there a way to introspect a function or class' required arguments,
particularly keyword arguments?
I can easily use a dictionary since it is my own function that I wish
to introspect. I haven't tested the below code yet, but e.g.
obj = getattr(self, 'obj')()
preprocessors = {'Card':[{'obj_attr
On Dec 13, 2007 3:38 PM, earlylight publishing
<[EMAIL PROTECTED]> wrote:
> Do people really write whole applications just using the shell?
>
The shell isn't intended for writing whole applications. However, it's
invaluable for testing. For writing whole applications I'd recommend
The One True Edit
I can't recall what your initial project was. I think it was a text
adventure. I imagine that you have bigger ideas regarding timers then
your current code suggests. Maybe you should investigate a time aware
long-running process. Twisted Python is such a beast.
While I can't recommend it's use as
I'd like the below to be a single line if possible.
hours = metrics.totaltime/360
minutes = (metrics.totaltime - 360*hours)/6
seconds = (metrics.totaltime - 360*hours - 6*minutes)/1000
Would it be possible to simplify this with a generator expression e.g.
total_time = tuple((
You might want to search for how it fits together with twisted's reactor
http://www.google.com/search?q=twisted+glade+reactor
Luis.
On 10/15/05, Adam <[EMAIL PROTECTED]> wrote:
> I'm making a Twisted app that needs a client side GUI and GTK seems like the
> best way to go about this. Can anybody
> Luis,
>
> I was actually asking how usable Boa-Constructor is right now for project
> purposes, since I had "heard" it was kind of unstable and crashes a lot. Is
> that your experience with Boa-Constructor? Or was the information I found
> misleading?
>
> Thanks,
> Terry
I found Boa-co
On 9/11/05, Damien Gouteux <[EMAIL PROTECTED]> wrote:
> Hi all.
> I try to run Venom, a Python binding for the Irrlicht engine. But I need
> python23.dll.
Download a game from pygame.org
Luis.
___
Tutor maillist - Tutor@python.org
http://mail.python
On 9/12/05, Terry Kemmerer <[EMAIL PROTECTED]> wrote:
> Hey Guys,
>
> I am trying to pick an IDE, and it seems to me that Boa-Constructor has
> great potential.
Did you check Boa out of CVS? It tends not to have an intermittent
schedule of releases.
Luis
On 9/1/05, Luis N <[EMAIL PROTECTED]> wrote:
> Hi,
>
> After fighting with installing pysqlite2
Apologizes, I started over. It went much better the second time.
bash-2.05
Hi,
After fighting with installing pysqlite2, (although you require the
.tar.gz for a *Nix build, the header file required, sqlite3.h, was
actually in the source .zip supplied for windows users sans a unix
build environment)
Anyway, I have pysqlite2, but:
Python 2.3.4 (#1, Aug 23 2004, 13:59:34)
On 8/24/05, Daniel Watkins <[EMAIL PROTECTED]> wrote:
> I'm currently trying to write a script that will get all the files
> necessary for a webpage to display correctly, followed by all the
> intra-site pages and such forth, in order to try and retrieve one of the
> many sites I have got jumbled u
On 8/23/05, Scott Oertel <[EMAIL PROTECTED]> wrote:
> I have extracted a list of names, i.e.
>
> "Joe Smith"
> "Joe Smith"
> "Jack Smith"
> "Sam Love"
> "Joe Smith"
>
> I need to be able to count the occurances of these names and I really
> don't have any idea where to begin.
>
> Any ideas? exc
On 8/23/05, Shitiz Bansal <[EMAIL PROTECTED]> wrote:
> Hi,
> Suppose i have a string '347 liverpool street'.
> I want to remove all the numbers coming at the starting of the string.
> I can think of a few ways but whats the cleanest way to do it?
>
> Shitiz
>
I believe this question to be
On 8/15/05, ZIYAD A. M. AL-BATLY <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-08-15 at 11:52 -0400, Michael Murphy wrote:
> > Hi all
> >
> > I'm having problems with installing LiveWire for python for Linux
> > (Linspire 5.0 to be exact) and I'm having trouble compiling setup.py.
> > Heres the results
On 8/15/05, Simon Gerber <[EMAIL PROTECTED]> wrote:
> You could probably do something like this... (Note: This example is
> for Linux - but you can adapt it fairly easily to Windows.)
>
>
> # E.g. Find every .inf file on a CD-ROM.
> path = '/cdrom'
> # 'E:\\' or whatever for Windows
> inf_lis
On 8/11/05, Jorge Louis De Castro <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm interested in writing with my own Python implementation of a Jabber IM
> server and client.
> Anyone knows where I could host my Python Jabber IM server for a reasonable
> monlthy fee? It doesn't need to be a top-not
On 8/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I'd like to write some web gallery software from scratch for my girlfriend.
> I've looked at the > PIL (python imaging library) and I'm using it to
> generate thumbnails from given images.
> Something else i'd like to get done
On 8/13/05, David Holland <[EMAIL PROTECTED]> wrote:
> What is a good way of using xml and python ?
ElementTree? http://effbot.org/zone/element-index.htm
or, lxml http://codespeak.net/lxml/
Luis.
___
Tutor maillist - Tutor@python.org
http://mail.pyth
On 8/7/05, gordnjen <[EMAIL PROTECTED]> wrote:
>
> I am now stuck again. I am at my wit's end. The course I am taking is a
> supposed "beginners" course. It is a distance education class, and our
> textbook does NOT contain the information required to do all of the
> assignments (perhaps it was de
On 8/5/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is there a quicker method than the following?
>
> import random
> numbers = [0,1,2,3,4,5,6,7,8,9,10,11,12]
> cards =
> ["Ace","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King"]
> hand = {
On 8/4/05, Brian Kelley <[EMAIL PROTECTED]> wrote:
> Yeah the spaces kill me as well sometimes, and then I think that the
> spaces are okay sometimes.
>
> The real issue is that a metakit column name can include any printable
> character except a comma ",".
>
> So, now you know :)
>
> Here is an
On 8/3/05, Jay Loden <[EMAIL PROTECTED]> wrote:
> I've been considering some web projects recently, but I have some concerns
> about selecting the tools I plan to use. I like Python, and I was immediately
> thinking of using Zope to build on.
>
> However, I am concerned about performance, resource
On 8/3/05, Shitiz Bansal <[EMAIL PROTECTED]> wrote:
> Hi,
> I need to program a web browser in python.I dont have any idea of how to
> start, what i do have is time and willingness to learn.Could anyone direct
> me to some suitable reference?
> Shitiz
>
How about Grail http://grail.sourceforge.
On 7/31/05, Jorge Louis de Castro <[EMAIL PROTECTED]> wrote:
Hi,Thanks for your reply. I have been googling this issue and found thisarticle:http://starship.python.net/crew/theller/moin.cgi/SingleFileExecutable
that seems to indicate what I want is possible and it is available.
Hi,
I looked at th
On 7/27/05, Luis N <[EMAIL PROTECTED]> wrote:
On 7/27/05, Nathan Pinno <[EMAIL PROTECTED]
> wrote:
Hi all,
How do I go about the following: I want to write a program that will print
two lists one after another, then show all the available possibilities for
matches e.g a0 an
On 7/27/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
Hi all,
How do I go about the following: I want to write a program that will print
two lists one after another, then show all the available possibilities for
matches e.g a0 and x0.
Here is what I have so far:
lista = [x0, x1, x2, x3
On 21 Jul 2005 20:39:36 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,I have a list of tuples like this:[(1423, 2637),(6457, 8345),(9086, 10100),(12304, 15666)]
Each tuple references coordinates of a big long string and they are in the'right' order, i.e. earliest coordinate first within ea
On 7/21/05, dina lenning <[EMAIL PROTECTED]> wrote:
YES...heres my problem I am a university student..will be a teacher in 2 years hopefully..andhave taken a first year computing course that said it required NO PRIORknowledge, but i am having great difficulty. The students (71 of them)
are all co
On 7/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote:
Luis N wrote:> I'd appreciate some comments on my use of globals and the map function.>> import metakit> import marshal>> db = metakit.storage('addy.mk
<http://addy.mk>',1)> dbs = db.getas(
I'd appreciate some comments on my use of globals and the map function.
The idea here is that (simple) Metakit database definitions can be
loaded dynamically from another Metakit database detifintion. (Yes this
would likely be easier with a SQL database, don't ask!) Nasty code
ahead:
import metak
27;ve skimmed through it a bit, and will give it a more thorough read shortly.
Thanks!
Luis N
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi,
I was wondering if someone knowledgeable of both Tcl and Python could
suggest whether it would be a good or a bad idea to write a Python/Tk
application, with the motive to rewrite the application in Tcl/Tk once
completed. My reason for considering this route is that I have never
written a sing
On 7/2/05, Kent Johnson <[EMAIL PROTECTED]> wrote:
Luis N wrote:> def listItems():> l= []> d = {}> for r in range(len(vw)):> for x in range(lt):> ed = desc[x]> exec("d['%s']=vw[%d].%s" % (ed,r,ed))
&g
m vw by 5. How can I have:
for each record in the database:
for each column in the record:
do stuff.
Without multiplying the result i.e len(vw) * lt
Thanks.
Luis N.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 7/2/05, Luis N <[EMAIL PROTECTED]> wrote:
Umm, sorry, I meant:
d[desc[x]] = exec("""'vw[%s].desc[%s]'""" % (r,x ))
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
dded without changing the
code.
I thought that if:
def listItems():
l= []
d = {}
lt = len(desc)
for r in range(len(vw)):
for x in range(len(lt)):
d[desc[x]] = exec("""'vw'+[r]+'.'+desc[x]""")
l.append(d)
Hi,
>>> l
[{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'},
{'last': 'Bar', 'first': 'Foo'}, {'last': 'Bar', 'first': 'Foo'}]
This is how I imagine it:
for i in l:
for j in l[i]:
for k in l[i][j]:
print k.get('first')
print k.get('last')
Is
I grabbed this from the docs:
Gnuplot.py uses Python distutils and can be installed by untarring the
package, changing into the top-level directory, and typing "python
setup.py install". The Gnuplot.py package is pure Python--no
compilation is necessary.
On Mar 30, 2005 11:13 PM, jrlen balane <[
Hi,
I've been exploring xmlrpc implementations, and am somewhat confused
as to what I should use. I've spent the most time poking at Twisted,
which took me a while to figure out the basics of, and have spent a
moment or two exploring py-xmlrpc as well as SimpleXMLRPCServer in the
standard library.
This code seems a little slow, is there anything in particular that
jumps out as being not quite right.
The idea is that a file is opened that contains path names to other
files, that are appended and outputed into a directory of choice.
I plan to move this off the filesystem into a database when
Does it make sense to do this:
In [2]: class AB:
...: pass
...:
In [3]: a = AB()
In [4]: a
Out[4]: <__main__.AB instance at 0x8428bec>
In [5]: class BC:
...: def __init__(self, foo):
...: self.foo = foo
In [6]: b = BC(a)
In [7]: b.foo
Out[7]: <__main__.AB instance a
Thanks that's much nicer.
On Fri, 11 Feb 2005 22:28:55 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> If you iterate over the author nodes you can check the user name and password
> of each in turn.
>
> Not tested code!
>
> def authenticateAuthor(author, password):
> authorxml = 'author.x
Hi,
This code works, but I don't like it much:
def authenticateAuthor(author, password):
authorxml = 'author.xml'
path = os.path.join(xml, authorxml)
try: if not os.path.exists(path):
authorfile = False
else:
authorfile = True
tree = E.ElementTree(file=path
In other words I have to do some arithmetic:
>>> import time
>>> time.timezone
0
The server is located in Dallas, Texas.
On Wed, 26 Jan 2005 15:44:48 +1300, Tony Meyer <[EMAIL PROTECTED]> wrote:
> > time.timezone gives you, I think, the offset between
> > your current timezone and GMT. However,
Ok, urllib.quote worked just fine, and of course so did urllib.pathname2url.
I should have run a dir() on urllib. Those functions don't appear in
http://docs.python.org/lib/module-urllib.html
Now, how might one go about calculating the New York time off-set from
GMT? The server is in the U.S. but
How would I best turn this string:
'2005-01-24 00:00:00.0'
into this string:
'2005%2D01%2D24%2000%3A00%3A00%2E0'
In order to call a URL.
I've hunted through the standard library, but nothing seemed to jump out.
Thank You.
___
Tutor maillist - Tuto
When the script begins with main(f), it gets a KeyError and goes to
the login page, but when the form data is submitted it returns a 404.
Am I not setting/getting the cookie properly? Absolutely nothing is
printed until zptIO is called.
import os
import Cookie
from spanishlabs.conf import *
from s
Hi,
I gave this a quick read: http://aspn.activestate.com/ASPN/Mail/Message/573292
I'm wondering how I can turn a variable number of keyword arguments
passed to a class into variables for use in said class:
#This so doesn't work
class SomethingLikeThis:
def __init__(self, **kwargs):
Hi,
I've passed this through the interperter line-by-line, yet still can't
get it to work right.
The first time the cgi driver script initiates it runs the login
function which renders a zpt. Upon submission of their vitals, the
user is authenticated via sqlobject, and if they pass the chapters
> [Jeff]
> > Also, even though this is intended to be a quick shell script, it's
> > not a bad idea to make everything except function defs into a little
> > main() function, and call it in a script-only section.
>
>
> [Luis]
>
> > The only thing I'm not clear about is how 'trashcan' can be a
>
Hi,
Jeff Shanon, thanks for your help. I was wondering if there was a
function to automatically get the user on a *nix system, and had tried
the if __name__ == __main__ but didn't really get it until your
example. The only thing I'm not clear about is how 'trashcan' can be a
local variable inside
This is the most meaningful thing this newbie has ever done. Comments
are appreciated:
#!/usr/local/bin/python
trashcan = "/home/anewby/.trashcan"
import os, sys, shutil
junk = []
for arg in sys.argv:
junk.append(arg)
junk = junk[1:]
empty = False
if "-e" in junk:
empty = True
ju
56 matches
Mail list logo