15,181 Topics
| |
I have the following code: lista_cosas=[] class cosa(): global lista_cosas def __init__(self,color): self.color=color def operacion(self): if self.color=="verde": lista_cosas.append(cosa("azul")) else: lista_cosas.append(cosa("verde")) c=cosa("verde") lista_cosas.append(c) n=0 while n<10: n+=1 for cosa in lista_cosas: cosa.operacion() and it gives me the following error: Traceback (most recent call last): File "C:/Users/elster/Desktop/Cancer modelling with python/recursive_test.py", line 21, … | |
I'm hoping to create a scheduler based on data extracted from an Excel (2016) spreadsheet. At the moment I'm using Ubuntu 14.04 LTS with the desire to port the completed project to Android through Bulldozer. I like what I've heard about the simplicity of Pyqt. The completed project must work … | |
Random Number File Writer: Write a program that writes a series of random numbers to a file. Each random umber should be in range of 1 through 500. The application should let user specify how many numbers the file will hold. Which I have. __author__ = 'Preston Howard' # Random … | |
Assignment - Create a program that asks user: 1. enter amount of money invested, number of years investing, and annual interest rate in decimal format 2. call a user-defined function to get total value at end of investment term(futureValue) 3. call another user defined function to get total interest earned. … | |
Hi guys. I have a program where users enter in their username and password. If the password and username match with the record stored in a database, they are able to pay a game which opens in a new window. If the entered information is correct, I want to print … | |
I want to consider Arrival Column and Departure, but let me consider the ARRIVAL. I have "Paris" and "Los Angeles", I want to create a dictionary that will deplay everything associated to the "Paris" and every that has to do "Los Angeles". In case they are more than more than … | |
Hi, I am trying to build a scrapper and for that I am using mechanize to get the page source then beautiful soup to parse it. But yesterday I faced a very strange error the page source which I am getting is kind of binary, though from browser I can … | |
Here is a weird regular expression for emails . We can have various kind of email addresses [email]string1@somemail.com[/email] [email]string1@somemail.co.in[/email] [email]string1.string2@somemail.com[/email] [email]string1.string2@somemail.co.in[/email] The following regular expression can find any of the mails above email2="santa.banta@gmail.co.in" email1="arindam31@yahoo.co.in'" email="bogusemail123@sillymail.com" email3="santa.banta.manta@gmail.co.in" email4="santa.banta.manta@gmail.co.in.xv.fg.gh" email5="abc.dcf@ghj.org" email6="santa.banta.manta@gmail.co.in.org" [CODE]re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email2) >>> x.group() 'santa.banta@gmail.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email1) >>> x.group() 'arindam31@yahoo.co.in' … | |
Hi, I'm trying to write code that will allow me to assign values to lists of strings. I then want to compare user input to the lists and create a scoring system based on what has been typed in. For example if the input contains letters in list1 then the … | |
My issue is much. I have a csv file, and want to select where Arrival or Departure and must be the same "date and time" have the same value. I can only read from csv file but can't go further import pandas as pd df = pd.read_csv("data.csv") row = next(df.iterrows())[1] … | |
Hello, i need help with my project. Im making a program that encrypts and decrypts the contents of a text file. I had to generate an 8 character key which is converted to ascii and then calculate the offset factor of the key that was generated (New every time program … | |
Hi everyone I am new with you. I study in the university, they teaching us many programming languages. I wont you to help me to found the best to focus on. thank you by the way I am good in java ... | |
hi! i want to place the contents of a dictionary into a csv file. Can someone help me with this? i already have the code in reading the csv file [CODE] import csv reader = csv.reader(open("c:\sample.dat")) for row in reader: print row [/CODE] i want the first element of the … | |
hi this is my quiz. what i need to do is add a thing at the start where it askes the user their age. if the user is under the age of 5 they will only be asked 5 question and if there 5 or above they will be asked … | |
Hello friends, I'm currently in Tech class doing a project on a very old version of python and need help animating a moving object. I have no idea what to do please help i need to create a winter wonderland Landscape with a cabin, trees, a chimney with active smoke … | |
hi there what i've tried a lot is to make it so at the start of the quiz it asks the user there age. if the user is under 5 they will only be asked 5 questions and if there over 5 they will be asked all 10 #rhys translation … | |
I have a form from which I can launch various Test Modules. The Form has 16 PushButtons, one for each of the possible Modules. I need to disable Button_2 through Button_11 until the Modules that are connected to Button_1 and Button_0 are succesfully completed. The Buttons are on a pyQT … | |
I am trying to find out if a button is disabled....If it is , I want to enable it . For example : if button disabled: self.convertButton.setDisabled(False) So what can be button disabled be? | |
Hi this is a quiz i'm making for school. I've tried to add a restart but nothing worked. i want it to say "do you want to restart". the user then types yes or no and it will begin the quiz again. PLEASE HELP thanks # rhys translation quiz #intro … | |
Just a simple exploration of the goslate module (uses the Google Translate API) to translate some common languages. However, some IDE's create character problems. Note: Your computer has to be connected to the Internet to access Google. | |
I have been using Eric to develop Python2.7 code for a while. I have just tried to look at Python3 and cannot figure out how to do it in Eric. Setting > Preferences > Python says Python2 uses .py extension, Python3 uses .py3 I create hello.py3 #!/usr/bin/env python3 from platform … | |
Hi guys, could you tell me how to solve this problem. This is what i've done. The result show : [9, 2, 6] [3, 9, 5] l1 = [4,9,2,6] l2 = [3,9,4,5] i = 0 j = 0 while(i < len(l1)): while(j < len(l2)): if(l1[i] == l2[j]): del(l1[i]) del(l2[j]) j … | |
Hi I got this error when I ran my scrip? import vidcap,time ImportError: No module named vidcap Where can I download the module? | |
| So I am trying to make this code run in a constant loop. Any ideas how I would do this? As I said before I am trying to self teach myself Python and so far I have been successful. import os import datetime import time print('What would you like to … |
Hi, I need help if my Pseudocode is correctCreate and load an array with the following 7 values. Then add one more word (of your own choosing) to the array for a total of 8 words. This is a very basic programming class. We use Raptor lol biff comely fez … | |
| So I am trying to self teach myself Python, and so far it is working great. However I have ran into a bump in the road and can't really figure out why this script isn't working... Any ideas? import os answer = raw_input('Ready for shutdown, continue?') if answer == raw_input('Yes'): … |
Hello , Let's say I have : def mine( a, b ): return a>=b - 1 I can't understand what's going on with the -1. So , if a = 4 , b = 2 , it gives True If the opposite it gives False. As I said I don't … | |
Hi I have an python script send me log files and ip address from my PC-B Is it posssible to add functins that I can Remote uninstall (distance)my script from my PC-B? if yes how? any idea? | |
char patron10(int m , int n ) char patron10(int m , int n ) { for ( int = 0 ; i < m ; i++) cout<< "." ; int a = 0 ; while (True) { cout<< 10*a ; if (10*a >= n) break ; for ( int i … | |
Hello, I'm a python beginner & I'm learning it on my own. So, I've few (dumb) questions about it. - Where should I host a python project on linux? I'm sure there'd be multiple choices. So, Where would you host it & on what circumstances? - I understand that `virtualenv` … |
The End.