Re: Definitive guide for Regex

2021-10-01 Thread Shaozhong SHI
Hi, Barry,

In cases of automating checking, validation and producing reports in the
context of data quality control and giving specific feedback to production
teams, regex is perhaps the only way.

Perhaps, we can give each element of data specifications a name, that are
associated with a regex value, so that we can automate checking and
reporting on data sets.  We can report on which row of records meet
specification and requirements and which one is not.  And, report on which
cell needs to be corrected should a row is found not meeting specification
and requirements.

What do you think?

Regards,

David

On Thu, 30 Sept 2021 at 22:02, Barry Scott  wrote:

>
>
> > On 30 Sep 2021, at 19:35, dn via Python-list 
> wrote:
> >
> > On 01/10/2021 06.16, Barry Scott wrote:
> >>
> >>
> >>> On 30 Sep 2021, at 12:29, Shaozhong SHI 
> wrote:
> >>>
> >>> Dear All,
> >>>
> >>> I am trying to look for a definitive guide for Regex in Python.
> >>> Can anyone help?
> >>
> >> Have you read the python docs for the re module?
> >
> >
> > I learned from Jeffrey Friedl's book "Mastering Regular Expressions",
> > but that was in a land far away, last century, and under a different
> > language (and the original version - I see it's now up to its third
> > edition).
> >
> > Despite their concise exercise of power (and the fact that in my
> > Python-life I've never been put into a corner where I absolutely must
> > use one), I'm no longer a fan...
>
> Agreed, regex is the last tool I reach for in python code.
> I find I use split() a lot to break up strings for processing.
> But there are cases where a regex is the best tool for a particular job
> and I then use the re module. But it costs in maintainability.
>
> I speak as the author of a regex engine and know how to write scary
> regex's when the need arises.
>
> Barry
>
>
> > --
> > Regards,
> > =dn
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-10-01 Thread Jach Feng
Shaozhong SHI 在 2021年9月30日 星期四下午7:29:47 [UTC+8] 的信中寫道:
> Dear All, 
> 
> I am trying to look for a definitive guide for Regex in Python. 
> Can anyone help? 
> 
> Regards, 
> 
> David
Try the rexegg.com which is a site dedicate to this subject and has many 
resources.

--Jach
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python39.dll not found

2021-10-01 Thread Sravan Kumar Chitikesi
You might copy the installation files from one to another computer, but you
missed the copying pytho**.dll from from windows/system32 folder.

Regards,
*Sravan Chitikesi*
AWS Solutions Architect - Associate


On Fri, Oct 1, 2021 at 12:38 AM jitendrabeura001 
wrote:

>Please someone help me to find the solution for the problem
>Whenever I am trying to run python idle after installing, it is showing
>me-
>[1]python.exe - Syntax Error
>The code execution cannot proceed because [2]python39.dll was not found.
>Re-installing the program may fix the problem.
>
> References
>
>Visible links
>1. http://python.exe/
>2. http://python39.dll/
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to pass a method as argument?

2021-10-01 Thread Anil Anvesh
On Friday, October 1, 2021 at 6:04:34 AM UTC+5:30, Mats Wichmann wrote:
> On 9/29/21 23:11, Anil Anvesh wrote: 
> > I want to write a python calculator program that has different methods to 
> > add, subtract, multiply which takes 2 parameters. I need to have an execute 
> > method when passed with 3 parameters, should call respective method and 
> > perform the operation. How can I achieve that? 
> >
> let me add - this is probably not the place you are in your Python 
> learning, so don't worry about this, but the operator module is designed 
> for these kind of usages, when you want to pass an operator like + - 
> etc. but of course can't pass the op itself to take actions because it's 
> not a callable - the operator module has callables that can be used.

I solved it with simple if condition and without using init

#calculator class with arithmetic methods

class calc:
 
def execute(self, func, a, b):
self.a = a
self.b = b
if func == "add":
self.add()
elif func == "sub":
self.sub()
elif func == "mul":
self.mul()
elif func == "div":
self.div()
 
def add(self):
print (self.a,"+",self.b,"=",self.a + self.b)
  
 
def sub(self):
  print (self.a,"-",self.b,"=",self.a - self.b)
 
 
def mul(self):
  print (self.a,"*",self.b,"=",self.a* self.b)

 
def div(self):
print (self.a,"/",self.b,"=",self.a / self.b)
   
 
 
cal = calc()
cal.execute("div", 6, 3)
-- 
https://mail.python.org/mailman/listinfo/python-list


Problems with desinatlation

2021-10-01 Thread TONI MORAL SEGURA



Hi,

I can not remove the program Python 2.7.10 in my Windows 10
What can I do to resolve this problema?

Thank you

[cid:image003.png@01D7B6E5.51F6E520]


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python39.dll not found

2021-10-01 Thread Eryk Sun
On 10/1/21, Sravan Kumar Chitikesi  wrote:
> You might copy the installation files from one to another computer, but you
> missed the copying pytho**.dll from from windows/system32 folder.>

The PSF installer 3.4 and earlier installs "pythonXY.dll" in the
system directory when it peforms an all-users installation. The
installer for 3.5+, however, only installs files to the target
installation directory and child directories. The file "python3X.dll"
should be installed in the same directory as "python.exe".
-- 
https://mail.python.org/mailman/listinfo/python-list