15,175 Topics

Member Avatar for
Member Avatar for Thisisnotanid

Hi all, I was working on a MATLab program and I came to a point where I wanted to define a function such that one of the arguments would be used as a command. To clarify, the function being defined was an implementation of Simpson's rule that would integrate using …

Member Avatar for TrustyTony
0
244
Member Avatar for jkrueger

Hi, Noticed on the Mac that after a script runs the terminal is still there and not usable, one has to control q it to go away. Is there a way to have the script quit the terminal from the script when it ends? Thanks, jkrueger

Member Avatar for jkrueger
0
948
Member Avatar for jarograv

Currently I am making code to be used to make my playing of an online conquest video game easier. The first program the user would run is the initialize program. This is how the program looks: [CODE] #initialize import csv x=1 y=1 n=0 citiesx=[] citiesy=[] city_names=[] total=input("How many cities do …

Member Avatar for griswolf
0
2K
Member Avatar for Shansal

When I try to open an excel file by calling EXCEL itself from python, I cant see any Excel file opened . How can I fix that? Thanks in advance. The code I use is: [CODE] import os from win32com.client import Dispatch xl = Dispatch('Excel.Application') wb = xl.Workbooks.Open(os.path.abspath("Modules.xls")) [/CODE]

Member Avatar for TrustyTony
0
53
Member Avatar for karlamadeus

Hi guys, I am a bit new to OOP in general, and I was just wondering if I am going around what I want to do in the right way. I am making a small game to try to learn OOP and in this game I have several classes for …

Member Avatar for snippsat
0
113
Member Avatar for nagtan3

Hi, I am developing a website, I Have to get the google map on the basis of a particular location which i would get from an object of the database. This ill use it from the template language. For example: [B]person.address[/B] is what ill refer and i should get the …

Member Avatar for TrustyTony
0
166
Member Avatar for tigerra80

My assignment is to write a golf program that tallies the scores and prints out names and final scores in this format: Player4:21, Player2:33 etc etc. My question is can you use the range function to assign input to the proper variable name in Python 2.7. Here's what I have …

Member Avatar for sneekula
0
2K
Member Avatar for laung

My coding here: [code] option_input = raw_input(">>>") option_input = option_input.upper() if option_input == "V": print "High Scores:" saveFile = open("scores.txt", 'r') scores = saveFile.read() saveFile.close() nameScore= [] for line in scores.split('\n'): # skip any empty line if not line: continue userScore, score = line.split(',') #convert score to a numeric value …

Member Avatar for TrustyTony
0
188
Member Avatar for novice20

Hi, I am working with [B]python2.4 on windows[/B], and want pysnmp to be imported. Have downloaded [B]pysnmp-4.1.14a.tar.gz[/B] and [B]pyasn1-0.0.12a.tar.gz[/B] and put it under [B]D:\Python24\Lib\site-packages\[/B]. Still i am getting the import error. from pysnmp.entity.rfc3413.oneliner import cmdgen ImportError: No module named pysnmp.entity.rfc3413.oneliner What should I do to make pysnmp importable?

Member Avatar for snippsat
0
2K
Member Avatar for karlamadeus

Hello all. I am trying to write a short little game, mainly to boost my knowledge of classes and objects, and of course I am starting to encounter problems. I have several classes for different types of creatures in this game. Most of them take the form of: [CODE] class …

Member Avatar for griswolf
0
225
Member Avatar for stan_l

After reading a reply to a post regarding importing modules, help("modules") was suggested as a means to display what is currently available. I tried it and got errors after only performing a basic install of Python 2.7 and Python for Windows. Can these be repaired [see attached]

Member Avatar for snippsat
0
481
Member Avatar for HelloPeople1

Hi guys I'm writing a top down shooter game in pygame and wanted to use sprites for my object. I got a character sprite working fairly well except I have two problems. 1. When I rotate my character the point of rotation is changing. This causes a uneven rotation in …

0
102
Member Avatar for Eric Noa

Im taking Intro to computer programming and I have to designed a program in python that reads the numbers on a .txt file and then adds those numbers and display the sum to the user. Very simply program but I can't get it to work. I know sure how to …

Member Avatar for TrustyTony
0
8K
Member Avatar for RewindPlay

Using functions, how would I print the lowest, highest, and average of my PAY list? [CODE]try: text_file = open ("Pay.txt", "w") text_file.writelines(Pay) text_file.close() except (IOError): print 'Error opening/writing Pay.txt' try: text_file= open("Pay.txt","r") PAY= text_file.readlines() text_file.close() PAY.sort()[/CODE]

Member Avatar for vegaseat
-1
126
Member Avatar for Fo.katia

I have to write a program in Python that creates two circles colliding to each other and to the sides of the window. Here is what I have so far, but the problem is that they don't collide and they don't bump against the walls. Please tell me what i'm …

Member Avatar for vegaseat
0
392
Member Avatar for Niner710

I have a simple question with Python numpy. I have a numpy array as follows. [CODE]a = [ [1000 2 3] [4 5000 6] [7 8 9000] ] [/CODE] I want to be able to print 3 slices of the array to a txt file so that the elements in …

Member Avatar for vegaseat
0
550
Member Avatar for jkrueger

Hi, I'm a Linux user, and have general knowledge of windows. OK, have cygwin terminals working and have colorama and termcolor modules working. Colorrama allows use of termcolor on windows. So, when doing quick scripts that have some color in them programed on Linux I can quickly cxfreeze them on …

Member Avatar for jkrueger
0
368
Member Avatar for hughesadam_87

Hey guys, Couldn't find the answer to this question in any old threads, probably because I don't know the terminology involved well enough. I have a program which takes in data and writes it into a numpy array at the beginning of a pipeline. I use a class called Masterarray …

Member Avatar for hughesadam_87
0
94
Member Avatar for shama_kandy

What would be the loss if Python was fully interpreted instead of having a hybrid (compilation + interpretation) model of implementation ?

Member Avatar for shama_kandy
0
59
Member Avatar for RewindPlay

hello, I just signed up to ask...How would I store the information from my code(see below) into a object? I'll be naming the object employees. The code I have now executes this:(please tell me if there are any mistakes on the code I have so far) 1.Ask the user to …

Member Avatar for woooee
0
133
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
272
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

The End.