Re: # of Months between two dates

2018-04-05 Thread Steven D'Aprano
On Thu, 05 Apr 2018 22:03:07 -0600, Jason Friedman wrote: >> > > I've written a function to return the months between date1 and >> > > date2 >> but >> > > I'd like to know if anyone is aware of anything in the standard >> > > library to do the same? For bonus points, does anyone know if >> > > p

Re: # of Months between two dates

2018-04-05 Thread Jason Friedman
> > > > I've written a function to return the months between date1 and date2 > but > > > I'd like to know if anyone is aware of anything in the standard library > > > to do the same? For bonus points, does anyone know if postgres can do > > > the same (we use a lot of date/time funcitons in postgr

Re: try-except syntax

2018-04-05 Thread Steven D'Aprano
On Thu, 05 Apr 2018 23:04:18 +0200, ElChino wrote: > I'm trying to simplify a try-except construct. E.g. how come this: >try: > _x, pathname, _y = imp.find_module (mod, mod_path) > return ("%s" % pathname) imp.find_module is deprecated and should not be used in new code. Putting th

Re: install MySQL-python failed ....

2018-04-05 Thread INADA Naoki
https://stackoverflow.com/questions/11107155/how-to-fix-address-space-is-already-occupied-error-on-fetch-commit On Fri, Apr 6, 2018 at 8:12 AM, yi zhao wrote: > $ python -m pip install MySQL-python > Collecting MySQL-python > Downloading MySQL-python-1.2.5.zip (108kB) > 100% |██

Re: install MySQL-python failed ....

2018-04-05 Thread Larry Martell
On Thu, Apr 5, 2018 at 7:12 PM, yi zhao wrote: > $ python -m pip install MySQL-python > Collecting MySQL-python > Downloading MySQL-python-1.2.5.zip (108kB) > 100% || 112kB 260kB/s > 930 [main] python2.7 12948 child_info_fork::abort: address space needed

install MySQL-python failed ....

2018-04-05 Thread yi zhao
$ python -m pip install MySQL-python Collecting MySQL-python Downloading MySQL-python-1.2.5.zip (108kB) 100% || 112kB 260kB/s 930 [main] python2.7 12948 child_info_fork::abort: address space needed by 'datetime.dll' (0x87) is already occupied Error

Re: try-except syntax

2018-04-05 Thread Gregory Ewing
Ben Bacarisse wrote: Anyway, to coalesce two or more exception handlers, you are probably looking for except (ImportError, RuntimeError): To the OP: Are you sure you really want to mask RuntimeError here? Usually it means something has gone seriously wrong, and is a symptom that shouldn't be

Re: try-except syntax

2018-04-05 Thread Ben Bacarisse
ElChino writes: > I'm trying to simplify a try-except construct. E.g. how come > this: > try: > _x, pathname, _y = imp.find_module (mod, mod_path) > return ("%s" % pathname) > except ImportError: > pass > except RuntimeError: > pass > return ("") > > Cannot be simplified

Re: try-except syntax

2018-04-05 Thread Ian Kelly
On Thu, Apr 5, 2018 at 3:04 PM, ElChino wrote: > I'm trying to simplify a try-except construct. E.g. how come > this: > try: > _x, pathname, _y = imp.find_module (mod, mod_path) > return ("%s" % pathname) > except ImportError: > pass > except RuntimeError: > pass > return

Re: try-except syntax

2018-04-05 Thread Rob Gaddi
On 04/05/2018 02:04 PM, ElChino wrote: I'm trying to simplify a try-except construct. E.g. how come this:   try:     _x, pathname, _y = imp.find_module (mod, mod_path)     return ("%s" % pathname)   except ImportError:     pass   except RuntimeError:     pass     return ("") Cannot be si

try-except syntax

2018-04-05 Thread ElChino
I'm trying to simplify a try-except construct. E.g. how come this: try: _x, pathname, _y = imp.find_module (mod, mod_path) return ("%s" % pathname) except ImportError: pass except RuntimeError: pass return ("") Cannot be simplified into this: try: _x, pathname, _y

Re: logging.FileHandler diff Py2 v Py3

2018-04-05 Thread Skip Montanaro
> I'll poke around a little and maybe open a bug report if I can't find any > explanation for the change in behavior. Turns out to be a known problem with a bit of history: https://bugs.python.org/issue27805 Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: RegEx to match set of lines

2018-04-05 Thread Terry Reedy
On 4/5/2018 11:03 AM, Steven D'Aprano wrote: On Thu, 05 Apr 2018 14:09:23 +0530, Prahallad Achar wrote: I would like to match set of lines from the below data. this data comes from one of the network Good grief! You don't need to post your entire data set! We don't need or want to see hundred

Re: want to export some of the packets from a big pacp file to another file.

2018-04-05 Thread Grant Edwards
On 2018-04-05, supsw...@gmail.com wrote: > Hi, > > I am using dpkt python package to parse .pcap file and I am able to do > successfully. > > My requirement is to filter some of the traffic from the big .pcap > file and to export the result to another file. > > I don't know how to do this. The e

Re: want to export some of the packets from a big pacp file to another file.

2018-04-05 Thread Anders Wegge Keller
På Thu, 5 Apr 2018 08:06:10 -0700 (PDT) supsw...@gmail.com skrev: > Hi, > > I am using dpkt python package to parse .pcap file and I am able to do > successfully. > > My requirement is to filter some of the traffic from the big .pcap file > and to export the result to another file. > > I don't k

want to export some of the packets from a big pacp file to another file.

2018-04-05 Thread supswain
Hi, I am using dpkt python package to parse .pcap file and I am able to do successfully. My requirement is to filter some of the traffic from the big .pcap file and to export the result to another file. I don't know how to do this. PFB the setup details I am using. ###

Re: RegEx to match set of lines

2018-04-05 Thread Steven D'Aprano
On Thu, 05 Apr 2018 14:09:23 +0530, Prahallad Achar wrote: > Hello, > I would like to match set of lines from the below data. this data comes > from one of the network Good grief! You don't need to post your entire data set! We don't need or want to see hundreds of lines. Cut your data down to

RegEx to match set of lines

2018-04-05 Thread Prahallad Achar
Hello, I would like to match set of lines from the below data. this data comes from one of the network Part of data : [ If circuit type is OCHCC then I need Circuit name and service ID from that group ] Circuit ID: ad8a0165:25 *Circuit Name: T3A_100G_SD20* Circuit Version: 0 Circuit Monitor: fal

Re: # of Months between two dates

2018-04-05 Thread ankit . singh
On Sunday, August 8, 2010 at 11:46:51 PM UTC+5:30, MRAB wrote: > Greg Lindstrom wrote: > > I work for a company that processes claims for the health care industry > > (Novasys Health, recently purchased by Centene Corp). My current > > assignment has me writing a routine to compute insurance pre