15,175 Topics

Member Avatar for
Member Avatar for jeremywduncan

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 …

Member Avatar for woooee
0
207
Member Avatar for johnny0627

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 …

Member Avatar for woooee
0
210
Member Avatar for krystosan

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

Member Avatar for krystosan
0
331
Member Avatar for krystosan

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 …

Member Avatar for Gribouillis
0
25K
Member Avatar for ebc3142

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 …

Member Avatar for LastMitch
0
909
Member Avatar for james.lu.75491856

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

Member Avatar for woooee
0
587
Member Avatar for zaphoenix

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 …

Member Avatar for zaphoenix
0
2K
Member Avatar for lancevo3

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 …

Member Avatar for slate
0
144
Member Avatar for dirtydit27

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?

Member Avatar for dirtydit27
0
240
Member Avatar for tony75

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 …

Member Avatar for tony75
0
271
Member Avatar for mkweska

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 …

Member Avatar for mkweska
0
266
Member Avatar for Steph102

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 …

Member Avatar for Gribouillis
0
16K
Member Avatar for joseph619

i need to find density in video using optical flow in opencv python plz help me out to solve

0
107
Member Avatar for qbektrix

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 …

Member Avatar for cproger
0
166
Member Avatar for tony75

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 …

Member Avatar for tony75
0
442
Member Avatar for delta_frost

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 …

Member Avatar for delta_frost
0
583
Member Avatar for Ismatus3

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 …

Member Avatar for Ismatus3
0
285
Member Avatar for entropic3105

I've been using Tkinter a little and want a program with the save and save as functions. Does anyone know how?

Member Avatar for vegaseat
0
302
Member Avatar for Fernando_1

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 …

Member Avatar for woooee
0
313
Member Avatar for dirtydit27

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 …

Member Avatar for dirtydit27
0
460
Member Avatar for karenhaha

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 …

Member Avatar for karenhaha
0
265
Member Avatar for woooee

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 …

Member Avatar for sepp2k
1
202
Member Avatar for dirtydit27

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

Member Avatar for Lucaci Andrew
0
294
Member Avatar for ajit.nayak3

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

Member Avatar for TrustyTony
0
254
Member Avatar for Plonkaa

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 …

Member Avatar for vegaseat
0
313
Member Avatar for entropic3105

I want to make a program in which you can edit pictures or similar to paint in windows. Does anyone have any idea how?

Member Avatar for entropic3105
0
183
Member Avatar for paulmal

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 …

Member Avatar for Gribouillis
0
139
Member Avatar for ajit.nayak3

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 …

Member Avatar for bumsfeld
0
315
Member Avatar for cthornton71

pleae help how to start coding to concantenate strings that contains numbers and string

Member Avatar for IIM
0
83
Member Avatar for jellyworms

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 …

Member Avatar for bumsfeld
2
285

The End.