15,190 Topics

Member Avatar for
Member Avatar for sob_andizzle

my assignment is to write a program that asks the user to enter the name of the artist, the name of the art and then how much it is worth. At the end the program should print the average of the values. After that, it wants the program to sort …

Member Avatar for TrustyTony
0
103
Member Avatar for dbphydb

Hi My txt file looks something like this: Branch: ltm_7.4 Destination: Test 5 [CODE] lines = open("branch_dest.txt").readlines() lines=[x.split() for x in lines] print lines branch = "%s" % lines[0][1].strip(': ') print branch destination = "%s" % lines[1][2].strip(': ') print destination [/CODE] I need to extract the branch name and the …

Member Avatar for dbphydb
0
5K
Member Avatar for jpl1993

i'm pretty clueless about everything dealing with python. i need help creating a sorting algorithm that can sort names in a list alphabetically. and example code to help get me started would be much appreciated.

Member Avatar for lllllIllIlllI
0
138
Member Avatar for ktsangop

Hi everybody! I'm facing a really tricky problem in python. I am using the pyserial package to communicate with an external serial interface board. The board accepts certain hexadecimal strings as commands in the following form : --example-- command1 : "\x02\xa1" command2 : "\x03\xa2\xb5" etc... Some of the commands are …

Member Avatar for ktsangop
0
266
Member Avatar for dbphydb

Hi, I want to access a link starting with clients_test on a particular webpage. I have the following code client_re = re.compile(r"clients_test") def get_client_url(): url = get_artifacts_url() for link in get_links(url): if client_re.search(link["href"]): return "http://11.12.13.27:8080" + link["href"] Sometimes the page has many links beginnng with clients_test for e.g: clients_test4, clients_test5, …

Member Avatar for dbphydb
0
116
Member Avatar for TrustyTony

I started to think how to create up and down style loop, and what I ended up was this. Wanted to do it little unconventional way though to demonstrate the property of range as list.[code]for n in range(8): for i in range(n)+range(n-2,-1,-1): print i, print """ Output: 0 0 1 …

Member Avatar for TrustyTony
-1
481
Member Avatar for strider1066

I have registered a new Tkinter module @ pypi. tkPickaColor is a dialog intended for Linux coders to provide a more full featured color chooser than is now available. I say for Linux coders since a better chooser is already available on the MS Windows side. It seems to be …

1
104
Member Avatar for jpl1993

so i have a project due in my computer programming class and i need some serious help. we are learning about recursive sorting, such as merge sort, selection sort, etc. my project has to do with taking 10 people and sorting them in order by their names (alpabetically), rank (numerically), …

Member Avatar for griswolf
0
122
Member Avatar for Jordian

Hey guys, I'm pretty inexperienced with Python, but I wanted to give it a shot because I plan on using it on an upcoming visual aid contest. I've been working on a side scrolling type project where you move left and right and the backgrounds scroll across displaying various images. …

0
84
Member Avatar for ChargrO

Im working on this bit of code below, The only thing im worried about editing atm is the self.toggle() and self.hello(). Im currently getting this error TclError: unknown option "-menu" from this line of code self.config(menu=menubar), does anyone know how i could fix this problem?? [CODE] from Tkinter import * …

Member Avatar for Ene Uran
0
1K
Member Avatar for bbman

Hey everyone, I need some help on some simple Python programming, below is my problem: Identify numbers or words in any .txt file that aren't listed in a provided .txt file and to output those numbers or words that aren't in the text file one per line, in alphabetical or …

Member Avatar for Ene Uran
-1
113
Member Avatar for Qwazil

I'm an absolute beginner. Is there a function to search inside a set? If not, does anyone have a function that does so? (set to search in, value to search for)

Member Avatar for Ene Uran
0
60
Member Avatar for dreadyteddy

I am TRYING to write a program that finds restriction sites in a DNA file and returns a picture and information box of the enzyme which cuts it. My problems are; a) I have no idea if my program works past opening the file directory. b) I dont know how …

Member Avatar for dreadyteddy
0
848
Member Avatar for cchris

I'm in the beginning stages of writing (and learning as I go) a Python database app using SQLite. I have the db structure planned on paper, and I have the queries I'll need in mind, but before I start coding I want to fully test the db design to make …

Member Avatar for griswolf
0
292
Member Avatar for eric_arambula

Hi Guys, I'm a beginner programming with Python. This is my first program. The purpose of this program is to add two numbers and then give me the result. However, after that I want for it to ask me if I want to continue (y) or (n). I came with …

Member Avatar for eric_arambula
0
104
Member Avatar for ArtemisFowl

I need help creating a python function that makes concentric circles. I already have a function that makes a circle(from the Python Programming book), so I thought I'd use a for loop; however, I'm not sure how. Here's what I have so far: (where 'number' is the number of circles, …

Member Avatar for ArtemisFowl
0
4K
Member Avatar for asthaynian

I'm trying to make quiz GUI. The GUI has one button and an entry box. The user presses the button and it asks a random question from using the world database. After 10 questions, it tells you the number correct and incorrect. I'm having a lot of trouble with the …

Member Avatar for TrustyTony
0
1K
Member Avatar for morteza_ipo
Member Avatar for Ene Uran
0
101
Member Avatar for nsutton

Im trying to make a bac calculator and make a gui for it but am having issues with the math code for it. Here's my code. Everything I input returns 0. The BAC forumula is (150/body weight)(% alcohol/50)(ounces consumed)(0.025). Btw, I suck at math so it could be a math …

Member Avatar for griswolf
0
2K
Member Avatar for aint

hi, I am working on a text proccessing project, actually related to protein sequences. I want to list occurrences of a search term with the hit positions. I tried the following, but it only gives it for the first hit. [CODE] text = 'MSKSASPKEPEQLRKLFIGGLSFETTDESLRSAHFESSSYGSAGRRF' index = text.find('SA') print index [/CODE] …

Member Avatar for TrustyTony
0
598
Member Avatar for saba_newbie

I am using scipy distribution scipy-0.4.9.win32-py2.4.exe with python 2.4 on Windows XP. When I try to import scipy I get the following error. [code] Traceback (most recent call last): File "<pyshell#4>", line 1, in ? from scipy import * File "D:\Python24\lib\site-packages\scipy\__init__.py", line 33, in ? del lib NameError: name 'lib' …

Member Avatar for TrustyTony
0
1K
Member Avatar for TrustyTony

Here is some saved interaction in command prompt. [CODE]>>> type((1,2)) <type 'tuple'> >>> (3*x for x in (4,4)) <generator object <genexpr> at 0x00E73EB8> >>> tuple(x**2 for x in range(10)) (0, 1, 4, 9, 16, 25, 36, 49, 64, 81) >>> set(x for x in range(10)) set([0, 1, 2, 3, 4, …

Member Avatar for TrustyTony
-3
712
Member Avatar for Kruptein

I'm working on an addon system for one of my projects. I'm able to add a new menu item, but the self.Bind(...) is causing me troubles instead of bind the function to the menu-item, it just calls the function. and doesn't bind at all... :s [code=python]self.ID_OPEN=wx.NewId() wxglade_tmp_menu.Append(self.ID_OPEN, eval(menucontent)[i][0], "", eval("wx.ITEM_"+eval(menucontent)[i][1])) …

Member Avatar for Kruptein
0
104
Member Avatar for micseydel

Attached are a C file, a .i file, and a Makefile that I thought could produce a Python-loadable binary. Also, I included a text file with the output I got showing the failure. It looks like I didn't include something vital but I don't know what. Can anyone help me …

Member Avatar for micseydel
0
549
Member Avatar for elvis1

Hi guys, I am a complete newbie (but learning slowly). I am trying to make a script to check for proxies that are contained in a file using a regex. Fact is that I lack of knowledge and I do not know how to make it go. This is my …

Member Avatar for elvis1
0
187
Member Avatar for anjaliua

I have created an owl ontology using protege.Is dere any way to query the owl ontology n give the results to python code??

Member Avatar for merchise
-1
418
Member Avatar for eleonora

I do have a problem with my connect four code ; it doesn't check whether there is a winner even though the function its okay :-/ Can anyone help me to solve my problem ??? [CODE=python] import random board = dict() rows,columns = 4,4 def game(): choose_player() #MAKE BOARD FUNCTION …

Member Avatar for TrustyTony
0
3K
Member Avatar for gdtraveller

Hi, Does anyone have an example of code in wxpython that moves a sprite across an image background? Or can point me to an url that shows an example? Thanks

0
60
Member Avatar for TrustyTony

This problem came up in one thread and here is my finalised version to follow changes of files in list of paths given.

0
717
Member Avatar for Kruptein

I'm working on an add-on system, which is till now going pretty good. no I need to assign an id to a menu item, but I don't know which are all in use (by other addons f.e.) so is there a way to either: -get a random integer that isn't …

Member Avatar for Kruptein
0
142

The End.