15,175 Topics

Member Avatar for
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
721
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
354
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
60
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
Member Avatar for nevets04

I finally got apache installed. I moved my .cgi python web application to var/www/cgi-bin however when I went to 127.0.0.1/cgi-bin/web.cgi but it said the web address didn't exsist. So I put the file in in var/www/ and it just read what was in the script, it didnt execute it. So …

Member Avatar for jlm699
0
196
Member Avatar for gsingh2011

This is my python script: [url]http://gsingh.pastebin.com/mc602006[/url] This is my setup.py file for py2exe: [url]http://gsingh.pastebin.com/m70a19449[/url] When I go to command prompt and run the .py file with the command, email.py message It works fine, it sends me an email with the message, which is what it's supposed to do. When I …

Member Avatar for snippsat
0
644
Member Avatar for saikeraku

hi, im trying to make a program that simulates the game Risk. It should output something like this: [code] Attacking Army: Army A Defending Army: Army B Number of attacking army: 4 Number of defending army: 3 ----------------------------------- Round 1: Army A: 3, Army B: 2 Attackers' Dice: 5 2 …

Member Avatar for woooee
0
90
Member Avatar for tlj333

I read the guidelines on posting homework questions and I think this one is within the rules. A little background, currently taking my first computer program class, its an online class (big mistake), it's very hard to get feedback or assistance. I have been ripping my hair out trying to …

Member Avatar for tlj333
0
191
Member Avatar for rmsagar

In my file, I have lines similar to this <Log LogID="633198520" LogLevel="Normal" Date="10/01/09 19:18" Type="Error" Source="Mentor" Text="Failed to process the request." /> When the line is read, if it is converted as field value pair I thought it will be easy to take required field. Please advise how this can …

Member Avatar for rmsagar
0
115
Member Avatar for MkeVaughanG

I need to gather data from a weather rss feed. But i ONly need certain "Variables, such as humidity, temp (high and low) etc. What I want to do is (i think) is parse them from Rss to integers in python. Any help would be much appreciated. :)

Member Avatar for lrh9
0
39

The End.