15,181 Topics
| |
I have a file that contains a class, its called test.py. How can i call on that class within another file called xml.py? | |
Hi everybody, I'm doing some programming in Flask, and as part of the program I'm doing a basic system of logging in, but that's not where my problem resides. During my programming, the page that is supposed to verify a login absolutely refuses to go past a specific line of … | |
| Hey, Im working on the UNO game in python and am almost done with the rest of the code but I am not able to print the UNO logo as of yet. Please help. I need to submit my work tomorrow. |
i have a set of code for a gui that runs using a dictionary but i cant get the code to exit once the user presses the last button named end import sys import tkinter as tk from functools import partial class Situation(tk.Frame): def __init__(self, master=None, story='', buttons=[], **kwargs): tk.Frame.__init__(self, … | |
If you run the following code (on Windows 7, Python 2.6.5), you should see a light border around a black square and some text below it. How do I get rid of that border? Thanks! [code=python] from Tkinter import * class App: def __init__(self, master): #background frame self.bgFrame = Frame(master, … | |
Hi, how do we write value into text file in wxpython. As in python, file_out = open("filename", "wb") is used (as far as I know). Im trying to write the value from textctrl using: self.val = self.textctrl.GetValue() So, as for the next step to write the value into text file, … | |
hello ive been trying to get a sound file to play once i press a button in a situation using winsound but i am unable to get the audio to play here is the code i have import winsound import tkinter as tk from functools import partial # a quick … | |
I want to draw the following graph in python. https://pasteboard.co/JKp5Iyc.png There are two equation as follow and I want to draw them with matplotlib. https://pasteboard.co/JKp6eWW.png Because I don't have any numeric value I had some trouble drawing them. Many thanks in advance. | |
a. Create an application to calculate the GPA of a student. b. GPA calculation must also take into account courses / subjects with UM status (Repeat Subjects). c. The number of subjects / courses entered by students / system users is not fixed. d. Students only need to enter the … | |
i have tried below as python but got error while calling result = kth_element_finder(arr1,arr2,arr1+10,arr2+5,k) i want the given cpp code in python, can you help me out on this please cppcode: int kth(int *arr1, int *arr2, int *end1, int *end2, int k){ if (arr1 == end1) return arr2[k]; if (arr2 … | |
I have multiple .TXT files in a folder. Each text file has the same outline of paragraphs out of which I wish to select everything between 2 specific words. I have a regex code for finding the particular text of interest. The aim is to write a python code that … | |
import time #this inports time for the sleep command in line number three... print("This Program is a speed calculator") #This Program Will take user input as distance and time and gives output as speed time.sleep(3.5) #this line adds a puase in the print funtion so the user can readthe line … | |
Hello, I'm a newby to Python and I want to write a function which imports a CSV file and returns a dictionary for each subcategory of a column: other: 6, teacher: 3, services: 2, health: 1 Any advice? Thanks! ![Schermafbeelding_2021-01-07_om_22_21_47.png](https://static.daniweb.com/attachments/4/0ea446ffd447c73b0031dfd0fdddbfe8.png) | |
Rick is really fond of fruit juices, but he is bored of their traditional flavours. Therefore, he has decided to mix as many of them as possible to obtain something entirely new as a result. He has N glasses, numbered from 0 to N-1, each containing a different kind of … | |
Hello, I'm a newby to Python and I want to write a function which imports a CSV file and returns a dictionary for the index of each subcategory in a column like this: hockey: 3, Tennis: 54, volleyball: 59. Any advise on how to adjust my code? Thanks! import csv … | |
class Test { char Paper[20]; int Marks public: Test() //Function 1 { strcpy(Paper,”Computer”); Marks=0; } //Function 2 Test(char P[]) { strcpy(Paper,P); Marks=0; } //Function 3 Test(int M) { strcpy(Paper,”Computer”); Marks=M; } Test(char P[],int M) //Function 4 { strcpy(Paper,P); Marks=M; } }; | |
Hello I need to do a function that reads from a text file and returns me a new text file with a calculation Average max and min Each line in the file includes a location after ' : ' There are real numbers that are forded by a sign ' … | |
I have a code of c++ and i want to convert it into python i shall be thankful to you. | |
from socket import * #Start test() def test(): #Specify the port serverPort = 80 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) #Listen for the 1 connection serverSocket.listen(1) #Print the port address print("web server on port",serverPort) #Start thw while loop. while True: #Establish the connection. print("ready to serve") #Create connection socket for accepted client. … | |
The printer seems to be a much ignored computer peripheral when it comes to programming. This little code snippet explores one way to send text to the default printer. It actually draws the text into an imaginary box on the paper. You can specify the upper left and lower right … | |
Hi! Can you please help me to interupt this pseudo code to real python code! def authenticate_user(credentials: str) -> bool: """Procedure for validating user credentials""" username = 'Chevy_Chase' # Expected username. MAY NOT BE MODIFIED!! password = 'i0J0u0j0u0J0Zys0r0{' # Expected password. MAY NOT BE MODIFIED!! user_tmp = pass_tmp = str() … | |
Create a dialog box and add text entry box and colour to the dialog box and text using wxpyton | |
How to use object based coding to create dialog box in wxpython add only close button | |
I am a final year student. Now I need to start work for final project. But I am not familiar how to do it. Can you help me out, How to prepare a index page for my website ( Complaint website). Or if you have completed project before, Please send … | |
| |
In this pattern, n represents the dimensions of the shape pieces and k their number of repetitions. For example, if **n** input is 3 and **k** input is 5, the following figure will be the output of the program. ![Screenshot_(631).png](https://static.daniweb.com/attachments/4/d6ce9d095cf0984a75b33841cd98f248.png) | |
I have checked various sites about, "**How to balance chemical equations thru programming by usiong python or c++ ?**." They all have simple easy equations, but how do we programme Chemical Equations which consist **Ions/ Hydrates**. If some one knows how to do that please respond. A slight idea can … | |
Hi everyone I'm new in python, I need to read the first 10 line of multiple .txt files (from s1 to s50) in folder and save these values of each file in another file (separately) and then read the second 10 lines of (s1 to s50) then save the second … | |
Hi guys, I have this assignment and I have to write a program to translate file from Piglatin to english without using the split function. My code only works for a word and I can't figure out how to do it for a sentence without the split function. Thanks in … | |
I just started using python a couple of days ago, so I am a complete beginner. Basically what I am trying to do is the following. Imagine that I have a string variable such as: food = 'bread' I want to create another variable (integer or another type) so that … |
The End.