• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 195

Backtrace:

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/views/question.php
Line: 195
Function: _error_handler

File: /home/u125378470/domains/lawhelpguru.org/public_html/application/controllers/Questions.php
Line: 416
Function: view

File: /home/u125378470/domains/lawhelpguru.org/public_html/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Python function calling repeated for each element in list

<button aria-describedby="--stacks-s-tooltip-wx636vuw" aria-label="Bookmark" aria-pressed="false" class="js-bookmark-btn s-btn s-btn__unset c-pointer py4 js-gps-track" data-controller="s-tooltip" data-gps-track="post.click({ item: 1, priv: 0, post_type: 1 })" data-s-tooltip-placement="right" data-selected-classes="fc-yellow-600"></button><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" height="18" viewbox="0 0 19 18" width="19"></svg>

 

Hi i am trying to pass a list to my SendMail function and i am getting values like this for list['abc','cde','ijk']output abc abc,cde abc,cde,ijk.I need my function to run once and give me the final list only which is list['abc','cde','ijk']. The original list is a collection of unmatched files names. here is my code please help me. And i am receiving email for each output i need one email

##Packages used
import os
import re
import sys
import glob
import pandas as pd

##Send mail function using unix sendmail
def sendMail(msg):
    a=''
    for i in msg:
        a+="%s
" %i
    sendmail_location = "/usr/sbin/sendmail" # sendmail location
    p = os.popen("%s -t" % sendmail_location, "w")
    p.write("From: %s
" % "abc@123.com")
    p.write("To: %s
" % "abc@123.com")
    p.write("Subject: File Name  Error
")
    p.write("
") # blank line separating headers from body
    p.write("
"+a)
    print("
"+a)
    status = p.close()
    if status != 0:
           print("Sendmail exit status", status)
match=[]
not_match=[]
try:
    for file in glob.glob('*.csv'):
        r = re.search(r'sales_abc_(20[0-9][0-9])-([1-9]|1[0-2]|0[0-9])-([1-9]|1[0-9]|2[0-9]|3[0-1]|0[0-9])-[0-9]{2}_[a-z0-9]{3,5}.csv', file)
        if r:
            match.append(file)
        if not r:
            not_match.append(file)
            sendMail(not_match)
except Exception:
    not_found="File Not Found"
    sendMail(not_found)