from tkinter import * import time root = Tk() root.title("Testing System") root.geometry("900x600") def main(): def tick(): time_str1= time.strftime("%H:%M:%S") clock.config(text = "Current Time:\n" + time_str1) clock.after(200, tick) def date(): date_str1 = time.strftime("%A, %d %B %Y") date2.config(text = date_str1) date2.after(200, tick) frame = Frame(root) clock = Label(frame, font = ("times", 14, "bold"), bg = "light pink") clock.place(x = 260, y = 60) tick() date2 = Label(frame, font = ("times", 13, "bold")) date2.place(x = 40, y = 560) date() button1 = Button(frame,text = "Test", height = 2, width = 10, command = frame.destroy and menu) button1.pack() button1.place(x = 370, y = 150) def …

Member Avatar
+0 forum 0

Machine learning is the science of getting computers to act without being explicitly programmed. machine learning has given us self-driving cars, practical speech recognition, effective web search, and a vastly improved understanding of the human genome. It is so pervasive today that you probably use it dozens of times a day without knowing it.

Member Avatar
+0 forum 0

**Dear** I have the hyperspectral image --- how to preprocess data need time Traditional CNN cannot be applied to project directly --- it needs a lot of time to test (may be take 3 months) Need to do many experiments to get good result --- especially when compared to other existed methods (own contribution) May I know** how to simplify **my experimentation and research --- and I am using Spyder Python 3.7 with Winsdows 10 *Here I would like to apply the CNN and DNN for computing and later will compare that both of them which one is better or …

Member Avatar
+0 forum 0

I was solving a problem related to the scheduling. The problem statement is as below:- We want to keep a three months workshop in the university in which all the students of the university will participate. All the students will be trained by the lecturers of their own university for two days in a month for a subject of his choice. And similarly he would get the training in the other two months for the other two subjects and all the students will study the three subjects in the complete three months workshop. The students needs to be divided into …

Member Avatar
+0 forum 0

As I continue my conversion from vbScript to Python I am finding the gotchas. For example... A lot of my utility scripts take a file name or a file pattern as a parameter. My script, bitrate.vbs, for example allows me to invoke it as bitrate file bitrate pattern Technically file and pattern are identical since specifying a file is really just specifying a pattern that matches up to one file. To get file listings in vbScript I would just spawn a dos `dir` command and grab the output from stdout. In Python, however, they provide what I thought was a …

Member Avatar
+2 forum 0

Hi, I have to monitor outlook and trigger one code when ever new mail comes. Please help me.

Member Avatar
+0 forum 0

Can someone explain me how can i check if an answer is right from question in files with python. In my files there are questions with three answers and among them one is the right one and the others are wrong. Users have to click on button to answer. Please help me.

Member Avatar
+0 forum 0

![Untitled.png](/attachments/large/4/b37cb01c4fe2e908e745a6af2e4a7975.png) hello i am currently working on a python program that remote controlls multiple computers at once, as if they were multiple screens of one computer. one of the features of this program, is that the server controlling all computers, builds a map from screens, and including its own - server screen. But when the server controlls its own screen, a recurtion effect starts, because it takes screenshots of the screenshots it show on the screen, and so on.. Here's the rough code of the screen capture i use (With PIL) def capture_screen(self): screen_contents = ImageGrab.grab() size = win_width, win_height …

Member Avatar
+0 forum 0

Hello, so im making an os in pydroid 3, but i cant make a clock, im trying to make a graphical os but i cant cause i need a clock, Any idea? And i edited someones code for username and password to work, but i had to delete raw_data or the program wont work, like, i enter a username and a password and it says wrong username/password entered, any help?

Member Avatar
+1 forum 0

I have to write a python program that get a keyboad number and verfiy using the def function. Help n = int(input("Write a number") def countdown(n): if n >= 0: print('Blast off! Zero down') else: print(n) countup(n+1) countdown(3)

Member Avatar
+0 forum 0

I tried achieving using list index position but that's not the good way of coding, as we will never know which position is the column located. Honestly, I tried to come how to achieve in python in getting correct values for each column but in vain Need help in python how to get value for each ![Screen_Shot_2019-04-02_at_9_28_20_PM.png](/attachments/large/4/c360b7f4bd678f42dffcd650aabc62ba.png) Expected output as ![Screen_Shot_2019-04-02_at_9_34_44_PM.png](/attachments/large/4/62a05994baf66cc0f0e98e23f06a9cd1.png)

Member Avatar
+0 forum 0

Hiya, looking for some help on this bit of code: def save(x,y,z): user=x yourinventory=y score=z allinvent=[] allscore=[] with open("Inventory.txt","r+")as inventory: for line in inventory: allinvent.append(line.strip().split(',')) allinvent.append("\n") for line in allinvent: if (line[0]==yourinventory): allinvent.append(yourinventory) allinvent.pop(line[0:8]) print(allinvent) break inventory.append(allinvent) inventory.close I'm currently working on saving things like inventory, and I'm not sure what I need to use instead of append as I keep getting this error. Traceback (most recent call last): File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 192, in <module> save("pandatron03", invent, 8) File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 19, in save inventory.append(allinvent) `AttributeError: '_io.TextIOWrapper' object …

Member Avatar
+0 forum 0

I have four ordinary differential equation written in mathmatica : Simplify[DSolve[{y1'[x] == -0.162y1[x], y2'[x]=-0.148 y2[x]+ 0.055y1[x],y3'[x]==-0.134 y3[x]+ 0.033y1[x]+ 0.039y2[x],y4'[x]==-0.125y4[x]+0.021 y1[x]+0.025y2[x]+ 0.043y3[x], y1[0] == 100,y2[0]==4.76,y3[0]==69.7,y4[0]==0}, {y1[x], y2[x],y3[x],y4[x]}, x]] I am trying to write them in python I have try the following : def n1(y,x): s1 = 0.162131 dydx = -s1 * y return dydx def n2(y,x): s2 = 0.148234 s12= 0.0555877 dydx2 = -s2 * y + s12 * n1(y,x) return dydx2 def n3(y,x): s3 = 0.134337 s13= 0.0333526 s23= 0.0389114 dydx3 = -s3 * y + s13 * n1(y,x) + s23 * n2(y,x) return dydx3 def n4(y,x): s4= 0.125072 s14= …

Member Avatar
+0 forum 0

import csv import xlwt import os import sys #import openpyxl # Look for input file in same location as script file: inputfilename = os.path.join(os.path.dirname(sys.argv[0]), 'book2.txt') # Strip off the path basefilename = os.path.basename(inputfilename) # Strip off the extension basefilename_noext = os.path.splitext(basefilename)[0] # Get the path of the input file as the target output path targetoutputpath = os.path.dirname(inputfilename) # Generate the output filename outputfilename = os.path.join(targetoutputpath, basefilename_noext+'.xls') # Create a workbook object workbook = xlwt.Workbook() # Add a sheet object worksheet = workbook.add_sheet(basefilename_noext, cell_overwrite_ok=True) # Get a CSV reader object set up for reading the input file with tab delimiters datareader …

Member Avatar
+0 forum 0

Hi guys so ive been taking a python 3 class this semester and im having some trouble. so here is the problem. Create a python script that stores 20 random integers from 1 to 100 into a file delimited (ie. seperated) by commas (,). For example; if you cat the file when you are done, it should look similar to the following: >cat numbers.txt 61,8,46,71,9,95,77,62,69,6,97,97,77,96,95,20,89,31,3,23 Create a script that read in the text file from PRx0D. It should take the data and put each integer into a list. Eg: [61,8,46,71,9,95,77,62,69,6,97,97,77,96,95,20,89,31,3,23] It should then display the following information from the list: …

Member Avatar
+0 forum 0

Hi I try to upload my picture to local server via FTP Batch file I created script.batch which is contain open 127.0.0.1 Tony 123abc #cd public_html lcd C:\xampp\htdocs lcd XAMPP Shared Folder binary mput C:\Users\Laptop\Desktop\XAMPP Shared Folder\AboutMe.jpg bye I have also another script(upload.batch) which is contain `ftp -i -s:script.bat` When I run upload.batch file it happen nothing? I wonder why? Is there any better code to upload picture to server? I appreciate your help

Member Avatar
+0 forum 0

Hi! My name is Steven and I am a computer science student. I've been working on a project recently (just for fun, practice, and because I was bored lol). I need some testers. It is a game engine for developing text based games in python (3). As of now, it is in very early stages. I need some people to try to develop with it, find bugs, or just suggest features. It is available to download from github [here](https://github.com/tman540/T.A.R.B.S.-Engine). There is also documentation for the most recent version [here](https://tautonico-enterprises.gitbook.io/tarbs/). Thanks! Note: I haven't been programming python for too long, so …

Member Avatar
+0 forum 0

![Untitled_spreadsheet_Google_Sheets.png](/attachments/small/2/57c66e06439c72d5acbb2b9623cf737a.png "align-left") I have column A and Column B. I need to create new column C by iterating through Column A and B and if value in Column A is same then merge value in Column B.

Member Avatar
+0 forum 0

I am trying to take a user input from an entry input and display it back to the user in a simpl text widget. I have implementing a label but apparently that's a bad idea for what I desire. Ultimatley, I'd like my gui to look like this: User: Hey Bot: Oh hey there, User: How are you My gui and response code is as follows: #Creating the GUI myText = tk.StringVar() window.resizable(False, False) window.title("Ashley-UDOL Chatbot") window.geometry('400x400') User_Input = tk.Entry(window, textvariable=myText, width=50).place(x=20, y=350) subButton = tk.Button(window, text="Send", command=Response).place(x =350, y=350) displayText = Text(window, height=20, width=40).pack() scroll = Scrollbar(window, command=displayText).pack(side=RIGHT) window.mainloop() …

Member Avatar
+0 forum 0

I am facing issue while appending fieldlist through append_entry in flask-wtf. I am able to add one row of fields from fieldlist but after adding first row, i am not able to add second row. No errors are shown. In first attempt a new row is added of field list items and in server log "Data is King" and "True" is printed {I have included this to see if add button sends data and loop actually goes through}. In second attemt new row is not added but page reloads and in server log "Data is King" and "True" is printed …

Member Avatar
+0 forum 0

Hi everyone I have this code that I am using from a book, it seems that it does not run correctly, I am new to tkinter and trying to understand how its lay out is supposed to work, is this code up-to-date with using pycharm? I have tried pycharm and IDLE, but it does not display all the widgets as talked about in the book, is there other modules/functions that should be arranged into this or have I done too many typos? from tkinter import * class Application(Frame): def __init__(selfself, master): super(Application, self).__init__(master) self.grid() self.create_widgets() def create_widgets(self): Label(self, text="enter information …

Member Avatar
+0 forum 0

Hello. I found this packet sniffer code that uses the pycap wrapper. Initially, its for live capture but I've changed it to read a .pcap file instead and im trying to understand it but some parts of it i can't i comprehend. could someone explain them to me please? the full code is: import socket from struct import pack, unpack import pcapy import sys def main(argv): dev = input("Enter file name to sniff : ") print("Sniffing file " + dev) # Read offline cap = pcapy.open_offline(dev) #start sniffing packets while(1) : (header, packet) = cap.next() parse_packet(packet) # change to string …

Member Avatar
+0 forum 0

Im trying to find for bytes(unknown) that appear before another set of bytes that have already been found. i have a binary file that for example looks like this: 82 00 10 00 00 00 00 00 00 00 00 00 00 01 00 00 60 F8 6C 10 BF 58 87 45 87 6F 0C 61 0D 26 B0 F5 10 00 00 00 01 00 11 00 00 00 00 00 0E 00 11 00 2D 00 04 00 72 46 13 F4 18 43 C0 D2 0A 64 24 91 F3 E7 00 80 54 00 4E …

Member Avatar
+0 forum 0

when we telnet a multi layer switch for its trace route to a specific host, I need to get router name instead of point-to-point name or IP. I would need to Write a script/program which takes the switch/router name and destination host as input. The script need to return list of router name in between. any advice where to start? I have zero knowledge on scripting..

Member Avatar
+0 forum 0

# An orders class def __init__(self, order): # Initialise self.ID = order.order_id self.kits = [] kit = {} for x in order.kits: # Add kit kit['Type'] = x.kit_type kit['Objects'] = x.objects self.kits.append(kit)

Member Avatar
+0 forum 0

INSERT [table].[Region] ([RegionID], [RegionDesc]) VALUES (1, N'East') INSERT [table].[Region] ([RegionID], [RegionDesc]) VALUES (2, N'West') INSERT [table].[Region] ([RegionID], [RegionDesc]) VALUES (3, N'North') INSERT [table].[Region] ([RegionID], [RegionDesc]) VALUES (4, N'South') I have a text file like above. From the above insert statements i want to write code so that it turns into a python list thing like. Output should be [table].[Region]:- [RegionID] [RegionDesc] 1 N'East 2 N'West 3 N'North how to achieve this kind of result. plz help

Member Avatar
+0 forum 0

Hi, how would you output the values of a foreign key. For example: if there is a table with two foreign keys (which are linked to other tables), how would you output the values of those foreign keys.

Member Avatar
+0 forum 0

In [this page](https://uwsgi.readthedocs.io/en/latest/WSGIquickstart.html), the first example of using python with uwsgi is the following code: def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"] As you can see, there is this `start_response` function which is provided by uwsgi, which is similar to all those things that framewroks like django provide to receive and reply requests. So...does uwsgi provide enough of these things so that you can make a web app with python without using any web framework?

Member Avatar
+0 forum 0

I am trying to delete files in flask after they are downloaded, but I'm hung up on file path issues, generating empty excel files. The file that is downloaded is passed to the route for the file download from a session variable. The following code finds the file and downloads it: @app.route('/dnld_outputfile/', methods=['POST','GET']) def download_output(): output_file1 = session.get('session_variable', None) return send_file(output_file1, attachment_filename='outputfile.xlsx', as_attachment=True) But this code uses a generator to serve and then delete the file: @app.route('/dnld_outputfile/', methods=['POST','GET']) def download_output(): output_file1 = session.get('output_file', None) path = os.path.join(current_app.instance_path,output_file1) def generate(): with open(path) as f: yield from f os.remove(output_file1) r = app.response_class(generate(), …

Member Avatar
+0 forum 0

import turtle import os import math import random import pygame #set up the screen wn = turtle.Screen() wn.bgcolor("black") wn.title("Space invaders") wn.bgpic("space_invaders_backgrounds.gif") pygame.init() #Register the shapes turtle.register_shape("ship.gif") turtle.register_shape("Enemy.gif") #Drawing my border border_pen = turtle.Turtle() border_pen.speed(0) border_pen.color("white") border_pen.penup() border_pen.setposition(-300,-300) border_pen.pendown() border_pen.pensize(3) for side in range(4): border_pen.fd(600) border_pen.lt(90) border_pen.hideturtle() #Set the score to 0 score = 0 #Draw the score score_pen = turtle.Turtle() score_pen.speed(0) score_pen.color("white") score_pen.penup() score_pen.setposition(-290, 280) scorestring = "Score: %s" %score score_pen.write(scorestring, False, align="left", font=("Arial", 14, "normal")) score_pen.hideturtle() #create the player turtle player = turtle.Turtle() player.color("blue") player.shape("ship.gif") player.penup() player.speed(0) player.setposition(0, -250) player.setheading(90) playerspeed = 18 #Choose a number of enemies number_of_enemies …

Member Avatar
+0 forum 0

The End.