Friday, November 26, 2021

Whatsapp Automation

<p>import csv</p>
<p>import pywhatkit&nbsp;</p>
<p>f=open(&apos;E:\\contact.csv&apos;,&apos;r&apos;)</p>
<p>readobj=csv.reader(f)</p>
<p>x,y=13,28</p>
<p>for row in readobj:</p>
<p>&nbsp; &nbsp; a=&apos;+91&apos;+str(row[0])</p>
<p>&nbsp; &nbsp; pywhatkit.sendwhatmsg(a, &quot;Hello&quot;,x,y)</p>
<p>&nbsp; &nbsp; y+=1</p>
<p>f.close()</p>
<p><br></p>

Monday, July 26, 2021

*args vs **kwargs in Python

args vs kwargs
In [1]:
def varadd(*x):
       print(type(x))
       print(x)
varadd(5,6)
varadd(6,7,"fggdfg")
<class 'tuple'>
(5, 6)
<class 'tuple'>
(6, 7, 'fggdfg')
In [3]:
def varfun(**y):
       print(type(y))
       print(y)
       print(y)
varfun()
varfun(a=4,b=8,c=9,d="dfgfdg",e=[])
<class 'dict'>
{}
{}
<class 'dict'>
{'a': 4, 'b': 8, 'c': 9, 'd': 'dfgfdg', 'e': []}
{'a': 4, 'b': 8, 'c': 9, 'd': 'dfgfdg', 'e': []}
In [ ]: