File tree 3 files changed +16
-20
lines changed
3 files changed +16
-20
lines changed Original file line number Diff line number Diff line change
1
+ This is sample text
Original file line number Diff line number Diff line change 16
16
from datetime import date ,timedelta
17
17
today = date .today () - timedelta (days = 1 )
18
18
today_minus_8 = date .today () - timedelta (days = 8 )
19
- print today_minus_8
19
+ print ( today_minus_8 )
20
20
21
21
last_seven_days = []
22
22
seven_forteen_days = []
26
26
for i in range (8 ,15 ):
27
27
seven_forteen_days .append (date .today () - timedelta (days = i ))
28
28
29
- print last_seven_days
30
- print seven_forteen_days
29
+ print ( last_seven_days )
30
+ print ( seven_forteen_days )
31
31
# outlet/date/camerano/
32
32
# df=pd.DataFrame()
33
33
datalist = []
39
39
# print object_summary.key
40
40
# break
41
41
42
- print count
42
+ print ( count )
43
43
44
44
except Exception as e :
45
- print e
46
- print 'Error on line {}' .format (sys .exc_info ()[- 1 ].tb_lineno )
45
+ print ( e )
46
+ print ( 'Error on line {}' .format (sys .exc_info ()[- 1 ].tb_lineno ) )
Original file line number Diff line number Diff line change 1
- # from file2 import *
2
- import os
3
1
2
+ # step1=assign a variable with python2 text
3
+ # step2=make a file2.py with this text
4
+ # step3=convert with the 2to3 module within the code
5
+ # step4= extract the text from the converted file
6
+ import os
4
7
python2 = '''
5
8
import sys
6
9
try:
49
52
print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)
50
53
'''
51
54
52
-
53
55
myVar = "file2"
54
56
55
57
x = open (myVar + ".py" , "w" )
56
58
x .write (python2 )
57
59
x .close ()
58
-
59
-
60
+ os .system ("Echo Hello World" )
61
+ os .system ("echo This is sample text > MyFile.txt" )
62
+ os .system ("2to3 -w file2.py" )
63
+ # Note for Devops:Running this os.system(2to3 -w file2.py) command in virtual environment
60
64
# Run 2to3 file2.py
61
65
62
-
63
-
64
- # step1=assign a variable with python2 text
65
- # step2=make a file2.py with this text
66
- # step3=convert with the 2to3 module within the code
67
- # step4= extract the text from the converted file
68
-
69
66
python3 = ''' '''
70
67
a = "file2.py"
71
68
filetoopen = open (a ,'r' )
72
69
line = filetoopen .readline ()
73
70
74
71
while (line != "" ):
75
- # print(line)
76
72
python3 = python3 + line
77
73
line = filetoopen .readline ()
78
-
79
74
filetoopen .close ()
80
75
print (python3 )
81
76
You can’t perform that action at this time.
0 commit comments