def project_solution(height, length, gs_x, gs_y, u_in, cc, au, av, ap, rho, mu): # Get Mesh u_grid, v_grid, p_grid = Preprocessing.gen_mesh(height, length, gs_x, gs_y) # Get Initial Values u, v, p = Preprocessing.initial_con(u_grid[0].shape[0], u_grid[1].shape[0], u=0., v=0., p=0.) # Get Boundary Conditions bc = Preprocessing.boundary_cond('velocity', 'velocity gradient', 'no slip', 'no slip', [u_in, None, None, None]) # Create viewers p_viewer = Viewer.FlowContours(p, p_grid[0], p_grid[1], [0, 0, length, height], 'Pressure') x_v_viewer = Viewer.FlowContours(u, u_grid[0], u_grid[1], [0, 0, length, height], 'X Velocity') y_v_viewer = Viewer.FlowContours(v, v_grid[0], v_grid[1], [0, 0, length, height], 'Y Velocity') s = Solver.Solution(p, u, v, u_grid[0], v_grid[0], v_grid[1], u_grid[1], bc, cc, au, av, ap, rho, mu, p_viewer, x_v_viewer, y_v_viewer) p = s.p_n[s.ni/2:-1, s.nj/2] dp = p[-1]-p[0] print 'dp/dx = ' + str(dp/(gs_x*(len(p)-1))) print 'max U = ' + str(s.u_n[s.ni/2:-1, s.nj/2].max()) print 'max V = ' + str(s.v_n[s.ni/2:-1, s.nj/2].max()) Viewer.keep_open()
def start__dfs(lis, depth, r, c): "pure depth first search" start = time.time() "Setting number of rows, columns" global row, column, liste, help_list, nodes row = r column = c liste.append(lis) "starting depth first search" dfs(lis, depth) end = time.time() result = end - start if solution_found: "generating solution sequence from states of puzzles in liste (previously copied to help_list) " str = Viewer.view_reverse(help_list, row, column) print("Sequence:", str) print("Length:", int(len(str) / 2)) print("Nodes:", nodes) print("Duration:", result) "asking if user wants to see states of puzzle to solution " ask = input("Viewer (YES/NO):") if ask == "YES": Viewer.view(str, lis) else: print("TERMINATED") else: print("Duration:", result)
def start(lis, r, c, h): "start of best first search" "getting start time" start = time.time() global row, column, nodes, heuristic "setting number of rows and columns" row = r column = c "setting heuristic" heuristic = h "starting best first search with max depth of 999" best_first(lis, 999) "getting end time and time needed" end = time.time() result = end - start "getting string of moves to solution by putting in states of puzzle to solution" str = Viewer.view_reverse(liste, row, column) if checker is True: print("Sequence:", str) print("Length:", int(len(str) / 2)) print("Duration:", result) print("Nodes:", nodes) ask = input("Viewer (YES/NO):") if ask == "YES": Viewer.view(str, lis) else: print("TERMINATED") else: print("Duration:", result)
def start(lis, r, c, h): start = time.time() global row, column, str, heuristic "setting heuristic" heuristic = h row = r column = c "contains initial state of puzzle, heuristic value, layer and belonging direction of the chosen move" liste = [0, 0, "0", lis] "start A*star algorithm " a_star(liste) end = time.time() result = end - start "checking if solution was found" if checker: print("Sequence:", str) print("Length:", int(len(str) / 2)) print("Duration:", result) print("Nodes:", nodes) ask = input("Viewer (YES/NO):") if ask == "YES": Viewer.view(str, lis) else: print("TERMINATED") else: print("Duration:", result)
def main(): while True: Viewer.main_view("MAZE") ch = Viewer.main_select() if ch == '1': UserController.login() elif ch == '2': UserController.register() elif ch == '3': exit(1) elif ch == '4': TestingReport.report() else: print("INVALID INPUT!")
def shop(user): Viewer.main_view("MAZE COIN SHOP") ch = Shop.purchase(user) if ch == 'cancel': return 0 else: os.system("cls") Viewer.main_view("MAZE Coin Shop") print("성공적으로 구매하였습니다.") input("계속하려면 아무키나 누르세요") os.system("cls")
def show_data(self, datatype): print("Here is DataManager.Analysis.show_data!") import Viewer self.load_output() try: data = self.movement_data[datatype] print(data) Viewer.plot(data) except KeyError: print("File {}.csv not found, unable to process!".format(datatype)) pass
def inventory(user): l = DBcon.showinventory(user) Viewer.menu_view(user, "MAZE Inventory") print("당신이 가지고 있는 스킨들\n") for i in range(len(l)): print(str(l[i][0]) + "번 스킨: " + l[i][1], end="") ch = input("\n스킨을 바꾸시겠습니까? (y/n): ") if ch == 'y': c = input("몇번 스킨으로 바꾸시겠습니다? :") DBcon.skinchange(user, int(c)) user.update(login_refresh(user.username)) os.system("cls")
def createListOfViewers(fileName, allFilms, k, startIndex): viewers = {} file = open(fileName, "r") currentViewer = 1 viewers[currentViewer] = Viewer.Viewer(currentViewer) lines = file.readlines() for i in range(startIndex, len(lines), k): lines[i] = lines[i].rstrip("\n") lines[i] = lines[i].split() if int(lines[i][0]) != currentViewer: currentViewer = int(lines[i][0]) viewers[currentViewer] = Viewer.Viewer(currentViewer) elif int(lines[i][0]) == currentViewer: viewers[currentViewer].addReview(lines[i], allFilms) return viewers
def user_info(): msg = "" while True: Viewer.main_view("MAZE LOGIN") print(msg) username = input("ID를 입력하세요 : ") password = input("PW를 입력하세요 : ") m = DBcon.valid_id_check(username, password) if m == 2: msg = "INVALID ID!" elif m == 3: msg = "PASSWORD INCORRECT!" else: os.system("cls") break os.system("cls") user = User(m[0][0], m[0][1], m[0][2], m[0][3], m[0][4], m[0][5]) return user
def convert(self): self.video_input = self.video_input.filter('scale', self.sw, self.sh) self.process = self.video_input.output('pipe:', format='rawvideo', pix_fmt='rgb24').run_async(pipe_stdout=True) self.frames = [] while True: bytes_in = self.process.stdout.read(self.sw * self.sh * 3) if not bytes_in: break # frame is essentially a list of rgb [[r, g, b], [r, g, b], [r, g, b],...] frame = np.frombuffer(bytes_in, np.uint8).reshape([self.sh, self.sw, 3]).copy() # frame[0][0] is [r, g, b], frame is 2d array / matrix frame_new = [] for i, row in enumerate(frame): frame_new.append([]) for col in row: frame_new[i].append(self.get_ascii_pixel(col)) self.frames.append(frame_new) # append asciified frame self.viewer = Viewer(self.__dict__) return self.viewer
def __init__(self, config_file_name): # Reads a config file self.config_file_name = config_file_name ini_file = configparser.ConfigParser() ini_file.read(self.config_file_name) # Generates objects self.line_ui_manager = LINEUIManager.LINEUIManager() self.pre_precess_manager = PreProcessManager.PreProcessManager( self.config_file_name) self.post_process_manager = PostProcessManager.PostProcessManager( self.config_file_name) self.exfile_manager = ExFileManager.ExFileManager( self.config_file_name) self.viewer = Viewer.Viewer() # Directory names where data will be stored self.path_data_dirs = ''.join(ini_file['Setting']['path_data_dirs']) # For learning self.mini_batch_size = int( ini_file.get('GeneralParameter', 'mini_batch_size')) # dir name for saving result self.dir_for_saving_result = os.path.join( 'Result', dt.now().strftime('%Y-%m-%d-%H-%M-%S')) self.width = 0 self.height = 0
def getInit(RTMfile): #This is typically run before all the other functions in here to initiate #communication with the model. var1=VCmd.Activate( 1, r"VHostManagerPlugin.VhmInterface", r"VhmCommand" ) var2=VCmd.Activate( 1, r"VSessionManager.Command", r"SessionCommand" ) var3=VCmd.Activate( 1, r"VToolKit.VSectionCutInterface", r"VEAction" ) ret=VE.ChangeContext( r"Visual-RTM" ) VE.SetActiveWindow( r"p1w1" ) ret=VExpMngr.LoadFile( r"D:\\IDPcode\\pamrtm\\mainSimFiles\\"+RTMfile+".vdb", 0 ) VE.SetCurrentPage( 1 ) ret=VE.ModelChange( "M @0" ) VScn.ExecutePythonInterpeter( r"C:\Program Files\ESI Group\Visual-Environment\15.0\COMMON\Resources\VisualProcessExec\user_scripts\CompositeLoadResult.py" ) import Viewer Viewer.SetTHPdisplayOnOff( 0 ) VE.Command( r">>> fpmmarkersize(3)" ) Viewer.SetLogConstantInfo( 0.000000000100000000000000003643 , 1 )
def getPhill(RTMfile): #Assuming file is already open. #Exports file times for each node in the file. #This functions wasn't used for a while, while changes were made, might #not work. i = 124 strX = lPath_auto+"\\pamrtm\\mainsimfiles\\"+str(RTMfile)+"_RESULTS.erfh5" #__________________ VtkContourDlg BEGIN __________________ var4=VCmd.Activate( 1, r"VToolKit.VToolKitInterface", r"VtkContourDlg" ) VCmd.SetStringValue( var4, r"FileName", strX ) VCmd.SetStringValue( var4, r"ContourMethod", r"ByEntity" ) VCmd.SetStringValue( var4, r"ContourParentName", r"NODE" ) VCmd.SetStringValue( var4, r"ContourDisplayName", r"FILLING_FACTOR" ) VCmd.SetStringValue( var4, r"Encoding", r"Scalar" ) VCmd.SetIntValue( var4, r"ContourGrayFlag", 1 ) ret=VCmd.ExecuteCommand( var4, r"ApplyContour" ) VCmd.SetStringValue( var4, r"SpectrumDispMode", r"Smeared" ) Viewer.AnimDisplayFrame( i ) VCmd.SetStringValue( var4, r"ExportStates", r"CURRENT STATE" ) VCmd.SetStringValue( var4, r"ExportAppliedOn", r"ON MODEL" ) VCmd.SetStringValue( var4, r"ExportAsVectorScalar", r"SCALAR" ) VCmd.SetStringValue(var4,r"ExportPath", lPath_auto+"\\pamrtm\\mainsimfiles\\Filling_factor"+str(i)+".txt") ret=VCmd.ExecuteCommand( var4, r"ExportContour" )
def __init__(self, mini_batches, epoch, num_visible_units, num_hidden_units, sampling_type, sampling_times, learning_rate, momentum_rate, weight_decay_rate, sparse_regularization, width_sf, height_sf, num_sf,dir_for_saving_result): # Generates objects self.viewer = Viewer.Viewer() self.line_ui_manager = LINEUIManager.LINEUIManager() # Parameters self.mini_batches = mini_batches self.epoch = epoch self.num_visible_units = num_visible_units self.num_hidden_units = num_hidden_units self.sampling_type = sampling_type self.sampling_times = sampling_times self.learning_rate = learning_rate self.momentum_rate = momentum_rate self.weight_decay_rate = weight_decay_rate self.sparse_regularization_target = sparse_regularization[0] self.sparse_regularization_rate = sparse_regularization[1] self.width_spread_function = width_sf self.height_spread_function = height_sf self.dir_for_saving_result = dir_for_saving_result side_len_img = int(math.sqrt(num_visible_units)) self.spread_funcs = np.array( [self.spread_function((side_len_img, side_len_img), (np.random.randint(0, side_len_img - 1), np.random.randint(0, side_len_img - 1)), 10, 10) for _ in list(range(num_sf))]) """
def getALLff(RTMfile,nS): #Assuming file is already open. #This function exports filling factors as text files for each analysis #frame. strX = "D:\\IDPcode\\pamrtm\\mainSimFiles\\"+str(RTMfile)+"_RESULT.erfh5" ii = int(0) with open("D:\\IDPcode\\pamrtm\\mainSimFiles\\currentProgress.txt", "a") as text_file: text_file.write("tell me where is Gandalf "+str(nS)+"\n") while ii < int(nS): #__________________ VtkContourDlg BEGIN __________________ var4=VCmd.Activate( 1, r"VToolKit.VToolKitInterface", r"VtkContourDlg" ) VCmd.SetStringValue( var4, r"FileName", strX ) VCmd.SetStringValue( var4, r"ContourMethod", r"ByEntity" ) VCmd.SetStringValue( var4, r"ContourParentName", r"NODE" ) VCmd.SetStringValue( var4, r"ContourDisplayName", r"FILLING_FACTOR" ) VCmd.SetStringValue( var4, r"Encoding", r"Scalar" ) VCmd.SetIntValue( var4, r"ContourGrayFlag", 1 ) ret=VCmd.ExecuteCommand( var4, r"ApplyContour" ) VCmd.SetStringValue( var4, r"SpectrumDispMode", r"Smeared" ) Viewer.AnimDisplayFrame( ii ) VCmd.SetStringValue( var4, r"ExportStates", r"CURRENT STATE" ) VCmd.SetStringValue( var4, r"ExportAppliedOn", r"ON MODEL" ) VCmd.SetStringValue( var4, r"ExportAsVectorScalar", r"SCALAR" ) VCmd.SetStringValue( var4, r"ExportPath", r"D:\\IDPcode\\pamrtm\\mainSimFiles\\FILLING_FACTOR"+str(ii)+".txt" ) ret=VCmd.ExecuteCommand( var4, r"ExportContour" ) ii = ii + 1
def OnInit(): random.seed() print(sys.path) _ctx = Context.GetInstance() _ctx.stateMachine = StateMachine() _ctx.viewer = Viewer.GetInstance() _ctx.viewer.Init() _ctx.LoadImages()
def register(): msg = "" while True: Viewer.main_view("MAZE Registering") print("주의! 한글로 만들면 2자이하, 영어로 만들면 13자 이하입니다.") print(msg) _id = input("ID: ") _pw = input("PW: ") m = DBcon.valid_id_check(_id, _pw) if len(_id) == 0: msg = "INVALID ID!" elif m != 2: msg = "USED ID!" else: DBcon.db_register(_id, _pw) os.system("cls") print("Registered Successfully!") break os.system("cls")
def __init__(self, parent=None): super(Mozayik, self).__init__(parent) mainLayout = QHBoxLayout() #setup button icons assets = os.getcwd() + "/assets" if os.path.exists(assets): os.chdir(assets) trash = assets + "/trash.png" if os.path.isfile(trash): trashIcon = QIcon(QPixmap(trash)) add = assets + "/plus.png" if os.path.isfile(add): addIcon = QIcon(QPixmap(add)) folder = assets + "/folder.png" if os.path.isfile(folder): folderIcon = QIcon(QPixmap(folder)) #setup buttons self.enterFolderButton = QPushButton(folderIcon, "") self.enterFolderButton.clicked.connect(self.enterFolderContact) self.addTilesButton = QPushButton(addIcon, "") self.addTilesButton.clicked.connect(self.addTilesContact) self.deleteButton = QPushButton(trashIcon, "") self.deleteButton.clicked.connect(self.deleteContact) #layout buttons buttonLayout1 = QHBoxLayout() buttonLayout1.addWidget(self.enterFolderButton) buttonLayout1.addWidget(self.addTilesButton) buttonLayout1.addWidget(self.deleteButton) #setup image viewer scrollView = QScrollArea() scrollView.setBackgroundRole(QPalette.Dark) self.viewer = Viewer() scrollView.setWidget(self.viewer) size = QSize(350,600) scrollView.setMaximumSize(size) #scrollView.setMinimumSize(size) #setup mozayik area #self.mozayik = QLabel("Area reserved") self.mozayik = Canvas() #layout main view viewLayout1 = QVBoxLayout() viewLayout1.addLayout(buttonLayout1) viewLayout1.setAlignment(buttonLayout1,Qt.AlignRight) viewLayout1.addWidget(scrollView) viewLayout1.setAlignment(scrollView,Qt.AlignLeft) mainLayout.addLayout(viewLayout1) mainLayout.addWidget(self.mozayik) self.setLayout(mainLayout) self.setWindowTitle("Mozayik")
def chat(self): done = False font = pygame.font.Font(None, 32) clock = pygame.time.Clock() text = '' print('debug') # make text box active while not done: pygame.event.pump() try: self.chatbox(clientSocket.recv(1024).decode('utf-8')) except BlockingIOError: True for event in pygame.event.get(): self.color = color_active #pygame.event.pump() if event.type == pygame.KEYDOWN: if event.key == pygame.K_RETURN: # send info through socket instead of sending to Viewer function boxout = ''.join(text) if len(text) > 0: self.sockconn("CHAT" + boxout) Viewer.printChat(text) text = '' self.color = color_inactive done = True break elif event.key == pygame.K_BACKSPACE: text = text[:-1] else: text += event.unicode else: done = False self.on_render() # Render the current text. txt_surface = font.render(text, True, self.color) # Resize the box if the text is too long. #width = max(200, txt_surface.get_width()+10) #self.input_box.w = width # Blit the text. self._display_surf.blit( txt_surface, (self.input_box.x + 5, self.input_box.y + 5)) # Blit the input_box rect. pygame.display.flip() clock.tick(30)
def __init__(self, config_file_name): # Reads a config file ini_file = configparser.ConfigParser() ini_file.read(config_file_name) # self.threshold_h_1 = float(ini_file['Parameter']['threshold_h_1']) self.line_ui_manager = LINEUIManager.LINEUIManager() self.viewer = Viewer.Viewer() self.exfile_manager = ExFileManager.ExFileManager(config_file_name)
def getVisc(RTMfile): #creates a numpy file of all the states of viscosity during infusion (42 states, each node) #This function is currently not used within other scripts. It will require #adjustments if included. with open("D:\\IDPcode\\pamrtm\\mainSimFiles\\currentProgress.txt", "a") as text_file: text_file.write("wegotsomewhere3\n") i= 0 while i < 42: var4=VCmd.Activate( 1, r"VToolKit.VToolKitInterface", r"VtkContourDlg" ) VCmd.SetStringValue( var4, r"FileName", r"D:\\IDPcode\\pamrtm\\mainSimFiles\\IDP_spar_A145_M001_B001_R002_RESULT.erfh5" ) with open("D:\\IDPcode\\pamrtm\\mainSimFiles\\currentProgress.txt", "a") as text_file: text_file.write("wegotsomewhere88\n") VCmd.SetStringValue( var4, r"ContourMethod", r"ByEntity" ) VCmd.SetStringValue( var4, r"ContourParentName", r"NODE" ) VCmd.SetStringValue( var4, r"ContourDisplayName", r"VISCOSITY" ) VCmd.SetStringValue( var4, r"Encoding", r"Scalar" ) VCmd.SetIntValue( var4, r"ContourGrayFlag", 1 ) ret=VCmd.ExecuteCommand( var4, r"ApplyContour" ) VCmd.SetStringValue( var4, r"SpectrumDispMode", r"Smeared" ) Viewer.AnimDisplayFrame( i ) VCmd.SetStringValue( var4, r"ExportStates", r"CURRENT STATE" ) VCmd.SetStringValue( var4, r"ExportAppliedOn", r"ON MODEL" ) VCmd.SetStringValue( var4, r"ExportAsVectorScalar", r"SCALAR" ) VCmd.SetStringValue( var4, r"ExportPath", r"D:\\IDPcode\\pamrtm\\mainSimFiles\\VISCOSITY.txt" ) ret=VCmd.ExecuteCommand( var4, r"ExportContour" ) with open("D:\\IDPcode\\pamrtm\\mainSimFiles\\currentProgress.txt", "a") as text_file: text_file.write("wegotsomewhere14\n") eef = open("D:\\IDPcode\\pamrtm\\mainSimFiles\\VISCOSITY.txt", "rt") ee = eef.read() #doesnt work for non full infusion ... number 42 becomes number TOP, while top needs to be found numbers = ee.split("Number 42")[1] nc = numbers.count("\n") iii = 2 nmat = np.zeros([1,2]) nmat_temp = np.zeros([1,2]) while iii < nc: n = numbers.split("\n")[iii] nmat_temp[0,0] = int(n.split()[0]) nmat_temp[0,1] = float(n.split()[1]) nmat = np.concatenate((nmat,nmat_temp),0) iii = iii + 1 nmat = np.delete(nmat, (0), axis=0) print(nc) print(nmat) eef.close() if i == 0: allmat = nmat else: allmat = np.concatenate((allmat,nmat),1) i = i + 1 np.save(r"D:\\IDPcode\\pamrtm\\mainSimFiles\\"+RTMfile+"_VISCOSITY.npy", allmat)
def status(user): global flag while True: Viewer.menu_view(user, "MAZE") ch = Viewer.menu_select() if ch == '1': GameController.start_maze(user) break elif ch == '2': ranking() elif ch == '3': shop(user) elif ch == '4': inventory(user) elif ch == '0': flag = 1 break else: print("INVALID INPUT")
def purchase(user): while True: print("현재 코인: " + str(user.coin) + "개\n\n") li = item_list() item, text = li[0], li[1] ch = input("\n0. Back\n\n당신의 선택은? : ") if ch == '0': os.system("cls") return "cancel" else: if item[int(ch)] > user.coin: os.system("cls") Viewer.main_view("MAZE Coin Shop") input("코인이 부족합니다.") else: c = user.coin - item[int(ch)] user.shopping(int(ch), c) DBcon.db_shopping(user, text[int(ch)]) return ch
def open_input(self, filename): self.ifile = filename basename = os.path.split(filename)[1] title = 'in: ' + basename try: vin = Viewer.InputViewer(filename, title) except: self.err('Can\'t open input file', filename) return self.close_input() self.vin = vin self.in_file.label = basename self.ishow()
def start__idfs(lis, r, c): "iterative depth first search" start = time.time() global checker, liste, solution_found, row, column, help_list row = r column = c "Max depth of searching is 20" for i in range(20 + 1): "leaves loop when solution found" if solution_found or checker: break "removing all previous states" liste.clear() "appending initial state for next run" liste.append(lis) "starting depth first algorithm" dfs(lis, i) "generating solution sequence from states of puzzles in liste (previously copied to help_list) " str = Viewer.view_reverse(help_list, row, column) end = time.time() result = end - start if solution_found: print("Sequence:", str) print("Length:", int(len(str) / 2)) print("Duration:", result) print("Nodes:", nodes) "asking if user wants to see states of puzzle to solution " ask = input("Viewer (YES/NO):") if ask == "YES": Viewer.view(str, lis) else: print("TERMINATED") else: print("Duration:", result)
def run(self): if not self.intitialized: self.initialize() while True: self.selection() self.reproduction() # Save self.best_child self.best_child = self.current_pop[np.argmax( self.current_pop_fitness)] self.generation_list.append(self.best_child) # Get fitness of best child gen = len(self.generation_list) # Gen is used to determine bag for sampling random.seed(gen) bag_index = random.choice(range(len(self.bags))) selected_bag = self.bags[bag_index] f = Fitness(self.best_child, json_data=self.json_data, gen=gen, data=selected_bag, y_classes=self.y_classes, fitness_func=self.fitness_func) f.run() best_child_fitness = round(f.fitness_value, 2) self.generation_fitness.append(best_child_fitness) if len(self.generation_list) % 1 == 0: if not self.silent: print('Generation: {} Fitness: {}'.format( len(self.generation_list), best_child_fitness)) if self.auto_plot: # Plays through data in a pygame window Viewer.Playback(f.fitness_data_array, text='Generation: {} Fitness: {}'.\ format(len(self.generation_list),best_child_fitness), dna=f.world.world).run() # Update to the next generation self.update_pop() # If the max_epochs is met, then stop. if self.max_epochs != -1: if len(self.generation_list) > self.max_epochs: break return self
def OnBaseCreate(self): print("<<<<<<Avatar OnBaseCreate>>>>") print("AvatarID %d" % self.AvatarID) print("Name", self.Name) print("attr1 %d" % self.attr1) print("attr2 %d" % self.attr2) print("attr4 ", self.attr4) print("attr5 ", self.attr5) print("attr6 ", self.attr6) print("attr7 ", self.attr7) print("attr8 ", self.attr8) print("<<<<<<Avatar OnBaseCreate>>>>") Viewer.GetInstance().RegisterEntity(self.id, self._view)
def get_ranking(): rows = DBcon.get_all_db() Viewer.main_view("MAZE RANKING") print("등수 \t" + "{:<24}".format("ID"), end="\t") print("{:<6}".format("LV"), end="\t") print("{:<6}".format("Coin"), end="\t") print("{:<6}".format("Elapsed Time"), end="\n\n") for i in range(len(rows)): print(str(i + 1) + "등\t", end="") for j in range(len(rows[i])): if j == 0: if rows[i][j] == 99999.0: print("없음", end="") else: print("{:<24}".format(rows[i][j]), end="\t") else: if rows[i][j] == 99999.0: print("없음", end="") else: print("{:<6}".format(rows[i][j]), end="\t") print() input("\n\n돌아가려면 아무키나 누르세요") os.system("cls")
def open_output(self, filename): self.ofile = filename basename = os.path.split(filename)[1] title = 'out: ' + basename try: vout = Viewer.OutputViewer(filename, \ title, self.qsize) except: self.err('Can\'t open output file', filename) return self.close_output() self.vout = vout self.out_file.label = basename if self.vin: self.vout.setinfo(self.vin.getinfo()) self.oshow()
def main(): rmc = Viewer() arg = None isfile = True if len(sys.argv) > 1: arg = os.path.abspath(sys.argv[1]) if not os.path.exists(arg): arg = None elif os.path.isdir(arg): isfile = False dngs = [f for f in os.listdir(arg) if f.lower().endswith(".dng")] if len(dngs) > 0: isfile = True if arg and isfile: rmc.load(os.path.abspath(arg)) else: rmc.openBrowser(arg) ret = rmc.run() PerformanceLog.PLOG_PRINT() return ret
#!/usr/bin/python2.7 # -*-coding:Latin-1 -* from Viewer import * root = Tk() app = Viewer(root, 1) root.mainloop() app.stop() """while True: test = sys.stdin.readline() if app.readLine(test) == 0 : print test"""
parent = parent.Merge() comm = parent size = comm.Get_size() rank = comm.Get_rank() name = MPI.Get_processor_name() package = {'parent':parent, 'comm':comm, 'size':size, 'rank':rank, 'name':name} source = comm.recv(source=MPI.ANY_SOURCE, tag=5) flag = comm.recv(source=source, tag=5) GL_Data = comm.recv(source=source, tag=5) #windowSize = comm.recv(source=source, tag=5) windowSize = [1024, 1024] mViewer = Viewer("viewer", windowSize, package) print_blue("GL : recv from runFunc (VerticsData)") mViewer.setGLData(GL_Data) #mViewer.initializeBuffer(vertices) #mViewer.initializeTubeShader() #mViewer.initializeCircleShader() print "init End!" mViewer.EnterMainLoop()