15,175 Topics
| |
This is for part of my homework in an Object Oriented Programming class. I debugged the top part to make it workable. I need help on how to delete a searched item and also think I am missing closing the database file at the end. The search function #2 is … | |
I don't get what's wrong with this code I keep getting a value error when i run this it says Traceback (most recent call last): File "rolling.py", line 40, in <module> dice1, dice2, dice3 = numb(dice) ValueError: need more than 2 values to unpack please help? def numb(dice): if dice … | |
how should i readout data from shell to python script variables.. ? process = subprocess.Popen("rsh botham 'ps -eo fname | grep sublime'",shell=True, stdout=subprocess.PIPE) process2= subprocess.Popen('hostname') | |
parser = argparse.ArgumentParser('Utility to display SyncId information.') parser.add_argument('ids', help='list of ids to dsiplay information related to them.') becuase if i pass more than one value to the function from commandline , i get error of multiple values being passed saying error: unrecognized arguments: second third the first one goes through … | |
Hi, I've succesfully created a new project in Python Django, but when I try to run the server using: python manage.py runserver I receive this error: Validating models... Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x10166b250>> Traceback (most recent call last): File "/Library/Python/2.6/site-packages/django/core/management/commands/runserver.py", line … | |
f = open(raw_input("File")).read().split() cows = f[0] data = dict(enumerate(f[1:],start=1)) print data nonloopy = [] loopy = [] def isloopy(cownum,data,did=[]): print " ",cownum,did cownum = int(cownum) if cownum in nonloopy: return False elif cownum in loopy: return True if cownum in did: return True if cownum == 0: return False did.append(cownum) … | |
Hi, I have been trying to solve a problem,i need to write code to an existing projectile class to calculate the maximum height reached by a projectile ,i have tried all possible solutions but seem stuck,here is the code below # Canonball in form of a class # projectile.py from … | |
Hi All, I have a project I am going to be starting shortly, just recieved the specs. I plan on using python with flask for this project and the question I have (for now) just has to do with the python. My question is, this calculator is going to calculate … | |
Hello, I have the following code that using list comprehension to find even numbers in list L. L = [1,2,3,4,5,6,7,8,9,10] K = sum([(i) for i in L if i%2 ==0]) I wanted to know if this was the most efficient way to sum list K? | |
Hi Im working with a python Odd numbers and my question is?. > An integer can either be odd (like 1,3,5,7,. . . ) or even (2,4,6,8,. . . ). > > 1. Write a python code which takes as input two numbers and displays all odd numbers between them … | |
Hello all! I am sorry to have to waste your time with such an easy problem but I am stuck with some coders block on this one. I know it is definitely an easy fix I just cannot seem to wrap my head around it at the moment... I do … | |
Hi everyone. I am just learning Python on class so I am really at the basic. I need to write a python program that will flip a coin 100 times and then tell how many times tails and heads were flipped. This is what I have so far but I … | |
i need to find density in video using optical flow in opencv python plz help me out to solve | |
I am a newbie to Python. I just have 2yrs experience in C# Asp.net Web form. I have gone through a couple of tutorials but I am still not sure. So, I decided to do a project as a way of learning better and I need help and guidance to … | |
Hi I’m working with an old python exercise is to implement the caesar cipher, a simple encryption technique. Description of the methods can be found on the web (wikipedia) http://en.wikipedia.org/wiki/Caeser_cipher and the additional document. In short, each letter is replaced by another letter (like a is replaced by b, b … | |
I have this simple first multiprocessing code in pyton,but I encounter a BSOD when running it.Can anyone please point out what is wrong with it ? import multiprocessing def cracker(): print "Hello" return procs = [] for i in range(8): p = multiprocessing.Process(target = cracker) procs.append(p) p.start() for p in … | |
Hello friends , I have two questions : 1) I was using psycopg2 for old versions of python 2.x , and now while using Python 3.3 , i can install psycopg2 , maybe it needs a special psycopg for Python 3.3 . 2) I could install py-postgresql , and i … | |
I've been using Tkinter a little and want a program with the save and save as functions. Does anyone know how? | |
the names and course and grade dont print, just the totals [Click Here](http://pastebin.com/BNz8VX3T) it reads a file text file [Click Here](http://pastebin.com/a2VjXjwz) the output should look like [Click Here](http://pastebin.com/Lt9uchM9) Im barely learning how to use the control break method and most of the program is broken up in functions. Im not … | |
Hello, I'm currently working a project for class and I've gotten stuck. I am suppose to write a program that will read a csv file and create a text file with information from this csv file. So, far I have code that prompts for the file name and gives a … | |
I have been using Python for a few months in a Windows environment with IDLE. I installed Python on my (new) Macbook and opened the same files, but am now getting strange results. These are scripts that worked fine in Windows: 1. When I use a function to open and … | |
The following code does the same lookups using a list and a dictionary. Lists are sequential in memory, meaning that the program has to get the offset for the beginning of the item it wants to use, go to that offset, compare to what it wants to find, and go … | |
Hello, I'm a newbie to python and I am having a very hard time trying to solve a homework question that I have. Here it is: Given a list of items, write a program that generates a list of lists of the following form: [a,b,c,…,z] → [[z], [y,z], [x,y,z], … … | |
how can i plot the graph for the below code.I am having matplot library.plot graph for time vs v1 and time vs v2 and in Time1.csv file for tS import csv def test1(): inputCSV = open(r'test.csv', 'rb') outputCSV = open(r'test1.csv', 'wb+') appendCSV = open(r'test1.csv', 'ab+') cr = csv.reader(inputCSV, dialect = … | |
Hello, I have added a image file to my code in tkinter but it basically fills my the whole frame so if its possible can you recommend a tutorial that shows or explains how to do this.... unless you can show me on here. I havent added my full code … | |
I want to make a program in which you can edit pictures or similar to paint in windows. Does anyone have any idea how? | |
I have 8 teams who have to play each other in a round-robin format, therefore 7 rounds, but only have 4 fields. How can I write a script to allocate fields to games in a fair manner so that any one team only plays on the same field as few … | |
Dear all , i have an csv file . I wanna copy content particular column and paste in another csv file.where i am trying to calcultion and plot graph assume original csv file contain i.e column 4 contain time(hh.mm.ss) format continue by other columns i wanna copy these data to … | |
pleae help how to start coding to concantenate strings that contains numbers and string | |
Hi, I just started learning python a few days ago...and I'm already stuck on something easy TT.TT I have a Tab-Separated-Values data.tsv file that contains 3 columns (country name, area, and population). here's a snippet of my current tsv file country area population MACAU 28.2 578025 MONACO 2 30510 SINGAPORE … |
The End.