15,181 Topics
| |
how do I catch changes to a mutable object ie: [CODE=python] class test(object): def __init__(self): self.x = [] def __getattr__(self, atr): print 'retrieving atr %s' % atr return self.__dict__[atr] def __setattr__(self, atr, val): print 'setting atr %s to value % s' % (atr, val) self.__dict__[atr] = val [/CODE] >>> instance … | |
Response to hijacker of thread: [url]http://www.daniweb.com/software-development/python/threads/59745[/url] | |
Hi there, I've been trying to create a memory test game, but been trying to figure out a way to get the output to display for a limited amount of time, any suggestions geeks in the house. | |
I have just started looking at simple cryptography in order to learn python better. Encryptions and decryptions should be speedy and accurate so im hoping it will improve my programming skills. I recently wrote this quick script for a shift cypher but i wasnt sure how to be able to … | |
can anyone please send me the code for marking an object in two successive frames???? please its very urgent.... | |
Hey, everybody, I'm a newbie at Python (2.7.1), and new to DaniWeb as well. and the apparent simplicity of Python got me interested in programming (seriously, the only thing before this was HTML). Anyway... I was taking a test and thought that after I was finished I could make an … | |
Hey, I am new to python and was wondering how to import modules? I want to import the datetime module. Do i have to download it from a website? Thanks | |
Hi all, I need to set some variables via Pysnmp which take 'unsigned int' only. Is python int by default a 32 bit- signed int? How do I convert it into 16 and 8 bit- unsigned ints? I need to read two registers consequently( which are of 8 bits each) … | |
Well i just bought "python for the absolute begginer" and title says it all. The task at the end of the chapter wants me to print "Game over" and then write something like '\n\nPress the enter key to exit.' which i causes the program with double click however this is … | |
Hello i am new to python and i am getting increasingly worried. I have a deadline on tuesday and i have to make a game in python. I have tried and tried but i am useless at python. Therefore i have decided to finish off a piece of code that … | |
I am working on a project that requires me to clean data from a series of RS-232 instruments. These instruments can have a different version number, and output format (both of which can change the expected ouput). On top of that there are flags that determine if certain fields are … | |
I have an issue with my python code and in some cases, users are getting the "IndexError: list index out of range" message. However, I'm not getting the error and it's not happening with every case so it's a bit confusing. I did search the site and found this article … | |
print "Hello, World!" ;) Hi, everyone, Venku (a.k.a Python Newb) here. I just kind of randomly opened up Python today (I do that a lot), and I decided I would finally ask this: What does the "is" statement do in Python 2.7.1 (if the ver# matters)? I checked out the … | |
HI, I have written a small program that uses a while loop to calculate how many years it takes for an investment to double given an interest rate: However, I think there is something minor wrong with the calculation for years, since when testing I put in 100% it should … | |
[CODE]#created by Jaron Graveley #April 26th, 2011 #This program completes reservations for Jon Von Poechman’s airline in an easy to use program #variable list: #i=counter used to limit the number of seats present on the diagram #n= counter to display the row number on the diagram #num_booked=counts the number of … | |
Hello, I'm re-creating the game Riveter using wxPython. I have all the basic fundamental groundwork done, and now I'm just trying to polish certain aspects. I am, however, having problems removing buttons from the screen. I have a panel, with a vertical sizer inside of it. Inside of that vertical … | |
i've a problem to split a joining multipe type of file here's my code for joining two diff type file, pict file (jpg) and audio file(mp3) an ouput is pict file contains audio file in it. a problem is how do i check this file is joining file or not? … | |
Hey all, I'm relatively new to python, just started learning it about a week ago. I've been working on making some small scripts to make learning easier for me. This is a cypher script I've been working on that is based off of the order of letters used on a … | |
Hello friends, I searching for "Combination generator" and I found something but not this what I need me... I want to write a script who will generate all possible combination by given string and range of length. e.g. string = "daniweb" length_range (3, 5) The results should be: _____________ ddd … | |
I honestly have no idea what part of the code i messed up on. It says line 94 but there is nothing wrong with that line, i tried all i could do to fix it...maybe someone can help a bit? [ICODE]# Tic-Tac_toe # Plays the game of tic-tac-toe against a … | |
okay, i'm stuck on an assignment! (first post btw, so tell me if i'm doing anything wrong please :) ) okay, my assignment is as follows : Write some efficient and commented python code to do the following: Accept an input value between 33 and 126 and convert it to … | |
So essentially I'm prompting the user for two binary numbers. How can I add these together? I don't know how to get the 0b in front the the original input. If there is an easier way to do it, please let me know. #Prompt the user for two binary numbers … | |
hi, I have a images in bmp format and I would like to convert into dicom. I am not a professional in python or vtk. if you may have advice, please reply me. I have started like this but it does not work :(... file_in = 'C:/programfile/image.bmp' file_out = 'test1.dcm' … | |
hello every one i have a python file with two different classes class threaded rotation ..... ....... class optimizer ...... ..... i want to separate this two classes in to two different files optimizer.py and threaded rotation .py .... wat i want to do is import threaded rotation class in … | |
This is a part the extension module im writing for python using c++. ( The complete source is available as an attachment ) [CODE] #include <python2.6/Python.h> #include <iostream> #include <fstream> #include "structmember.h" using namespace std; typedef struct { PyObject_HEAD fstream file; } CppFileObject; static int CppFile_init( CppFileObject *self, PyObject *args … | |
Hmm - I was looking at the following code for a PyQt4 program: [CODE] import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() widget.resize(250, 150) widget.setWindowTitle('simple') widget.show() sys.exit(app.exec_()) [/CODE] Could someone please explain what sys.argv does/means, and what it means in this context. | |
I'm having another crack at python - and I am enjoying the clean simple syntax - but one thing I couldn't work out was how to read a line from a file until a '\t' character. How could I do this? It is a phone-book program and the data is … | |
Hi, I've posted two scripts that I would like to improve. The first one (SparePartsDemo.py) is a little utility that takes a .csv (.txt) data file exported from another application, builds a SQLite database,performs a request to select and sort records and write the results to a sqlite database file, … | |
Dear experts in Python, I have written a binary search method that receives a list of float and one new float item. It needs to look for the proper index for that item to be placed and return that index. To make it simple, I give an example: imagine a … | |
I was planning on writing code that would get stock data from the exchange and store it for use and analysis later. I'm new to programming and Python so I don't really know where to get started. Are there functions, modules, or techniques I should be aware of? So far … |
The End.