This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TestIterator: | |
| def __init__(self, list1): | |
| self.index = 0 | |
| self.data = list1 | |
| def __iter__(self): | |
| print('Iter got called') | |
| return self | |
| def __next__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Setting the initial variables | |
| IFILE="$HOME/bday.csv" | |
| OFILE="bday_out"$$ | |
| MAILID="guru@xyz.com" | |
| # Retrieving today's date and month |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LIMIT=5 | |
| IFILE="$HOME/bday.csv" | |
| OFILE="bday_out"$$ | |
| MAILID="guru@xyz.com" | |
| for((i=1 ; i<=$LIMIT; i++)) | |
| do | |
| arr[$i]=`date '+%d-%b' -d "$i days"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| file=`echo $1 | sed 's/\(.*\)\.\(.*\)/\1/'` | |
| ext=`echo $1 | sed 's/.*\.\(.*\)/\1/'` | |
| if [ ! -f $1 ]; then | |
| if [ $ext = "pl" ]; then | |
| echo "#!/usr/bin/perl " > $1 | |
| elif [ $ext = "py" ]; then | |
| echo "#!/usr/bin/python " > $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/home/guru/anaconda3/bin/python | |
| import sys, time | |
| import pandas as pd | |
| from alpha_vantage.timeseries import TimeSeries | |
| stock_dir = '/home/guru/history/stock/' | |
| fd = open('/home/guru/history/config/nifty50list.dat') | |
| ts = TimeSeries(key='ABCDEFGHIJKLMNOP', output_format='pandas') |