├── 1day.py ├── 2day.py ├── 3day.py ├── 4day.py ├── 5day.py ├── 6day.py ├── 7day.py ├── Screenshot from 2025-05-20 23-40-44.png ├── app.py ├── index.html ├── json save data.py └── sever.js /1day.py: -------------------------------------------------------------------------------- 1 | print("hello Python") 2 | print("hello world") 3 | print(101) 4 | print("10183") 5 | # the comments 6 | '''Hello comments''' 7 | -------------------------------------------------------------------------------- /2day.py: -------------------------------------------------------------------------------- 1 | # verelave learning 2 | name = "Nahid HK" 3 | myname = " data load function!" 4 | print(myname) 5 | print (name) -------------------------------------------------------------------------------- /3day.py: -------------------------------------------------------------------------------- 1 | # data type py 2 | 3 | nahid = 2229 4 | dayg = 192929j 5 | 6 | print(type(dayg)) 7 | print(nahid) 8 | print(type(nahid)) -------------------------------------------------------------------------------- /4day.py: -------------------------------------------------------------------------------- 1 | # 2nd veryavle 2 | YourName = "Nahid" 3 | MyName = "Hossen" 4 | print("My Name Is " + ' ' + YourName + "_" + MyName) -------------------------------------------------------------------------------- /5day.py: -------------------------------------------------------------------------------- 1 | # bool data type 2 | Bool = True 3 | nahid = False 4 | print(Bool) 5 | print(type(Bool)) 6 | print(nahid) 7 | x = 8 8 | y = 10 9 | print (x>y) 10 | print (x 20 | 21 | 22 | 23 | 24 | Create File 25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 36 | ''' 37 | 38 | if __name__ == '__main__': 39 | app.run(debug=True) 40 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Form 7 | 8 | 9 |
10 | 11 | 12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /json save data.py: -------------------------------------------------------------------------------- 1 | # from http.server import BaseHTTPRequestHandler, HTTPServer 2 | # import json 3 | 4 | # class RequestHandler(BaseHTTPRequestHandler): 5 | # def _set_headers(self, status=200): 6 | # self.send_response(status) 7 | # self.send_header('Content-type', 'text/plain') 8 | # self.end_headers() 9 | 10 | # def do_POST(self): 11 | # content_length = int(self.headers['Content-Length']) 12 | # post_data = self.rfile.read(content_length) 13 | # data = json.loads(post_data) 14 | 15 | # with open('data.json', 'w') as f: 16 | # json.dump(data, f) 17 | 18 | # self._set_headers() 19 | # self.wfile.write("Data saved successfully".encode('utf-8')) 20 | 21 | # def run(server_class=HTTPServer, handler_class=RequestHandler, port=3000): 22 | # server_address = ('', port) 23 | # httpd = server_class(server_address, handler_class) 24 | # print(f'Server is running on port {port}') 25 | # httpd.serve_forever() 26 | 27 | # if __name__ == '__main__': 28 | # run() 29 | -------------------------------------------------------------------------------- /sever.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const http = require('http'); 3 | const qs = require('querystring'); 4 | 5 | const server = http.createServer((req, res) => { 6 | if (req.method === 'POST') { 7 | let body = ''; 8 | req.on('data', chunk => { 9 | body += chunk.toString(); 10 | }); 11 | req.on('end', () => { 12 | const formData = qs.parse(body); 13 | const jsonData = JSON.stringify(formData); 14 | 15 | fs.writeFile('data.json', jsonData, 'utf8', (err) => { 16 | if (err) { 17 | console.error(err); 18 | res.writeHead(500, {'Content-Type': 'text/plain'}); 19 | res.end('Internal Server Error'); 20 | return; 21 | } 22 | console.log('Data saved successfully'); 23 | res.writeHead(200, {'Content-Type': 'text/plain'}); 24 | res.end('Data saved successfully'); 25 | }); 26 | }); 27 | } else { 28 | res.writeHead(405, {'Content-Type': 'text/plain'}); 29 | res.end('Method Not Allowed'); 30 | } 31 | }); 32 | 33 | const PORT = process.env.PORT || 3000; 34 | server.listen(PORT, () => { 35 | console.log(`Server is running on port ${PORT}`); 36 | }); 37 | --------------------------------------------------------------------------------