15,185 Topics

Member Avatar for
Member Avatar for jarograv

I have this psuedocode: [QUOTE]FUNCTION initialize FOR row = 1 to num_items get random number for the list ENDFOR ENDFUNCTION initialize FUNCTION show FOR row = 1 to num_items show output: list(row) ENDFOR ENDFUNCTION show FUNCTION sort FOR pass = 1 to num_items posn = 1 sorted = True WHILE …

Member Avatar for TrustyTony
0
270
Member Avatar for MUFC4life

Hi i'm trying to make a basic snake game. However i cannot seem to be able to display any food. I have tried numerous different ways but i just can't get anything to show :@. I simply want a red rectangle that will display in random places everytime the snake …

Member Avatar for Tech B
0
162
Member Avatar for almoj4ever

hi there ,,, im new to this forums and i really need somehelp in paython as i've got this homework and i need somehelp with it !! ,,, and im so stuck in it ! 1.Write a function to find average of a series of numbers entered by the user. …

Member Avatar for predator78
0
163
Member Avatar for ROTC89

Hi I am new to python. I am trying to get my fraction program to work but I keep getting this error message: Any advice would be helpful! [ICODE] File "main.py", line 5, in ? from fraction import* File "/home/students/bf133052/CS4223/fraction.py", line 10 def__init__(self,numerator,denominator=1): ^ SyntaxError: invalid syntax [/ICODE] here is …

Member Avatar for ROTC89
0
3K
Member Avatar for ihatehippies

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 …

Member Avatar for ihatehippies
0
226
Member Avatar for TrustyTony

Response to hijacker of thread: [url]http://www.daniweb.com/software-development/python/threads/59745[/url]

Member Avatar for TrustyTony
1
324
Member Avatar for e-papa

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.

Member Avatar for e-papa
0
273
Member Avatar for Archenemie

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 …

Member Avatar for Archenemie
0
223
Member Avatar for fisat

can anyone please send me the code for marking an object in two successive frames???? please its very urgent....

Member Avatar for object21
0
55
Member Avatar for Venku Tur'Mukan

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 …

Member Avatar for vegaseat
0
44K
Member Avatar for UnitedForLife

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

Member Avatar for vegaseat
0
103
Member Avatar for novice20

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) …

Member Avatar for vegaseat
0
9K
Member Avatar for Darion

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 …

Member Avatar for Darion
0
366
Member Avatar for confusedman

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 …

Member Avatar for TrustyTony
0
310
Member Avatar for swinchen

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 …

0
138
Member Avatar for pjconrad

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 …

Member Avatar for TrustyTony
0
1K
Member Avatar for Venku Tur'Mukan

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 …

Member Avatar for Venku Tur'Mukan
0
795
Member Avatar for macca1111

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 …

Member Avatar for NoddyNUIG
0
4K
Member Avatar for jarograv

[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 …

Member Avatar for jarograv
0
247
Member Avatar for dare599z

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 …

Member Avatar for dare599z
0
2K
Member Avatar for DYP

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? …

Member Avatar for DYP
0
177
Member Avatar for Speleo

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 …

Member Avatar for predator78
0
270
Member Avatar for Krstevski

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 …

Member Avatar for Tech B
0
113
Member Avatar for katscandybar

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 …

Member Avatar for woooee
0
154
Member Avatar for kannibalkiwi

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 …

Member Avatar for woooee
0
161
Member Avatar for NumeroUno123

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 …

Member Avatar for britanicus
0
160
Member Avatar for mscbme

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' …

Member Avatar for britanicus
0
244
Member Avatar for pavanteja1987

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 …

Member Avatar for britanicus
0
194
Member Avatar for britanicus

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 …

0
75
Member Avatar for Shift_

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.

Member Avatar for Gribouillis
0
122

The End.