diff options
Diffstat (limited to 'Programming_in_C/Chapter_18.ipynb')
-rw-r--r-- | Programming_in_C/Chapter_18.ipynb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/Programming_in_C/Chapter_18.ipynb b/Programming_in_C/Chapter_18.ipynb index 675ba691..86358365 100644 --- a/Programming_in_C/Chapter_18.ipynb +++ b/Programming_in_C/Chapter_18.ipynb @@ -27,19 +27,13 @@ "cell_type": "code", "collapsed": false, "input": [ - "#18.1.py\n", - "#Adding Debug statements in program\n", "\n", - "#Program logs will be saved in file- 18.1_logFile.txt\n", "\n", - "#Import library\n", "import logging\n", "\n", - "#Function to return sum of 3 numbers\n", "def process(i,j,k):\n", " return i+j+k\n", "\n", - "#Main()\n", "def main():\n", "\n", " logger = logging.getLogger()\n", @@ -66,7 +60,6 @@ " print(\"sum= %i\\n\"%process(arr[0],arr[1],arr[2]))\n", "\n", "\n", - "#Setting top level conditional script\n", "if __name__=='__main__':\n", " main()\n", "\n" @@ -112,15 +105,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "#18.2.py\n", - "#Compiling in Debug \n", "\n", - "#Program logs will be saved in file- 18.2_logFile.txt\n", "\n", - "#Import Libraries\n", "import logging,sys\n", "\n", - "#Function to return product of two numbers\n", "def process(i1,i2):\n", "\n", " global logger \n", @@ -130,7 +118,6 @@ " return val\n", "\n", "\n", - "#Main()\n", "def main():\n", "\n", " global logger\n", @@ -173,7 +160,6 @@ " #print(\"product = %i\\n\" %( process (arg1, arg2)))\n", "\n", "\n", - "#Setting top level conditional script\n", "if __name__=='__main__':\n", " main()\n", "\n" @@ -236,23 +222,12 @@ "cell_type": "code", "collapsed": false, "input": [ - "#18.3.py\n", - "#Compiling in Debug--version2\n", "\n", - "#Program logs will be saved in file- 18.3_logFile.txt\n", "\n", - "#Using different logging levels\n", - "#DEBUG Detailed information, typically of interest only when diagnosing problems.\n", - "#INFO Confirmation that things are working as expected.\n", - "#WARNING An indication of some problem in the near future (e.g.'disk space low')\n", - "#ERROR Due to a more serious problem, the software has not been able to perform some function.\n", - "#CRITICAL A serious error, indicating that the program itself may be unable to continue running.\n", "\n", "\n", - "#Import Libraries\n", "import logging,sys\n", "\n", - "#Function to return product of two numbers\n", "def process(i1,i2):\n", "\n", " global logger \n", @@ -262,7 +237,6 @@ " return val\n", "\n", "\n", - "#Main()\n", "def main():\n", "\n", " global logger\n", @@ -305,7 +279,6 @@ " #print(\"product = %i\\n\" %( process (arg1, arg2)))\n", "\n", "\n", - "#Setting top level conditional script\n", "if __name__=='__main__':\n", " main()\n", "\n" @@ -368,10 +341,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "#18.4.py\n", - "#A simple program for use with pdb(gdb like python debugger)\n", "\n", - "#Main()\n", "def main():\n", " \n", " #Variable Declaration\n", @@ -386,7 +356,6 @@ " print(\"sum = %i\\n\"%(sum))\n", " \n", "\n", - "#Setting top level conditional script\n", "if __name__=='__main__':\n", " main()\n", "\n" @@ -417,10 +386,7 @@ "cell_type": "code", "collapsed": false, "input": [ - "#18.5.py\n", - "#Working more with pdb\n", "\n", - "#Class Declaration\n", "class date:\n", " def __init__(self,m,d,y): #Class constructor\n", " self.month=m\n", @@ -431,7 +397,6 @@ " x.day+=1\n", " return x\n", "\n", - "#Main()\n", "def main():\n", "\n", " #Variable Declaration\n", @@ -446,7 +411,6 @@ " print(\"today= %d/%d/%d\"%(today.day,today.month,today.year))\n", "\n", "\n", - "#Setting top level conditional script\n", "if __name__=='__main__':\n", " main()\n", "\n", |