Re: web access through vpn client

2009-05-02 Thread mark . seagoe
On May 2, 3:01 am, "Martin P. Hellwig" wrote: > mark.sea...@gmail.com wrote: > > On May 1, 5:57 pm, "Martin P. Hellwig" > > wrote: > >> mark.sea...@gmail.com wrote: > >>> Hi; > >>> I am trying to retrieve financial data off website for stock market > >>> analysis.  Just hobby not for pay.  I actu

Re: web access through vpn client

2009-05-01 Thread mark . seagoe
On May 1, 5:57 pm, "Martin P. Hellwig" wrote: > mark.sea...@gmail.com wrote: > > Hi; > > > I am trying to retrieve financial data off website for stock market > > analysis.  Just hobby not for pay.  I actually am impressed that > > urllib2 and BeautifulSoup work pretty well to do what I want, and

web access through vpn client

2009-05-01 Thread mark . seagoe
Hi; I am trying to retrieve financial data off website for stock market analysis. Just hobby not for pay. I actually am impressed that urllib2 and BeautifulSoup work pretty well to do what I want, and the first little routine actually gets the data from the web page... except if my VPN client is

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
Just as feedback, I went back to the __init__ style routine, weeded out a few things, installed python 2.6.1, and it works great. Thanks for all your help. Now I've got to convince 1000 people at my company to switch. That's going to be the tough part. -- http://mail.python.org/mailman/listinfo

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 12:05 pm, mark.sea...@gmail.com wrote: > On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote: > > > > > > > On Mar 30, 11:53 am, Dave Angel wrote: > > > > After taking out the class  myclass stuff, the code worked for me in > > > Python 2.6.1, through the cat line.  Could you please tell u

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote: > On Mar 30, 11:53 am, Dave Angel wrote: > > > After taking out the class  myclass stuff, the code worked for me in > > Python 2.6.1, through the cat line.  Could you please tell us what > > version of Python you're running this on? > > > import sy

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 11:53 am, Dave Angel wrote: > After taking out the class  myclass stuff, the code worked for me in > Python 2.6.1, through the cat line.  Could you please tell us what > version of Python you're running this on? > > import sys > print "Python version: ", sys.version > > yielded (on my m

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
If I cast it long then it prints fine, but I was hoping there would be a slicker way (to accomplish this in the class itself). print 'bird val = 0x%016X' % long(bird) -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 10:53 am, David Bolen wrote: > mark.sea...@gmail.com writes: > > class myclass(object): > > # > >     # def __new__(class_, init_val, size, reg_info): > >     def __init__(self, init_val, size, reg_info): > > >         # self = object.__new__(class_) > >         self.reg_info = reg_info

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 9:40 am, Scott David Daniels wrote: > mark.sea...@gmail.com wrote: > > ... > > It seems like there's no way to do what I'm trying.  I am confined to > > Python 2.5.3 for business reasons. > > > So I want a class ShadowRegister, which just has a value that I can do > > get/set bit sel an

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
Here again is example: from ctypes import * class REG_INFO(Structure): _fields_ = [ ('address', c_ubyte), ('message', c_char * 256), ('size', c_ubyte) ] class myclass(object): # # def __new__(class_, init_val, size, reg_info): def __init__(self, init_

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
It needs to read HW reg and adjust ChipRegister value, or ShadowRegister and change the HW value (order was reversed). I will look at MyHDL again though to see if there is some reason it can print class subclassed from intbv, or if it even has a class subclassed from intbv, without casting as a l

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 2:30 am, Jan Decaluwe wrote: > mark.sea...@gmail.com wrote: > > Python 2.5.3 for business reasons. > > > So I want a class ShadowRegister, which just has a value that I can do > > get/set bit sel and slice ops.  I got that working with __init__.  It > > was subclass from "object".  Then

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 29, 11:16 pm, Chris Rebert wrote: > 2009/3/29 Scott David Daniels : > > > mark.sea...@gmail.com wrote: > > >> On Mar 29, 9:52 pm, Chris Rebert wrote: > > >>> On Sun, Mar 29, 2009 at 9:18 PM,   wrote: > > ... > > >>> ... Also, you shouldn't use `class_ ` as the name of the first argume

Re: global name 'self' is not defined - noob trying to learn

2009-03-29 Thread mark . seagoe
On Mar 29, 9:52 pm, Chris Rebert wrote: > On Sun, Mar 29, 2009 at 9:18 PM,   wrote: > > Hi.  So now I have this class that works to allow me to pass in my > > reg_info struct.  However when I try to make it part of my class it > > gets an error "global name 'self' is not defined.  I've never seen

global name 'self' is not defined - noob trying to learn

2009-03-29 Thread mark . seagoe
Hi. So now I have this class that works to allow me to pass in my reg_info struct. However when I try to make it part of my class it gets an error "global name 'self' is not defined. I've never seen this error before. If I comment out the line below 'self.reg_info = reg_info" then the code runs

Re: Python print and types selection

2009-03-29 Thread mark . seagoe
On Mar 28, 1:47 pm, Scott David Daniels wrote: > mark.sea...@gmail.com wrote: > > ... > > It appears that if I make the class a subclass of long... > > class bignumber(long): > >     def __init__(self, initval): > >         self.val = initval > > > Then if I make a new class of subclass of bignumb

Re: Python print and types selection

2009-03-28 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles wrote: > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > >> Python print recognizes the local constant "dog", but it goes and > >> fetches the __int__ type from my object-based class, even though it's > >> val

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 7:48 pm, mark.sea...@gmail.com wrote: > On Mar 27, 4:00 pm, Miles wrote: > > > > > > > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > > >> Python print recognizes the local constant "dog", but it goes and > > >> fetches t

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
On Mar 27, 4:00 pm, Miles wrote: > On Fri, Mar 27, 2009 at 6:56 PM, Gabriel Genellina wrote: > > En Fri, 27 Mar 2009 18:43:16 -0300, escribió: > >> Python print recognizes the local constant "dog", but it goes and > >> fetches the __int__ type from my object-based class, even though it's > >> val

Re: Python print and types selection

2009-03-27 Thread mark . seagoe
What I mean is, is there a way to change the class so that print will see it as a long, without having to cast it as one in the main program. -- http://mail.python.org/mailman/listinfo/python-list

Python print and types selection

2009-03-27 Thread mark . seagoe
Python 2.5, PC. I have a question about getting Python print to be able to recognize a long type. class bignumber(object): def __init__(self, initval=0): self.val = initval # def __int__(self): print 'bignumber.__int__ returning a %s' % type(self.val) return self

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
On Feb 11, 5:51 pm, Marc 'BlackJack' Rintsch wrote: > On Wed, 11 Feb 2009 17:33:23 -0800, mark.seagoe wrote: > > Not sure what generic attribute container is.  I am reading in from xml > > file all reg names for a chip. > > Are you using instances of that class to interface C code or to read/ > wr

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
Hi Gabriel; Not sure what generic attribute container is. I am reading in from xml file all reg names for a chip. So then I'd be able to use python scripts to access the regs. So eventually this class will get subclassed w/ hw access instead of just saving in int. So I want to call this modu

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
In last post, I mixed code w/ 'p' and 'point'. Should be: >>> point._fields_.append(('z', c_int)) >>> point.z = 30 >>> print 'List:', list(point) List: [10, 20, 30] -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
On Feb 11, 9:01 am, mark.sea...@gmail.com wrote: > On Feb 10, 9:52 pm, "Gabriel Genellina" > wrote: > > > > > > > En Wed, 11 Feb 2009 00:31:26 -0200, escribió: > > > > I like the ability to access elements of a struct such as with ctypes > > > Structure: > > myStruct.elementName1 > > > 4 > >

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
On Feb 10, 9:52 pm, "Gabriel Genellina" wrote: > En Wed, 11 Feb 2009 00:31:26 -0200, escribió: > > > I like the ability to access elements of a struct such as with ctypes > > Structure: > myStruct.elementName1 > > 4 > > > What I like about it is there are no quotes needed. > > > What I don't

Iterable Ctypes Struct

2009-02-10 Thread mark . seagoe
I like the ability to access elements of a struct such as with ctypes Structure: >>>myStruct.elementName1 4 What I like about it is there are no quotes needed. What I don't like about it is that it's not iterable: >>>for n in myStruct: <== gives error >>>print n I don't want to force the en

Re: Using equals operator without changing reference pointer

2009-01-30 Thread mark . seagoe
On Jan 29, 8:03 pm, Terry Reedy wrote: > Erik Max Francis wrote: > > mark.sea...@gmail.com wrote: > > >> Is there a way to lock down myInst so that it still refers to the > >> original object, and is there some special member that will allow me > >> to override the equals operator in this case?  O

Using equals operator without changing reference pointer

2009-01-29 Thread mark . seagoe
I know this may be asking too much of Python, but you never know unless you ask... So now having a class that can be treated like an int as far as math upon the instance name, and can be treated as in HDL simulators, allowing bitslice and bitselect ops, I was stoked. Also reading back the instanc

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki wrote: > mark.sea...@gmail.com wrote: > > Thanks.  So far these solutions will return strings.  So I can't > > really treat it like a variable, yet still perform bitslice on it, > > since I need a special class to do bitslice and bit selection, but as > > soon as I

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
On Jan 29, 3:13 pm, Stef Mientki wrote: > mark.sea...@gmail.com wrote: > > Thanks.  So far these solutions will return strings.  So I can't > > really treat it like a variable, yet still perform bitslice on it, > > since I need a special class to do bitslice and bit selection, but as > > soon as I

Re: verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
Thanks. So far these solutions will return strings. So I can't really treat it like a variable, yet still perform bitslice on it, since I need a special class to do bitslice and bit selection, but as soon as I try to pass it into some other function to check a bit, I gotta then do another operati

Re: Can't understand what python wants from me

2009-01-29 Thread mark . seagoe
On Jan 29, 1:50 pm, Oleksiy Khilkevich wrote: > Hello, everyone, > This may be a totally noob question, but since I am one, so here is it. For the input function, python is expecting you to input a number or a string. If you enter 'asd' without the '' then it thinks you are entering some variabl

verilog like class w/ bitslicing & int/long classtype

2009-01-29 Thread mark . seagoe
I'm trying to make a script environment with datatypes (or classes) for accessing hardware registers. At the top level, I would like the ability to bitwise ops if bit slice brackets are used, but if no brackets are used, I would like it to write/read the whole value. For example, if I have someth