15,190 Topics
![]() | |
Printing a convenient [url=http://en.wikipedia.org/wiki/ANSI_escape_sequence]ansi escape sequence[/url] clears the terminal (if you're running python from a terminal). Similar techniques could be used to print in colors. | |
Evening there. [B]I need to return an (x,y) tuple of an object, This x,y will be used to help 1 object calculate where the other object is and move towards it.[/B] My problem is that both the objects need to know the others' x,y. (i'm unsure how to get the … | |
im taking a class in python but i just cant keep up with the curriculum. Some things confuse me so i was wondering if anyone have any websites or anything that can help me get through python or at least help me understand it easier. the book im using right … | |
hi, Im calling Oracle 10g stored proc from python 2.6. 1. How do I pass String VArray (list in python) to stored proc ? 2. How do I return cursor from Oracle stored proc ? 3. How do I return list of strings from Oracle stored proc ? My Oracle … | |
kind of a basic question but i cant seem to figure it out. well i have a list and i split it up using the split function but now im confusing how i can use one string and divide it to another. i tried turning it into a int or … | |
[CODE]reply=float(raw_input("Enter your choice: ")) if reply!=1 or reply!=2: print "Not a Valid Choice" [/CODE] i cant use while loops other wise i prob wouldve done so. Basically im trying to get the user input to only allow the numbers 1 or 2. anything else should give a not a valid … | |
Hey, everyone. I know how to strip certain characters from a string using for loop. Can you give an example of how that can be done with the use of while loop? | |
So i have a h/w assignment due tomorrow, and i have tried to work on it, but as usual, python frustrates me. Here is the assignment: [url]http://www.cs.gonzaga.edu/depalma/courses/cpsc121/assignPython/asgn5.pdf[/url] and for part two, here is the link for example26 it says to use: [url]http://www.cs.gonzaga.edu/depalma/courses/cpsc121/examplesPython/example26.py[/url] So i tried working out the first part … | |
I need help with my Palindrome code For some reason, I cannot seem to convert the text into lower case letters and I cannot seem to ignore spaces and commas and periods and so on. Here is my code [CODE]def is_palindrome(user_input): i = 0 result = True while i <= … | |
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 | |
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 … | |
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 … ![]() | |
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? ![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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! ![]() |
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 … | |
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 … | |
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 … | |
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 | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.