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

I am wondering if anyone could recommend the best CMS for an Airbnb-style marketplace that allows people to sublet their apartments, and other people to search, filter, and pay for the apartments listed. These are the main requirements: - Ability to sign up both buyers and sellers. - Accounts for buyers can be created automatically without approval by an administrator. Seller accounts will require approval. - Sellers can have multiple listings, but each listing must be approved by an administrator before going live in the system. - For each apartment listing, seller can fill out information for a number of …

Member Avatar
Member Avatar
+0 forum 5

This is a program to get a student mark, as an input from user and print its grade based on the following criteria: if mark>=80 print 'A' if mark between 70-80 print 'B' if mark between 60-70 print 'C' if mark between 50-60 print 'D' if mark < 50 print 'F' How do I fix this code when e.g someone gets 75 it says you got a B C D ? percent = 85 if percent > 80: print("You got an A!") if percent > 70: print("You got a B!") if (percent >60): print("You got a C!") if (percent > …

Member Avatar
Member Avatar
+0 forum 2

Task 2: Write a program that simulates an unbiased coin flip. Your program should print true if the coin flip results in a head and false if the coin flip results in a tail. Hint: any value greater than 0.5, represents Head otherwise it represents Tail

Member Avatar
Member Avatar
+0 forum 1

i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and skipping numbers based on the step specified in the arguments. Note: The function range(x, y, z) can takes in 3 arguments. For example, range(1, 11, 2) will return a list of numbers [1,3,5,7,9]. Examples [CODE] >>> generateNumber(2, 10, 2) [2, 4, 6, 8, 10] >>> generateNumber(10, 10, 1) [10] >>> …

Member Avatar
Member Avatar
+0 forum 8

Hi, I'm attemting to learn programming with Python and am currently trying to design an adventure game that sets up rooms and a player can move between them. I'm having problems working out a lop function that can move the player around the rooms. The current method has an error code saying 'list index out of range'. I don't want to throw in the towel and will carry on trying to debug the programme but is there a better way to loop the method and is there a way to show a message if a wrong direction is chosen. The …

Member Avatar
Member Avatar
+0 forum 2

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 need a project# Hi, I am brand new to programming and was wondering if anybody had any suggestions of where/ how I could learn more python, and or a good project that would help my learn new elements of code as i learn them.

Member Avatar
Member Avatar
+0 forum 4

Hello, I have run into an issue where my output for shipping charge needs to be Real Use local named constants not global Also the package weight needs to be times the rate PER pound, is what I have correct? rate1= 1.1 rate2= 2.2 rate3= 3.7 rate4= 3.8 def main(): packageWeight = float(input( "What is the weight of the package?")) shipping_Weight(packageWeight) def shipping_Weight(packageWeight): if packageWeight <= 2: Weight = rate1 * packageWeight print ("The total shipping charge is $: " , Weight) elif packageWeight <= 6: Weight = rate2 * packageWeight print ("The total shipping charge is $: " , …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am fairly new to the community, and have recently began to code using python, however, I am stuck on something: I have written quite a length of code, and am using the 'if' command, and I am attempting to restart the code if they type 'yes'. It would look something like this: if restart == "Yes": (restart program here?!?) I know to some, this is an incredibly easy thing to do, but I have tried multiple different solutions, none of them working. (I even tried examples from the internet - same outcome. They just restart the shell, or …

Member Avatar
Member Avatar
+0 forum 1

x=int(input("Enter a number to check whether it is a palindrome number or not here : ")) m=x k=0 for j in range (m): digit=m%10 k=k*10+digit m=m//10 if k==x: print("%d is a palindrome nukber"%(x)) else: print("%d is not a palindrome number"%(x)) print()

Member Avatar
Member Avatar
+0 forum 3

Is there a library that has a function that will take (theta,phi) and return (x,y,z)? Thanks, Dave

Member Avatar
Member Avatar
+0 forum 13

Because Microsoft will be removing vbScript in the next version of Windows, I have been busy converting my utility vbScripts into Python. Part of this is a library of functions that I keep in `D:\include`. I'd like to maintain this system in Python, but the import process is rather clumsy. I have to import sys sys.path.insert(0,r'D:\include') Only after that can I import a file. The documentation is somewhat obtuse but I gather my best option is to add the file `D:\include__init__.py`. As long as that folder is known to Python I could then do from include import myfile1 to include …

Member Avatar
Member Avatar
+0 forum 6

Hi there PyQt is not available as tag, but this should be a simple question anyway: - drag & drop: from QListWidget to QListwidget - pushButton action: inserts chosen items from second QListWidget into QTableWidget But: when i run my code - most of the time the chosen items are inserted twice into my QTableWidget, sometimes the code runs like expected - and i can't figure out why. Of course i tried a "print(num)", and the added really occurs twice, for example: (0) ListEdit (0) ListEdit (1) TextEdit (1) TextEdit ... a.s.o. Here's the snippet: vheader = self.tableWidget.verticalHeader() r_count = …

Member Avatar
Member Avatar
+0 forum 2

So I've successfully written a metaclass that gives python the functionality of private attributes in classes. Q: But what about `inst.__private`? A: >>> class A(object): __slots__ = ['__private'] def __new__(cls): inst = object.__new__(cls) inst.__private = 10 return inst def showprivate(inst): return inst.__private >>> inst = A() >>> inst.showprivate() 10 >>> inst._A__private = 20 # security through obscurity never works >>> inst.showprivate() # sorry not private 20 With my metaclass, private attributes are inaccessible outside native and super-native namespaces: class A(object, metaclass=privatetype): __slots__ = ['A'] __private__ = ['B'] # NOTE: __slots__ is enforced for security regardless of local definition def __new__(cls): …

Member Avatar
Member Avatar
+0 forum 22

what are the different relational operators in python?

Member Avatar
Member Avatar
-1 forum 4

Hi im new to programming and i need a bot that autofills a website because i constantly advertise a website on different websites and i basically copy and paste repeatedly for like 5 to 8 hours a day but my friend said i might be able to make a bot to help do it for me is this at all possible.

Member Avatar
Member Avatar
+0 forum 1

hello dear community, first of all - i hope that my beginner-question will fit into this sub-forum.  I hope so.  Servo Control  with Micropython - with the ESP 8266 ...- compared to Arduino  I work with young kids and I'm always looking for economical platforms to build intriguing projects. While we can say that Arduino clones are pretty cheap, it uses the C/C++ language that the kids are not familiar with. This is pretty challenging. Also and furthermore, it doesn't have a built-in WiFi which is a must for all the IoT projects that i have in mind. On the …

Member Avatar
Member Avatar
+0 forum 1

I have been wrestling with this for two days now and getting nowhere. Something is broken, either the GridSizer control or me. I'm hoping it's me and someone can show me the problem. I've stripped my app of non-essentials. What I am building is a Sudoku app which consists of several nested controls, as can be seen in the atached image. The outer frame contains the puzzle which contains a 3x3 grid of panes. Each pane contains a 3x3 grid of tiles and each tile contains a 3x3 grid of digits. So far so good. Except for the layout. I …

Member Avatar
Member Avatar
+0 forum 1

Hi! I am creating a simple python tkinter calculator. However when I was due to submit my code in my teacher said that my code is inefficient and recommended i change the following: 1.) Create buttons using a for loop 2.) have two classes - one of which is for the functions defintions and one for the GUI components and all 3.) remove all global variables and use parameters and scopes However i am a novice at programming as i just started recently an have been given a short time. Can anyone help me? Any help is appreciated. from tkinter …

Member Avatar
Member Avatar
+0 forum 2

Hi! I am creating a simple python tkinter calculator. However when I was due to submit my code in my teacher said that my code is inefficient and recommended i change the following: 1. Create buttons using a for loop 2. have two classes - one of which is for the functions defintions and one for the GUI components and all 3. remove all global variables and use parameters and scopes However i am a novice at programming as i just started recently an have been given a short time. Can anyone help me? Any help is appreciated. from tkinter …

Member Avatar
Member Avatar
+0 forum 1

class foo(object): __slots__ = ['__base__'] What's expected is for `foo.__base__` to be a member_descriptor object but instead what you get is: >>> foo.__base__ <class 'object'> >>> foo.__base__ is object True I guess something happens within the magic of class construction that makes use of `__base__` as an object. I stumbled across this because my particular class represented by `foo` makes use of `__base__` for holding objects `foo` makes special instances of when called. Just something interesting to note here, and possibly some useful knowledge so others can know to stay away from `'__base__'` as a class attr name.

Member Avatar
Member Avatar
+0 forum 2

#include <stdio.h> int main() int pv, cv, temp; temp = 15; pv = 1; printf("%d\n" ,pv); cv = 1 printf("%dn" ,cv); while (cv < 10) cv = temp; temp =pv; pv = cv; printf("%d\n ,pv); printf("%d\n ,cv); geche(); return 0;

Member Avatar
Member Avatar
+0 forum 2

i want to remove a card from a randomly shuffled deck. so that each time a card is picked from the again shuffled deck. that card is eliminated from further play until all 52 cards are drawn. in python3.7

Member Avatar
Member Avatar
+0 forum 3

hi everyone. been a while since i have been on here, alot has changed. I am in the middle of amending/adding features to an installer using python. I have the dropbox API (for business) set up and working, upload and downloading without issue. The potential issue i see is during the progress of either up/down the CLI sits, does nothing. So my question is (as i am still finding my way with all that is Python), how can i add a progress bar? For download and can use the API call to get the metadata file_size if that helps? PS, …

Member Avatar
Member Avatar
+0 forum 2

So I have this for a sound crew to select jobs for workers based on the training they have recieved. My code allows you to add workers to the list and set what jobs they are allowed to do through use of inputs. The second Function then randomly creates job assignments for people based on the parameters in the first function. I would like to be able to have people selected, with no repeats, and preferably without permanently deleting people from the lists, so that the lists can be saved permanently. With the current code i get the error ValueError: …

Member Avatar
Member Avatar
+0 forum 1

I have a python script which extracts unique ip addresses from snort log but how to modify or use regex to extract IPs only if they are logged more than 10 times per second? more specific: using "regex", if the second (i.e 41 in this scenario) doesn't change for more than 10 lines of having the same IP address then extract that IP. blacklist = list(open("/home/asad/blackdb/blacklist", 'r').read().split('\n')) logfile = list(open('/home/asad/logdb/snort.alert', 'r').read().split('\n')) newip = [] for entry in logfile: ips = re.findall(r'[0-9]+(?:\.[0-9]+){3}', entry) for ip in ips: newip.append(ip) newblist = blacklist + newip with open("/home/asad/blackdb/blacklist", 'w+') as f: f.write('\n' .join(set(newblist))+'\n\n') f.close() …

Member Avatar
Member Avatar
+0 forum 9

Below is a program that asks the user to input a username and password. Once logged off the user is asked to re-enter their username and password. Is the program correct where it checks if the username and password input before is correctly input again?. Any help would be welcome Regards Mark # program that checks that the username and password are correct # username = input("Please enter your username : ") password = input("Please enter your password : ") print ("Greetings," , username, "you are now logged in now with a password") command = input("Please type a command :") …

Member Avatar
Member Avatar
-1 forum 7

Design a function named max that accepts two integer values as arguments and returns the value that is greater? For example: if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is greater of the two.

Member Avatar
Member Avatar
-1 forum 15

The End.