how to set python hosting !

2008-05-16 Thread [EMAIL PROTECTED]
Hi, i do have some basic python know-how. i want to tryout by actually implementing some python generated dynamic page etc. i am having websetup which runs with mysql on linux, and pythong is installed on it. so is there any ref. from where i can know how to configure my webserver for python.

Re: ElementTree and DTDs

2008-05-16 Thread J . Pablo Fernández
Or is there another library that would handle DTDs correctly, performing entity replacements? Thanks. On May 16, 12:20 am, J. Pablo Fernández <[EMAIL PROTECTED]> wrote: > Hello, > > Is ElementTree supposed to load DTDs? I have some xmls heavy on > entities and it fails this way: > > Python 2.5.2

Re: managing properties/configurations

2008-05-16 Thread A.T.Hofkamp
On 2008-05-16, Venkatraman.S. <[EMAIL PROTECTED]> wrote: > Or a better example would be: Indeed, this is concrete enough to make some suggestions. > I have the params in a config file and import this module: > myconfig.py > a=10 > b=30 > c=31 > d=40 The big problem imho with coding such stuff di

default object comparison considered harmful?

2008-05-16 Thread A.T.Hofkamp
Hello all, Yesterday we found the cause of a bug that has caused problems for a long time. It appeared to be the following: class A(object): pass print min(1.0, A()) which is accepted by Python even though the A() object is not numerical in nature. The cause of this behavior seems to be th

Re: default object comparison considered harmful?

2008-05-16 Thread Bruno Desthuilliers
A.T.Hofkamp a écrit : Hello all, Yesterday we found the cause of a bug that has caused problems for a long time. It appeared to be the following: class A(object): pass print min(1.0, A()) which is accepted by Python even though the A() object is not numerical in nature. The cause of this

Re: Dbase / foxpro files

2008-05-16 Thread martindesalinas
look at http://pypi.python.org/pypi?%3Aaction=search&term=dbf&submit=search i use dbfpy -- http://mail.python.org/mailman/listinfo/python-list

Re: send yield

2008-05-16 Thread Aspersieman
castironpi wrote: On May 15, 7:16 pm, castironpi <[EMAIL PROTECTED]> wrote: On May 15, 6:43 pm, castironpi <[EMAIL PROTECTED]> wrote: On May 15, 6:16 pm, castironpi <[EMAIL PROTECTED]> wrote: On May 15, 4:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

Re: datamining .txt-files, library?

2008-05-16 Thread martindesalinas
look at module re (rgular expression) or pyparser see http://nedbatchelder.com/text/python-parsers.html -- http://mail.python.org/mailman/listinfo/python-list

Re: how to set python hosting !

2008-05-16 Thread olive
On May 16, 9:16 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > i do have some basic python know-how. i want to tryout by actually > implementing some python generated dynamic page etc. > > i am having websetup which runs with mysql on linux, and pythong is > installed on it. > > so is

Re: default object comparison considered harmful?

2008-05-16 Thread Peter Otten
A.T.Hofkamp wrote: > Yesterday we found the cause of a bug that has caused problems for a long > time. It appeared to be the following: > > class A(object): > pass > > print min(1.0, A()) > > which is accepted by Python even though the A() object is not numerical in > nature. > > The cause

Instance of class "object"

2008-05-16 Thread 甜瓜
Howdy, I wonder why below does not work. a = object() a.b = 1# dynamic bind attribute failed... To make it correct, we have to create a new class: class MyClass(object): pass a = MyClass() a.b = 1 # OK Does this strange behavior break the LSP (Liskov substitution principle)?

Re: Instance of class "object"

2008-05-16 Thread Hrvoje Niksic
"甜瓜" <[EMAIL PROTECTED]> writes: > Howdy, > I wonder why below does not work. > > a = object() > a.b = 1# dynamic bind attribute failed... Because the default object class doesn't have a dict or other indication of state. It's a "pure" Python object whose only visible properties are

Re: Instance of class "object"

2008-05-16 Thread Ben Finney
"甜瓜" <[EMAIL PROTECTED]> writes: > Howdy, > I wonder why below does not work. > > a = object() > a.b = 1# dynamic bind attribute failed... > > To make it correct, we have to create a new class: > class MyClass(object): pass > a = MyClass() > a.b = 1 # OK It's annoyingly diffic

Re: Instance of class "object"

2008-05-16 Thread Peter Otten
甜瓜 wrote: > I wonder why below does not work. > > a = object() > a.b = 1# dynamic bind attribute failed... The implementation of slots depends on that behaviour: http://docs.python.org/ref/slots.html > Does this strange behavior break the LSP (Liskov substitution principle)? Can y

Re: ElementTree and DTDs

2008-05-16 Thread Stefan Behnel
J. Pablo Fernández wrote: > Is ElementTree supposed to load DTDs? AFAIR, you have to provide entities by hand. > Or is there another library that would handle DTDs correctly, > performing entity replacements? http://codespeak.net/lxml http://codespeak.net/lxml/parsing.html#parser-options Stefa

Re: Using file objects with elementtree

2008-05-16 Thread Stefan Behnel
castironpi wrote: > [...], and making up words. Blah? "Blah" is not made up. Try again. Stefan PS: this might be getting slightly off-topic... -- http://mail.python.org/mailman/listinfo/python-list

Re: Instance of class "object"

2008-05-16 Thread 甜瓜
2008/5/16 Hrvoje Niksic <[EMAIL PROTECTED]>: > "甜瓜" <[EMAIL PROTECTED]> writes: > >> Howdy, >> I wonder why below does not work. >> >> a = object() >> a.b = 1# dynamic bind attribute failed... > > Because the default object class doesn't have a dict or other > indication of state. It's

TPCServer and xdrlib

2008-05-16 Thread Laszlo Nagy
Hi All, I'm trying to write a multi threaded TPC server. I have used xmlrpc before for many purposes, but in this case this would not be efficient: - I have to send larger amounts of data, the overhead of converting to XML and parsing XML back would be too much pain - I have no clue how to

Re: Problem creating a shorcut

2008-05-16 Thread Wolfgang Draxinger
Mike Driscoll wrote: > Hi, > > I've had this niggling issue from time to time. I want to > create a shortcut on the user's desktop to a website that > specifically loads Firefox even if Firefox is not the default > browser. > > I usually use COM as it allows very specific settings of the > short

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Wolfgang Draxinger wrote: 1) you should not hardcode the backslashes ('\'), instead use os.sep for it. With respect, the OP is creating a Windows desktop shortcut. Unless Microsoft suddenly decide to change their use of the backslash, I suggest that this is a needless generalisation. 3) You

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Wolfgang Draxinger wrote: 1) you should not hardcode the backslashes ('\'), instead use os.sep for it. With respect, the OP is creating a Windows desktop shortcut. Unless Microsoft suddenly decide to change their use of the backslash, I suggest that this is a needless generalisation. 3) You

Re: usage of python

2008-05-16 Thread afrobeard
On May 14, 9:13 pm, Rajarshi <[EMAIL PROTECTED]> wrote: > Thanks to the all posters. This will be very useful! No Problem :). Let me know if you need any code snippets. P.S. I wouldn't mind working with you to prepare introductory material and examples for beginners if it becomes public property.

Re: managing properties/configurations

2008-05-16 Thread Venkatraman.S.
On May 16, 7:45 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: Thanks > By picking better names, the config gets much more readable. > > The big advantage here is that a config file is something readable and > editable > without appearing it to be Python. > If this is too low level for your users,

ply yacc lineno not working?

2008-05-16 Thread Laszlo Nagy
This is a fragment from my yacc file: import ply.yacc as yacc from lex import tokens from ast import * def p_msd(p): r"""msd : SCHEMA WORD LBRACE defs RBRACE """ p[0] = MSDSchema(p[2]) print p.lineno(5) # Line number of the right brace p[0].items = p[4] Here is a test input: "

class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
wassup here? >>> 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' >>> class customer: def __init__(self, ID, movies): self.ID = ID self.m

Re: ply yacc lineno not working?

2008-05-16 Thread Laszlo Nagy
I'm sorry for the dumb question. I had to add these to the lexer: def t_comment(t): r"\#[^\n]*\n" t.lexer.lineno += 1 # We do not return anything - comments are ignored. # Define a rule so we can track line numbers def t_newline(t): r'\n+' t.lexer.lineno += len(t.value) Well, it

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Christian Heimes
globalrev schrieb: > cust1 = customer.__init__('12',['1','435','2332']) cust1 = customer('12',['1','435','2332']) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: no inputstream?

2008-05-16 Thread max
On May 15, 10:31 pm, castironpi <[EMAIL PROTECTED]> wrote: > On May 15, 6:49 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > > > On May 15, 6:42 pm, John Krukoff <[EMAIL PROTECTED]> wrote: > > > > On Thu, 2008-05-15 at 17:32 -0600, John Krukoff wrote: > > > > On Thu, 2008-05-15 at 17:11 -0600, John

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Peter Otten
Christian Heimes wrote: > globalrev schrieb: >> cust1 = customer.__init__('12',['1','435','2332']) > > cust1 = customer('12',['1','435','2332']) ... and before that from customer import customer Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: managing properties/configurations

2008-05-16 Thread A.T.Hofkamp
On 2008-05-16, Venkatraman.S. <[EMAIL PROTECTED]> wrote: > The problem being, if i change the config file, then the configobj has > to reload this file again. I do not want to 'refresh' the config obj > per transaction but only when the config params change. If you have trustable time stamps at yo

Pyparsing Question

2008-05-16 Thread Ant
Hi all, I have a question on PyParsing. I am trying to create a parser for a hierarchical todo list format, but have hit a stumbling block. I have parsers for the header of the list (title and description), and the body (recursive descent on todo items). Individually they are working fine, c

Re: default object comparison considered harmful?

2008-05-16 Thread Kay Schluehr
On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > Hello all, > > Yesterday we found the cause of a bug that has caused problems for a long > time. > It appeared to be the following: > > class A(object): > pass > > print min(1.0, A()) > > which is accepted by Python even though the A

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : wassup here? 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' class customer: 1/ naming convention : class names should be CamelCased

Re: TPCServer and xdrlib

2008-05-16 Thread Henrique Dante de Almeida
On May 16, 7:16 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: >   Hi All, Hello, :-) > > I'm trying to write a multi threaded TPC server. I have used xmlrpc How exactly did you come to the conclusion that your server must be multi threaded ? > - I have to send larger amounts of data, the overhe

Re: default object comparison considered harmful?

2008-05-16 Thread Bruno Desthuilliers
Kay Schluehr a écrit : On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: Hello all, Yesterday we found the cause of a bug that has caused problems for a long time. It appeared to be the following: class A(object): pass print min(1.0, A()) which is accepted by Python even though

Re: TPCServer and xdrlib

2008-05-16 Thread Diez B. Roggisch
Did you consider gzipping your XML (or YAML) packets ? Would the transfer time be acceptable in this case ? That would add even more to the overhead of transcoding the transportlayer. Switching from XMLRPC to a json-based protocol reduced in a project of mine reduced the overhead 10-20fold -

free dictionary english - spanish?

2008-05-16 Thread globalrev
i want to write a translationprogram, i have the webapp done already. i need a big free dictionary though. english-spanish/spanish-english seems like the best i know some spanish and thats what also is needed the most i think together with chinese. anywhere you can download one? preferrably easy

morning in Python

2008-05-16 Thread castironpi
I want to talk to the newsgroup. As I have found that its readers will be non-trivially attentive, I esteem it a worthwhile production, for finely divided values of worth & while. (Disclaimer: Don't call me millionaire; life & money...). It is not clear that I will be posting code first thing, f

Re: datamining .txt-files, library?

2008-05-16 Thread castironpi
On May 16, 3:22 am, [EMAIL PROTECTED] wrote: > look at module re (rgular expression) or pyparser > > seehttp://nedbatchelder.com/text/python-parsers.html This ties in to 'call tree tool?' from yesterday. Do we have any visualization modules? My two examples were 're' and 'call trees' -- http://m

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: > > globalrev schrieb: > >> cust1 = customer.__init__('12',['1','435','2332']) > > > cust1 = customer('12',['1','435','2332']) > > ... and before that > > from customer import customer > > Peter why do i have to wri

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 14:19, Bruno Desthuilliers wrote: > globalrev a écrit : > > > wassup here? > > > 7 > > > Traceback (most recent call last): > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > > > print cust1.getID() > > AttributeError: 'NoneType' object has no attribute 'getID'

Re: Problem creating a shorcut

2008-05-16 Thread Larry Bates
Mike Driscoll wrote: On May 15, 2:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: Mike Driscoll wrote: Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. I u

Re: Problem creating a shorcut

2008-05-16 Thread Mike Driscoll
On May 16, 5:44 am, Wolfgang Draxinger <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > Hi, > > > I've had this niggling issue from time to time. I want to > > create a shortcut on the user's desktop to a website that > > specifically loads Firefox even if Firefox is not the default > > browse

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread globalrev
On 16 Maj, 14:19, Bruno Desthuilliers wrote: > globalrev a écrit : > > > wassup here? > > > 7 > > > Traceback (most recent call last): > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > > > print cust1.getID() > > AttributeError: 'NoneType' object has no attribute 'getID'

Re: Dbase / foxpro files

2008-05-16 Thread Larry Bates
[EMAIL PROTECTED] wrote: look at http://pypi.python.org/pypi?%3Aaction=search&term=dbf&submit=search i use dbfpy That's another option. The caveat is that dbfpy specifically states that it only works on "simple" files. I'm pretty sure ODBC is universal. The nice thing about using ODBC is

Re: Problem creating a shorcut

2008-05-16 Thread Mike Driscoll
On May 16, 1:51 am, Chris <[EMAIL PROTECTED]> wrote: > On May 15, 5:13 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I've had this niggling issue from time to time. I want to create a > > shortcut on the user's desktop to a website that specifically loads > > Firefox even if Fire

Re: Problem creating a shorcut

2008-05-16 Thread Mike Driscoll
On May 15, 8:24 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 15 May 2008 12:13:56 -0300, Mike Driscoll <[EMAIL PROTECTED]>   > escribió: > > > I've had this niggling issue from time to time. I want to create a > > shortcut on the user's desktop to a website that specifically loads >

Re: Pydev Console use vs. stdout/stderr

2008-05-16 Thread RossGK
On May 15, 5:26 pm, [EMAIL PROTECTED] wrote: > On May 15, 3:12 pm, RossGK <[EMAIL PROTECTED]> wrote: > > > Just getting used to the PyDev environment in eclipse by playing with > > a few simple programs. I'm also using wxPython GUI stuff. > > > I've noticed though that simple print commands in my

Re: default object comparison considered harmful?

2008-05-16 Thread castironpi
On May 16, 7:23 am, Bruno Desthuilliers wrote: > Kay Schluehr a écrit : > > > > > > > On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > >> Hello all, > > >> Yesterday we found the cause of a bug that has caused problems for a long > >> time. > >> It appeared to be the following: > > >>

Re: Problem creating a shorcut

2008-05-16 Thread Mike Driscoll
On May 16, 8:09 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > On May 15, 2:03 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > >> Mike Driscoll wrote: > >>> Hi, > >>> I've had this niggling issue from time to time. I want to create a > >>> shortcut on the user's desktop to a web

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Peter Otten
globalrev wrote: > On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: >> Christian Heimes wrote: >> > globalrev schrieb: >> >> cust1 = customer.__init__('12',['1','435','2332']) >> >> > cust1 = customer('12',['1','435','2332']) >> >> ... and before that >> >> from customer import customer >>

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Mike Driscoll wrote: Ah. I was unaware of the Arguments parameter. That works quite well. Where does one find this information anyway? I think I found mine from bits and pieces scattered in various tutorials. The canonical place would be: http://msdn.microsoft.com/en-us/library/bb774950(VS.85)

Re: TPCServer and xdrlib

2008-05-16 Thread Nick Craig-Wood
Laszlo Nagy <[EMAIL PROTECTED]> wrote: > I'm trying to write a multi threaded TPC server. I have used xmlrpc > before for many purposes, but in this case this would not be efficient: > > - I have to send larger amounts of data, the overhead of converting to > XML and parsing XML back would b

Re: default object comparison considered harmful?

2008-05-16 Thread castironpi
On May 16, 8:18 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 7:23 am, Bruno Desthuilliers > > > > > [EMAIL PROTECTED]> wrote: > > Kay Schluehr a écrit : > > > > On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > >> Hello all, > > > >> Yesterday we found the cause of a bug tha

Re: Problem creating a shorcut

2008-05-16 Thread Duncan Booth
Tim Golden <[EMAIL PROTECTED]> wrote: >> 3) You assume, that Firefox is always installed at C:\Program >> Files\Mozilla Firefox\firefox.exe >> However the path largely differs from system to system. > > This is broadly true. However, it's fairly clear from the > phrase "the user's desktop" that

Re: default object comparison considered harmful?

2008-05-16 Thread castironpi
On May 16, 8:18 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 7:23 am, Bruno Desthuilliers > > > > > [EMAIL PROTECTED]> wrote: > > Kay Schluehr a écrit : > > > > On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > >> Hello all, > > > >> Yesterday we found the cause of a bug tha

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : (snip) cust1 = customer.__init__('12',['1','435','2332']) __init__ is automagically called on instanciation, so you don't have to call it yourself. And FWIW, your __init__ returns None. what should init re

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 4:26 am, Peter Otten <[EMAIL PROTECTED]> wrote: > 甜瓜 wrote: > > I wonder why below does not work. > > > a = object() > > a.b = 1# dynamic bind attribute failed... > > The implementation of slots depends on that behaviour: > > http://docs.python.org/ref/slots.html > > > Does t

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread J. Cliff Dyer
On Fri, 2008-05-16 at 06:07 -0700, globalrev wrote: > On 16 Maj, 14:19, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: > > globalrev a écrit : > > > > > wassup here? > > > > > 7 > > > > > Traceback (most recent call last): > > > File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in > > >

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 8:51 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 4:26 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > > 甜瓜 wrote: > > > I wonder why below does not work. > > > > a = object() > > > a.b = 1# dynamic bind attribute failed... > > > The implementation of slots depends o

Re: Problem creating a shorcut

2008-05-16 Thread Tim Golden
Duncan Booth wrote: It's not too hard to get the required command line from the registry: import _winreg print _winreg.QueryValue(_winreg.HKEY_CLASSES_ROOT, 'FirefoxURL\shell\open\command') and of course it throws an exception if firefox isn't installed. Then just replace %1 with the url t

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Larry Bates
globalrev wrote: On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : wassup here? 7 Traceback (most recent call last): File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in print cust1.getID() AttributeError: 'NoneType' object has no attribute 'getID' class custome

Variable by label

2008-05-16 Thread rocco . rossi
Is there any function which will return a variable by passing to it the string containing the variable's name? Something like this for instance: foo = some_function("foo") or perhaps it's a dictionary. I don't know, but I would really like to find out how it can be done. I guess it is achievable.

Re: Variable by label

2008-05-16 Thread Arnaud Delobelle
[EMAIL PROTECTED] wrote: > Is there any function which will return a variable by passing to it > the string containing the variable's name? Something like this for > instance: > > foo = some_function("foo") > > or perhaps it's a dictionary. I don't know, but I would really like to > find out how

Re: default object comparison considered harmful?

2008-05-16 Thread castironpi
On May 16, 8:35 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 8:18 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > > > On May 16, 7:23 am, Bruno Desthuilliers > > [EMAIL PROTECTED]> wrote: > > > Kay Schluehr a écrit : > > > > > On 16 Mai, 10:03, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Bruno Desthuilliers
globalrev a écrit : On 16 Maj, 14:19, Bruno Desthuilliers wrote: globalrev a écrit : (snip) def getMovies(): return self.movies 4/ Python has support for computed attributes, so you just don't need these getters. > when class = > class customer: Please, do yourself and the wor

writing python extensions in assembly

2008-05-16 Thread inhahe
Can anyone give me pointers/instructions/a template for writing a Python extension in assembly (or better, HLA)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Variable by label

2008-05-16 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Is there any function which will return a variable by passing to it > the string containing the variable's name? Something like this for > instance: > > foo = some_function("foo") > > or perhaps it's a dictionary. I don't know, but I would really like to > find out how

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 4:16 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "甜瓜" <[EMAIL PROTECTED]> writes: > > Howdy, > > I wonder why below does not work. > > > a = object() > > a.b = 1# dynamic bind attribute failed... > > Because the default object class doesn't have a dict or other > indicatio

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread J. Cliff Dyer
On Fri, 2008-05-16 at 06:04 -0700, globalrev wrote: > On 16 Maj, 13:54, Peter Otten <[EMAIL PROTECTED]> wrote: > > Christian Heimes wrote: > > > globalrev schrieb: > > >> cust1 = customer.__init__('12',['1','435','2332']) > > > > > cust1 = customer('12',['1','435','2332']) > > > > ... and before th

Re: ply yacc lineno not working?

2008-05-16 Thread inhahe
I dunno but on Dos/Windows a newline is usually \r\n (although that still includes a \n..) "Laszlo Nagy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm sorry for the dumb question. I had to add these to the lexer: > > def t_comment(t): >r"\#[^\n]*\n" >t.lexer.lineno +=

Re: writing python extensions in assembly

2008-05-16 Thread Diez B. Roggisch
inhahe schrieb: Can anyone give me pointers/instructions/a template for writing a Python extension in assembly (or better, HLA)? You could write a C-extension and embed assembly. See the docs for how to write one. If you know how to implement a C-callingconvention-based shared library in asse

Re: Variable by label

2008-05-16 Thread Jarek Zgoda
[EMAIL PROTECTED] pisze: > Is there any function which will return a variable by passing to it > the string containing the variable's name? Something like this for > instance: > > foo = some_function("foo") > > or perhaps it's a dictionary. I don't know, but I would really like to > find out how

Re: Variable by label

2008-05-16 Thread inhahe
>>> a = 1 >>> b = eval("a") >>> b 1 >>> a =1 >>> b = globals()["a"] >>> b 1 >>> a =1 >>> b = locals()["a"] >>> b 1 <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there any function which will return a variable by passing to it > the string containing the variable's name? Somethin

Re: free dictionary english - spanish?

2008-05-16 Thread Banibrata Dutta
if it is complete sentence translation that you intend to do, then there is a lot more than just word dictionary that you need. you need the grammer too. hope you have that covered. On 5/16/08, globalrev <[EMAIL PROTECTED]> wrote: > > i want to write a translationprogram, i have the webapp done a

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 8:56 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 8:51 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > > > On May 16, 4:26 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > 甜瓜 wrote: > > > > I wonder why below does not work. > > > > > a = object() > > > > a.b = 1

Re: writing python extensions in assembly

2008-05-16 Thread inhahe
Well the problem is that I'm actually not an assembler guru, so I don't know how to implement a dll in asm or use a c calling convention, although I'm sure those instructions are available on the web. I was just afraid of trying to learn that AND making python-specific extensions at the same ti

Re: writing python extensions in assembly

2008-05-16 Thread D'Arcy J.M. Cain
On Fri, 16 May 2008 10:13:04 -0400 "inhahe" <[EMAIL PROTECTED]> wrote: > Can anyone give me pointers/instructions/a template for writing a Python > extension in assembly (or better, HLA)? I am trying to imagine the requirements document for your project. - Must be error prone and hard to debug

Re: TPCServer and xdrlib

2008-05-16 Thread Henrique Dante de Almeida
On May 16, 9:26 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >  Did you consider gzipping your XML (or YAML) packets ? Would the > > transfer time be acceptable in this case ? > > That would add even more to the overhead of transcoding the > transportlayer. Switching from XMLRPC to a json-ba

Re: default object comparison considered harmful?

2008-05-16 Thread castironpi
On May 16, 9:10 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 8:35 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > > > On May 16, 8:18 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > On May 16, 7:23 am, Bruno Desthuilliers > > > [EMAIL PROTECTED]> wrote: > > > > Kay Schluehr a écrit

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 9:41 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 8:56 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > > > On May 16, 8:51 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > On May 16, 4:26 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > 甜瓜 wrote: > > > > > I wonder

Cookies and CookieJar

2008-05-16 Thread Larry Bates
I'm struggling with a project using mechanize and cookies to screen scape a website. The site requires a client created cookie for authentication. Below is the code I'm attempting to use with the traceback I'm getting: >>> import Cookie >>> c=Cookie.SimpleCookie() >>> c["Manageopen"]="cards

Re: writing python extensions in assembly

2008-05-16 Thread inhahe
You could be right, but here are my reasons. I need to make something that's very CPU-intensive and as fast as possible. The faster, the better, and if it's not fast enough it won't even work. They say that the C++ optimizer can usually optimize better than a person coding in assembler by hand

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 10:21 am, castironpi <[EMAIL PROTECTED]> wrote: > On May 16, 9:41 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > > > On May 16, 8:56 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > On May 16, 8:51 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > > On May 16, 4:26 am, Peter Otten

Re: TPCServer and xdrlib

2008-05-16 Thread Diez B. Roggisch
Henrique Dante de Almeida schrieb: On May 16, 9:26 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Did you consider gzipping your XML (or YAML) packets ? Would the transfer time be acceptable in this case ? That would add even more to the overhead of transcoding the transportlayer. Switching

Re: writing python extensions in assembly

2008-05-16 Thread Diez B. Roggisch
inhahe schrieb: Well the problem is that I'm actually not an assembler guru, so I don't know how to implement a dll in asm or use a c calling convention, although I'm sure those instructions are available on the web. I was just afraid of trying to learn that AND making python-specific extensio

Python book question

2008-05-16 Thread Matt Herzog
People keep telling me I need a course in "Data Structures and Algorithms." Since Python is the only language that doesn't give me headaches I thought this book might be good. Has anyone read it or can anyone recommend the author? Can anyone recommend a better Data Structures and Algorithms book

IDE for Python

2008-05-16 Thread Jonathan Barbero
Hi! I´m newbie with Python and to learn it better I want to use a good IDE to concentrate on Python power. There is any IDE like Eclipse for Java for Python? If not, what is the best Python´s IDE for you? Thanks, Jonathan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Variable by label

2008-05-16 Thread rocco . rossi
On May 16, 4:27 pm, "inhahe" <[EMAIL PROTECTED]> wrote: > >>> a = 1 > >>> b = eval("a") > >>> b > 1 > >>> a =1 > >>> b = globals()["a"] > >>> b > 1 > >>> a =1 > >>> b = locals()["a"] > >>> b > > 1<[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Is there any function which will

Re: Instance of class "object"

2008-05-16 Thread castironpi
On May 16, 4:26 am, Peter Otten <[EMAIL PROTECTED]> wrote: > 甜瓜 wrote: > > I wonder why below does not work. > > > a = object() > > a.b = 1# dynamic bind attribute failed... > > The implementation of slots depends on that behaviour: > > http://docs.python.org/ref/slots.html > > > Does t

Re: Pyparsing Question

2008-05-16 Thread Paul McGuire
On May 16, 6:43 am, Ant <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a question on PyParsing. I am trying to create a parser for a > hierarchical todo list format, but have hit a stumbling block. I have > parsers for the header of the list (title and description), and the body > (recursive desce

Re: writing python extensions in assembly

2008-05-16 Thread D'Arcy J.M. Cain
On Fri, 16 May 2008 11:21:39 -0400 "inhahe" <[EMAIL PROTECTED]> wrote: > You could be right, but here are my reasons. > > I need to make something that's very CPU-intensive and as fast as possible. > The faster, the better, and if it's not fast enough it won't even work. > > They say that the C+

Thread killing - I know I know!

2008-05-16 Thread Roger Heathcote
Hello everyone, this is my first post so hello & please be gentle! Despite many peoples insistence that allowing for the arbitrary killing of threads is a cardinal sin and although I have no particular threading problem to crack right now I remain interest in the taboo that is thread killing.

Re: Making Variable Text Output More Pythonic?

2008-05-16 Thread Arnaud Delobelle
afrobeard <[EMAIL PROTECTED]> writes: > Arnaud's code wont work if self.opt1 is None, an empty list, an empty > tuple, False, etc, because all these evaluate to false. They wont > print the internal state of these variables. [Just an informational > notice, this may be the behavior you expect] ??

Re: Pyparsing Question

2008-05-16 Thread castironpi
On May 16, 6:43 am, Ant <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a question on PyParsing. I am trying to create a parser for a > hierarchical todo list format, but have hit a stumbling block. I have > parsers for the header of the list (title and description), and the body > (recursive desce

Re: Python book question

2008-05-16 Thread D'Arcy J.M. Cain
On Fri, 16 May 2008 10:31:16 -0500 Matt Herzog <[EMAIL PROTECTED]> wrote: > Since Python is the only language that doesn't give me headaches I thought > this book might be good. Has anyone read it or can anyone recommend the > author? Can anyone recommend a better Data Structures and Algorithms b

Re: "indexed properties"...

2008-05-16 Thread David C. Ullrich
On Thu, 15 May 2008 10:59:41 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >En Wed, 14 May 2008 18:15:41 -0300, David C. Ullrich <[EMAIL PROTECTED]> >escribió: > >> Having a hard time phrasing this in the form >> of a question... >> >> The other day I saw a thread where someone asked >> a

Re: morning in Python

2008-05-16 Thread inhahe
I'm not an expert in this but what does it mean to emphasize state? It seems the opposite of that would be a) functional programming, and b) passing parameters instead of using global or relatively local variables. And maybe c) coroutines (generators as implemented in Python), although perhaps

Re: Pyparsing Question

2008-05-16 Thread Ant
Hi Paul, LineStart *really* wants to be parsed at the beginning of a line. Your textline reads up to but not including the LineEnd. Try making these changes. 1. Change textline to: textline = pp.Combine( pp.Group(pp.Word(pp.alphas, pp.printables) + pp.restOfLine)) + \ pp.

Re: writing python extensions in assembly

2008-05-16 Thread inhahe
I like to learn what I need, but I have done assembly before, I wrote a terminal program in assembly for example, with ansi and avatar support. I'm just not fluent in much other than the language itself, per se. Perhaps C would be as fast as my asm would, but C would not allow me to use SIMD,

  1   2   3   >