15,190 Topics

Member Avatar for
Member Avatar for henks83

I have no idea how to do this. Please help. This week's lab is to design a hangman game. Your program should be able to open a text file which contains a list of words (one word on each line of the text file) and read the words into a …

Member Avatar for masterofpuppets
0
954
Member Avatar for bunkus

Hi, I tried the following code to capture the contents of the foreground window to an avi-file. It works under Python 2.6 and OpenCV2.0 though it only takes about 210 shots and then crashes. I think it might be a memory problem. Any ideas? You need to resize the window …

Member Avatar for bunkus
0
823
Member Avatar for AutoPython

I can't find a compiler to compile version 3 Python scripts to .exe. All the compilers I see are all for Python 2.

Member Avatar for vegaseat
0
186
Member Avatar for tomtetlaw

I tried to make a leet speak converter, but it outputs characters that I don't even tell it to.. This is what I mean: (Test run) Enter something to convert to L337 5P34K: Hi, how are you? L337 5P34K equivilent: hi,@H0w 4R3 Y0u? I don't know why it's got the …

Member Avatar for willygstyle
0
531
Member Avatar for m.albert

Hi I have made a small program to record sound. I have a TK window with a record button. I would like to add a vumeter to this TK window. I use ubuntu and pulseaudio. If I type pavumeter in the terminal window I see a (pa) vumeter on my …

0
68
Member Avatar for thehivetyrant

Greetings Pythoneers. I've got this problem and the problem is thus: i have drawn a shape using [B]pygame.draw.circle[/B] i am finding it hard to make it move. i tried [icode]self.move_to(self.x-5,self.y)[/icode] and also [icode]self.forward(random.randint(0,10))[/icode] (Where forward is defined as a function as [icode]self.x,self.y + 10[/icode])<== I dont think i defined the …

Member Avatar for vegaseat
0
8K
Member Avatar for P3run

I just started to learn Python before a week or so and i found this example and rewrited it in Notepad++ (btw it was really painfull to figure out how to connect Notepad++ with python.exe but i like notepad++ more than Python GUI) and this program just wont work nor …

Member Avatar for snippsat
0
130
Member Avatar for python.noob

Hello geeks, First of all thanks to the members of this forum for their active participation, contribution and willingness to help. Now i'm in need of your valuable suggestions for my project in python. 1) I want to have GUI interface in my project and now i'm using python 3.1.1. …

Member Avatar for vegaseat
0
136
Member Avatar for nerdagent

Just like the title says. I need help on clicking on a box in a grid and filling it in with a color. Right now each block is 10x10 so I would have to use a 9x9 rectangle so it doesn't overlap. [CODE] #!/usr/bin/python import pygame,os,sys from pygame.locals import * …

Member Avatar for vegaseat
0
2K
Member Avatar for mishu5770l

I want to create a string like this: (just theoretically:-)) [CODE]import random list1 = ["1", "2", "3"] string1 = random.choice(list1) string2 = "Random Number is" + string1 [/CODE] but I want string2 to show up formatted like this: Random Number is [INDENT] 2[/INDENT] But, for the life of me I …

Member Avatar for vegaseat
0
104
Member Avatar for johnroach1985

Hi there, Trying to write a small script in python. What it will basically do is this; 1- A SSH user initiates the python script (from SSH remotely) 2- The script gets the connected users IP (the user is connected through SSH) 3- The connected IP is sent back to …

Member Avatar for johnroach1985
0
2K
Member Avatar for mms6

binding_locations(strA, strB) My specifications The first parameter represents a strand of DNA. The second parameter is one strand from a recognition sequence. Return a list of all the indices where the recognition sequence appears in the DNA strand. (These are the restriction sites.) ------------------------------------------------------- For example, if the DNA palindrome …

Member Avatar for AutoPython
0
100
Member Avatar for nizbit

This is a very basic question, but I'm very new to python. I want to read data in a file. The data is between two delimiters. I'm not exactly sure how I can extract the data and skip the delimiters. Any help would be great.

Member Avatar for vegaseat
0
274
Member Avatar for simpatar

Ok my program looks like this: [CODE]U = set([0,1,2,3,4,5,6,7,8,9]) A = set([2,4,5]) B = set([5,8]) C = set([5]) def main(): print('This is a program to give complement to given elements') x = input('Enter elements bla bla: ') y = U.difference(x) print('The complement of given elements are:', y) main()[/CODE] As you …

Member Avatar for simpatar
0
80
Member Avatar for rackster992

Hello Everyone I am new to this forum and new to learning Python. I was looking for a good book to help teach it to myself and on a recommendation purchased the book [I]Python Programming In Context[/I] by Bradley Miller and David Ranum. This is a good book in terms …

Member Avatar for dcghelp
0
1K
Member Avatar for Yeen

I ran into a something I did not expect when making a small program. I'm not including the whole program, just exemplifying the stick in the wheel, as it's part of a homework assignment. I'd just like some clarification on why the last "x = 1" is ignored. [CODE] x …

Member Avatar for pspwxp fan
0
98
Member Avatar for prbalamurugan

Hi to all, I am new to python environment,i got the knowledge about REST and python.. But i didn't know how to implement it... I requesting you to give me some suggestion...

0
39
Member Avatar for zyrus001

I have a wx.ListCtr: [CODE] self.resultList = wx.ListCtrl(self.rightPanel, -1, style=wx.LC_REPORT | wx.EXPAND) f = self.GetFont() dc = wx.WindowDC(self) dc.SetFont(f) i = 0 for items in (SEARCHPARAMS): self.resultList.InsertColumn(i,items) width, height = dc.GetTextExtent(items) self.resultList.SetColumnWidth(i, width) i +=1[/CODE] I'd like to populate the ListCtrl from a dictionaries contained within an object list. I …

0
48
Member Avatar for krishna_sicsr

Hi All, I need to parse the out from following output: I need to get the adapter detail after the heading "System Adapter Configuration:" This adapter detail is in 2nd cloumn like ACPI_IA64_P, ACPI_IA64_B, XBUS and PCI. I have marked the desired output in [COLOR="Red"]RED[/COLOR] color. Please help me in …

Member Avatar for krishna_sicsr
0
137
Member Avatar for mms6

I want to allow certain characters to a string For example I want strA to contain either 'A' or 'B' or 'C' or 'D' How do I do that, help would be greatly appreciated. Thanks strA = 'A' or 'B' or 'C' or 'D'

Member Avatar for mms6
0
86
Member Avatar for scrace89

I'm having a tough time figuring this out. we need to fill in the blanks [CODE]import ____________ def wordCount(): lineCnt = 0 wordCnt = 0 charCnt = 0 list = [] ______________ = _______________("Enter the filename : ") file = ________(filename, __________) for _________ in file: ____________ += 1 list …

Member Avatar for vegaseat
0
381
Member Avatar for nevets04

[code] def a(classname,highdamageweaponname,lowdamageweaponname,ldmgname,hdmgname,yourhealth,enemyhealth,ldmgspellname,hdmgspellname): import os import random os.system("clear") monsters = ['cyclopse', 'duck', 'dragon', 'wizard', 'magician'] randommonster = random.choice(monsters) print "Class: %s" % classname print "1) %s (More damage, but less armor)" % highdamageweaponname print "2) %s (Less damage, but more armor)" % lowdamageweaponname a = int(raw_input("You are battling a %s …

Member Avatar for nevets04
-2
310
Member Avatar for rush_ik52

hey guys.. I wana implement a stop watch in python... The timer turns on when my program starts and continuesly shows the time spent until the end of the program.. Can someone please help me with this..??

Member Avatar for snippsat
0
822
Member Avatar for bdesc100

I am trying to add a path to sys.path fix an error importing numpy. If I do: [CODE]import sys sys.path.append('/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages') print sys.path[/CODE] then path that I just added shows up and import numpy works. However, if I restart IDLE and try to import numpy again, I get an error. How …

Member Avatar for vegaseat
0
4K
Member Avatar for mms6

My code is [CODE]def is_base_pair(str1, str2): if lens(str1) == 1 and lens(str2) == 1: if (str1 == "A" and str2 == "T") or (str1 == "G" and str2 == "C") or (str1 == "T" and str2 == "A") or (str1 == "C" and str2 == "G"): return True else: return …

Member Avatar for vegaseat
0
128
Member Avatar for msaenz

I have a dicationary [code=python] x={'symbol':LTV,'user':derek,'where':home,'time':night} [/code] Obviously when u print it the dictionary doesnt keep the order you put them in. how do i have a dictionary that has it the way i input them? I looked online, but not sure to you cmp, lambda, etc? Thanks for the …

Member Avatar for vegaseat
0
164
Member Avatar for Kolz

Return the longest odd-length palindrome centered at the int index in the str. Assume that the index is valid, that the length of the str is at least one, and that there are only lowercase letters: no punctuation, spaces, or uppercase letters. I just want to know what this question …

Member Avatar for masterofpuppets
0
152
Member Avatar for bol0gna

I am reading in files containing 238 x 1 feature vectors. Attempting to grab the first 2 numbers in each file to create a 2d plot using numpy. I've got a decent start, just am stuck on how to fill the np array that I want to plot. [CODE] import …

Member Avatar for bol0gna
0
351
Member Avatar for mms6

[CODE]def get_even_palindrome_at(user_input, index): user_input = user_input.lower() user_input = remove_non_words(user_input) start_index, end_index = index, index while start_index >= 0 and end_index < len(user_input): if user_input[start_index] == user_input[end_index]: start_index -= 1 end_index += 1 else: break result = "" count_index = start_index while count_index < end_index: result += user_input[count_index] count_index = count_index …

Member Avatar for Kolz
0
71
Member Avatar for topcat712

Hey there, I've never actually used a forum to ask for help on any sort of project before, but I'm a little stuck.. okay, a lot. =D It's probably something really stupid and minuscule, though. Anyway, heres the project.. I hope it's not too confusing: Write a program that asks …

Member Avatar for snippsat
0
1K

The End.