Skip to content

Commit 54e9d56

Browse files
committed
hello
1 parent 8a944c2 commit 54e9d56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+491
-8
lines changed

.vscode/extensions.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"formulahendry.code-runner"
4+
]
5+
}

.vscode/launch.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{"name":"Python: Current File","type":"python","request":"launch","program":"${file}","console":"integratedTerminal"}
8+
]
9+
}

.vscode/settings.json

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
{
22
"compile-hero.disable-compile-files-on-did-save-code": false,
33
"cSpell.words": [
4-
"Scrrenshot",
54
"asarray",
5+
"jaspr",
66
"mohan",
77
"noops",
88
"numpy",
9+
"openpyxl",
10+
"println",
911
"pubg",
1012
"pyautogui",
11-
"sohan"
13+
"Scrrenshot",
14+
"sohan",
15+
"tkintertable"
1216
],
1317
"cSpell.enableFiletypes": [
1418
"jupyter",
1519
"r",
1620
"ruby",
1721
"search-result",
1822
"sql"
19-
]
23+
],
24+
"code-runner.clearPreviousOutput": true,
25+
"code-runner.saveAllFilesBeforeRun": true,
26+
"code-runner.saveFileBeforeRun": true,
27+
"code-runner.runInTerminal": true,
28+
"terminal.integrated.automationShell.windows": "",
29+
"terminal.integrated.profiles.windows": {
30+
31+
"PowerShell": {
32+
"source": "PowerShell",
33+
"icon": "terminal-powershell"
34+
},
35+
"Command Prompt": {
36+
"path": [
37+
"${env:windir}\\Sysnative\\cmd.exe",
38+
"${env:windir}\\System32\\cmd.exe"
39+
],
40+
"args": [],
41+
"icon": "terminal-cmd"
42+
},
43+
"Git Bash": {
44+
"source": "Git Bash"
45+
}
46+
}
2047
}

String encryption.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def encrypt(sttr,enkey):
2+
return enkey.join(sttr)
3+
def decrypt(sttr,enkey):
4+
return enkey.split(sttr)
5+
6+
# __main__
7+
mainString = input("Enter the main string : ")
8+
encryptStr = input("Enter the encryption key : ")
9+
enStr = encrypt(mainString, encryptStr)
10+
delst = decrypt(enStr,encryptStr)
11+
destr ="".join(delst)
12+
print("The encrypted String is : ",enStr)
13+
print("String after decryption is : ",destr)
283 Bytes
Binary file not shown.
327 Bytes
Binary file not shown.

abc.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
hey ! my name is jaspreet.
2+
jaspreetjaspreet singh
3+
jaspreet singh
4+
jaspreet
5+
6+
teerpsaj
7+
hgnis teerpsaj
8+
hgnis teerpsajteerpsaj
9+
.teerpsaj si eman ym ! yeh

arrat.py

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
list = ['mohan','rohan','sohan',1]
2-
print(list[0],list[1],list)
2+
print(list[0],list[1],list[0][4])
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+

array.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
l = ['list' , 'of' , '']
2+
# sum of two array is ar[]= i+j;

clock.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def add(i):
2+
if(i*3%2==0):
3+
i*=i
4+
else:
5+
i*=4
6+
return i
7+
a=add(10)
8+
print(a)
9+
10+
11+
12+
def Fun1():
13+
print('Python, let\’s fun with functions')
14+
Fun1()
15+

dates - Copy.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import calendar
2+
3+
calendar = {january, february, march, april, may, june, july, august, september, october, november,}

dates.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import calendar
2+
3+
calendar = ['january', 'february','march','april','may','june','july','august','september','october','november','december']
4+
a=int(input("ENTER THE NUMBER"))
5+
print(a)

excel_file_projects.xls

11 KB
Binary file not shown.

file handling.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
f1 = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
2+
st = input("enter the text = ")
3+
f1.write(st)
4+
f1.write("\n")
5+
f1.close()

filehandling10.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# wap which input 5 records in a file mmm.csv .
2+
3+
import csv
4+
5+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\mmm.csv",'a')
6+
wr = csv.writer(file)
7+
n = int(input('ENTER THE LIMIT : '))
8+
for i in range(1,n+1,1):
9+
print("Enter the record:",i)
10+
rollno = int(input('enter rollno:'))
11+
name = input("enter name:")
12+
marks = int(input('enter the marks:'))
13+
wr.writerow([rollno,name,marks])
14+
file.close()
15+

filehandling11.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import csv
2+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\mmm.csv",'a')

filehandling12.py

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
import pandas as pd
2+
from tkinter import *
3+
from tkinter import filedialog
4+
from tkinter import messagebox as msg
5+
from pandastable import Table
6+
import openpyxl
7+
8+
9+
class csv_to_excel:
10+
11+
def __init__(self, root):
12+
13+
self.root = root
14+
self.file_name = ''
15+
self.f = Frame(self.root,
16+
height = 200,
17+
width = 300)
18+
19+
# Place the frame on root window
20+
self.f.pack()
21+
22+
# Creating label widgets
23+
self.message_label = Label(self.f,
24+
text = 'FILE CONVERTER',
25+
font = ('Arial', 19,'underline'),
26+
fg = 'Green')
27+
self.message_label2 = Label(self.f,
28+
text = 'Converter of CSV to any file',
29+
font = ('Arial', 14,'underline'),
30+
fg = 'Red')
31+
32+
# Buttons
33+
self.convert_button = Button(self.f,
34+
text = 'Convert',
35+
font = ('Arial', 14),
36+
bg = 'Orange',
37+
fg = 'Black',
38+
command = self.convert_csv_to_xls)
39+
self.display_button = Button(self.f,
40+
text = 'Display',
41+
font = ('Arial', 14),
42+
bg = 'Green',
43+
fg = 'Black',
44+
command = self.display_xls_file)
45+
self.exit_button = Button(self.f,
46+
text = 'Exit',
47+
font = ('Arial', 14),
48+
bg = 'Red',
49+
fg = 'Black',
50+
command = root.destroy)
51+
52+
# Placing the widgets using grid manager
53+
self.message_label.grid(row = 1, column = 1)
54+
self.message_label2.grid(row = 2, column = 1)
55+
self.convert_button.grid(row = 3, column = 0,
56+
padx = 0, pady = 15)
57+
self.display_button.grid(row = 3, column = 1,
58+
padx = 10, pady = 15)
59+
self.exit_button.grid(row = 3, column = 2,
60+
padx = 10, pady = 15)
61+
62+
def convert_csv_to_xls(self):
63+
try:
64+
self.file_name = filedialog.askopenfilename(initialdir = '/Desktop',
65+
title = 'Select a CSV file',
66+
filetypes = (('csv file','*.csv'),
67+
('csv file','*.csv')))
68+
69+
df = pd.read_csv(self.file_name)
70+
71+
# Next - Pandas DF to Excel file on disk
72+
if(len(df) == 0):
73+
msg.showinfo('No Rows Selected', 'CSV has no rows')
74+
else:
75+
76+
# saves in the current directory
77+
with pd.ExcelWriter('excel_file_projects.xls') as writer:
78+
df.to_excel(writer,'GFGSheet')
79+
writer.save()
80+
msg.showinfo('Excel file created', 'Excel File created')
81+
82+
except FileNotFoundError as e:
83+
msg.showerror('Error in opening file', e)
84+
85+
def display_xls_file(self):
86+
try:
87+
self.file_name = filedialog.askopenfilename(initialdir = '/Desktop',
88+
title = 'Select a excel file',
89+
filetypes = (('excel file','*.xls'),
90+
('excel file','*.xls')))
91+
df = pd.read_excel(self.file_name)
92+
93+
if (len(df)== 0):
94+
msg.showinfo('No records', 'No records')
95+
else:
96+
pass
97+
98+
# Now display the DF in 'Table' object
99+
# under'pandastable' module
100+
self.f2 = Frame(self.root, height=200, width=300)
101+
self.f2.pack(fill=BOTH,expand=1)
102+
self.table = Table(self.f2, dataframe=df,read_only=True)
103+
self.table.show()
104+
105+
except FileNotFoundError as e:
106+
print(e)
107+
msg.showerror('Error in opening file',e)
108+
109+
# Driver Code
110+
root = Tk()
111+
root.title('---Convert CSV to any File----')
112+
113+
obj = csv_to_excel(root)
114+
root.geometry('800x600')
115+
root.mainloop()

filehandling2.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
f=open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'r')
2+
str = f.read()
3+
print(str)
4+
f.close()

filehandling3.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
f = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'r')
2+
str = f.read(6)
3+
print(str)
4+
f.close()
5+

filehandling4..py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
f = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'r')
2+
str = f.read()
3+
l=len(str)
4+
print("Length of the String =",l)

filehandling5.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
2+
str = input("Enter the text to send it to the file = ")
3+
st = file.write(str)
4+
print("The statemwnt contains",st,"character")
5+
file.write("\n")
6+
file.close()

filehandling6.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fr = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
2+
c = input("Enter the numbers : ")
3+
st=fr.write(c)
4+
print("The statement is : ",st)
5+
fr.write("\n")
6+
fr.close()

filehandling7.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
""" In this Python program the content in the file will get
2+
stored in another file in reverse order . """
3+
4+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
5+
6+
with open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'r') as myfile:
7+
data = myfile.read()
8+
9+
data_1 = data[::-1]
10+
11+
file.write(data_1)
12+
13+
file.close()

filehandling8.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
2+
3+
with open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'r') as myfile:
4+
data = myfile.readlines()
5+
6+
data_1 = data[::-1]
7+
8+
file.writelines(data_1)
9+
10+
file.close()

filehandling9.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
file = open("C:\\Users\\jaspr\\OneDrive\\Desktop\\python in vs code\\abc.txt",'a')
2+
3+
with open("abc.txt",'r') as myfile:
4+
data = myfile.readlines()
5+
6+
data_2 = data[::-1]
7+
""" Now we will just write the fully reverse
8+
list in the output2 file using following command """
9+
f2.writelines(data_2)
10+
11+
f2.close()

if elif.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
day=int(input('ENTER THE NO. OF DAYS FROM (1-7) '))
2+
if day==1:
3+
print("monday")
4+
elif day==2:
5+
print('tuesday')
6+
elif day==3:
7+
print('wednesday')
8+
elif day==4:
9+
print('thursday')
10+
elif day==5:
11+
print('friday')
12+
elif day==6:
13+
print('saturday')
14+
elif day==7:
15+
print('sunday')
16+
else:
17+
print('not a day')

kickstart.py

Whitespace-only changes.

0 commit comments

Comments
 (0)