15,181 Topics

Member Avatar for
Member Avatar for babsbj

Return True if the bases represented by the str parameters form a base pair and False otherwise. Each str is a single character: one of 'A', 'T', 'C', and 'G'. is_b_pair(letter,DNA): new_letter ="" new_DNA += new_letter if new_DNA in [GAATTC,AAGCTT]: return True else: return False please help

Member Avatar for strider1066
0
120
Member Avatar for Freakazo

Ok so I'm trying to write a little python program that simply monitors the total bandwidth usage of a computer, and have no idea how to do this. So if someone can just point me into the general direction of how to do something like this it would be great …

Member Avatar for Freakazo
0
81
Member Avatar for Kolz

If the str is a palindrome, return True; otherwise, return False. Punctuation, spaces, and other non-letters are ignored; their presence or absence should have no effect on the result. Uppercase letters are considered to be equal to their lowercase equivalents. So my question basically is... How do I "ignore" the …

Member Avatar for masterofpuppets
0
148
Member Avatar for pyprog

If I have a string "Mary had a little lamb" and a list of strings such as ["Mary", "Bob", "Steve"] how to use a loop to search this string for items in the list?

Member Avatar for masterofpuppets
0
110
Member Avatar for Megabyte89

OK I have a search script that suppose to search for information in my database. The problem I having is that I want the user to be able to enter a last name to search. The only part that is giving me problems is this part, I'm stuck on this …

Member Avatar for strider1066
0
212
Member Avatar for EvanGolder

Hi all.. I am new to Python and I am here seeking help. Actually, I'd like to run a DOS executable file from Python. The DOS excutable file requires 5 inputs from the users, and I have tried some coding which apparently doesn't work. Can anyone help? Here is my …

0
45
Member Avatar for baskar007

i am new to PyGtk. i don't know how to get realtime update on gtk. such as downloadmanagers show's every time the speed changes. here is my. in this code the "f='/home/tree.txt'" is a log file .this file regularly updated by another thread. i want to add the file contents …

Member Avatar for The_Kernel
0
723
Member Avatar for twoshots

I've just started learning Python but have hit a little issue when instancing a class. I seem to get errors like: AttributeError: type object 'Stuff' has no attribute 'a' or: AttributeError: class 'Stuff' has no attribute 'a' Clearly I'm missing something fairly fundamental :/ A quick test program shows what …

Member Avatar for twoshots
0
119
Member Avatar for sravan953

Hey All, I have made a program called "Pymailer", I have even made a GUI version... now what I want to do is to convert it to .exe format... how do I do it? I googled for some info, but in vain!

Member Avatar for sravan953
0
1K
Member Avatar for iamai

Hello guys I want to convert an integer to a hexadecimal string examples lets say i have an integer value 1 i want to convert it to 0001 integer value of 16 => 0010 245 =>00F5 and so on the string must have a length of 4 digits my code …

Member Avatar for iamai
0
628
Member Avatar for aot

I'd like to make a bogus Windows window pop up asking the user to choose between energy settings (better performance vs. better energy savings). This is for a social psychological experiment about ecologically sustainable behavior, so it's completely legitimate; it's approved by an ethical board, and the participants will be …

Member Avatar for jlm699
0
102
Member Avatar for AutoPython

Okay, I wrote a simple calculator, not in GUI form, but a calculator for simple stuff. So I'm wondering, would this layout be considered OO? I think this is how it works. Now I do know that I didn't use an object to handle the class since it just wasn't …

Member Avatar for AutoPython
0
214
Member Avatar for dinilkarun

Hi Friends, I need to write a piece of code to identify if an Excel session(the process which is listed in the Task Manager) is already running or not?. Can anyone guide me with this? Any help will be much appreciated! Regards, Dinil

Member Avatar for dinilkarun
0
143
Member Avatar for ebrutekim

[CODE]#include <iostream> #include <string> #include "Python.h" using namespace std; #define py PyRun_SimpleString(pythonCommand.c_str()) int main() { string pythonCommand; //Python started Py_Initialize(); pythonCommand = "import sys";py; pythonCommand = "from math import sqrt";py; pythonCommand = "sys.setrecursionlimit(1000000)";py; //factorial function pythonCommand = "def ft(x): return(1 if x==0 else x * ft(x-1))";py; //equation using function pythonCommand …

Member Avatar for ebrutekim
0
174
Member Avatar for ihatehippies

I have a Syncing program that, while idle, crawls through the sub-directories of the sources and destinations saved to a 'sync profile'. It starts a new thread and walks the directories calculating the divergence between the sources and directories. I want this feature to have little impact on computer performance …

Member Avatar for ihatehippies
0
115
Member Avatar for dads

I have to make some bookmarks so I quickly knocked up the script below and ran it. It created the files fine but with a with an incorrect ip in the second file The second bookmark created should be named York.URL which it is but the ip address of the …

Member Avatar for slate
0
111
Member Avatar for Kolz

First Question: Use the following variables: i , lo , hi , and result . Assume that lo and hi each are associated with an int and that result refers to 0 . Write a while loop that adds the integers from lo up through hi (inclusive), and associates the …

Member Avatar for Kolz
0
2K
Member Avatar for pyprog

The following code should return the longest odd-length palindrome in a string centered at the index. So in a string 'asradarer' it should return 'radar'. Can you explain to me what the problem here is? [CODE]def get_odd_palindrome_at(word, index): num = 1 new_word = "" while index < len(word): if word[index …

Member Avatar for vegaseat
0
898
Member Avatar for bol0gna

My file directory is full of filenames with "male" and "female" being part of them. I want to loop through the directory and distinguish between the two. [CODE] import os maleDataSets = 0 femaleDataSets = 0 females = [] males = [] filePath = "Dataset/parameter feature vectors" for file in …

Member Avatar for vegaseat
0
196
Member Avatar for lewashby

I the following program, can someone please explain these two lines. "def __init__(self, master):, & Frame.__init__(self, master)" One other thing. Shouldn't the method "update_count" use a return to return the new count? thanks. [CODE]# Click Counter # Demonstrates binding an event with an event handler from Tkinter import * class …

Member Avatar for vegaseat
0
198
Member Avatar for nevets04

Heres the situation so far.I'm in 9th grade and I've been programming in python. I enjoy python however, my high school doesn't offer any courses for python. In 11th and 12th grade, I can take C++. So here's my question: Should I: A) Learn python for the next to years …

Member Avatar for vegaseat
0
211
Member Avatar for beginner10

Hi Everyone, Sorry if this has a totally obvious solution. I am trying to write a simple cows and bulls game; the program generates a secret number, the player has to guess it, the program then compares the guess to the secret number and tells the player that either they …

Member Avatar for beginner10
0
1K
Member Avatar for gdr969

I have program than finds the minimum temperature of every month, but i can't find a way for it to find the minimum temperature that is higher than 0, i can't just use min() cos if the month has temperature that is lower than 0 it is also counted.

Member Avatar for gdr969
0
149
Member Avatar for lrh9

So I'm interested in learning about data validation. Especially in Python. Python all ready has several common idioms for data validation. There are several statements that evaluate data. For instance, isinstance(object, classinfo) will check that the given object is an instance of the class or type in classinfo. One idiom …

Member Avatar for paddy3118
0
355
Member Avatar for A_Dubbs

Hello everyone, new programmer here. In my class we have an oppurtunity to make up credit on a previous homework by modifying a program if we got any of it wrong. The problem for the progam was: Problem #4. Write a program to solve the following problem. Find a word …

Member Avatar for woooee
0
134
Member Avatar for bdesc100

I am trying to specify which variables a function should return. The purpose of this is to allow the function to return different sets of variables according to the requirements of another function, in order to make things more efficient (rather than always returning all the variables): [CODE] # Python …

Member Avatar for paddy3118
0
111
Member Avatar for lrh9

I want to call another object's methods from another object, and I have no idea how. Can someone please help me? Thank you.

Member Avatar for lrh9
0
202
Member Avatar for SoulMazer

Hi, I'm looking for a little help with the function "getattr". Here's my code: [code=python]class MyClass: def __init__(self): trycmd = getattr(self, "cmd_testing") try: trycmd() except: print "Fail." def cmd_testing(self): print "Victory!" obj = MyClass()[/code] So, when I run this code, I get the output "Fail.". I'm not sure what I'm …

Member Avatar for vegaseat
1
137
Member Avatar for redpython

I am new to Python and am trying to marry a Python module with a CGI interface. I understand a little of both but not how they work together. I created a class called Vehicle and (using IDLE) and am able to import it and set the year, make, and …

0
61
Member Avatar for simpatar

Alright, this is how my newest program looks like: [CODE]import math def main(): print('This program finds the real solutions to a quadratic') print s = float(input('Please enter the coefficients (a,b,c): ')) a, b, c = s.split(',') discRoot = float(math.sqrt(b * b - 4 * a * c)) root1 = (-b …

Member Avatar for vegaseat
0
79

The End.