log file.

2016-06-14 Thread owenpaul . po
I have a programme to pump out water from a sump and would like to log to a readable file when the pump operates. what is the easiest way to acheive this with python 3. -- https://mail.python.org/mailman/listinfo/python-list

Re: log file.

2016-06-14 Thread Jussi Piitulainen
owenpaul...@gmail.com writes: > I have a programme to pump out water from a sump and would like to log > to a readable file when the pump operates. what is the easiest way to > acheive this with python 3. Depending on any number of details, the easiest may be to just print. Direct stdout and stde

mod_python compilation error in VS 2008 for py2.7.1

2016-06-14 Thread asimkon
I would like to ask you a technical question regarding python module compilation for python 2.7.1. I want to compile mod_python library for Apache 2.2 and py2.7 on Win32 in order to use it for psp - py scripts that i

Re: for / while else doesn't make sense

2016-06-14 Thread alister
On Tue, 14 Jun 2016 12:43:35 +1000, Steven D'Aprano wrote: > > On this list, I daresay somebody will insist that if their computer is > on one of Jupiter's moons it will keep running fine and therefore I'm > wrong. > Anyone on a moon of Jupiter would not be able to get internet access (TCP/IP ti

Re: mod_python compilation error in VS 2008 for py2.7.1

2016-06-14 Thread Pavel S
Have you considered to use rather WSGI-based solution? (for Apache Httpd is mod_wsgi). Mod_python is totally obsolete. -- https://mail.python.org/mailman/listinfo/python-list

Re: for / while else doesn't make sense

2016-06-14 Thread Ian Kelly
On Tue, Jun 14, 2016 at 5:39 AM, alister wrote: > On Tue, 14 Jun 2016 12:43:35 +1000, Steven D'Aprano wrote: >> >> On this list, I daresay somebody will insist that if their computer is >> on one of Jupiter's moons it will keep running fine and therefore I'm >> wrong. >> > > Anyone on a moon of Ju

Re: for / while else doesn't make sense

2016-06-14 Thread Chris Angelico
On Tue, Jun 14, 2016 at 11:51 PM, Ian Kelly wrote: > On Tue, Jun 14, 2016 at 5:39 AM, alister wrote: >> On Tue, 14 Jun 2016 12:43:35 +1000, Steven D'Aprano wrote: >>> >>> On this list, I daresay somebody will insist that if their computer is >>> on one of Jupiter's moons it will keep running fine

Re: for / while else doesn't make sense

2016-06-14 Thread Rustom Mody
On Tuesday, June 14, 2016 at 8:13:53 AM UTC+5:30, Steven D'Aprano wrote: > No. The sun exploding was me gently mocking you for your comment disputing > the "unconditional" part. Yes, you are technically right that technically > the "else" block will only run if no "break" is reached, and no "return

Multiple files reading

2016-06-14 Thread Joaquin Alzola
Hi Guys I am doing program that reads into a directory for the files that were created the last 5 mins. (working) Inside those files there are 242 fields in each line separated by | (pipe). Each file has about 5k records and there are about 5 files per 5 mins. I will look for field 29 and 200

Re: log file.

2016-06-14 Thread Paul Owen
I am very inexperienced at programming.! is there a lot of code needed to use those modules. regards paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: log file.

2016-06-14 Thread John Gordon
In <05d2df77-8cd0-467b-8ab3-54bf730d8...@googlegroups.com> owenpaul...@gmail.com writes: > I have a programme to pump out water from a sump and would like to > log to a readable file when the pump operates. what is the easiest > way to acheive this with python 3. Are you asking for help with log

Re: Multiple files reading

2016-06-14 Thread MRAB
On 2016-06-14 17:53, Joaquin Alzola wrote: Hi Guys I am doing program that reads into a directory for the files that were created the last 5 mins. (working) Inside those files there are 242 fields in each line separated by | (pipe). Each file has about 5k records and there are about 5 files

Re: log file.

2016-06-14 Thread Paul Owen
logging please. my pump programme works but I want to log the time etc. when the pump runs and stops. I am trying to improve the programme I am a novice! -- https://mail.python.org/mailman/listinfo/python-list

RE: log file.

2016-06-14 Thread Joaquin Alzola
>logging please. Check this modules: import logging import logging.handlers This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt. -- https://mail.python.org/m

RE: log file.

2016-06-14 Thread Paul Owen
thanks I will look at them. -- https://mail.python.org/mailman/listinfo/python-list

RE: Multiple files reading

2016-06-14 Thread Joaquin Alzola
>> The dictionary that I am using in the classes: >> {'Country':'Empty','Service':'Empty','TimeStamp':'Empty','Ocg':'see3', >> 'DiameterCodes':{'2001':0,'4010':0,'4012':0,'4998':0,'4999':0,'5007':0 >> ,'5012':0}} >> >> Wanted help from your side on how to focus this just because I want to read >>

Re: log file.

2016-06-14 Thread Joel Goldstick
On Tue, Jun 14, 2016 at 4:14 PM, Paul Owen wrote: > thanks I will look at them. > -- > https://mail.python.org/mailman/listinfo/python-list If your program is called 'my_program.py' you can write print statements (or print functions in python 3) and when you run your program, those prints will

Re: Multiple files reading

2016-06-14 Thread MRAB
On 2016-06-14 21:06, Joaquin Alzola wrote: > >> The dictionary that I am using in the classes: > >> {'Country':'Empty','Service':'Empty','TimeStamp':'Empty','Ocg':'see3', > >> 'DiameterCodes':{'2001':0,'4010':0,'4012':0,'4998':0,'4999':0,'5007':0 > >> ,'5012':0}} > >> > >> Wanted help from your si

RE: log file.

2016-06-14 Thread Joaquin Alzola
>thanks I will look at them. As an example for your guide: ##log_handler### import sys import logging import logging.handlers from configfile_read import * def LogHandler(logger): CONFIG_FILE = ('./conf/' + 'config.ini') config = configfile(CONFIG_FILE) FORMAT = '%(ascti

RE: log file.

2016-06-14 Thread Paul Owen
Gmail Google+ Calendar Web more Inbox pump programme Paul Owen to me 1 hour ago Details from gpiozero import LED,Button from signal import pause print ("Pump Programme Running") led = LED(17) low = Button (2) high = Button (3) high.when_pressed = led.on  low.when_released = led.of

RE: Multiple files reading

2016-06-14 Thread Joaquin Alzola
> What I meant was that you would have a dict of dicts, where the key was the > country: Thanks MRAB I could not see that solution. That save me a lot of lines of code. Certainly my previous solution also manage to do that but yours is more clean-code wise. This email is confidential and may be

Re: for / while else doesn't make sense

2016-06-14 Thread Rustom Mody
On Wednesday, June 15, 2016 at 4:58:05 AM UTC+5:30, Lawrence D’Oliveiro wrote: > On Wednesday, June 15, 2016 at 3:34:14 AM UTC+12, Rustom Mody wrote: > > > And break is a euphemism for goto > > Is this the old > “structured-programming-is-mathematically-equivalent-to-gotos” red herring > again?

Re: for / while else doesn't make sense

2016-06-14 Thread Steven D'Aprano
On Wed, 15 Jun 2016 01:33 am, Rustom Mody wrote: > On Tuesday, June 14, 2016 at 8:13:53 AM UTC+5:30, Steven D'Aprano wrote: >> No. The sun exploding was me gently mocking you for your comment >> disputing the "unconditional" part. Yes, you are technically right that >> technically the "else" block

Re: log file.

2016-06-14 Thread Steven D'Aprano
On Wed, 15 Jun 2016 05:54 am, Paul Owen wrote: > logging please. > > my pump programme works but I want to log the time etc. when the pump runs > and stops. > > I am trying to improve the programme > > I am a novice! As a novice, start with the simplest thing. Whenever the pump runs or stops,

python regex: variable length of positive lookbehind assertion

2016-06-14 Thread Yubin Ruan
Hi everyone, I am struggling writing a right regex that match what I want: Problem Description: Given a string like this: >>>string = "false_head aaa bbb false_tail \ true_head some_text_here ccc ddd eee true_tail" I want to match the all the text surrounded by those " ", but

Re: for / while else doesn't make sense

2016-06-14 Thread Rustom Mody
On Wednesday, June 15, 2016 at 8:42:33 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 15 Jun 2016 01:33 am, Rustom Mody wrote: > > > On Tuesday, June 14, 2016 at 8:13:53 AM UTC+5:30, Steven D'Aprano wrote: > >> No. The sun exploding was me gently mocking you for your comment > >> disputing the "unc

Re: loading trees...

2016-06-14 Thread Lawrence D’Oliveiro
On Monday, June 13, 2016 at 6:56:07 AM UTC+12, Fillmore wrote: > I then need to run a program that loads the whole forest in the form of a > dict() where each item will point to a dynamically loaded tree. Store it in JSON form? I like language-neutral solutions. -- https://mail.python.org/mailma

Re: python regex: variable length of positive lookbehind assertion

2016-06-14 Thread Yubin Ruan
On Wednesday, June 15, 2016 at 12:18:31 PM UTC+8, Lawrence D’Oliveiro wrote: > On Wednesday, June 15, 2016 at 3:28:37 PM UTC+12, Yubin Ruan wrote: > > > I want to match the all the text surrounded by those " ", > > You are trying to use regex (type 3 grammar) to parse HTML (type 2 grammar) >

Re: python regex: variable length of positive lookbehind assertion

2016-06-14 Thread Jussi Piitulainen
Yubin Ruan writes: > Hi everyone, > I am struggling writing a right regex that match what I want: > > Problem Description: > > Given a string like this: > > >>>string = "false_head aaa bbb false_tail \ > true_head some_text_here ccc ddd eee > true_tail" > > I want to match the a

Re: log file.

2016-06-14 Thread Paul Owen
Thank you Steven. that is just what I need. regards Paul. -- https://mail.python.org/mailman/listinfo/python-list