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
+0 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

from PyQt5 import QtCore, QtGui, QtWidgets # Import the PyQt5 module we'll need import sys # We need sys so that we can pass argv to QApplication import design # This file holds our MainWindow and all design related things # it also keeps events etc that we defined in Qt Designer import os # For listing directory methods class ExampleApp(QtWidgets.QMainWindow, design.Ui_MainWindow): def __init__(self): # Explaining super is out of the scope of this article # So please google it if you're not familar with it # Simple reason why we use it here is that it allows us to …

Member Avatar
+0 forum 0

Hi guys, I developed JIT compiler for Python. It compiles simplified Python code directly to x86 native code. Focus here is usage on SIMD instructions. With SIMDy you can easily outperform C++ in compute intensive tasks like monte carlo simulations, rendering, fluid simulations, etc... Web(WIP): www.tahir007.com I would like to hear your opinions about SIMDy package!

Member Avatar
+0 forum 0

I have two dataframes and I need to separate rows where a value from pmdf matches one of the codes in jcrdf.All_codes. If pmdf.code is in jcrdf.All_codes, I need a dataframe with all values from jcrdf AND pmdf.count. Dataframes: pmdf = pd.DataFrame( { 'code': ['0567-8315','0007-4977','0096-0225','1365-2133','8675-309J'], 'count':['6','7','10','2','1'] } ) jcrdf = pd.DataFrame( { 'jobtitle': ['manager','technician','noob','retiree'], 'location': ['loc1','loc3','loc4','loc2'], 'jcode' : ['4444-4444','3333-3333','2222-2222','1111-1111'], 'All_codes': ['0096-0225,0096-0225','1820-7448,0567-8315,0567-8315','0007-4977,0007-4977','0007-0963,0007-0963,0366-077X,1365-2133'] }) I have a lookup that allows for a diff: jcrdf_lookup = pd.DataFrame(jcrdf['All_codes'].str.split(',').tolist(), index=jcrdf.jcode).stack(level=0).reset_index(level=0) matches = jcrdf_lookup[jcrdf_lookup[0].isin(pmdf.code)] jcrdfmatch = jcrdf[jcrdf.jcode.isin(matches.jcode)] jcrdfnomatch = pmdf[~pmdf.code.isin(matches[0])] But I can't figure out how to include pmdf.count. I tried making a df of the …

Member Avatar
+0 forum 0

hello freinds i have put an image (self.image) on my window background now, i need to put another image(mi_but1) on this window.. my problem: image mi_but1 is put on window with a gray square behind it(a gray square between image mi_but1 and window's background) .the final gui doesnt look nice.i don't want this gray background... what should I do? how can i remove this gray square behind the button(button background)? OR how can i put the image of window background(self.image) in behind of the button (button background) my code: from tkinter import * from PIL import Image, ImageTk root = …

Member Avatar
+0 forum 0

I want to display the content of selected treeview only in tkinter but when i select the treeview other treeview content also display but i want only the selected treeview to display. I have working around to get this by the use of style widget but it display other content to which i dont want to display until i select it to display. from tkinter import * from tkinter import ttk import tkinter as tk root =Tk() root.geometry("1000x450") tree = ttk.Treeview(root) tree.insert("","0","item1",text="LANGUAGE") tree.insert("","1","item2",text="GUI") tree.insert("item1", "0", text="pyhton") style = ttk.Style(root) style.configure("Treeview", rowheight=50) tree.configure(style="Treeview") tree.config(columns=("NOTE","book")) tree.column("NOTE",width=300) tree.heading("NOTE",text="Info") tree.column("book",width=300) tree.heading("book",text="profile") tree.set("item1","NOTE","Am using python …

Member Avatar
+0 forum 0

Hello everybody! Today i am writing a program to connect usées without database, with only one function: `createaccount(username,password)` That you must write on the beginning if the program. But i don't know how to finish it, with the "connect" function : class User(): def init(self, inputusername="a", inputpassword="b"): self.username = str(inputusername) self.password = str(inputpassword) def createaccount(user,pw): user = User(user,pw) def connect(userinput,pwinput): what? def loadaccounts(): createaccount("user1","mypw") createaccount("testuser","testpassword") def askuser(): while True: user = droid.dialogGetInput("User","Entrez votre nom d'utilisateur").result pw = droid.dialogGetPassword("Password","Entrez votre mot de passe").result if connect(user,pw) == True: print("ok") break else: break I am french, and so my program is. Don't Give …

Member Avatar
+0 forum 0

import urlparse import urllib import urllib2 from bs4 import BeautifulSoup from collections import Counter import re import Tkinter from Tkinter import * import ttk from tkFileDialog import askopenfilename import logging import tkMessageBox import tkFileDialog import csv import json import os import time import collections import shutil import thread from PIL import Image, ImageTk from timeit import default_timer as timer from functools import partial # In[27]: # Identify all the possible links from the starting URL # dedupe the URL list to get the unique list of URLs to scrape url="http://www.dawsons.co.uk/finance-information/" urls=[url] #stack of urls to scrape visited=[url] #historic record of …

Member Avatar
+0 forum 0

How can i set a frame according to parent window size? I was trying to set it but it is taking only region where button displayed from Tkinter import * class Example: def __init__(self, parent): self.parent = parent self.parent.title("CBLFinder") self.initUI() def initUI(self): self.frm1=Frame(self.parent,background="white",\ borderwidth=5,relief="sunken",\ width=400,\ height=500) #print self.parent.winfo_reqwidth(),self.parent.winfo_reqheight() btn=Button(self.frm1,text="Submit",command=self.update_frame) btn.grid(row=2,column=2,padx = 5, pady = 5) self.frm1.grid(row=0,column=0,sticky=(N,S,E,W)) def update_frame(self): self.frm1.grid_forget() def main(): root = Tk() root.geometry("250x150+300+300") app = Example(root) root.mainloop() if __name__ == '__main__': main()

Member Avatar
+0 forum 0

The End.