15,190 Topics
![]() | |
I'm new to here.so i posted it on the code thread pls go through it and help me [url]http://www.daniweb.com/code/snippet271890.html[/url] | |
[code]#Blast workbench using biopython from Bio.Blast import NCBIWWW ##result_handle = NCBIWWW.qblast("blastn", "nr", "8332116") fasta_string = "AATTCAGTGGCAAAAAAAAAACTCAAATTTTAGGGAAGGCCCTAATATTATCAAATAATTAGAGGGGGGG" result_handle = NCBIWWW.qblast("blastn", "nt", fasta_string) save_file = open("my_blast.xml", "w") save_file.write(result_handle.read()) save_file.close() result_handle.close() result_handle = open("my_blast.xml") from Bio.Blast import NCBIXML for record in NCBIXML.parse(open("my_blast.xml")) : #We want to ignore any queries with no search results: … | |
Is python web programming anything like php? Is there simple examples like submitting a form to perform a calculator functions etc? | |
I want to remove all the 1's from the sublists so l becomes [[2], [2], [2]] but have trouble keeping track of indices. Can someone help out? [CODE]l = [[1, 2, 1],[1, 1, 2],[2, 1, 1]] i = 0 for element in l: while i < len(element): if element[i] == … | |
Hello. I need some help. I have a function [icode]my_function(a, b, c, d)[/icode] which takes string parameters and output them in different combinations. It works well in IDLE, but I would like to output the result into a file. Such code [code=python]file = open("out_file.txt", 'w') file.write(my_function(a, b, c, d)) [/code] … | |
I'm a bio informatics student who is leaning programming.With the help of this site and other blogs I made this one so far.I need to create a interface which give a text box to enter sequence and a start button and a window that display results.I went through Wx tutorials … | |
Just a quick one- I'm writing code that asks the user for a filename and checks that it exists. If it does it has to print the file's contents, if not print a message. [CODE]import os fileName = raw_input("Enter the name of the file: ") if os.path.exists(fileName) == True: fileName.read() … | |
I'm trying to get a SQLite3 DB to populate a wx.ListCrtl. I can get it to print to stdout/stderr without any problem. I just can't seem to figure out how to display the data in the DataWindow/DataList? I'm still learning programing/python so any advice would be appreciated. After two days … | |
![]() | I have this code: [CODE]class Member: def __init__(self, name, typeOM, fee, yearJoin): self.name = name self.typeOM = typeOM self.fee = float(fee) self.yearJoin = yearJoin # Reader Methods def getName(self): return self.name def getTypeOM(self): return self.typeOM def getFee(self): return self.fee def getYearJoin(self): return self.yearJoin def getMemberTypeString(self): if self.typeOM == 'P' or … ![]() |
Hi, I have serial data that can come in at irregular intervals from a hand held barcode scanner. The scanner continuously looks for a barcode (no button or trigger is ever pressed) and when the scanner captures a valid barcode it sends the code to the PC over serial. What … | |
I'm trying to code the game of Minesweeper. I haven't put in graphics just yet, only text labels on the buttons. Here is my create_widgets method: [code] def create_widgets(self): #Create the grid. self.square = [] self.isAMine = [] for i in range(self.y): row = [] mineRow = [] for j … | |
Hi all, I am trying to open an excel file which is in the same folder as my python script. The script is able to open the file first time, & after that it just throws the following exception: pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'Microsoft Office Excel', u"'test .xls' could … | |
Hello all and thanks in advance for any help you can provide. I'm new to programming in Python and am looking to put todays date parameter passed into a URL string...how would I go about accomplishing this. This is some code I've sort of been messing around with: [start code] … | |
[CODE] def dotask(): print "Task done..." def returnvalue(): return "Awesome" cmd = raw_input("Your command: ") eval(cmd + "()") [/CODE] I know that you can't use eval to assign a value to a variable. but is it the best way to have user input be performing a function? For example: I … | |
Greetings, I just want to know how to split a string using values of dictionary: dic = {'': '000', ' ': '011', 'e': '1111', 'g': '10', 'h': '010', 'o': '00', 'p': '1101', 's': '1110', 'r': '1100'} word = '1000011100001110001101010111111001110000' for items in dic.values(): [INDENT]word.split(items)[/INDENT] .... and when i do this … | |
Hi everyone, I am getting a error when using Xampp with mod_python addon and another python script 1. First I entered a string in a html form and passed it to pyform.py 2.Now in pyform.py, I imported the entire simpledb.py module. 3.Simpledb.py module fetches data from mysql server. Everything till … | |
I absolutely can't figure this problem out, can anyone please help? Write a program that asks for a phrase and then calculates and displays the number of vowels in the phrase, twice. The first time, your program should calculate the number of vowels in the phrase using a for loop. … ![]() | |
Here is 2 classes: [CODE] class Test(object): def __init__(self, var1=123): self.var1 = var1 class Test2(Test): # ... [/CODE] As you can see, Test2 is an instance of Test, which has var1. var1's default value is 123. How can I change the var1 in Test2 without __init__ again? Or better yet, … | |
A demo of the Tkinter listbox widget that shows you how to create the listbox, make it scrollable, position it within a grid, load it with data from a file, select a line of data with the mouse and display it. Also, sort the lines, add a line, delete a … | |
I've realized that it would be very helpful to me to SET the mouse cursor to a particular location. Having done the usual internet searches, I can't seem to find anything on how to do it. Any ideas? (So I'm still set on converting to wx, but the project I've … | |
Dear all, Currently I am able to print out the saved values from sqlite3 database. However, I figuring out to put individual values into different text boxes.. Just like this... [img]http://i39.tinypic.com/9jnfbn.jpg[/img] Using my little experience on Java, I am thinking to use arraylist(if there is for python) and retrieve the … | |
[CODE]#WEAVING A RUG WITH PYTHON #################################################################################### ## END STRINGS## for rows in range(1): for cols in range(36): print('~', end='') print('\n') ## SEAM ## for rows in range(1): for cols in range(12): print('- -', end='') print() ## DUAL ROW DESIGN ## for rows in range(2): for cols in range(36): print('*', end='') … | |
Hi again. I want to have a file for one of my python programs, that looks something like this: [CODE]<WINDOW> #Window size 640 480 <WINDOW TITLE> App Platform Test <ICON> icon.png[/CODE] I have a function that reads each line of, and uses the data to make a window. What happens … | |
I have created a number guessing game that writes and reads scores from a text file. When a section of code was added to sort and right-align the scores from lowest to highest, a problem was encountered. This is my code: [CODE] import random print "Welcome to the Great CP1200 … | |
[CODE]list1 = [[],[],[]] list2 = [[1,2,3],[4,5,6],[7,8,9]] i = 0 j = 0 k = 0 while i < len(list1): list1[i].append(list2[j][k]) i += 1 k += 1[/CODE] I want my output for list1 to be [[1,4,7],[2,5,8],[3,6,9]]. The problem is I don't know how to advance through the lists in list2. Can … | |
Hello In my program I have a text file that I read from and write to. However, I would like to display the contents of the text file in an alligned and sorted manner. The contents currently read- name, score name, score Would I have to convert this information into … | |
im new to python. just started today. learned a few things but not much. I have made 4 different menus each with a list of choices that executes certain functions. i want to make a 4 choice menu that can direct me to each one of the other 4 menus. … | |
Hi, I am working on a project in text mining using Python. As part of the project I need to use a technical term extractor, and I found the [URL="http://www.nactem.ac.uk/software/termine/#form"]Termine[/URL] system from NACTEM very useful. I have used the web demo (it's pretty nifty) and now want to integrate it … | |
First some background, i am writing a stats program for my school, the way you enter stats is by a window that has a textbox that shows how many of that stat the player has, lets say pass thrown, and two buttons a plus and a minus to add or … | |
I have a Value Error that is caught, in the exception block when I have no problem printing to the terminal, however, i cannot insert any text into the text widget. Heres the code snippet, any ideas? try: if len( errorCode ) == 0 and len( errorCodeHex ) >= 1: … |
The End.