15,190 Topics
![]() | |
Hi, I've just started out with Python and I've been stuck on this problem for a few hours now trying to parse a file into a certain format.. I am trying to create a list in a list out of a list. I currently have this list; ['MPNRRRCKLSTAISTVATLAIASPCAYFLVYEPTASAKPAAKHYEFKQAASIADLPGEVLDAISQGLSQFGINL', 'MQLVDRVRGAVTGMSRRLVVGAVGAALVSGLVGAVGGTATAGAFSRPGLPVEYLQVPSPSMGRSELPGWLQA', 'etc'] … | |
I am using Python 2.6 with ide and i created a list with names `names = 'mark', 'raymond', 'rachel', 'matthew', 'roger', 'judith', 'charlie', 'melissa', 'betty']` and then set `names = nmls` so even if I update names, nmls gets updated... however if I do `names = deque(['raymond', 'rachel', 'matthew', 'roger', … | |
I'm stuck writing some code for an intro programming class. I'm pretty sure the mistake is probably that I mixed integers with strings trying to get a result, but I'm just not sure which code I need to replace after messing with it all day and getting many different traceback … | |
I am currently trying to pull high,low, and closing stock data from Yahoo finance, and graph it using Turtle. I was able to pull the data from the url into a list but I can't figure out how to graph it. I know the dates have to be the x-axis, … | |
import logging ... log1 = logging.getLogger() How can I find out what is the file name + path used for logging?. Like to find that out from anywhere the logging is accomplished. also, for plotting, plot.xticks(), I like to create a range to force beginning tick, the ending tick and … | |
Hi I was doing an exercise in the Real Python book. It gave a task of simulating a coin toss "I keep flipping a fair coin until I've seen it land on both heads and tails at least once each – in other words, after I flip the coin the … | |
Hi, My project requires me to read in multiple ascii files and process them. So I am going to go through the data and using conditional statements store the result in lists. After this, I need to store this data and plot some of it using matlab and display the … | |
in the code from mox example on their page [[http://code.google.com/p/pymox/wiki/MoxDocumentation](http://code.google.com/p/pymox/wiki/MoxDocumentation)] where does PersonDao comes from ? import unittest import mox class DaoUnitTest(unittest.TestCase): def setUp(self): # Create an instance of Mox self.person_mocker = mox.Mox() def testUsingMox(self): # Create a mock PersonDao dao = self.person_mocker.CreateMock(PersonDao) # Return a value when this method … | |
HI i m new in linux and i have on my pc linux mint,now i just installed python 3 in my linux.. how i can use the gui to write some scripts i m learning python..and in the tuto he shows the gui in windows very easy to write how … | |
hi , I have found vegaseats codes and tutorials helpful for biginners , how can I collect them in the pdf format? | |
Hi again all, I have been tussling with this program all day. I can't seem to get pickle.dumps (or f.write..tried that earlier) to save without saving over itself. If I do a deposit(option 1) and then a withdraw(option 2), and then history(option 3), it only shows the last option ran … | |
Hi I would like to write the script that produces at least 6 encrypted password using crypt module and save them in a file called password.txt but I get error? and How can I add more than 6 encrypted password ? import crypt import random, string password = input("Please ender … | |
I wrote this function earlier to set the priority if the items in listwidget, however what I think would be more pythonic is to write get and set priority method... how should i proceed with writing the method in a pythonic way ? def changePriority(self,direction): """ Reorder the items in … | |
I'm trying to extract some metadata from a m4v file. I'm looking for the duration, height, width, etc. I do all my programming on a Raspberry Pi and was looking at gexiv2 but could not get it going. I got exiftool working though. My script looks like this: import exiftool … | |
I am trying to make a simple cryptography program using a simple subsitution method. If any one could help that would be nice. I need to be able to encode it as well as decode it. but im just a little confused on how to go about doing that. here … | |
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 … |
The End.