15,190 Topics

Member Avatar for
Member Avatar for krimgo

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

Member Avatar for krimgo
0
343
Member Avatar for krystosan

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

Member Avatar for Lardmeister
0
207
Member Avatar for josh.culley.31

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 …

Member Avatar for woooee
0
6K
Member Avatar for alice.cooper.18659

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

Member Avatar for alice.cooper.18659
0
198
Member Avatar for johans22

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 …

Member Avatar for johans22
0
150
Member Avatar for flebber

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 …

Member Avatar for flebber
0
2K
Member Avatar for in_xx

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 …

Member Avatar for vegaseat
0
478
Member Avatar for krystosan

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 …

Member Avatar for krystosan
0
239
Member Avatar for asaidi

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 …

Member Avatar for asaidi
0
96
Member Avatar for fonzali

hi , I have found vegaseats codes and tutorials helpful for biginners , how can I collect them in the pdf format?

Member Avatar for fonzali
0
157
Member Avatar for jeremywduncan

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 …

Member Avatar for woooee
0
269
Member Avatar for tony75

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 …

Member Avatar for tony75
0
660
Member Avatar for krystosan

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 …

Member Avatar for woooee
0
239
Member Avatar for 4evrmrepylrning

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 …

Member Avatar for 4evrmrepylrning
0
3K
Member Avatar for tizzqman

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 …

Member Avatar for Lucaci Andrew
0
178
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
214
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
332
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
910
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
588
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
273
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
269
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
167
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
443

The End.