15,190 Topics
![]() | |
Assignment Overview1 This assignment focuses on the design, implementation and testing of a Python program which uses file processing, lists and strings to solve the problem described below. Program Specifications: The New York Times newspaper has published “best seller” lists since 1942. Book sales are tracked nationwide, leading to a … | |
Recently I started coding a simple Game Engine in Python, but for some reason I couldn't remember how to get Pygame to recognize you clicked on a certain area. No sample code (sorry) but I was wondering if anybody knew how to make it so Pygame will recognize that the … | |
I'm using the BullionVault API to view my orders. I use the requests from the official documentation https://www.bullionvault.com/help/xml_api.html and python language. My issue is **the request response is the HTML DOM of the BullionVault login page**. Here is my code: login_page_url = "https://or.bullionvault.fr/secure/login.do" login_page_url2 = "https://live.bullionvault.com/secure/j_security_check" payload2 = {'j_username': 'myusername', … | |
Hi, can anyone explain to make script `downstream kbps` and `upstream kbps` ? It's totally Different method from ubuntu, because my `Os System` still window 7. Every second `downstream` and `upstream` must change... Thanks Before... Noted: Python2.7 | |
How do you catch incorrect entries? Instead of yes or no the user enters something else? def weather(): import sys raining=input('Is it raining? ').lower() if raining == 'yes': ask =(input('Do you have an umbrella? ')).lower() if raining=='no': print('Go outside 1') sys.exit(0) if ask == 'yes': print('Go outside 2') sys.exit(0) while … | |
Alright so I wrote a little program using Python 2.7 and the pygame module. For some reason, no matter what I do, the actual Pygame screen itself won't flip() or update() at all, no matter what I do. The code's pictured below(it's rather long): import pygame pygame.init() DISPLAY = pygame.display.set_mode((800, … | |
Recently I attempted to install Pygame for Python 2.5 on my new computer. The computer runs Windows 10 32-bit, and I have installed a 32 bit copy of Pygame, so there shouldn't be problems there. Whenever I enter my Python shell to attempt to import, this error happens: >>> import … | |
I want to use Tkinter funtion to create a a temperature calculator. I have all the code for the calculator, however using Tkinter function i cant figure out how to get the variable input by the users. I am new to python and programming, just started programming less then a … | |
I am new to python, in the below code i am reading 2 files and writing in 2 files. I want to open these files in seperate functions as to make some indented look. Can anyone suggest me how to do it? def compare(): memberReportFile=open("D:\MemberReport.txt", 'w') readableRulesFile=open("D:\ReadableRules.txt", 'w') membersFile=open("D:\Members.txt") rulesFile=open("D:\Rules.txt", … | |
Hello everyone, I have two files i.e Rules.txt and Members.txt. I have set different rules for different members. Now i have break down the rules comma seperately using the for loop. I want to compare each index of the 1st file with the respective index of the second file. If … | |
Hi, i still learning about python. Now i study learning convert ***bandwidth*** (**Byte**) from `ifconfig eth0`to **Kbps** The problem is, my pc using **os windows 7** not **linux/ubuntu** I dont know how to using command `ifconfig eth0` using win7. Any other way to solved this problem? | |
Please help me , I need to convert this C code in Python: #include<stdio.h> #include<stdlib.h> #include<conio.h> main() { system ("color F9"); float preco[150], precoNF, NFPreco_Produto[150]; //Vetores e variáveis que trabalham com preço int a=0, x=0, v=0, rel=0, y, i, aux, cod_exclui, troca; //Declaração de variáveis utilizadas para leitura, gravação, exlclusão … | |
Hi there, I need some help to finish that code, In fact, there is one problem in my code : The last line, when i tried to convert a hexadecimal number in int. The problem is, I got variables containing : ff or 00 or C6 etc... And i want … | |
I have a text file in the form like below sourceFiles { hello.cpp, hi.cpp, main.cpp, } headerFiles { hello.h, hi.h, } path { source [ what, how, which, ] header [ include, inc, head, ] } I need to populate several lists from this text file. So far I have … | |
I need to make multiple instances of a class, then use its methods to find the output. It is straightforward to write the code in multiple lines but I need a more efficient way of doing that. Basically, here is what I want to do in a loop: class test(object): … | |
Okay so my code is almost complete but I still need one small thing that I can figure out. When running my code it will add 5 when accelerating and subtract 5 when braking, but I need it to display an error when speed >0 when braking, then reset speed … | |
Okay so my code works, but I need a few more requirements for it and I can't seem to get them right even though they should be pretty simple. I just need the window to display an error message when the values entered are not numerical and when the values … | |
 I am trying to write a python code to verify for the presence of `.mp3` and corresponding `.json` file in the dropbox. dropboxmp3txt = self.driver.find_element_by_xpath('//android.widget.ListView/android.view.View/android.widget.TextView[contains(@index, "1")]') print dropboxmp3txt.text This gives me the output : `abc2016-05-05, 10.38.26.mp3` Which is perfectly fine!!! I need the similar xpath to find the … | |
Hi, I'm still practice learning Python. I have a litte homework, make Class method, Class Date and Class Delta without using import. it must be like this... `>>> date(2020, 5, 2) + delta(year=5)` `date(2025, 5, 2)` `>>> date(2020, 5, 2) + delta(month=3)` `date(2020, 8, 2)` `>>> date(2020, 5, 2) + … | |
Hi I have around 20 python files. Each time I run these files in the terminal this form one after another : python a.py python b.py python c.py python d.py python e.py python f.py python g.py . . . (I have provided general file names here) This process takes lot … | |
I have this point in (x,y) : ([27.266378342786531], [1.9505463431334713]) Now I want to use this point(I have many points,I want to know how can I use this point first ) to put it in the function below insted of x :(I have tried to make an array put i don't … | |
Please see attachment. Any help is appreciated! :D | |
I saw someone getting an assignment to implement the Vigenere Cipher, so I decided, just for the frig of it, to implement the Caesar Cipher. The algorithm below, however, doesn't account for spaces and punctuation. How can I account for those without redoing the whole thing? from random import choice … | |
Hello, I would like to create a chess game GUI but I have a problem with my code. When I run my programm, at the beginning, my code is supposed to read a ".lvl" file to place pieces on the chessboard (same method as in Mario Sokoban). However, it doesn't … | |
It's a simple script, giving me an error. I'm running it from a command line: scott$ python VerifyAboutPage.py chrome any And the error is: AttributeError: 'module' object has no attribute 'chrome' The relevant portions of the script should be: from selenium import webdriver import unittest, time, re, reporting, sys class … | |
I am trying to plot the picewise function below: rho0 = 3*10e-11 Rd = 3.15 Rc = 7 def Density(rho0, r, Rc, Rd): if r < Rc : return rho0 elif r> Rc : return rho0*np.exp(-(r-Rc)/Rd) r = np.linspace(0,20, 1000) y= Density(rho0, r, Rc, Rd) plt.plot(r, y) plt.show() I am … | |
Onager Ornery Clicker presents a grid of buttons. One says "Click Me!" and the rest say "Don't Click Me!" Clicking the right button scores a point, while clicking the wrong button costs a point. After each click the buttons reshuffle. There is a timer you can start and stop. You … | |
I'm developing a dirt-simple text editor for personal use, customized the way I like it. My biggest difficulty is with grasping how OOP works. Could you kindly review the following code and suggest improvements (or at least link further information)? Much appreciated. from tkinter import Tk, END, INSERT from tkinter.scrolledtext … | |
Hi I have some python file.i runs these file one by one as below on unix server. python f4761sk3.py python f4761sk2.py python f4761sk1.py python f4761se3.py python f4761se2.py python f4761se1.py python f4761pl3.py python f4761pl2.py python f4761pl1.py python f4761no3.py python f4761no2.py python f4761no1.py python f4761nl3.py python f4761nl2.py python f4761nl1.py python f4761ie3.py python … | |
I'm trying to use a "python loop through list" and execute a command on each line from the list found and in between sleep to give it time to finish that command. Here my script. I know it's the basic, but some one can help me to help me in … |
The End.