15,181 Topics

Member Avatar for
Member Avatar for adam291086

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?

Member Avatar for chethan_2
0
14K
Member Avatar for Nether_1

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 …

Member Avatar for Reverend Jim
0
75
Member Avatar for Tima_2

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.

Member Avatar for rproffitt
0
36
Member Avatar for mangle200

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, …

Member Avatar for rproffitt
0
167
Member Avatar for kingmu

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, …

Member Avatar for Madnokof
0
11K
Member Avatar for Rusyaidi

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, …

Member Avatar for rproffitt
0
29
Member Avatar for mangle200

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 …

Member Avatar for rproffitt
0
386
Member Avatar for Ali_139

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.

Member Avatar for rproffitt
0
51
Member Avatar for d088814

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 …

Member Avatar for tinstaafl
0
66
Member Avatar for peru60220

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 …

Member Avatar for rproffitt
0
77
Member Avatar for iShockk

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 …

Member Avatar for Dani
0
112
Member Avatar for Prem_13

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 …

Member Avatar for Dani
0
25
Member Avatar for timjohns

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)

Member Avatar for rproffitt
0
30
Member Avatar for obedz

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 …

Member Avatar for Chrisphine
0
3K
Member Avatar for timjohns

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 …

Member Avatar for Dani
1
343
Member Avatar for 28-Ivan

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; } };

Member Avatar for rproffitt
-1
39
Member Avatar for nadi_1

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 ' …

Member Avatar for rproffitt
0
94
Member Avatar for Arslan_7
Member Avatar for rproffitt
0
50
Member Avatar for Computer Doctor

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. …

Member Avatar for JamesCherrill
0
200
Member Avatar for vegaseat

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 …

Member Avatar for Djcordeiro
2
4K
Member Avatar for Mohammad eyad

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() …

Member Avatar for rproffitt
0
38
Member Avatar for Nikita_14
Member Avatar for Nikita_13
Member Avatar for Alamgir_3

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 …

Member Avatar for Dani
0
45
Member Avatar for 21savage
Member Avatar for Alien_1

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)

0
55
Member Avatar for Rudrakshi Rajalaxmi

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 …

Member Avatar for rproffitt
0
25
Member Avatar for lena_

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 …

Member Avatar for rproffitt
0
53
Member Avatar for Amelie_3

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 …

0
16
Member Avatar for jopeto

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 …

Member Avatar for Rayalacheruvu
1
102K

The End.