Re: CLP stats: last 500 posts

2016-12-11 Thread Wildman via Python-list
On Sun, 11 Dec 2016 12:03:07 -0500, DFS wrote: > For this short stat version I only used the 'User-Agent' header. I have > a longer version that uses both 'User-Agent' and 'X-Newsreader' > > > You can put a conditional in place for now: > > if s='giganews': > printStat("X-Newsreader","N

Re: The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Steve D'Aprano
On Mon, 12 Dec 2016 07:10 am, Juan C. wrote: > I'm watching a Python course and was presented a topic regarding classes. > One of the examples were: > > box.py > > class Box: > serial = 100 > > def __init__(self, from_addr, to_addr): > self.from_addr = from_addr > self.t

Re: The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Terry Reedy
On 12/11/2016 5:29 PM, Gregory Ewing wrote: Juan C. wrote: The instructor said that the right way to call a class attribute is to use 'Class.class_attr' notation, but on the web I found examples where people used 'self.class_attr' to call class attributes. I believe that using the first notation

Re: The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Gregory Ewing
Juan C. wrote: The instructor said that the right way to call a class attribute is to use 'Class.class_attr' notation, but on the web I found examples where people used 'self.class_attr' to call class attributes. I believe that using the first notation is better ('Class.class_attr'), this way the

Re: The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Chris Angelico
On Mon, Dec 12, 2016 at 7:10 AM, Juan C. wrote: > class Box: > serial = 100 > > def __init__(self, from_addr, to_addr): > self.from_addr = from_addr > self.to_addr = to_addr > self.serial = Box.serial > Box.serial += 1 > I would say that this is awkward usa

Re: pySerial raw data

2016-12-11 Thread MRAB
On 2016-12-11 21:29, Wanderer wrote: On Sunday, December 11, 2016 at 12:52:04 PM UTC-5, MRAB wrote: On 2016-12-11 16:28, Wanderer wrote: > I have an outdoor thermometer that transmits to an indoor receiver at 433Mhz. I also have a 433Mhz USB serial port jig from a TI development tool. I would l

Re: pySerial raw data

2016-12-11 Thread Paul Rubin
Wanderer writes: > I also have a 433Mhz USB serial port jig from a TI development > tool The TI USB port registers as a COM port that I can access > with pySerial. If the TI jig has 433 mhz (LORA?) at one end and serial at the other, you have to find the port parameters in the docs for the TI

Re: pySerial raw data

2016-12-11 Thread Wanderer
On Sunday, December 11, 2016 at 12:52:04 PM UTC-5, MRAB wrote: > On 2016-12-11 16:28, Wanderer wrote: > > I have an outdoor thermometer that transmits to an indoor receiver at > > 433Mhz. I also have a 433Mhz USB serial port jig from a TI development > > tool. I would like to use the TI USB seria

Re: CLP stats: last 500 posts

2016-12-11 Thread Jon Ribbens
On 2016-12-11, Wildman wrote: > I don't think it is a problem with the code but any thoughts > why giganews is not playing nice? Most likely because you're calling XHDR on a header which is not in the server's overview file. -- https://mail.python.org/mailman/listinfo/python-list

The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Juan C.
I'm watching a Python course and was presented a topic regarding classes. One of the examples were: box.py class Box: serial = 100 def __init__(self, from_addr, to_addr): self.from_addr = from_addr self.to_addr = to_addr self.serial = Box.serial Box.serial

PyGreSQL 5.0.3 released

2016-12-11 Thread D'Arcy Cain
Release 5.0.3 of PyGreSQL. It is available at: http://pygresql.org/files/PyGreSQL-5.0.3.tar.gz. If you are running NetBSD, look in the packages directory under databases. There is also a package in the FreeBSD ports collection. Please refer to the changelog.txt file for things that have changed

Re: pySerial raw data

2016-12-11 Thread MRAB
On 2016-12-11 16:28, Wanderer wrote: I have an outdoor thermometer that transmits to an indoor receiver at 433Mhz. I also have a 433Mhz USB serial port jig from a TI development tool. I would like to use the TI USB serial port to capture the temperature information. The TI USB port registers a

pySerial raw data

2016-12-11 Thread Wanderer
I have an outdoor thermometer that transmits to an indoor receiver at 433Mhz. I also have a 433Mhz USB serial port jig from a TI development tool. I would like to use the TI USB serial port to capture the temperature information. The TI USB port registers as a COM port that I can access with pyS

Re: CLP stats: last 500 posts

2016-12-11 Thread Wildman via Python-list
On Sat, 10 Dec 2016 12:31:33 -0500, DFS wrote: > After correcting my stupid oversights, the code runs fine up to the point where the user agents are printed. I get an error saying that 'User-Agent' is an unsupported header field. It must have something to do with giganews. If I use aioe.org I

Re: Help in creating a dynamic/loop based on variables and CSV files

2016-12-11 Thread Peter Otten
Umar Yusuf wrote: > Hi all, > I need your help with any of these questions? > > 1- > http://stackoverflow.com/questions/41083699/python-create-dynamic-loop-based-on-variables-and-csv You should really make a serious attempt to explain the problem in plain english. Throwing a piece of code at ot

Re: % string formatting - what special method is used for %d?

2016-12-11 Thread Veek M
Ian Kelly wrote: > On Sat, Dec 10, 2016 at 11:40 PM, Veek M wrote: >> Well take a look at this: >> ### >> #!/usr/bin/python >> >> class Foo(int): >> def __init__(self, value): >> self.value = value >> >> def __str__(self): >> print '