This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
processes = int(input("number of processes : ")) | |
resources = int(input("number of resources : ")) | |
max_resources = [int(i) for i in input("maximum resources : ").split()] | |
print("\n-- allocated resources for each process --") | |
currently_allocated = [[int(i) for i in input(f"process {j + 1} : ").split()] for j in range(processes)] | |
print("\n-- maximum resources for each process --") | |
max_need = [[int(i) for i in input(f"process {j + 1} : ").split()] for j in range(processes)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
processes = int(input("number of processes : ")) | |
resources = int(input("number of resources : ")) | |
max_resources = [int(i) for i in input("maximum resources : ").split()] | |
print("\n-- allocated resources for each process --") | |
currently_allocated = [[int(i) for i in input(f"process {j + 1} : ").split()] for j in range(processes)] | |
print("\n-- maximum resources for each process --") | |
max_need = [[int(i) for i in input(f"process {j + 1} : ").split()] for j in range(processes)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
import tkMessageBox | |
import ttk | |
class Track(tk.Frame): | |
def __init__(self, master): | |
tk.Frame.__init__(self, master) | |
x = (self.master.winfo_screenwidth() - self.master.winfo_reqwidth()) / 2 | |
y = (self.master.winfo_screenheight() - self.master.winfo_reqheight()) / 2 |