├── .vscode └── settings.json ├── README.md ├── Sem-5 ├── Collections │ ├── Dictionary │ │ └── dictionary1.py │ ├── Lists │ │ ├── list1.py │ │ ├── list2.py │ │ └── list3.py │ ├── Set │ │ ├── set1.py │ │ └── set2.py │ └── Tuple │ │ └── tuple1.py ├── Conditional Statements │ ├── if-elif.py │ ├── ifcondition.py │ └── nestedif.py ├── Datatypedeclaration.py ├── Hashtable │ └── hashtable1.py ├── Loops │ ├── Forloops │ │ ├── forloop-break.py │ │ ├── forloop-continue.py │ │ ├── forloop-pass.py │ │ ├── forloop-print1_to_n.py │ │ ├── forloop1.py │ │ ├── forloop2.py │ │ ├── forloop3.py │ │ ├── forloop4.py │ │ ├── forloop5.py │ │ └── nestedforloop.py │ └── Whileloop │ │ ├── break-whileloop.py │ │ ├── continue-whileloop.py │ │ ├── else-whileloop.py │ │ └── whileloop1.py ├── Module │ ├── buildinmodule.py │ ├── callmodulefunction.py │ ├── module1.py │ ├── module2.py │ └── module3.py ├── OOP │ ├── first.py │ ├── hierarchicalnheritance.py │ ├── hybridnheritance.py │ ├── methodoverloadingnotsupported-1.py │ ├── methodoverloadingnotsupported.py │ ├── multilevelnheritance.py │ ├── multipleinheritance.py │ ├── overloadingusingmultipledispacher.py │ ├── overriding.py │ └── singleinheritance.py ├── Operators │ ├── and_operator.py │ ├── bitwise_operator.py │ ├── in_operator.py │ ├── is_operator.py │ ├── multipleassignment.py │ ├── not_operator.py │ └── or_operator.py ├── RegularExpression │ ├── data.txt │ ├── generaterandomdata.py │ ├── longerexample.txt │ ├── longerexample1.py │ ├── re-findall.py │ ├── re1.py │ └── re2.py ├── ScopeofVariable │ └── scopeofvariable1.py ├── SearchingMethods │ ├── binarysearch.py │ └── linearsearch.py ├── TextProcessing │ ├── Names.csv │ ├── data.csv │ ├── jsondata.json │ ├── readcsv.py │ ├── readjson.py │ ├── sample.json │ ├── sample1.json │ ├── samplexml.xml │ ├── writecsv.py │ ├── writedictionarytocsv.py │ ├── writejson_dump.py │ ├── writejson_dumps.py │ ├── writexml.py │ ├── xml1.py │ ├── xml2.py │ ├── xml3.py │ └── xmldata.xml ├── Unit1Notebook.ipynb ├── assertexample.py ├── file_io │ ├── file_append.py │ ├── file_append_read.py │ ├── file_readline.py │ ├── file_xmode.py │ ├── fileio.py │ ├── fileread.py │ ├── filewrite.py │ ├── myfile.txt │ ├── myfile2.txt │ └── myfile3.txt ├── functions │ ├── arbitraryarguments.py │ ├── arbitrarykeywordargument.py │ ├── defaultparametervalue.py │ ├── fibonacci_recursion.py │ ├── function1.py │ ├── function2.py │ ├── functionwithargument.py │ ├── functionwithreturnvalue.py │ ├── keywordargumentfunction.py │ ├── passinglistasargument.py │ ├── passingunlimitednumberofarguments.py │ └── recursion.py ├── jupyternotebook.ipynb ├── pythonmysql │ ├── connection_check.py │ ├── create_connection.py │ ├── create_database.py │ ├── create_table.py │ ├── deleterecord.py │ ├── displayalldatabases.py │ ├── insertmultiplerecord.py │ ├── insertrecord.py │ ├── join.py │ ├── login.py │ ├── readdata.py │ ├── tclcommand-example.py │ └── updaterecord.py ├── sortingmethods │ ├── Bubble_sort.py │ ├── SelectionSort.py │ ├── bubblesort.py │ ├── insertionsort.py │ ├── mergesort.py │ ├── quicksort.py │ └── shellsort.py ├── strings │ ├── multilinestring.py │ ├── stringasarray.py │ ├── stringlen.py │ ├── stringmethods.py │ └── strings.py └── try_except │ ├── multiple_except.py │ ├── tempCodeRunnerFile.py │ ├── try_except_syntax.py │ ├── userdefinedexception.py │ └── userdefinedexception1.py ├── Sem-6 ├── Plotting │ ├── 3dgraph.py │ ├── bargraph.py │ ├── first.py │ ├── histogramgraph.py │ ├── linegraph.py │ ├── piegraph.py │ ├── scattergraph.py │ └── subplot.py ├── Threading │ ├── __pycache__ │ │ └── queue.cpython-37.pyc │ ├── multithread-deprecated.py │ ├── multithread-lock.py │ ├── multithread.py │ ├── multithreading1.py │ ├── multithreading_queue.py │ ├── multithreadqueue.py │ ├── queueexample.py │ └── thread_and_queue.py ├── Tkinter │ ├── button.py │ ├── canvas.py │ ├── checkbutton.py │ ├── combobox.py │ ├── entry.py │ ├── frame.py │ ├── imageonbutton.py │ ├── lableframe.py │ ├── listbox.py │ ├── menu.py │ ├── message.py │ ├── messagebox │ │ ├── askokcancel.py │ │ ├── askquestion.py │ │ ├── askyesno.py │ │ ├── askyesnocancel.py │ │ ├── retrycancel.py │ │ ├── showerror.py │ │ ├── showinfo.py │ │ └── showwarning.py │ ├── radio1.py │ ├── scale.py │ ├── scrollbar.py │ ├── spinbox.py │ ├── text.py │ └── toplevel.py ├── django │ ├── blogexample │ │ ├── blog │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── admin.cpython-37.pyc │ │ │ │ ├── models.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── 0001_initial.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── blogexample │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ └── templates │ │ │ └── show.html │ ├── calcution │ │ ├── calc │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── calcution │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ └── templates │ │ │ ├── calc.html │ │ │ └── showresult.html │ ├── crudexample │ │ ├── crudexample │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── db.sqlite3 │ │ ├── employee │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── admin.cpython-37.pyc │ │ │ │ ├── forms.cpython-37.pyc │ │ │ │ ├── models.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── forms.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── 0001_initial.cpython-37.pyc │ │ │ │ │ └── __init__.cpython-37.pyc │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ ├── style.css │ │ │ │ │ └── style1.css │ │ │ ├── templates │ │ │ │ ├── edit.html │ │ │ │ ├── index.html │ │ │ │ └── show.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ └── manage.py │ ├── first │ │ └── firstproject │ │ │ ├── calc │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ │ ├── db.sqlite3 │ │ │ ├── firstproject │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ ├── views.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ │ └── manage.py │ ├── loginproj │ │ ├── auth │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── db.sqlite3 │ │ ├── loginproj │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ ├── manage.py │ │ └── templates │ │ │ ├── base.html │ │ │ ├── forgetpassword.html │ │ │ ├── login.html │ │ │ └── welcome.html │ ├── mysite │ │ ├── calc │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── mysite │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── settings.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ └── templates │ │ │ ├── base.html │ │ │ ├── home.html │ │ │ └── result.html │ └── studcrudexample │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── studcrudexample │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── settings.cpython-37.pyc │ │ │ ├── urls.cpython-37.pyc │ │ │ └── wsgi.cpython-37.pyc │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── student │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ ├── admin.cpython-37.pyc │ │ ├── forms.cpython-37.pyc │ │ ├── models.cpython-37.pyc │ │ ├── urls.cpython-37.pyc │ │ └── views.cpython-37.pyc │ │ ├── admin.py │ │ ├── apps.py │ │ ├── forms.py │ │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-37.pyc │ │ │ └── __init__.cpython-37.pyc │ │ ├── models.py │ │ ├── static │ │ └── css │ │ │ ├── style.css │ │ │ └── style1.css │ │ ├── templates │ │ └── books │ │ │ ├── add_book.html │ │ │ ├── edit_book.html │ │ │ └── show_book.html │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py ├── djangoproj2122 │ └── pollproj │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── pollproj │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-39.pyc │ │ │ ├── settings.cpython-39.pyc │ │ │ ├── urls.cpython-39.pyc │ │ │ └── wsgi.cpython-39.pyc │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ ├── polls │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-39.pyc │ │ │ ├── admin.cpython-39.pyc │ │ │ ├── apps.cpython-39.pyc │ │ │ ├── models.cpython-39.pyc │ │ │ ├── urls.cpython-39.pyc │ │ │ └── views.cpython-39.pyc │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ ├── __init__.py │ │ │ └── __pycache__ │ │ │ │ └── __init__.cpython-39.pyc │ │ ├── models.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ └── templates │ │ └── show.html ├── djangoprojs │ ├── myproject │ │ ├── db.sqlite3 │ │ ├── login │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-37.pyc │ │ │ │ ├── urls.cpython-37.pyc │ │ │ │ └── views.cpython-37.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── __init__.py │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── manage.py │ │ └── myproject │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── settings.cpython-37.pyc │ │ │ ├── urls.cpython-37.pyc │ │ │ └── wsgi.cpython-37.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ └── myproject1 │ │ ├── calc │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── urls.cpython-37.pyc │ │ │ └── views.cpython-37.pyc │ │ ├── admin.py │ │ ├── apps.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── models.py │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ │ ├── db.sqlite3 │ │ ├── manage.py │ │ ├── myproject1 │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-37.pyc │ │ │ ├── settings.cpython-37.pyc │ │ │ ├── urls.cpython-37.pyc │ │ │ └── wsgi.cpython-37.pyc │ │ ├── asgi.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ │ └── templates │ │ ├── customers.html │ │ ├── home.html │ │ └── index.html └── numpy │ ├── 2darray.py │ ├── arrayiteration.py │ ├── bitwiseand.py │ ├── bitwiseinvert.py │ ├── bitwiseleftshift.py │ ├── bitwiseor.py │ ├── bitwiserightshift.py │ ├── broadcasting.py │ ├── copy.py │ ├── datatype.py │ ├── declarearray.py │ ├── differentdimension.py │ ├── first.py │ ├── jaggedarray.py │ ├── joiningarray.py │ ├── linearalgebra.py │ ├── linspace.py │ ├── mathematicfunctions.py │ ├── matrix-arithmatic.py │ ├── matrix.py │ ├── matrixmultiply.py │ ├── min-max-sum.py │ ├── negativeindex.py │ ├── reshape.py │ ├── shape.py │ ├── size.py │ ├── slicing.py │ ├── sorting.py │ ├── sqrt-std.py │ ├── statisticalfunctions.py │ ├── stringfunction.py │ ├── unknowndimension-reshape.py │ ├── userdefineddatatype.py │ └── view.py └── django_project ├── salesproj ├── customer │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── admin.cpython-39.pyc │ │ ├── apps.cpython-39.pyc │ │ ├── models.cpython-39.pyc │ │ ├── urls.cpython-39.pyc │ │ └── views.cpython-39.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-39.pyc │ │ │ └── __init__.cpython-39.pyc │ ├── models.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db.sqlite3 ├── manage.py ├── salesproj │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-39.pyc │ │ ├── settings.cpython-39.pyc │ │ ├── urls.cpython-39.pyc │ │ └── wsgi.cpython-39.pyc │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── templates │ ├── showcustomer.html │ └── updatecustomer.html ├── studproj.zip └── studproj ├── db.sqlite3 ├── manage.py ├── studapp ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── admin.cpython-39.pyc │ ├── apps.cpython-39.pyc │ ├── models.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── migrations │ ├── __init__.py │ └── __pycache__ │ │ └── __init__.cpython-39.pyc ├── models.py ├── tests.py ├── urls.py └── views.py ├── studproj ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── wsgi.cpython-39.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── templates ├── add.html ├── delete.html ├── login.html ├── register.html ├── show.html └── update.html └── userapp ├── __init__.py ├── __pycache__ ├── __init__.cpython-39.pyc ├── admin.cpython-39.pyc ├── apps.cpython-39.pyc ├── models.cpython-39.pyc ├── urls.cpython-39.pyc └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── migrations ├── __init__.py └── __pycache__ │ └── __init__.cpython-39.pyc ├── models.py ├── tests.py ├── urls.py └── views.py /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.fontSize": 20 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python_repo 2 | Python Sample Programs 3 | -------------------------------------------------------------------------------- /Sem-5/Collections/Lists/list3.py: -------------------------------------------------------------------------------- 1 | # Count Method 2 | list = ["Mango","Apple","Pinapple","Mango","Mango"] 3 | print(list.count("Mango")) 4 | 5 | # Index Method 6 | print(list.index("Apple")) 7 | 8 | # Sort Method 9 | #list.sort() 10 | #print(list) 11 | 12 | # Reverse Method 13 | list.reverse() 14 | print(list) -------------------------------------------------------------------------------- /Sem-5/Conditional Statements/if-elif.py: -------------------------------------------------------------------------------- 1 | v =50 2 | 3 | if v < 0: 4 | print("Negative value") 5 | elif v > 0: 6 | pass 7 | else: 8 | print("Value is zero") -------------------------------------------------------------------------------- /Sem-5/Conditional Statements/ifcondition.py: -------------------------------------------------------------------------------- 1 | 2 | # Indentation 3 | v = -50 4 | if v < 0: 5 | print("Value is negative") 6 | else: 7 | print("Value is not negative") 8 | print("This is second line") 9 | print("This is third line") 10 | print("End of program") -------------------------------------------------------------------------------- /Sem-5/Conditional Statements/nestedif.py: -------------------------------------------------------------------------------- 1 | v = 50 2 | 3 | if v < 0: 4 | print("Value is negative") 5 | else: 6 | if v > 0: 7 | print("Value is positive") 8 | else: 9 | print("Value is zero") -------------------------------------------------------------------------------- /Sem-5/Datatypedeclaration.py: -------------------------------------------------------------------------------- 1 | print(type("3.0")) 2 | -------------------------------------------------------------------------------- /Sem-5/Hashtable/hashtable1.py: -------------------------------------------------------------------------------- 1 | student = { 2 | "name":"Rakesh", 3 | "class":"bca", 4 | "age":"19" 5 | } 6 | print(hash(student["name"])) 7 | print(hash(student["class"])) 8 | print(hash(student["age"])) 9 | 10 | a = "India" 11 | print(hash(a)) 12 | 13 | b = "India" 14 | print(hash(b)) 15 | 16 | c = "India" 17 | print(hash(c)) -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop-break.py: -------------------------------------------------------------------------------- 1 | for i in range(1,10): 2 | print(i) 3 | if i == 5: 4 | break 5 | else: 6 | print("End of loop") 7 | -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop-continue.py: -------------------------------------------------------------------------------- 1 | for i in range(1,10): 2 | if i == 5: 3 | continue 4 | print(i) 5 | else: 6 | print("End of loop") -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop-pass.py: -------------------------------------------------------------------------------- 1 | for i in range(5): 2 | pass -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop-print1_to_n.py: -------------------------------------------------------------------------------- 1 | n = int(input("Enter number : ")) 2 | for i in range(1,n+1): 3 | print(i) -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop1.py: -------------------------------------------------------------------------------- 1 | lst = ["India","Hindustan","Bharat","Hind"] 2 | i = 1 3 | for item in lst: 4 | print(i,item) 5 | i += 1 -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop2.py: -------------------------------------------------------------------------------- 1 | s = "Bharat" 2 | 3 | for c in s: 4 | print(c) -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop3.py: -------------------------------------------------------------------------------- 1 | 2 | for i in range(1,11,2): 3 | print(i) -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop4.py: -------------------------------------------------------------------------------- 1 | for i in range(10,1,-2): 2 | print(i) 3 | -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/forloop5.py: -------------------------------------------------------------------------------- 1 | for i in range(4): 2 | print(i) 3 | else: 4 | print("End of loop") -------------------------------------------------------------------------------- /Sem-5/Loops/Forloops/nestedforloop.py: -------------------------------------------------------------------------------- 1 | for i in range(1,6): 2 | for j in range(1,i+1): 3 | print(j,end=" ") 4 | print() 5 | print('End of program') -------------------------------------------------------------------------------- /Sem-5/Loops/Whileloop/break-whileloop.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | while i <= 5: 3 | print(i) 4 | if(i == 3): 5 | break; 6 | i += 1 7 | print("End of program") -------------------------------------------------------------------------------- /Sem-5/Loops/Whileloop/continue-whileloop.py: -------------------------------------------------------------------------------- 1 | i = 0 2 | while i <= 5: 3 | i += 1 4 | if i == 3: 5 | continue 6 | print(i) 7 | print("End of program") -------------------------------------------------------------------------------- /Sem-5/Loops/Whileloop/else-whileloop.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | while i <= 5: 3 | j = 1 4 | print(i) 5 | i += 1 6 | else: 7 | print("End of loop") 8 | 9 | print("End of program") 10 | -------------------------------------------------------------------------------- /Sem-5/Loops/Whileloop/whileloop1.py: -------------------------------------------------------------------------------- 1 | i = 1 2 | while i <= 5: 3 | print(i) 4 | i += 1 5 | print("End of program") -------------------------------------------------------------------------------- /Sem-5/Module/buildinmodule.py: -------------------------------------------------------------------------------- 1 | import platform 2 | 3 | x = platform.system() 4 | print(x) -------------------------------------------------------------------------------- /Sem-5/Module/callmodulefunction.py: -------------------------------------------------------------------------------- 1 | import module1 as m1 2 | import module2 3 | from module3 import function5 4 | 5 | m1.function1() 6 | m1.function2() 7 | 8 | module2.function3() 9 | module2.function4() 10 | 11 | print(m1.p_var) 12 | print(m1.mylist) 13 | 14 | function5() -------------------------------------------------------------------------------- /Sem-5/Module/module1.py: -------------------------------------------------------------------------------- 1 | p_var = 50 2 | 3 | mylist = [10,20,30] 4 | 5 | def function1(): 6 | print("This is Function 1") 7 | 8 | def function2(): 9 | print("This is Function 2") 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Sem-5/Module/module2.py: -------------------------------------------------------------------------------- 1 | def function3(): 2 | print("This is Function 3 of module 2") 3 | 4 | def function4(): 5 | print("This is Function 4 of module 2") -------------------------------------------------------------------------------- /Sem-5/Module/module3.py: -------------------------------------------------------------------------------- 1 | def function5(): 2 | print("This is Function 5 of module 3") 3 | 4 | def function6(): 5 | print("This is Function 6 of module 3") -------------------------------------------------------------------------------- /Sem-5/OOP/first.py: -------------------------------------------------------------------------------- 1 | class Student: # Class Defination 2 | def __init__(self,rno,name): # constructor 3 | self.rollno = 5 4 | self.nameofstudent = name 5 | 6 | def showname(self): 7 | print(self.nameofstudent) 8 | 9 | def test(self): 10 | print("abc") 11 | 12 | class test: 13 | pass 14 | 15 | s1 = Student(5,"Ram"); # Creating Object 16 | s1.showname() 17 | s1.nameofstudent ="Shyam" 18 | #del s1.nameofstudent 19 | s1.showname() 20 | s1.test() 21 | # del s1 22 | # s1.showname() -------------------------------------------------------------------------------- /Sem-5/OOP/hierarchicalnheritance.py: -------------------------------------------------------------------------------- 1 | class A: 2 | classAVariable = 5 3 | 4 | class B(A): # Hierarchical inheritance 5 | classBVariable = 6 6 | 7 | class C(A): # Hierarchical inheritance 8 | classCVariable = 7 9 | 10 | class D(A): # Hierarchical inheritance 11 | classDVariable = 8 12 | 13 | b = B() 14 | print(b.classAVariable) 15 | print(b.classBVariable) 16 | 17 | c = C() 18 | print(c.classAVariable) 19 | print(c.classCVariable) 20 | 21 | d = D() 22 | print(d.classAVariable) 23 | print(d.classDVariable) -------------------------------------------------------------------------------- /Sem-5/OOP/hybridnheritance.py: -------------------------------------------------------------------------------- 1 | # Hybrid Inheritance 2 | class A: 3 | classAVariable = 5 4 | 5 | class B(A): # Hierarchical inheritance 6 | classBVariable = 6 7 | 8 | class C(A): # Hierarchical inheritance 9 | classCVariable = 7 10 | 11 | class D(B,C): # Multiple inheritance 12 | classDVariable = 8 13 | 14 | d = D() 15 | print(d.classAVariable) 16 | print(d.classBVariable) 17 | print(d.classCVariable) 18 | print(d.classDVariable) -------------------------------------------------------------------------------- /Sem-5/OOP/methodoverloadingnotsupported-1.py: -------------------------------------------------------------------------------- 1 | # Function to take multiple arguments 2 | def add(datatype, *args): 3 | 4 | # if datatype is int 5 | # initialize answer as 0 6 | if datatype =='int': 7 | answer = 0 8 | 9 | # if datatype is str 10 | # initialize answer as '' 11 | if datatype =='str': 12 | answer ='' 13 | 14 | # Traverse through the arguments 15 | for x in args: 16 | 17 | # This will do addition if the 18 | # arguments are int. Or concatenation 19 | # if the arguments are str 20 | answer = answer + x 21 | 22 | print(answer) 23 | 24 | # Integer 25 | add('int', 5, 6,7,8) 26 | add('int', 5, 6) 27 | # String 28 | add('str', 'Hi ', 'Geeks') 29 | -------------------------------------------------------------------------------- /Sem-5/OOP/methodoverloadingnotsupported.py: -------------------------------------------------------------------------------- 1 | # Like other languages (for example method overloading in C++) do, 2 | # python does not supports method overloading by default. 3 | class Test: 4 | 5 | def sum(self,a,b): 6 | return a + b 7 | 8 | def sum(self,a,b,c): 9 | return a + b + c 10 | 11 | def sum(self,a): 12 | return a; 13 | 14 | test = Test() 15 | ans = test.sum(5) 16 | #ans = test.sum(5,10,20) 17 | print(ans) 18 | 19 | -------------------------------------------------------------------------------- /Sem-5/OOP/multilevelnheritance.py: -------------------------------------------------------------------------------- 1 | class A: 2 | classAVariable = 5 3 | 4 | class B(A): # Multilevel inheritance 5 | classBVariable = 6 6 | 7 | class C(B): # Multilevel inheritance 8 | classCVariable = 7 9 | 10 | c = C() 11 | print(c.classAVariable) 12 | print(c.classBVariable) 13 | print(c.classCVariable) -------------------------------------------------------------------------------- /Sem-5/OOP/multipleinheritance.py: -------------------------------------------------------------------------------- 1 | class A: 2 | classAVariable = 5 3 | 4 | class B: 5 | classBVariable = 6 6 | 7 | class C(A,B): # Multiple inheritance 8 | classCVariable = 7 9 | 10 | c = C() 11 | print(c.classAVariable) 12 | print(c.classBVariable) 13 | print(c.classCVariable) -------------------------------------------------------------------------------- /Sem-5/OOP/overriding.py: -------------------------------------------------------------------------------- 1 | class A: 2 | def __init__(self,firstname,lastname): 3 | self.fname = firstname 4 | self.lname = lastname 5 | 6 | def printname(self): 7 | print(self.fname,self.lname) 8 | 9 | class B(A): 10 | def __init__(self,firstname,middlename,lastname): 11 | self.middlename = middlename 12 | super().__init__(firstname,lastname) 13 | 14 | def printname(self): 15 | # super().printname(); 16 | print(self.fname,self.middlename,self.lname) 17 | 18 | 19 | b = B("Ram","Laxmanbhai","Desai") 20 | b.printname() -------------------------------------------------------------------------------- /Sem-5/OOP/singleinheritance.py: -------------------------------------------------------------------------------- 1 | class A: 2 | classAVariable = 5 3 | 4 | class B(A): # Single Inheritance. 5 | classBVariable = 6 6 | 7 | b = B() 8 | print(b.classAVariable) 9 | print(b.classBVariable) -------------------------------------------------------------------------------- /Sem-5/Operators/and_operator.py: -------------------------------------------------------------------------------- 1 | mark1 = 65 2 | mark2 = 41 3 | if mark1 > 40 and mark2 > 40: 4 | print("Result: Pass") 5 | else: 6 | print("Result: Fail") -------------------------------------------------------------------------------- /Sem-5/Operators/bitwise_operator.py: -------------------------------------------------------------------------------- 1 | a = 50 2 | b = ~a 3 | print(b) -------------------------------------------------------------------------------- /Sem-5/Operators/in_operator.py: -------------------------------------------------------------------------------- 1 | lst = [10,50,60,45,1,2,-2] 2 | sv = 500 3 | if sv in lst: 4 | print("Search value is in the list") 5 | else: 6 | print("Search value is not in the list") 7 | 8 | -------------------------------------------------------------------------------- /Sem-5/Operators/is_operator.py: -------------------------------------------------------------------------------- 1 | a = 50 2 | b = 60.0 3 | if type(a) is type(b): 4 | print("A and B are of similar object type") 5 | else: 6 | print("A and B are of different object type") -------------------------------------------------------------------------------- /Sem-5/Operators/multipleassignment.py: -------------------------------------------------------------------------------- 1 | # Multiple Assignment 2 | # a, b,c,d = 50,60,70,80 3 | # print(a,b,c,d) 4 | 5 | # Swap variable values 6 | # x,y = 100,200 7 | # print(x,y) 8 | 9 | # x , y = y , x 10 | 11 | # print(x,y) 12 | 13 | a , b = "India",10 14 | print(a,b) 15 | 16 | 17 | -------------------------------------------------------------------------------- /Sem-5/Operators/not_operator.py: -------------------------------------------------------------------------------- 1 | if not(True): 2 | print("condition is true") 3 | else: 4 | print("condition is false") 5 | -------------------------------------------------------------------------------- /Sem-5/Operators/or_operator.py: -------------------------------------------------------------------------------- 1 | mark1 = 39 2 | mark2 = 35 3 | if mark1 > 40 or mark2 > 40: 4 | print("Result: Pass") 5 | else: 6 | print("Result: Fail") 7 | -------------------------------------------------------------------------------- /Sem-5/RegularExpression/data.txt: -------------------------------------------------------------------------------- 1 | 1,aaa,9999912345,abc@gmail.com,31-03-2001 2 | 2,bbb,4444412345,abc_xyz@yahoo.co.in,04/05/2002 3 | 3,ccc,8888812345,abcxyz@gmail.com,06-09-2000 -------------------------------------------------------------------------------- /Sem-5/RegularExpression/generaterandomdata.py: -------------------------------------------------------------------------------- 1 | from random import randrange, choice 2 | from sys import maxsize 3 | from time import ctime 4 | from string import ascii_lowercase as lc 5 | tlds = ('com', 'edu', 'net', 'org', 'gov') 6 | for i in range(randrange(4, 8)): 7 | dtint = randrange(maxsize) 8 | dtstr = ctime(dtint) 9 | llen = randrange(4, 8) 10 | login = ''.join(choice(lc) for j in range(llen)) 11 | dlen = randrange(llen, 13) 12 | dom = ''.join(choice(lc) for j in range(dlen)) 13 | print ('%s::%s@%s.%s::%d-%d-%d' % (dtstr, login,dom, choice(tlds), dtint, llen, dlen)) -------------------------------------------------------------------------------- /Sem-5/RegularExpression/longerexample.txt: -------------------------------------------------------------------------------- 1 | Mon Sep 13 10:38:13 2032::qoovt@gehceomwnf.com::1978664893-5-10 2 | Thu Jan 31 06:47:46 1991::mpusrx@oursedukr.edu::665284666-6-9 3 | Thu Feb 3 12:56:32 2005::zqpddq@pzbpwgnvtto.org::1107415592-6-11 4 | Fri Sep 22 10:10:08 2023::uscaj@codqatid.com::1695357608-5-8 5 | Wed Apr 30 14:21:53 1986::fcnnxc@upzquwupaak.net::515235113-6-11 6 | Fri Mar 1 06:36:09 1985::vundd@fwjftgx.net::478487169-5-7 -------------------------------------------------------------------------------- /Sem-5/RegularExpression/longerexample1.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | fp = open("longerexample.txt","r") 4 | txt = fp.read() 5 | 6 | result = re.findall('(Mon|Tue|Web|Thu|Fri|Sat|Sun)',txt) 7 | print(result) 8 | 9 | result = re.findall('\d+-\d+-\d+',txt) 10 | print(result) 11 | 12 | result = re.findall('[0-9]+-[0-9]+-[0-9]+',txt) 13 | print(result) 14 | 15 | result = re.findall('[0-9]{3}',txt) 16 | print(result) 17 | 18 | -------------------------------------------------------------------------------- /Sem-5/RegularExpression/re1.py: -------------------------------------------------------------------------------- 1 | import re 2 | m = re.search("Hodw","Hi foo, How are you"); 3 | if m == None: 4 | print("Search not found") 5 | else: 6 | print("Search found") 7 | print(m) -------------------------------------------------------------------------------- /Sem-5/RegularExpression/re2.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | fp = open("data.txt","r") 4 | data = fp.read(); 5 | result = re.findall("\d{10}",data) 6 | print(result) 7 | 8 | result = re.findall("\d{2}[-|/]\d{2}[-|/]\d{4}",data) 9 | print(result) 10 | 11 | result = re.findall("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-..]+",data) 12 | print(result) 13 | 14 | import re 15 | txt = "I love my India, India is my country, You also love India" 16 | obj = re.compile("india",re.IGNORECASE) 17 | lst = obj.findall(txt) 18 | lst1 = obj.findall("India is great") 19 | print(lst) 20 | print(lst1) -------------------------------------------------------------------------------- /Sem-5/ScopeofVariable/scopeofvariable1.py: -------------------------------------------------------------------------------- 1 | a = 10 # global 2 | s = 1 # global 3 | 4 | def myfunction(): 5 | def myfunction1(): 6 | global a 7 | global s 8 | a = 5 9 | s = a * a 10 | print(a,s) 11 | print(a,s) # 10, 1 12 | myfunction1(); # 5,25 13 | print(a,s) # 5, 1 14 | 15 | myfunction() -------------------------------------------------------------------------------- /Sem-5/SearchingMethods/binarysearch.py: -------------------------------------------------------------------------------- 1 | def binarysearch(list,searchvalue): 2 | l = 0 3 | h = len(list) - 1 4 | while l <= h: 5 | m = int((l + h) / 2) 6 | if list[m] == searchvalue: 7 | return m; 8 | elif list[m] < searchvalue: 9 | l = m + 1 10 | elif list[m] > searchvalue: 11 | h = m - 1 12 | return -1 13 | 14 | rollno = [2, 3, 6, 11, 12, 44, 55, 69, 83, 87] 15 | # The list must be in sorted order 16 | rollno.sort() 17 | print(rollno) 18 | result = binarysearch(rollno,87) 19 | if result == -1: 20 | print("Search not found") 21 | else: 22 | print("Search found on position",result+1) -------------------------------------------------------------------------------- /Sem-5/SearchingMethods/linearsearch.py: -------------------------------------------------------------------------------- 1 | def linearsearch(list,searchvalue): 2 | position = 1 3 | for i in list: 4 | if i == searchvalue: 5 | return position 6 | else: 7 | position += 1 8 | return -1 9 | 10 | lst = [10,4,2,90,5,58,60,57,42,3] 11 | result = linearsearch(lst,57) 12 | if result == -1: 13 | print("Search not found") 14 | else: 15 | print("Search found on position",result) -------------------------------------------------------------------------------- /Sem-5/TextProcessing/Names.csv: -------------------------------------------------------------------------------- 1 | No,Name,Country 2 | 1,Alex,India 3 | 2,Ben,USA 4 | 3,Shri Ram,India 5 | 4,Smith,USA 6 | 5,Yuva Raj,India 7 | -------------------------------------------------------------------------------- /Sem-5/TextProcessing/data.csv: -------------------------------------------------------------------------------- 1 | Srno,Name,City,Pincode 2 | 1,aaa,Junagadh,123456 3 | 2,abc,Rajkot,321654 4 | 3,abd,Junagadh,123456 5 | 4,abe,Rajkot,321654 6 | 5,abf,Amreli,456123 7 | 6,bbb,Rjt,321456 8 | 7,bab,Jnd,323456 9 | 8,bac,Abd,324456 -------------------------------------------------------------------------------- /Sem-5/TextProcessing/jsondata.json: -------------------------------------------------------------------------------- 1 | { 2 | "fruit": "Apple", 3 | "size": "Large", 4 | "color": "Red" 5 | } -------------------------------------------------------------------------------- /Sem-5/TextProcessing/readcsv.py: -------------------------------------------------------------------------------- 1 | import csv 2 | fp = open('data.csv','r') 3 | reader = csv.reader(fp) 4 | for rec in reader: 5 | print(rec[0],rec[1],rec[2],rec[3]) 6 | 7 | fp.close() -------------------------------------------------------------------------------- /Sem-5/TextProcessing/readjson.py: -------------------------------------------------------------------------------- 1 | # Python program to read JSON from a file. 2 | import json 3 | 4 | # Opening JSON file 5 | with open('sample.json', 'r') as openfile: 6 | 7 | # Reading from json file 8 | json_object = json.load(openfile) 9 | 10 | print(json_object) 11 | print(type(json_object)) -------------------------------------------------------------------------------- /Sem-5/TextProcessing/sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sathiyajith", 3 | "rollno": 56, 4 | "cgpa": 8.6, 5 | "phonenumber": "9999900000" 6 | } -------------------------------------------------------------------------------- /Sem-5/TextProcessing/sample1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sathiyajith", 3 | "rollno": 56, 4 | "cgpa": 8.6, 5 | "phonenumber": "9999900000" 6 | } -------------------------------------------------------------------------------- /Sem-5/TextProcessing/writecsv.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | data = ( 4 | (6,'bbb','Rjt',321456), 5 | (7,'bab','Jnd',323456), 6 | (8,'bac','Abd',324456), 7 | ) 8 | 9 | fp = open("data.csv","a") 10 | writer = csv.writer(fp) 11 | for row in data: 12 | writer.writerow(row) 13 | 14 | fp.close() -------------------------------------------------------------------------------- /Sem-5/TextProcessing/writedictionarytocsv.py: -------------------------------------------------------------------------------- 1 | import csv 2 | csv_columns = ['No','Name','Country'] 3 | dict_data = [ 4 | {'No': 1, 'Name': 'Alex', 'Country': 'India'}, 5 | {'No': 2, 'Name': 'Ben', 'Country': 'USA'}, 6 | {'No': 3, 'Name': 'Shri Ram', 'Country': 'India'}, 7 | {'No': 4, 'Name': 'Smith', 'Country': 'USA'}, 8 | {'No': 5, 'Name': 'Yuva Raj', 'Country': 'India'}, 9 | ] 10 | csv_file = "Names.csv" 11 | try: 12 | with open(csv_file, 'w') as csvfile: 13 | writer = csv.DictWriter(csvfile, fieldnames=csv_columns) 14 | writer.writeheader() 15 | for data in dict_data: 16 | writer.writerow(data) 17 | except IOError: 18 | print("I/O error") -------------------------------------------------------------------------------- /Sem-5/TextProcessing/writejson_dump.py: -------------------------------------------------------------------------------- 1 | # Python program to write JSON to a file 2 | 3 | import json 4 | 5 | # Data to be written 6 | dictionary ={ 7 | "name" : "sathiyajith", 8 | "rollno" : 56, 9 | "cgpa" : 8.6, 10 | "phonenumber" : "9999900000" 11 | } 12 | 13 | with open("sample1.json", "w") as outfile: 14 | json.dump(dictionary, outfile) 15 | -------------------------------------------------------------------------------- /Sem-5/TextProcessing/writejson_dumps.py: -------------------------------------------------------------------------------- 1 | # Python program to write JSON to a file. 2 | 3 | import json 4 | 5 | # Data to be written 6 | dictionary ={ 7 | "name" : "sathiyajith", 8 | "rollno" : 56, 9 | "cgpa" : 8.6, 10 | "phonenumber" : "9999900000" 11 | } 12 | 13 | # Serializing json 14 | json_object = json.dumps(dictionary, indent = 4) 15 | 16 | # Writing to sample.json 17 | with open("sample.json", "w") as outfile: 18 | outfile.write(json_object) 19 | -------------------------------------------------------------------------------- /Sem-5/TextProcessing/xml1.py: -------------------------------------------------------------------------------- 1 | import xml.etree.ElementTree as ET 2 | tree = ET.parse('samplexml.xml') 3 | root = tree.getroot() 4 | print(root.tag) 5 | print(root.text) 6 | for child in root: 7 | print(child.tag,child.attrib) 8 | for subchild in child: 9 | print(subchild.tag,subchild.text) 10 | -------------------------------------------------------------------------------- /Sem-5/TextProcessing/xml3.py: -------------------------------------------------------------------------------- 1 | import xml.etree.ElementTree as ET 2 | 3 | def printxml(element): 4 | if element.text != '\n': 5 | print(element.text) 6 | if element: 7 | children = element.getchildren(); 8 | if len(children) == 0: 9 | return 0 10 | else: 11 | for child in children: 12 | printxml(child) 13 | 14 | tree = ET.parse('E:\\Python Programs\\python_repo\\TextProcessing\\samplexml.xml') 15 | root = tree.getroot() 16 | printxml(root) -------------------------------------------------------------------------------- /Sem-5/TextProcessing/xmldata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Amar 6 | 7 | 8 | Joshi 9 | 10 | 11 | 12 | 65000 13 | 14 | 15 | 16 | 17 | Mr. BCDE 18 | 19 | 20 | 75000 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Sem-5/assertexample.py: -------------------------------------------------------------------------------- 1 | a = 20 2 | 3 | assert a <= 10 4 | 5 | print("Program ends") 6 | 7 | x = "hello" 8 | 9 | #if condition returns False, AssertionError is raised: 10 | assert x == "goodbye", "x should be 'hello'" -------------------------------------------------------------------------------- /Sem-5/file_io/file_append.py: -------------------------------------------------------------------------------- 1 | # Will create a file if it does not exists 2 | # If file exist, content will be appended. 3 | fp = open('myfile2.txt',"a") 4 | fp.write("Good Morning\n") 5 | fp.close() 6 | 7 | fp = open("myfile2.txt","r") 8 | print(fp.read()) 9 | fp.close() -------------------------------------------------------------------------------- /Sem-5/file_io/file_append_read.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | fp = open("myfile2.txt","a+") 4 | fp.write("this is new content\n") 5 | # fp.close() 6 | # fp = open("myfile1.txt","r") 7 | 8 | # The tell method of the filehandle will return the current location of this pointer. 9 | print(fp.tell()) 10 | fp.seek(4,os.SEEK_SET) 11 | print(fp.tell()) 12 | # os.SEEK_SET - Begining of the file 13 | # os.SEEK_CUR - current position 14 | # os.SEEK_END - end of file 15 | 16 | txt = fp.read(6) 17 | print(txt) 18 | filesize = os.path.getsize("myfile2.txt") 19 | totallines = filesize/21 20 | print(totallines) 21 | fp.seek(5*21,os.SEEK_SET) 22 | print(fp.read(1)) 23 | fp.close() -------------------------------------------------------------------------------- /Sem-5/file_io/file_readline.py: -------------------------------------------------------------------------------- 1 | # fp = open("myfile1.txt","r") 2 | # txt = fp.read(14) 3 | # print(txt) 4 | # fp.close() 5 | 6 | # fp = open("myfile1.txt","r") 7 | # while(1): 8 | # txt = fp.readline() 9 | # if txt == '': 10 | # break 11 | # print(txt) 12 | # fp.close() 13 | 14 | fp = open("myfile.txt","r") 15 | for line in fp: 16 | print(line) 17 | fp.close() -------------------------------------------------------------------------------- /Sem-5/file_io/file_xmode.py: -------------------------------------------------------------------------------- 1 | # Will create a file if it does not exists 2 | # If file exist, will raise error. 3 | fp = open('myfile3.txt',"x") 4 | fp.write("Good Morning\n") 5 | fp.close() 6 | 7 | fp = open("myfile3.txt","r") 8 | print(fp.read()) 9 | fp.close() -------------------------------------------------------------------------------- /Sem-5/file_io/fileio.py: -------------------------------------------------------------------------------- 1 | import os 2 | os.remove('myfile1.txt') -------------------------------------------------------------------------------- /Sem-5/file_io/fileread.py: -------------------------------------------------------------------------------- 1 | fp = open("E:\\Python Programs\\python_repo\\Unit 1\\file_io\\myfile.txt","r") 2 | 3 | txt = fp.read() 4 | print(txt) -------------------------------------------------------------------------------- /Sem-5/file_io/filewrite.py: -------------------------------------------------------------------------------- 1 | # Will create a file if it does not exists 2 | # If file exist, it will be overwritten. 3 | fp = open('myfile1.txt',"w") 4 | fp.write("Good Morning") 5 | fp.close() 6 | 7 | fp = open("myfile1.txt","r") 8 | print(fp.read()) 9 | fp.close 10 | -------------------------------------------------------------------------------- /Sem-5/file_io/myfile.txt: -------------------------------------------------------------------------------- 1 | This is myfile and it is first line 2 | This is second line 3 | this is third line 4 | This is fourth line -------------------------------------------------------------------------------- /Sem-5/file_io/myfile2.txt: -------------------------------------------------------------------------------- 1 | this is new content 2 | this is new content 3 | this is new content 4 | this is new content 5 | this is new content 6 | this is new content 7 | this is new content 8 | this is new content 9 | this is new content 10 | this is new content 11 | this is new content 12 | this is new content 13 | this is new content 14 | this is new content 15 | this is new content 16 | this is new content 17 | this is new content 18 | -------------------------------------------------------------------------------- /Sem-5/file_io/myfile3.txt: -------------------------------------------------------------------------------- 1 | Good Morning 2 | -------------------------------------------------------------------------------- /Sem-5/functions/arbitraryarguments.py: -------------------------------------------------------------------------------- 1 | def my_sum(*numbers): 2 | total = 0 3 | for number in numbers: 4 | total += number 5 | print("Total : " + str(total)) 6 | 7 | my_sum(1,2,3,4) 8 | -------------------------------------------------------------------------------- /Sem-5/functions/arbitrarykeywordargument.py: -------------------------------------------------------------------------------- 1 | def student(**stud): 2 | for s in stud: 3 | print(s + " : " + str(stud[s])) 4 | 5 | student(age = 30, lastname = "Patel", firstname ="Fenil", m1=50,m2=60) -------------------------------------------------------------------------------- /Sem-5/functions/defaultparametervalue.py: -------------------------------------------------------------------------------- 1 | def student(firstname="Fenil",lastname="Patel",age = 25): 2 | print("Firstname : " + firstname) 3 | print("Lastname : " + lastname) 4 | print("Age : " + str(age)) 5 | 6 | student(age=19) -------------------------------------------------------------------------------- /Sem-5/functions/fibonacci_recursion.py: -------------------------------------------------------------------------------- 1 | def fibonacci_recursion(n,current_number=0,next_number=1): 2 | if n==1: 3 | return 0 4 | if current_number == 0: 5 | print (current_number) 6 | print (next_number) 7 | else: 8 | print(next_number) 9 | no = next_number 10 | next_number = current_number + next_number 11 | current_number = no 12 | fibonacci_recursion(n-1,current_number,next_number) 13 | 14 | fibonacci_recursion(10) -------------------------------------------------------------------------------- /Sem-5/functions/function1.py: -------------------------------------------------------------------------------- 1 | def my_function(): 2 | print("This is my function") 3 | 4 | def my_function1(): 5 | print("This is my function 1") 6 | 7 | def my_function2(): 8 | print("This is my function 2") 9 | 10 | my_function() 11 | my_function1() 12 | my_function2() -------------------------------------------------------------------------------- /Sem-5/functions/function2.py: -------------------------------------------------------------------------------- 1 | def function1(age,firstname,lastname): 2 | if type(age) is not int: 3 | print("Age is not integer") 4 | else: 5 | print("Age : " + str(age)) 6 | print(firstname + " " + lastname) 7 | 8 | function1(20,"Sanket","Patel") -------------------------------------------------------------------------------- /Sem-5/functions/functionwithargument.py: -------------------------------------------------------------------------------- 1 | def studentname(firstname,lastname): 2 | if firstname == None and lastname == None: 3 | print("Please pass arguments") 4 | elif lastname == None: 5 | print("Welcome " + firstname) 6 | elif firstname == None: 7 | print("Welcome " + lastname) 8 | else: 9 | print("Welcome " + firstname + " " + lastname) 10 | 11 | def studentdata(name,age): 12 | print("Name : " + name) 13 | print("Age : " + str(age)) 14 | 15 | # fn = input("Enter your firstname : ") 16 | # ln = input("Enter your lastname : ") 17 | #studentname("Mital","Rakholiya") 18 | 19 | studentdata("Mital",20) -------------------------------------------------------------------------------- /Sem-5/functions/functionwithreturnvalue.py: -------------------------------------------------------------------------------- 1 | def sqaure(a): 2 | s = a * a 3 | q = a * a * a 4 | return a,s,q 5 | 6 | a = sqaure(4) 7 | print(a[0]) 8 | print(a[1]) 9 | print(a[2]) 10 | 11 | b,c,d = sqaure(5) 12 | print(b,c,d) 13 | 14 | # e,f = sqaure(6) ## Will raise error 15 | # print(e,f) 16 | 17 | -------------------------------------------------------------------------------- /Sem-5/functions/keywordargumentfunction.py: -------------------------------------------------------------------------------- 1 | def student(firstname,lastname,age): 2 | print("Firstname : " + firstname) 3 | print("Lastname : " + lastname) 4 | print("Age : " + str(age)) 5 | 6 | student(age = 19, lastname = "Patel", firstname ="Fenil") -------------------------------------------------------------------------------- /Sem-5/functions/passinglistasargument.py: -------------------------------------------------------------------------------- 1 | def myfunction(args): 2 | for arg in args: 3 | print(arg) 4 | 5 | lst = [1,'India',True,'Bharat','Hindustan'] 6 | myfunction(lst) -------------------------------------------------------------------------------- /Sem-5/functions/passingunlimitednumberofarguments.py: -------------------------------------------------------------------------------- 1 | def sum(*abc): 2 | ans = 0 3 | for i in abc: 4 | ans = ans + i 5 | print(ans) 6 | 7 | 8 | sum(1,2,3) 9 | sum(1,2) 10 | sum(1,2,3,4,5,6,7,8,9,10) -------------------------------------------------------------------------------- /Sem-5/functions/recursion.py: -------------------------------------------------------------------------------- 1 | # Recursion 2 | 3 | def sqr(m,n): 4 | if n == 1: 5 | return m 6 | else: 7 | return m * sqr(m,n-1) 8 | 9 | ans = sqr(2,7) 10 | print(ans) 11 | -------------------------------------------------------------------------------- /Sem-5/pythonmysql/connection_check.py: -------------------------------------------------------------------------------- 1 | import mysql.connector 2 | 3 | -------------------------------------------------------------------------------- /Sem-5/pythonmysql/create_connection.py: -------------------------------------------------------------------------------- 1 | import mysql.connector 2 | 3 | mydb = mysql.connector.connect( 4 | host="localhost", 5 | user="root", 6 | password="" 7 | ) 8 | 9 | print(mydb) -------------------------------------------------------------------------------- /Sem-5/pythonmysql/create_database.py: -------------------------------------------------------------------------------- 1 | import mysql.connector 2 | 3 | mydb = mysql.connector.connect( 4 | host="localhost", 5 | user="root", 6 | password="" 7 | ) 8 | 9 | mycursor = mydb.cursor(); 10 | mycursor.execute("Create database pythonmysql1") 11 | print("Database created successfully") -------------------------------------------------------------------------------- /Sem-5/pythonmysql/create_table.py: -------------------------------------------------------------------------------- 1 | import mysql.connector 2 | 3 | mydb = mysql.connector.connect( 4 | host="localhost", 5 | user="root", 6 | password="", 7 | database = 'python_example_db' 8 | ) 9 | 10 | mycursor = mydb.cursor() 11 | 12 | mycursor.execute("create table tbl1(id int(11),nm varchar(20),city varchar(10))") 13 | -------------------------------------------------------------------------------- /Sem-5/pythonmysql/deleterecord.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | from mysql.connector.cursor import MySQLCursorBuffered 3 | 4 | mydb = con.connect( 5 | host = "localhost", 6 | user = 'root', 7 | password = '', 8 | database = 'python_example_db' 9 | ) 10 | 11 | student_id = input("Enter Student ID to delete : ") 12 | 13 | mycursor = mydb.cursor() 14 | args = (student_id,) 15 | mycursor.execute("delete from student where student_id = %s",args) 16 | 17 | 18 | if mycursor.rowcount == 0: 19 | print("No records deleted") 20 | else: 21 | print(mycursor.rowcount, "record(s) Deleted successfully") -------------------------------------------------------------------------------- /Sem-5/pythonmysql/displayalldatabases.py: -------------------------------------------------------------------------------- 1 | import mysql.connector 2 | 3 | mydb = mysql.connector.connect( 4 | host="localhost", 5 | user="root", 6 | password="" 7 | ) 8 | 9 | mycursor = mydb.cursor() 10 | mycursor.execute("show databases") 11 | 12 | for db in mycursor: 13 | print(db) 14 | -------------------------------------------------------------------------------- /Sem-5/pythonmysql/insertmultiplerecord.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | from mysql.connector.cursor import MySQLCursorBuffered 3 | 4 | mydb = con.connect( 5 | host = "localhost", 6 | user = 'root', 7 | password = '', 8 | database = 'python_example_db' 9 | ) 10 | 11 | mycursor = mydb.cursor() 12 | args = [ 13 | ("Rugved","Ahmedabad","India"), 14 | ("Yajurved","Ahmedabad","India"), 15 | ("Arthavved","Ahmedabad","India"), 16 | ("Samved","Ahmedabad","India") 17 | ] 18 | 19 | mycursor.executemany("insert into student(student_name,student_city,student_country) values(%s,%s,%s)",args) 20 | 21 | print(mycursor.rowcount, "record(s) inserted successfully") 22 | print("Last inserted record id :",mycursor.lastrowid) -------------------------------------------------------------------------------- /Sem-5/pythonmysql/insertrecord.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | from mysql.connector.cursor import MySQLCursorBuffered 3 | 4 | mydb = con.connect( 5 | host = "localhost", 6 | user = 'root', 7 | password = '', 8 | database = 'python_example_db' 9 | ) 10 | 11 | student_id = input("Enter Student Id : ") 12 | name = input("Name : ") 13 | city = input("City : ") 14 | country = input("Country : ") 15 | 16 | mycursor = mydb.cursor() 17 | args = (student_id,name,city,country) 18 | mycursor.execute("insert into student values(%s,%s,%s,%s)",args) 19 | 20 | print(mycursor.rowcount, "record(s) inserted successfully") 21 | print("Last Record id : ",mycursor.lastrowid) -------------------------------------------------------------------------------- /Sem-5/pythonmysql/join.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | 3 | mydb = con.connect( 4 | host = "localhost", 5 | user = 'root', 6 | password = '', 7 | database = 'python_example_db' 8 | ) 9 | 10 | mycursor = mydb.cursor() 11 | sql = "select s.student_name,s.student_city,b.book_id, b.tran_id from student as s left JOIN bookissue as b on s.student_id = b.student_id" 12 | mycursor.execute(sql) 13 | 14 | students = mycursor.fetchall() 15 | 16 | for student in students: 17 | print(student) 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Sem-5/pythonmysql/login.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | 3 | mydb = con.connect( 4 | host = "localhost", 5 | user = 'root', 6 | password = '', 7 | database = 'python_example_db' 8 | ) 9 | 10 | username = input("Username : ") 11 | password = input("Password : ") 12 | 13 | mycursor = mydb.cursor() 14 | 15 | #sql = "select * from users where username = '"+username+"' and password = '" + password + "'" 16 | sql = "select * from users where username = %s and password = %s" 17 | args = (username,password) 18 | #print(sql) 19 | mycursor.execute(sql,args) 20 | user = mycursor.fetchone() 21 | print(user) 22 | if user is None: 23 | print("Not a valid username or password") 24 | else: 25 | print("Welcome to the Python program") -------------------------------------------------------------------------------- /Sem-5/pythonmysql/readdata.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | 3 | mydb = con.connect( 4 | host = "localhost", 5 | user = 'root', 6 | password = '', 7 | database = 'python_example_db' 8 | ) 9 | 10 | mycursor = mydb.cursor() 11 | mycursor.execute("select * from student") 12 | 13 | firststudent = mycursor.fetchone(); 14 | print(firststudent) 15 | 16 | students = mycursor.fetchall() 17 | 18 | 19 | print("List of students") 20 | print("No\t Name\t City") 21 | print("------------------------") 22 | for student in students: 23 | print(student[0],"\t",student[1],"\t",student[2]) -------------------------------------------------------------------------------- /Sem-5/pythonmysql/tclcommand-example.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | 3 | mydb = con.connect( 4 | host = "localhost", 5 | user = 'root', 6 | password = '', 7 | database = 'python_example_db' 8 | ) 9 | 10 | mydb.autocommit =False 11 | 12 | mycursor = mydb.cursor() 13 | 14 | args = ('bbb',1) 15 | mycursor.execute("update student set student_name = %s where student_id = %s",args) 16 | 17 | args = ('bbbbbb',2) 18 | mycursor.execute("update student set student_name = %s where student_id = %s",args) 19 | 20 | mydb.rollback() 21 | 22 | print(mycursor.rowcount, "record(s) updated successfully") 23 | 24 | mycursor.close() 25 | mydb.close() -------------------------------------------------------------------------------- /Sem-5/pythonmysql/updaterecord.py: -------------------------------------------------------------------------------- 1 | import mysql.connector as con 2 | 3 | mydb = con.connect( 4 | host = "localhost", 5 | user = 'root', 6 | password = '', 7 | database = 'python_example_db' 8 | ) 9 | 10 | mycursor = mydb.cursor() 11 | args = ('Ramesh',5) 12 | mycursor.execute("update student set student_name = %s where student_id = %s",args) 13 | 14 | print(mycursor.rowcount, "record(s) updated successfully") -------------------------------------------------------------------------------- /Sem-5/sortingmethods/Bubble_sort.py: -------------------------------------------------------------------------------- 1 | def bubblesort(list): 2 | l = len(list) 3 | for i in range(0,l-1): 4 | for j in range(l-1,i,-1): 5 | if list[j] < list[j-1]: 6 | list[j], list[j-1] = list[j-1], list[j] 7 | return list 8 | 9 | 10 | lst = [5,200,-20,16,-11] 11 | result = bubblesort(lst) 12 | print(result) 13 | -------------------------------------------------------------------------------- /Sem-5/sortingmethods/SelectionSort.py: -------------------------------------------------------------------------------- 1 | def selectionsort(list): 2 | l = len(list) 3 | for i in range(0,l): 4 | minindex = i 5 | for j in range(i+1,l): 6 | if(list[minindex] > list[j]): 7 | minindex = j 8 | if(i != minindex): 9 | list[i] , list[minindex] = list[minindex],list[i] 10 | return list 11 | 12 | lst =[-40,8,-69,4,56] 13 | result = selectionsort(lst) 14 | print(result) -------------------------------------------------------------------------------- /Sem-5/sortingmethods/bubblesort.py: -------------------------------------------------------------------------------- 1 | mylist = [10,5,6,1,100,88,99,40,51,70] 2 | # for i in range(10): 3 | # v = int(input("Enter number : ")) 4 | # mylist.append(v) 5 | l = len(mylist) 6 | for i in range(0,l-1): 7 | for j in range(l-1,i,-1): 8 | if(mylist[j] < mylist[j-1]): 9 | mylist[j],mylist[j-1] = mylist[j-1],mylist[j] 10 | 11 | print(mylist) -------------------------------------------------------------------------------- /Sem-5/sortingmethods/insertionsort.py: -------------------------------------------------------------------------------- 1 | # Python program for implementation of Insertion Sort 2 | # Function to do insertion sort 3 | def insertionSort(arr): 4 | # Traverse through 1 to len(arr) 5 | for i in range(1, len(arr)): 6 | key = arr[i] 7 | # Move elements of arr[0..i-1], that are 8 | # greater than key, to one position ahead 9 | # of their current position 10 | j = i-1 11 | while j >= 0 and key < arr[j] : 12 | arr[j + 1] = arr[j] 13 | j -= 1 14 | arr[j + 1] = key 15 | return arr 16 | 17 | # Driver code to test above 18 | arr = [12, 11, 13, 5, 6] 19 | result = insertionSort(arr) 20 | print(result) -------------------------------------------------------------------------------- /Sem-5/strings/multilinestring.py: -------------------------------------------------------------------------------- 1 | s1 = """Hello friends, 2 | Good Morning, 3 | I am fine, 4 | How about you, 5 | Hope you will also be fine""" 6 | 7 | s2 = '''Be creative, 8 | Learn new things daily, 9 | Read daily''' 10 | 11 | print(s1) 12 | print(s2) 13 | -------------------------------------------------------------------------------- /Sem-5/strings/stringasarray.py: -------------------------------------------------------------------------------- 1 | s1 = "I love India" 2 | for i in range(len(s1)): 3 | print(s1[i]) -------------------------------------------------------------------------------- /Sem-5/strings/stringlen.py: -------------------------------------------------------------------------------- 1 | s1 = "India is great" 2 | print("The length of the string '",s1, "' is : ",len(s1)) -------------------------------------------------------------------------------- /Sem-5/strings/strings.py: -------------------------------------------------------------------------------- 1 | s1 = "I love India" 2 | print(s1[7:10]) # Ind 3 | 4 | print(s1[-5:-1]) # Indi 5 | 6 | print(s1[-5:]) # India 7 | 8 | print(s1[-10:5]) # lov 9 | 10 | print(s1[2:-2]) # love Ind 11 | 12 | # start:end:step 13 | print(s1[0:15:2]) # Ilv ni 14 | 15 | print(s1[0:15:4]) # Ivn 16 | -------------------------------------------------------------------------------- /Sem-5/try_except/multiple_except.py: -------------------------------------------------------------------------------- 1 | try: 2 | num1 = int(input("Enter any number : ")) 3 | num2 = int(input("Enter any number : ")) 4 | num3 = num1 / num2 5 | print("Answer is ",num3) 6 | except ValueError: 7 | print("Invalid input") 8 | except ZeroDivisionError: 9 | print("Second value can not be zero") 10 | except: 11 | print("Other error") 12 | else: 13 | print("No Errors...Greate.. You are good Programmer") 14 | finally: 15 | print("Try..Except block completed") -------------------------------------------------------------------------------- /Sem-5/try_except/tempCodeRunnerFile.py: -------------------------------------------------------------------------------- 1 | print("Valid input") -------------------------------------------------------------------------------- /Sem-5/try_except/try_except_syntax.py: -------------------------------------------------------------------------------- 1 | try: 2 | num = int(input("Enter any number : ")) 3 | print("You entered " + str(num)) 4 | except: 5 | print("Invalid input, please try again") 6 | finally: 7 | print("This is finally block") -------------------------------------------------------------------------------- /Sem-5/try_except/userdefinedexception.py: -------------------------------------------------------------------------------- 1 | try: 2 | num = int(input("Enter any number : ")) 3 | if num < 0: 4 | raise TypeError("Value can not be less than zero") 5 | elif num >= 0 and num <= 10: 6 | raise ValueError("Value can not be between 1 to 10") 7 | elif num >= 11 and num <= 20: 8 | raise Exception("Value can not be between 11 to 20") 9 | print("Valid input") 10 | except ValueError: 11 | print("This is value error") 12 | except TypeError: 13 | print("This is type error") 14 | except: 15 | print("Other type of error") 16 | -------------------------------------------------------------------------------- /Sem-5/try_except/userdefinedexception1.py: -------------------------------------------------------------------------------- 1 | num = 1 2 | 3 | if not type(num) is int: 4 | raise Exception("Not a valid integer number") -------------------------------------------------------------------------------- /Sem-6/Plotting/3dgraph.py: -------------------------------------------------------------------------------- 1 | from mpl_toolkits import mplot3d 2 | import numpy as np 3 | import matplotlib.pyplot as plt 4 | 5 | height = np.array([100,110,87,85,65,80,96,75,42,59,54,63,95,71,86]) 6 | weight = np.array([105,123,84,85,78,95,69,42,87,91,63,83,75,41,80]) 7 | plt.scatter(height,weight) 8 | 9 | fig = plt.figure() 10 | ax = plt.axes(projection='3d') 11 | # This is used to plot 3D scatter 12 | ax.scatter3D(height,weight) 13 | plt.title("3D Scatter Plot") 14 | plt.xlabel("Height") 15 | plt.ylabel("Weight") 16 | plt.title("3D Scatter Plot") 17 | plt.xlabel("Height") 18 | plt.ylabel("Weight") 19 | 20 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/bargraph.py: -------------------------------------------------------------------------------- 1 | # from matplotlib import pyplot as plt 2 | # players = ['Virat','Rohit','Shikhar','Hardik'] 3 | # runs = [51,87,45,67] 4 | # plt.bar(players,runs,color = 'green') 5 | # plt.title('Score Card') 6 | # plt.xlabel('Players') 7 | # plt.ylabel('Runs') 8 | # plt.show() 9 | 10 | from matplotlib import pyplot as plt 11 | from matplotlib import style 12 | 13 | style.use('ggplot') 14 | 15 | players1 = ['Virat','Rohit','Shikhar','Hardik'] 16 | runs = [51,87,45,67] 17 | players2 = ['V','R','S','H'] 18 | wicket = [1,2,3,4] 19 | 20 | plt.bar(players1, runs, color = 'y', align='center') 21 | plt.bar(players2, wicket, color='c', align='center') 22 | 23 | plt.title('Information') 24 | 25 | plt.ylabel('Y axis') 26 | plt.xlabel('X axis') 27 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/first.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | import matplotlib 3 | # print(matplotlib.__version__) 4 | 5 | x = [1,2,3,4,5,6,7,8,9,10] 6 | y = [4,15,20,21,22,31,41,51,61,66] 7 | plt.plot(x,y) 8 | 9 | plt.axis([0, 20, 0, 200]) 10 | 11 | plt.title('Today\'s Cricket Match') 12 | plt.ylabel('Runs') 13 | plt.xlabel('Overs') 14 | 15 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/histogramgraph.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | population_age = [21,21,22,23,25,27,30,42,40,1,2,102,95,8,15,105,70,65,55,70,75,60,52,25,25,21,45] 3 | bins = [0,10,20,30,40,50,60,70,80,90,100] 4 | plt.hist(population_age, bins, histtype='bar', rwidth=0.8) 5 | plt.xlabel('age groups') 6 | plt.ylabel('Number of people') 7 | plt.title('Histogram') 8 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/linegraph.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | from matplotlib import style 3 | 4 | style.use('ggplot') 5 | x = [16, 8, 10] 6 | y = [8, 16, 6] 7 | x2 = [8, 15, 11] 8 | y2 = [6, 15, 7] 9 | plt.plot(x, y, 'r', label='India', linewidth=5) 10 | plt.plot(x2, y2, 'm', label='Aus', linewidth=5) 11 | plt.legend() 12 | plt.title('Epic Info') 13 | fig = plt.figure() 14 | plt.ylabel('Y axis') 15 | plt.xlabel('X axis') 16 | 17 | plt.grid(True, color='k') 18 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/piegraph.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | 3 | Players = 'Rohit', 'Virat', 'Shikhar', 'Yuvraj' 4 | Runs = [44, 30, 15, 10] 5 | explodearr = (0.1, 0, 0.3, 0) 6 | plt.pie(Runs,labels=Players,explode=explodearr, 7 | shadow=True, startangle=180,autopct='%1.3f%%') 8 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/scattergraph.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | from matplotlib import style 3 | style.use('ggplot') 4 | 5 | x = [5,7,10] 6 | y = [18,10,6] 7 | 8 | x2 = [6,9,11] 9 | y2 = [7,14,17] 10 | 11 | plt.scatter(x, y,label="Plot1") 12 | plt.scatter(x2, y2, color='g',label="Plot2") 13 | 14 | plt.title('Epic Info') 15 | plt.ylabel('Y axis') 16 | plt.xlabel('X axis') 17 | plt.legend() 18 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Plotting/subplot.py: -------------------------------------------------------------------------------- 1 | from matplotlib import pyplot as plt 2 | names = ['Abhishek', 'Himanshu', 'Devansh'] 3 | marks= [87,50,98] 4 | 5 | plt.figure(figsize=(9,3)) 6 | 7 | plt.subplot(131) 8 | plt.title('1st Chart') 9 | plt.bar(names, marks) 10 | plt.subplot(132) 11 | plt.title('2d Chart') 12 | plt.scatter(names, marks) 13 | plt.subplot(133) 14 | plt.title('3rd Chart') 15 | plt.plot(names, marks) 16 | plt.suptitle('Categorical Plotting') 17 | plt.show() -------------------------------------------------------------------------------- /Sem-6/Threading/__pycache__/queue.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/Threading/__pycache__/queue.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/Threading/multithread-deprecated.py: -------------------------------------------------------------------------------- 1 | import _thread 2 | from time import * 3 | def hello(message,): 4 | for i in range(5): 5 | print(message) 6 | sleep(1) 7 | def hi(message): 8 | for i in range(5): 9 | print(message) 10 | sleep(1) 11 | try: 12 | _thread.start_new_thread(hello,("Hello",)) 13 | _thread.start_new_thread(hi,("Hi",)) 14 | print("No error") 15 | except: 16 | print ("Error: unable to start thread") 17 | print("Bye") 18 | # while 1: 19 | # pass 20 | sleep(10) -------------------------------------------------------------------------------- /Sem-6/Threading/multithread.py: -------------------------------------------------------------------------------- 1 | import threading 2 | from time import sleep 3 | class C1(threading.Thread): 4 | def __init__(self,a,b): # Overriding Thread class(baseclass) __init__ method 5 | threading.Thread.__init__(self) 6 | self.a = a 7 | self.b = b 8 | def run(self): # Overriding Thread class(baseclass) run method 9 | for i in range(5): 10 | print("Sum",self.a+self.b) 11 | sleep(1) 12 | 13 | class C2(threading.Thread): 14 | def run(self): 15 | for i in range(5): 16 | print("Hi") 17 | sleep(1) 18 | obj1 = C1(5,6) 19 | obj2 = C2() 20 | obj1.start() 21 | obj2.start() 22 | obj1.join() 23 | obj2.join() 24 | 25 | print("Bye") -------------------------------------------------------------------------------- /Sem-6/Threading/multithreading1.py: -------------------------------------------------------------------------------- 1 | from threading import * 2 | from time import * 3 | 4 | def hello(): 5 | for i in range(5): 6 | print("Hello") 7 | sleep(1) 8 | 9 | def hi(): 10 | for i in range(5): 11 | print("Hi") 12 | sleep(1) 13 | 14 | Thread(target=hello).start() 15 | Thread(target=hi).start() -------------------------------------------------------------------------------- /Sem-6/Threading/multithreading_queue.py: -------------------------------------------------------------------------------- 1 | import threading, queue 2 | import time 3 | q = queue.Queue() 4 | def worker(): 5 | while True: 6 | item = q.get() 7 | print(f'Working on {item}') 8 | print(f'Finished {item}') 9 | q.task_done() 10 | # turn-on the worker thread 11 | threading.Thread(target=worker, daemon=True).start() 12 | 13 | # send thirty task requests to the worker 14 | for item in range(5): 15 | q.put(item) 16 | 17 | print('All task requests sent\n', end='') 18 | 19 | # block until all tasks are done 20 | q.join() 21 | print('All work completed') 22 | -------------------------------------------------------------------------------- /Sem-6/Threading/multithreadqueue.py: -------------------------------------------------------------------------------- 1 | import queue 2 | import threading 3 | import time 4 | # Fifo Queue 5 | # q = queue.Queue() 6 | # q = queue.LifoQueue() 7 | q = queue.PriorityQueue() 8 | 9 | def method1(): 10 | for i in range(5): 11 | print("Method 1") 12 | 13 | def method2(): 14 | for i in range(5): 15 | print("Method 2") 16 | 17 | def method3(): 18 | for i in range(5): 19 | print("Method 3") 20 | 21 | def method4(): 22 | for i in range(5): 23 | print("Method 4") 24 | 25 | t1 = threading.Thread(target=method1) 26 | t2 = threading.Thread(target=method2) 27 | t3 = threading.Thread(target=method3) 28 | t4 = threading.Thread(target=method4) 29 | 30 | q.put(("adil",t3)) 31 | q.put(("abodh",t2)) 32 | q.put(("Anil",t4)) 33 | q.put(("Zaakash",t1)) 34 | 35 | while not q.empty(): 36 | item = q.get() 37 | item[1].start() 38 | item[1].join() 39 | # q.task_done() 40 | print("End of program") -------------------------------------------------------------------------------- /Sem-6/Threading/queueexample.py: -------------------------------------------------------------------------------- 1 | import queue 2 | 3 | # Fifo Queue 4 | q = queue.Queue() 5 | for i in range(5): 6 | q.put(i) 7 | # for i in range(q.qsize()): 8 | while not q.empty(): 9 | item = q.get() 10 | print(item, end=' ') 11 | print("\n") 12 | 13 | #Lifo Queue 14 | q = queue.LifoQueue() 15 | 16 | for i in range(5): 17 | q.put(i) 18 | 19 | # for i in range(q.qsize()): 20 | while not q.empty(): 21 | item = q.get() 22 | print(item,end=" ") 23 | 24 | print("\n") 25 | 26 | # Priority Queue 27 | q = queue.PriorityQueue() 28 | q.put((4,"Value 4","Value 4S")) 29 | q.put((2,"Value 2","Value 2S")) 30 | q.put((3,"Value 3","Value 3S")) 31 | q.put((0,"Value 0","Value 0S")) 32 | q.put((1,"Value 1","Value 1S")) 33 | 34 | while not q.empty(): 35 | item = q.get() 36 | print(item[1], item[2]) 37 | 38 | print("\n") -------------------------------------------------------------------------------- /Sem-6/Threading/thread_and_queue.py: -------------------------------------------------------------------------------- 1 | import queue 2 | import threading 3 | 4 | # Fifo Queue 5 | q = queue.Queue() 6 | # q = queue.LifoQueue() 7 | # q = queue.PriorityQueue() 8 | 9 | def method1(): 10 | print("Thread started") 11 | while not q.empty(): 12 | item = q.get() 13 | print(item[1], end=' ') 14 | 15 | threading.Thread(target=method1).start() 16 | 17 | q.put((1,"Raj")) 18 | q.put((2,"Prakash")) 19 | q.put((3,"Rohit")) 20 | q.put((4,"Manish")) 21 | q.put((5,"Suresh")) 22 | # for i in range(q.qsize()): 23 | 24 | print("\n") 25 | print("End of program") -------------------------------------------------------------------------------- /Sem-6/Tkinter/canvas.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | master = Tk() 3 | w = Canvas(master, width=500, height=500,bg="red") 4 | w.pack() 5 | # canvas_height=20 6 | # canvas_width=200 7 | # y = int(canvas_height / 2) 8 | w.create_line(10, 10, 100, 10 ) 9 | coord = 10, 50, 240, 210 10 | arc = w.create_arc(coord, start=0, extent=150, fill="blue") 11 | mainloop() 12 | -------------------------------------------------------------------------------- /Sem-6/Tkinter/combobox.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | from tkinter.ttk import Combobox 4 | import mysql.connector as con 5 | 6 | mydb = con.connect( 7 | host = "localhost", 8 | user = 'root', 9 | password = '', 10 | database = 'pythonexample' 11 | ) 12 | 13 | mycursor = mydb.cursor() 14 | mycursor.execute("select * from coursedetails") 15 | courses = mycursor.fetchall() 16 | 17 | courselist = [] 18 | 19 | for course in courses: 20 | courselist.append(course[1]) 21 | 22 | win = Tk() 23 | win.title("Combobox Example") 24 | win.geometry("400x400") 25 | 26 | lbldata = StringVar() 27 | 28 | Label(win,textvariable=lbldata).pack() 29 | 30 | mycombo = Combobox(win, textvariable=lbldata,width=30) 31 | mycombo['values'] = courselist 32 | mycombo.current(2) 33 | 34 | mycombo.pack() 35 | win.mainloop() 36 | 37 | -------------------------------------------------------------------------------- /Sem-6/Tkinter/entry.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | window = Tk(); 5 | window.title("Entry Widget Example") 6 | window.geometry("500x500") 7 | 8 | tv1 = StringVar(); 9 | tv2 = StringVar(); 10 | 11 | def btn_click(): 12 | msg = messagebox.showinfo( "Entry Widget Example", "Hello " + tv1.get() + " " + tv2.get()) 13 | 14 | lbl1 = Label(window,text="First Name") 15 | txt1 = Entry(window,textvariable=tv1) 16 | lbl2 = Label(window,text="Last Name") 17 | txt2 = Entry(window,textvariable=tv2) 18 | btn = Button(window,command=btn_click, text="Click Me") 19 | 20 | lbl1.grid(row=0,column=0) 21 | txt1.grid(row=0,column=1) 22 | lbl2.grid(row=1,column=0) 23 | txt2.grid(row=1,column=1) 24 | btn.grid(row=2,column=1) 25 | 26 | window.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/frame.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | win = Tk() 4 | win.geometry("500x500") 5 | 6 | topframe = Frame(win,bg="green",bd=2,height=50,width=500,cursor="plus") 7 | bottomframe = Frame(win,bg="red",bd=2,height=50,width=500,cursor="circle") 8 | leftframe = Frame(win,bg="blue",bd=2,height=500,width=100) 9 | rightframe = Frame(win,bg="yellow",bd=2,height=500,width=400) 10 | topframe.pack(side=TOP) 11 | bottomframe.pack(side=BOTTOM) 12 | leftframe.pack(side=LEFT) 13 | rightframe.pack(side=RIGHT) 14 | 15 | Label(topframe,text="This is my frame example",font="Arial").pack() 16 | Label(bottomframe,text="About us : Program created by BCA Students").pack() 17 | Label(leftframe,text = "Home").pack(); 18 | Label(leftframe,text="Inventory").pack(side=TOP); 19 | Label(leftframe,text="Stock").pack(side=TOP); 20 | 21 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/imageonbutton.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from tkinter import PhotoImage, messagebox 3 | from tkinter import Button 4 | 5 | def btn_click(): 6 | msg = messagebox.showinfo( "Hello Python", "Welcome to python") 7 | 8 | topwindow = tk.Tk(screenName='Test', className='My First Program') 9 | 10 | btnimage = PhotoImage(file = "C:\\Users\\Mukesh\\Pictures\\forloop.png") 11 | #btnimage = btnimage.zoom(2,2) 12 | 13 | btn = Button(topwindow, text ="I am button",image=btnimage,height=100,width=100) 14 | btn.place(x= 50,y=50) 15 | topwindow.mainloop(); -------------------------------------------------------------------------------- /Sem-6/Tkinter/lableframe.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | win = Tk() 4 | win.title("Lable Frame Widget Example") 5 | win.geometry("500x500") 6 | 7 | lbl_frame = LabelFrame(win, 8 | text="Personal Information", 9 | padx=10, 10 | pady=10) 11 | lbl_frame.pack(padx=20,pady=20,fill=BOTH) 12 | 13 | btn = Button(lbl_frame,text="Do not click me") 14 | btn.pack() 15 | 16 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/listbox.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | w = Tk(); 4 | 5 | def btn_click(): 6 | curindex = lb.curselection() 7 | for i in curindex: 8 | msg = messagebox.showinfo( "Entry Widget Example", lb.get(i)) 9 | 10 | lb = Listbox(w,selectmode=MULTIPLE) 11 | lb.insert(1,'BCA') 12 | lb.insert(2,'B.Sc.IT') 13 | lb.insert(3,"PGDCA") 14 | lb.pack() 15 | 16 | btn = Button(w, text="click me", command=btn_click) 17 | btn.pack() 18 | 19 | w.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/message.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | 4 | 5 | win = Tk() 6 | win.title("Message Widget Example") 7 | win.geometry("200x200") 8 | 9 | msg = Message(win,text="This is message widget",width=300,bg="blue", 10 | fg="yellow") 11 | msg.pack() 12 | 13 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/askokcancel.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Ask yes No example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | r = messagebox.askokcancel("Confirmation","Are you sure? Exit ?") 10 | if r == True: 11 | messagebox.showinfo("Info","Pressed Ok button") 12 | else: 13 | messagebox.showinfo("Info","Pressed Cancel button") 14 | 15 | Button(win,text="Click Me",command=btn_click).pack() 16 | 17 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/askquestion.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Ask yes No example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | r = messagebox.askquestion("Confirmation","Are you sure? Exit ?",icon="warning") 10 | if r == "yes": 11 | messagebox.showinfo("Info",r) 12 | elif r == "no": 13 | messagebox.showinfo("Info","Pressed No button") 14 | 15 | Button(win,text="Click Me",command=btn_click).pack() 16 | 17 | win.mainloop() 18 | 19 | 20 | # Error 21 | # Info 22 | # Warning 23 | # Question -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/askyesno.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Ask yes No example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | r = messagebox.askyesno("Confirmation","Are you sure? Exit ?") 10 | if r == True: 11 | win.destroy() 12 | else: 13 | messagebox.showinfo("Info","You chhose not to exit") 14 | 15 | Button(win,text="Click Me",command=btn_click).pack() 16 | 17 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/askyesnocancel.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Ask yes No example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | r = messagebox.askyesnocancel("Confirmation","Are you sure? Exit ?") 10 | if r == True: 11 | messagebox.showinfo("Info","Pressed Yes Button") 12 | elif r == False: 13 | messagebox.showinfo("Info","Pressed No Button") 14 | elif r == None: 15 | messagebox.showinfo("Info","Pressed Cancel button") 16 | 17 | Button(win,text="Click Me",command=btn_click).pack() 18 | 19 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/retrycancel.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Ask yes No example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | r = messagebox.askretrycancel("Confirmation","Are you sure? Exit ?") 10 | if r == True: 11 | messagebox.showinfo("Info","Pressed Retry button") 12 | else: 13 | messagebox.showinfo("Info","Pressed Cancel button") 14 | 15 | Button(win,text="Click Me",command=btn_click).pack() 16 | 17 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/showerror.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Messagebox Example") 6 | win.geometry("200x200") 7 | 8 | def btn_click(): 9 | messagebox.showerror("Error messge","This is error message") 10 | 11 | btn = Button(win,text="Click me",command=btn_click).pack() 12 | 13 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/showinfo.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.geometry("500x500") 6 | 7 | def btn_click(): 8 | messagebox.showinfo("Messagebox Example","Hello Friends") 9 | 10 | btn = Button(win,text="Click Me",command=btn_click).pack() 11 | 12 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/messagebox/showwarning.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.geometry("200x200") 6 | win.title("Show warning example") 7 | 8 | messagebox.showwarning("warning","This is warning") 9 | 10 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/radio1.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | win = Tk() 4 | win.title("Message Widget Example") 5 | win.geometry("200x200") 6 | 7 | r_radio = StringVar() 8 | 9 | def radio_click(): 10 | txt = r_radio.get() 11 | lbl = Label(win,text=txt) 12 | lbl.pack() 13 | 14 | radio1 = Radiobutton(win,text="C Language",value=1,variable=r_radio, 15 | command=radio_click) 16 | radio2 = Radiobutton(win,text="C++",value=2,variable=r_radio, 17 | command=radio_click) 18 | radio3 = Radiobutton(win,text="Python",value=3,variable=r_radio, 19 | command=radio_click) 20 | 21 | radio1.pack() 22 | radio2.pack() 23 | radio3.pack() 24 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/scale.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | win = Tk() 4 | win.geometry("500x500") 5 | win.title("Spin Box Example") 6 | 7 | scalevar = DoubleVar() 8 | 9 | def btn_click(): 10 | messagebox.showinfo("Result",scalevar.get()) 11 | 12 | s = Scale(win,variable=scalevar,from_=-100,to=100, 13 | showvalue=1, 14 | resolution=0.2) 15 | s.pack() 16 | 17 | btn = Button(win,text="Click Me",command=btn_click) 18 | btn.pack() 19 | 20 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/scrollbar.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | win = Tk() 4 | win.title("Scrollbar Example") 5 | win.geometry("500x500") 6 | 7 | s_bar = Scrollbar(win) 8 | s_bar.pack(side=RIGHT,fill=Y) 9 | 10 | l_box = Listbox(win, yscrollcommand = s_bar.set) 11 | for i in range(100): 12 | l_box.insert(END,"List item No. : " + str(i+1)) 13 | l_box.pack(side=RIGHT,fill=BOTH) 14 | 15 | s_bar.config(command=l_box.yview) 16 | 17 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/spinbox.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | win = Tk() 4 | win.geometry("500x500") 5 | win.title("Spin Box Example") 6 | 7 | s_box = Spinbox(win,from_=11,to=20) 8 | s_box.pack() 9 | 10 | Entry(win).pack() 11 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/text.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from tkinter import messagebox 3 | 4 | win = Tk() 5 | win.title("Lable Frame Widget Example") 6 | win.geometry("500x500") 7 | 8 | def btn_cleartext(): 9 | txt.delete(2.5,3.7) 10 | # txt.delete(1.0,END) 11 | # txt.delete(2.5,END) 12 | 13 | def btn_gettext(): 14 | t = txt.get(1.0,END); 15 | messagebox.showinfo("Title",t) 16 | 17 | txt = Text(win,height=10,width=50) 18 | txt.pack() 19 | 20 | btnclear = Button(win,text="Clear Text",command=btn_cleartext) 21 | btnclear.pack() 22 | 23 | btngettext = Button(win,text="Get Text",command=btn_gettext) 24 | btngettext.pack() 25 | 26 | win.mainloop() -------------------------------------------------------------------------------- /Sem-6/Tkinter/toplevel.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | mainwin = Tk() 4 | mainwin.geometry("500x500") 5 | 6 | def btn1_click(): 7 | topwin2 = Toplevel(topwin1) 8 | topwin2.geometry("100x100") 9 | Label(topwin2,"This is top window-2").pack() 10 | Button(topwin2,text="Exit",command=topwin2.destroy).pack() 11 | topwin2.grab_set() 12 | 13 | def btn_click(): 14 | topwin1 = Toplevel() 15 | topwin1.geometry("300x300") 16 | lbl1 = Label(topwin1,text = "This is top window-1") 17 | lbl1.pack() 18 | btn1 = Button(topwin1,text="Click Me",command=btn1_click) 19 | btn1.pack() 20 | # topwin1.grab_set() 21 | 22 | lbl = Label(mainwin,text="This is main window") 23 | lbl.pack() 24 | 25 | btn = Button(mainwin,text="Show window",command=btn_click) 26 | btn.pack() 27 | mainwin.mainloop() -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BlogConfig(AppConfig): 5 | name = 'blog' 6 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-03 03:09 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Blog', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=100)), 19 | ('tagline', models.TextField()), 20 | ], 21 | options={ 22 | 'db_table': 'blog', 23 | }, 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blog/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Blog(models.Model): 5 | name = models.CharField(max_length=100) 6 | tagline = models.TextField() 7 | class Meta: 8 | db_table = "blog" 9 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path,include 3 | from . import views 4 | 5 | urlpatterns = [ 6 | path('', views.show), 7 | ] -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blog/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from blog.models import Blog 3 | # Create your views here. 4 | def show(request): 5 | # Create New Record - Method 1 6 | # b= Blog(name="Secondblog",tagline="Java") 7 | # b.save() 8 | 9 | # Create New Record - Method 2 10 | # b = Blog.objects.create(name="Third Blog", tagline="C++") 11 | 12 | # Update Record 13 | # blog = Blog.objects.get(id=1) 14 | # blog.name = "Namechanged" 15 | # blog.save() 16 | 17 | # Delete Record 18 | # blog = Blog.objects.get(id=1) 19 | # blog.delete() 20 | 21 | blogs = Blog.objects.all() 22 | 23 | # blogs = Blog.objects.filter(id=3) 24 | 25 | return render(request,'show.html',{'blogs':blogs}) -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blogexample/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blogexample/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blogexample/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blogexample/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/blogexample/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for blogexample project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogexample.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/urls.py: -------------------------------------------------------------------------------- 1 | """blogexample URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('', include('blog.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/blogexample/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for blogexample project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogexample.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/blogexample/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/blogexample/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blogexample.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/blogexample/templates/show.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | Show HTML file
11 | 12 | {% for blog in blogs %} 13 | 14 | 15 | 16 | 17 | {% endfor %} 18 |
{{ blog.name }}{{ blog.tagline }}
19 | 20 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calc/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calc/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calc/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calc/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CalcConfig(AppConfig): 5 | name = 'calc' 6 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calc/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.showcalc), 6 | path('result', views.showresult), 7 | ] -------------------------------------------------------------------------------- /Sem-6/django/calcution/calc/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | 5 | def showcalc(request): 6 | return render(request,'calc.html') 7 | 8 | def showresult(request): 9 | n1 = int(request.POST['num1']) 10 | n2 = int(request.POST['num2']) 11 | res = n1 + n2 12 | return render(request,'showresult.html',{'result':res}) -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calcution/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calcution/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calcution/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calcution/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/calcution/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for calcution project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'calcution.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/urls.py: -------------------------------------------------------------------------------- 1 | """calcution URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('',include('calc.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/calcution/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for calcution project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'calcution.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/calcution/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/calcution/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'calcution.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/templates/calc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Calculator 8 | 9 | 10 |
11 |

Welcome to Calculator App

12 | {%csrf_token%} 13 | Num 1 :
14 | Num 2 :
15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /Sem-6/django/calcution/templates/showresult.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

Wecome to result page

11 |

Result: {{result}}

12 | 13 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/crudexample/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/crudexample/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/crudexample/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/crudexample/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/crudexample/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for crudexample project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crudexample.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/urls.py: -------------------------------------------------------------------------------- 1 | """crudexample URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | urlpatterns = [ 20 | path('', include('employee.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/crudexample/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for crudexample project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crudexample.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/forms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/forms.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EmployeeConfig(AppConfig): 5 | name = 'employee' 6 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from employee.models import Employee 3 | class EmployeeForm(forms.ModelForm): 4 | class Meta: 5 | model = Employee 6 | fields = "__all__" 7 | #fields = ['eid','ename','ecity'] -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-25 03:18 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Employee', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('eid', models.CharField(max_length=20)), 19 | ('ename', models.CharField(max_length=100)), 20 | ('eemail', models.EmailField(max_length=254)), 21 | ('econtact', models.CharField(max_length=15)), 22 | ], 23 | options={ 24 | 'db_table': 'employee', 25 | }, 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/crudexample/employee/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Employee(models.Model): 5 | eid = models.CharField(max_length=20) 6 | ename = models.CharField(max_length=100) 7 | eemail = models.EmailField() 8 | econtact = models.CharField(max_length=15) 9 | class Meta: 10 | db_table = "employee" -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/static/css/style1.css: -------------------------------------------------------------------------------- 1 | body {font:12px/1.4 Verdana,Arial; background:#eee; height:100%; margin:25px 0; padding:0} 2 | h1 {font:24px Georgia,Verdana; margin:0} 3 | h2 {font-size:12px; font-weight:normal; font-style:italic; margin:0 0 20px} 4 | p {margin-top:0} 5 | ul {margin:0; padding-left:20px} 6 | 7 | #testdiv {width:600px; margin:0 auto; border:1px solid #ccc; padding:20px 25px; background:#fff} 8 | 9 | #tinybox {position:absolute; display:none; padding:10px; background:#fff url(images/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000} 10 | #tinymask {position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000; z-index:1500} 11 | #tinycontent {background:#fff} 12 | 13 | .button {font:14px Georgia,Verdana; margin-bottom:10px; padding:8px 10px 9px; border:1px solid #ccc; background:#eee; cursor:pointer} 14 | .button:hover {border:1px solid #bbb; background:#e3e3e3} -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/crudexample/employee/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from employee import views 4 | urlpatterns = [ 5 | path('emp', views.emp), 6 | path('',views.show), 7 | path('show',views.show), 8 | path('edit/', views.edit), 9 | path('update/', views.update), 10 | path('delete/', views.destroy), 11 | ] -------------------------------------------------------------------------------- /Sem-6/django/crudexample/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crudexample.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/calc/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CalcConfig(AppConfig): 5 | name = 'calc' 6 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/calc/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/calc/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/first/firstproject/firstproject/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for firstproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/urls.py: -------------------------------------------------------------------------------- 1 | """firstproject URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from . import views 19 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | 23 | ] 24 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/views.py: -------------------------------------------------------------------------------- 1 | from django.http.response import HttpResponse 2 | from django.shortcuts import render 3 | from django.http import HttpResponse 4 | def home(request): 5 | return HttpResponse("

Hello World

, Jay Swaminarayan") -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/firstproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for firstproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstproject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/first/firstproject/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'firstproject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/auth/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/auth/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/auth/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/auth/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AuthConfig(AppConfig): 5 | name = 'auth' 6 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/auth/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('',views.login), 6 | path('forgetpassword',views.forgetpassword), 7 | path('verifylogin',views.verifylogin) 8 | ] -------------------------------------------------------------------------------- /Sem-6/django/loginproj/auth/views.py: -------------------------------------------------------------------------------- 1 | from django.http.response import HttpResponse 2 | from django.shortcuts import render 3 | from django.http import HttpResponse 4 | 5 | # Create your views here. 6 | 7 | def login(request): 8 | return render(request,'login.html') 9 | 10 | def forgetpassword(request): 11 | return render(request,'forgetpassword.html') 12 | 13 | def verifylogin(request): 14 | username = request.POST['username'] 15 | password = request.POST['password'] 16 | if username == 'india' and password == 'india123': 17 | return render(request,'welcome.html') 18 | else: 19 | errormessage = "Not a valid username or password" 20 | return render(request,'login.html',{'errormessage':errormessage}) -------------------------------------------------------------------------------- /Sem-6/django/loginproj/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/loginproj/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/loginproj/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/loginproj/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/loginproj/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/loginproj/loginproj/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for loginproj project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'loginproj.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/urls.py: -------------------------------------------------------------------------------- 1 | """loginproj URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('',include('auth.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/loginproj/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for loginproj project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'loginproj.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'loginproj.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/templates/forgetpassword.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 | 4 |
5 | {% csrf_token %} 6 | 7 | 8 |
9 | {% endblock %} -------------------------------------------------------------------------------- /Sem-6/django/loginproj/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 | 4 |

Welcome

5 | 6 |
7 | {% csrf_token %} 8 | {{errormessage}} 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 | Forgot Password? 18 |
19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /Sem-6/django/loginproj/templates/welcome.html: -------------------------------------------------------------------------------- 1 | Welcome to web -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/calc/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/calc/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/calc/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/calc/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CalcConfig(AppConfig): 5 | name = 'calc' 6 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/calc/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('',views.home,name="home"), 6 | path('sum',views.calc,name="sum") 7 | ] -------------------------------------------------------------------------------- /Sem-6/django/mysite/calc/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import HttpResponse 3 | # Create your views here. 4 | 5 | def calc(request): 6 | #val1 = request. 7 | #return HttpResponse("Hello world") 8 | val1 = int(request.GET['num1']) 9 | val2 = int(request.GET['num2']) 10 | res = val1 + val2 11 | return render(request, 'result.html', {'result':res}) 12 | 13 | def home(request): 14 | #return HttpResponse("This is home page") 15 | return render(request,'home.html',{'name':'Ajay'}) -------------------------------------------------------------------------------- /Sem-6/django/mysite/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/mysite/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/mysite/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/mysite/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/mysite/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/mysite/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/mysite/mysite/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for mysite project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/urls.py: -------------------------------------------------------------------------------- 1 | """mysite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('',include('calc.urls')), 21 | path('admin/', admin.site.urls), 22 | ] -------------------------------------------------------------------------------- /Sem-6/django/mysite/mysite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mysite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SSSDIIT 8 | 9 | 10 |

Welcome to my website

11 | {% block content %} 12 | {% endblock %} 13 | 14 | -------------------------------------------------------------------------------- /Sem-6/django/mysite/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block content %} 3 |

this is my file. Welcome {{name}}

4 | 5 |
6 | Enter number 1 :
7 | Enter number 2 :
8 | 9 |
10 | {% endblock %} -------------------------------------------------------------------------------- /Sem-6/django/mysite/templates/result.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | 5 |

Result : {{result}}

6 | 7 | {% endblock %} -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studcrudexample.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/studcrudexample/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/studcrudexample/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/studcrudexample/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/studcrudexample/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/studcrudexample/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for studcrudexample project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studcrudexample.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/urls.py: -------------------------------------------------------------------------------- 1 | """studcrudexample URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('',include('student.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/studcrudexample/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for studcrudexample project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studcrudexample.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/forms.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/forms.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class StudentConfig(AppConfig): 5 | name = 'student' 6 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from student.models import Student 3 | from student.models import Stream 4 | from student.models import Book 5 | 6 | class StudentForm(forms.ModelForm): 7 | class Meta: 8 | model = Student 9 | fields = "__all__" 10 | 11 | class StreamForm(forms.ModelForm): 12 | class Meta: 13 | model = Stream 14 | fields = "__all__" 15 | 16 | class BookForm(forms.ModelForm): 17 | class Meta: 18 | model = Book 19 | fields = "__all__" -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/django/studcrudexample/student/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class Student(models.Model): 5 | studid = models.IntegerField() 6 | studename = models.CharField(max_length=20) 7 | studcity = models.CharField(max_length=50) 8 | class Meta: 9 | db_table = "stud_data" 10 | 11 | class Stream(models.Model): 12 | stream_id = models.IntegerField() 13 | stream_name = models.CharField(max_length=20) 14 | class Meta: 15 | db_table = "stream_data" 16 | 17 | class Book(models.Model): 18 | book_id = models.IntegerField() 19 | book_title = models.CharField(max_length=100) 20 | book_author = models.CharField(max_length=100) 21 | book_isbn = models.CharField(max_length=20) 22 | book_publishing_year = models.IntegerField() 23 | class Meta: 24 | db_table = "books" -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/static/css/style1.css: -------------------------------------------------------------------------------- 1 | body {font:12px/1.4 Verdana,Arial; background:#eee; height:100%; margin:25px 0; padding:0} 2 | h1 {font:24px Georgia,Verdana; margin:0} 3 | h2 {font-size:12px; font-weight:normal; font-style:italic; margin:0 0 20px} 4 | p {margin-top:0} 5 | ul {margin:0; padding-left:20px} 6 | 7 | #testdiv {width:600px; margin:0 auto; border:1px solid #ccc; padding:20px 25px; background:#fff} 8 | 9 | #tinybox {position:absolute; display:none; padding:10px; background:#fff url(images/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000} 10 | #tinymask {position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000; z-index:1500} 11 | #tinycontent {background:#fff} 12 | 13 | .button {font:14px Georgia,Verdana; margin-bottom:10px; padding:8px 10px 9px; border:1px solid #ccc; background:#eee; cursor:pointer} 14 | .button:hover {border:1px solid #bbb; background:#e3e3e3} -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/django/studcrudexample/student/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | urlpatterns = [ 4 | path('', views.show_book), 5 | path('add_book/', views.add_book), 6 | path('edit_book/', views.edit_book), 7 | path('update_book/', views.update_book), 8 | path('delete_book/', views.delete_book), 9 | ] 10 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollproj.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/pollproj/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/pollproj/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for pollproj project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollproj.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/urls.py: -------------------------------------------------------------------------------- 1 | """pollproj URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/4.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('polls', include('polls.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/pollproj/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for pollproj project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pollproj.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PollsConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'polls' 7 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoproj2122/pollproj/polls/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | class stud(models.Model): 6 | first_name = models.CharField(max_length=50) 7 | last_name = models.CharField(max_length=60) 8 | age = models.BigIntegerField() -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.login), 6 | ] -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from .models import stud 3 | # Create your views here. 4 | 5 | def login(request): 6 | s = stud(first_name="test",last_name="test1",age=50) 7 | s.save() 8 | return render(request,'show.html') -------------------------------------------------------------------------------- /Sem-6/djangoproj2122/pollproj/templates/show.html: -------------------------------------------------------------------------------- 1 | test show -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/login/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/login/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/login/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/login/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LoginConfig(AppConfig): 5 | name = 'login' 6 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/login/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.welcomesssdiit), 6 | ] -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/login/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import HttpResponse 3 | 4 | # Create your views here. 5 | 6 | def welcomesssdiit(request): 7 | return HttpResponse("Welcome to SSSDIIT") -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/myproject/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/myproject/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/myproject/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/myproject/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject/myproject/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/urls.py: -------------------------------------------------------------------------------- 1 | """myproject URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('', include('login.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject/myproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/calc/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/calc/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/calc/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/__pycache__/views.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/calc/__pycache__/views.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CalcConfig(AppConfig): 5 | name = 'calc' 6 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/calc/migrations/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | urlpatterns = [ 4 | path('',views.welcome), 5 | path('customers',views.customers) 6 | ] -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/calc/views.py: -------------------------------------------------------------------------------- 1 | from django.http.response import HttpResponse 2 | from django.shortcuts import render 3 | 4 | # Create your views here. 5 | 6 | def welcome(request): 7 | return render(request,'home.html',{'name':'Amar','school':'gurukul'}) 8 | 9 | def customers(request): 10 | return render(request,'customers.html') -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/db.sqlite3 -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject1.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/myproject1/__init__.py -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/myproject1/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/myproject1/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/myproject1/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/Sem-6/djangoprojs/myproject1/myproject1/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myproject1 project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject1.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/urls.py: -------------------------------------------------------------------------------- 1 | """myproject1 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('',include('calc.urls')), 21 | path('admin/', admin.site.urls), 22 | ] 23 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/myproject1/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myproject1 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject1.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/templates/customers.html: -------------------------------------------------------------------------------- 1 | {% extends 'index.html' %} 2 | {% block content %} 3 | This is custom customer page
4 | This is second line 5 | {% endblock %} -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'index.html' %} 2 | {% block content %} 3 |

Welcome {{name}} from {{school}}

4 | {% endblock %} -------------------------------------------------------------------------------- /Sem-6/djangoprojs/myproject1/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 |

This is header. Welcome to my webpage


11 | {% block content %} 12 | {% endblock %} 13 |

This is footer.


14 | 15 | -------------------------------------------------------------------------------- /Sem-6/numpy/2darray.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([[1,2,3],[4,5,6],[7,8,9]]) 4 | 5 | for i in range(3): 6 | for j in range(3): 7 | print("Value for element number ", i,j, " is ", arr[i,j]) -------------------------------------------------------------------------------- /Sem-6/numpy/bitwiseand.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = 15 4 | b = 14 5 | 6 | print("binary representation of a:",bin(a)) 7 | print("binary representation of b:",bin(b)) 8 | c = np.bitwise_and(a,b) 9 | print("binary representation of c:",bin(c)) 10 | print("Bitwise-and of a and b: ",c) -------------------------------------------------------------------------------- /Sem-6/numpy/bitwiseinvert.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([15],dtype = np.uint8) 4 | print("Binary representation:",np.binary_repr(arr[0],8)) 5 | 6 | ans = np.invert(arr[0]) 7 | print(ans) 8 | 9 | print("Binary representation: ", np.binary_repr(ans,8)) -------------------------------------------------------------------------------- /Sem-6/numpy/bitwiseleftshift.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = 78 4 | 5 | ans = np.left_shift(a,1) 6 | 7 | print("Value of a : ",a) 8 | print("Binary representation of 'a' in 8 bits",np.binary_repr(a, 8)) 9 | print("Value of ans : ",ans) 10 | print("Binary representation of 'ans' in 8 bits",np.binary_repr(ans,8)) -------------------------------------------------------------------------------- /Sem-6/numpy/bitwiseor.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = 10 4 | 5 | print("binary representation of a:",bin(a)) 6 | b = np.invert(a) 7 | print("binary representation of c:",bin(b)) 8 | print("Bitwise-and of a and b: ",b) -------------------------------------------------------------------------------- /Sem-6/numpy/bitwiserightshift.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = 10 4 | 5 | ans = np.right_shift(a,1) 6 | 7 | print("Value of a : ",a) 8 | print("Binary representation of 'a' in 8 bits",np.binary_repr(a, 8)) 9 | print("Value of ans : ",ans) 10 | print("Binary representation of 'ans' in 8 bits",np.binary_repr(ans,8)) -------------------------------------------------------------------------------- /Sem-6/numpy/copy.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | oldarr = np.array([1,2,3,4,5,6,7,8,9,10]) 4 | print(oldarr) 5 | 6 | newarr = oldarr.copy() 7 | print(newarr) 8 | 9 | oldarr[1] = 100 10 | newarr[7] = 700 11 | print(oldarr) 12 | print(newarr) -------------------------------------------------------------------------------- /Sem-6/numpy/datatype.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0,1,30,True,50,70,80,90,100],dtype='b') 4 | 5 | print(arr) 6 | print(arr.dtype) 7 | 8 | newarr = arr.astype('f') 9 | 10 | print(newarr) 11 | print(newarr.dtype) -------------------------------------------------------------------------------- /Sem-6/numpy/differentdimension.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | zero_d_arr = np.array(10) 4 | print(zero_d_arr) 5 | print(zero_d_arr.ndim) 6 | print(zero_d_arr) 7 | 8 | one_d_arr = np.array([10,20,30,40]) 9 | print(one_d_arr) 10 | print(one_d_arr.ndim) 11 | print(one_d_arr[0]) 12 | 13 | two_d_arr = np.array([[10,20,30],[40,50,60]]) 14 | print(two_d_arr) 15 | print(two_d_arr.ndim) 16 | print(two_d_arr[0,0]) 17 | 18 | three_d_arr = np.array([[[10,20,30],[40,50,60]]]) 19 | print(three_d_arr) 20 | print(three_d_arr.ndim) 21 | print(three_d_arr[0,0,0]) 22 | 23 | four_d_arr = np.array([10,20],ndmin=4) 24 | print(four_d_arr) 25 | print(four_d_arr[0,0,0,0]) -------------------------------------------------------------------------------- /Sem-6/numpy/first.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | arr = np.array([1,2,3,4,5]) 3 | print(arr) 4 | print(arr[0]) 5 | for i in arr: 6 | print(i) 7 | 8 | print ("Numpy Version : ") 9 | print(np.__version__) 10 | print(type(arr)) -------------------------------------------------------------------------------- /Sem-6/numpy/jaggedarray.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([[10,1,30,40],[50,80,90],[50,70,80,90]]) 4 | print(arr.shape) 5 | print(arr[0][0]) -------------------------------------------------------------------------------- /Sem-6/numpy/joiningarray.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # arr1 = np.array([1, 2, 3]) 4 | # arr2 = np.array([4, 5, 6]) 5 | # arr = np.concatenate((arr1, arr2)) 6 | # print(arr) 7 | 8 | # arr1 = np.array([[1, 2], [3, 4]]) 9 | # arr2 = np.array([[5, 6], [7, 8]]) 10 | # arr = np.concatenate((arr1, arr2), axis=0) 11 | # print(arr) 12 | 13 | # arr1 = np.array([1, 2, 3]) 14 | # arr2 = np.array([4, 5, 6]) 15 | # arr = np.stack((arr1, arr2), axis=1) 16 | # print(arr) 17 | 18 | a = np.array([[1,2,3]]) 19 | b = np.array([[4,5,6]]) 20 | print("Arrays vertically concatenated\n",np.vstack((a,b))); 21 | print("Arrays horizontally concatenated\n",np.hstack((a,b))) -------------------------------------------------------------------------------- /Sem-6/numpy/linspace.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a=np.linspace(1,12,6) 3 | #prints 10 values which are evenly spaced over the given interval 5-15 4 | print(a) -------------------------------------------------------------------------------- /Sem-6/numpy/matrix-arithmatic.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.array([[1,2,3],[4,5,6],[7,8,9]]) 3 | b = np.array([[1,2,3],[4,5,6],[7,8,9]]) 4 | print(a) 5 | print(b) 6 | print("Sum of array a and b\n",a+b) 7 | print("Product of array a and b\n",a*b) 8 | print("Division of array a and b\n",a/b) -------------------------------------------------------------------------------- /Sem-6/numpy/matrix.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import numpy.matlib 3 | 4 | # mat = numpy.matlib.empty((4,3)) 5 | # mat = numpy.matlib.zeros((4,3)) 6 | # mat = numpy.matlib.ones((4,3)) 7 | # mat = numpy.matlib.eye(n = 5, M = 10, k =4, dtype = int) 8 | # mat = numpy.matlib.identity(3, dtype = int) 9 | mat = numpy.matlib.rand(3,3,dtype=int) 10 | print(mat) -------------------------------------------------------------------------------- /Sem-6/numpy/matrixmultiply.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | array1=np.array([[1,2,3],[4,5,6],[7,8,9]],ndmin=3) 3 | array2=np.array([[1,2,3],[4,5,6],[7,8,9]],ndmin=3) 4 | # result=np.multiply(array1,array2) 5 | result=np.matmul(array1,array2) 6 | print(result) -------------------------------------------------------------------------------- /Sem-6/numpy/min-max-sum.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | # a = np.array([1,2,3,10,15,4]) 3 | # print("The array:",a) 4 | # print("The maximum element:",a.max()) 5 | # print("The minimum element:",a.min()) 6 | # print("The sum of the elements:",a.sum()) 7 | 8 | import numpy as np 9 | a = np.array([[1,2,30],[10,15,4]]) 10 | print("The array:",a) 11 | print("The maximum elements of columns:",a.max(axis = 0)) 12 | print("The minimum element of rows",a.min(axis = 1)) 13 | print("The sum of all rows",a.sum(axis = 1)) 14 | print("The sum of all rows",a.sum(axis = 0)) -------------------------------------------------------------------------------- /Sem-6/numpy/negativeindex.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([10,20,30,40,50]) 4 | 5 | print(arr[-4]) 6 | -------------------------------------------------------------------------------- /Sem-6/numpy/reshape.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | # Reshape returns View, not the copy. 3 | arr = np.array([1,2,3,4,5,6,7,8,9]) 4 | newarr = arr.reshape(3,3) 5 | print(newarr) 6 | print(newarr.shape) 7 | print(newarr.base) 8 | print(arr) 9 | print(newarr) 10 | 11 | 12 | arr[2] = 33 13 | print(arr) 14 | print(newarr) 15 | 16 | # arr1 = np.array([[1,2,3],[4,5,6]]) 17 | # newarr1 = arr1.reshape(6) 18 | # print(newarr1) 19 | 20 | -------------------------------------------------------------------------------- /Sem-6/numpy/shape.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([[10,1,30,40],[50,60,80,90],[50,70,80,90]]) 4 | print(arr.shape) -------------------------------------------------------------------------------- /Sem-6/numpy/size.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr1 = np.array([[1, 2, 3],[4,5,6]]) 4 | print(arr1.size) 5 | print(arr1.shape) -------------------------------------------------------------------------------- /Sem-6/numpy/slicing.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([10,20,30,40,50,60,70,80,90,100]) 4 | 5 | print(arr[2:9:2]) 6 | print(arr[:5]) 7 | print(arr[5:]) 8 | print(arr[-3:-1]) 9 | 10 | arr1 = np.array([[10,20,30,40,50],[60,70,80,90,100],[160,170,180,190,200]]) 11 | 12 | print(arr1[1:3,1:4]) -------------------------------------------------------------------------------- /Sem-6/numpy/sqrt-std.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.array([[1,4,9],[16,25,36]]) 3 | print(np.sqrt(a)) 4 | print(np.std(a)) -------------------------------------------------------------------------------- /Sem-6/numpy/unknowndimension-reshape.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # unknown dimension 4 | # can only specify one unknown dimension 5 | 6 | arr = np.array([1,2,3,4,5,6,7,8,9,10,11,12]) 7 | newarr = arr.reshape(4,-1) 8 | print(newarr.shape) 9 | 10 | newarr1 = arr.reshape(-1,2) 11 | print(newarr1.shape) 12 | 13 | newarr2 = arr.reshape(-1) 14 | print(newarr2.shape) 15 | 16 | # Note: There are a lot of functions for changing 17 | # the shapes of arrays in numpy flatten, ravel 18 | # and also for rearranging the elements rot90, 19 | # flip, fliplr, flipud etc. -------------------------------------------------------------------------------- /Sem-6/numpy/userdefineddatatype.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | student = np.dtype([('name','S20'), ('age', 'i1'), ('marks', 'f4'), ('bdate','S20')]) 3 | a = np.array([('abc', 21, 50,"aaa"),('xyz', 18, 75,"bbbb")], dtype = student) 4 | print(a) -------------------------------------------------------------------------------- /Sem-6/numpy/view.py: -------------------------------------------------------------------------------- 1 | # import numpy as np 2 | 3 | # oldarr = np.array([1,2,3,4,5,6,7,8,9,10]) 4 | # print(oldarr) 5 | 6 | # newarr = oldarr.view() 7 | # print(newarr) 8 | 9 | # oldarr[1] = 100 10 | # newarr[7] = 700 11 | # print(oldarr) 12 | # print(newarr) 13 | 14 | 15 | import numpy as np 16 | 17 | a = np.array([[1,2,3,4],[9,0,2,3],[1,2,3,19]]) 18 | print("Original Array:\n",a) 19 | print("\nID of array a:",id(a)) 20 | 21 | b = a.view() 22 | print("\nID of b:",id(b)) 23 | 24 | print("\nprinting the view b") 25 | print(b) 26 | 27 | b.shape = 4,3; 28 | a[0,0] = 100 29 | 30 | print("\nChanges made to the view b do not reflect a") 31 | print("\nOriginal array \n",a) 32 | print("\nview\n",b) -------------------------------------------------------------------------------- /django_project/salesproj/customer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__init__.py -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /django_project/salesproj/customer/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CustomerConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'customer' 7 | -------------------------------------------------------------------------------- /django_project/salesproj/customer/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.0.2 on 2022-03-11 03:15 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='customer', 16 | fields=[ 17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('cust_name', models.CharField(max_length=30)), 19 | ('cust_city', models.CharField(max_length=40)), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /django_project/salesproj/customer/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/migrations/__init__.py -------------------------------------------------------------------------------- /django_project/salesproj/customer/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/customer/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/customer/models.py: -------------------------------------------------------------------------------- 1 | from pyexpat import model 2 | from django.db import models 3 | 4 | # Create your models here. 5 | 6 | class customer(models.Model): 7 | cust_name = models.CharField(max_length=30) 8 | cust_city = models.CharField(max_length=40) -------------------------------------------------------------------------------- /django_project/salesproj/customer/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /django_project/salesproj/customer/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | urlpatterns = [ 5 | path('show/', views.showcustomers), 6 | path('update/', views.updatecustomer,name='updatecustomer'), 7 | ] -------------------------------------------------------------------------------- /django_project/salesproj/customer/views.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | from django.shortcuts import render 3 | from .models import customer 4 | # Create your views here. 5 | 6 | def showcustomers(request): 7 | customers = customer.objects.all() 8 | return render(request,'showcustomer.html',{"cust":customers}) 9 | 10 | def updatecustomer(request): 11 | cust_id = request.GET['cid'] 12 | r = customer.objects.get(id=cust_id) 13 | return render(request,'updatecustomer.html',{"cust":r}) -------------------------------------------------------------------------------- /django_project/salesproj/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/db.sqlite3 -------------------------------------------------------------------------------- /django_project/salesproj/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'salesproj.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/salesproj/__init__.py -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/salesproj/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/salesproj/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/salesproj/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/salesproj/salesproj/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for salesproj project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'salesproj.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/urls.py: -------------------------------------------------------------------------------- 1 | """salesproj URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/4.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | path('customer/', include('customer.urls')), 22 | ] 23 | -------------------------------------------------------------------------------- /django_project/salesproj/salesproj/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for salesproj project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'salesproj.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /django_project/salesproj/templates/showcustomer.html: -------------------------------------------------------------------------------- 1 | {% for customer in cust %} 2 | {{ customer.id }} - {{ customer.cust_name }} - {{ customer.cust_city }}
3 | {% endfor %} -------------------------------------------------------------------------------- /django_project/salesproj/templates/updatecustomer.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
5 |
7 | 8 |
9 | -------------------------------------------------------------------------------- /django_project/studproj.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj.zip -------------------------------------------------------------------------------- /django_project/studproj/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/db.sqlite3 -------------------------------------------------------------------------------- /django_project/studproj/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studproj.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /django_project/studproj/studapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__init__.py -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /django_project/studproj/studapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class StudappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'studapp' 7 | -------------------------------------------------------------------------------- /django_project/studproj/studapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/migrations/__init__.py -------------------------------------------------------------------------------- /django_project/studproj/studapp/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studapp/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | class stud(models.Model): 6 | first_name = models.CharField(max_length=50) 7 | last_name = models.CharField(max_length=60) 8 | age = models.IntegerField() -------------------------------------------------------------------------------- /django_project/studproj/studapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /django_project/studproj/studapp/urls.py: -------------------------------------------------------------------------------- 1 | from unicodedata import name 2 | from django.contrib import admin 3 | from django.urls import path,include 4 | from . import views 5 | 6 | urlpatterns = [ 7 | path('show', views.show,name="show"), 8 | path('add', views.add,name="add"), 9 | path('update', views.update,name="update"), 10 | path('delete/', views.delete,name="delete"), 11 | ] -------------------------------------------------------------------------------- /django_project/studproj/studproj/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studproj/__init__.py -------------------------------------------------------------------------------- /django_project/studproj/studproj/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studproj/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studproj/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studproj/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studproj/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studproj/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studproj/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/studproj/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/studproj/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for studproj project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studproj.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /django_project/studproj/studproj/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for studproj project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studproj.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /django_project/studproj/templates/add.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Add Student 8 | 9 | 10 |
11 | {% csrf_token %} 12 |
14 |
16 |
18 |
19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /django_project/studproj/templates/delete.html: -------------------------------------------------------------------------------- 1 | Id to be deleted : {{ studid }} -------------------------------------------------------------------------------- /django_project/studproj/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Login 8 | 9 | 10 |
11 | {% csrf_token %} 12 | {{ invaliduser }}
13 |
15 |
17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /django_project/studproj/templates/register.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Login 8 | 9 | 10 |
11 | {% csrf_token %} 12 |

Register User

13 | {{ invaliduser }}
14 |
16 |
18 |
20 |
21 |
22 | 23 | -------------------------------------------------------------------------------- /django_project/studproj/userapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__init__.py -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /django_project/studproj/userapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'userapp' 7 | -------------------------------------------------------------------------------- /django_project/studproj/userapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/migrations/__init__.py -------------------------------------------------------------------------------- /django_project/studproj/userapp/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mukesh-SSSDIIT/python_repo/a6ffe9dfee0e6f37025b62a90e011caf21e3bb5e/django_project/studproj/userapp/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /django_project/studproj/userapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | class users(models.Model): 6 | username = models.CharField(max_length=50) 7 | password = models.CharField(max_length=50) -------------------------------------------------------------------------------- /django_project/studproj/userapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /django_project/studproj/userapp/urls.py: -------------------------------------------------------------------------------- 1 | from unicodedata import name 2 | from django.contrib import admin 3 | from django.urls import path,include 4 | from . import views 5 | 6 | urlpatterns = [ 7 | path('login', views.login,name="login"), 8 | path('logout', views.logout,name="logout"), 9 | path('register', views.register,name="register"), 10 | ] --------------------------------------------------------------------------------