15,190 Topics

Member Avatar for
Member Avatar for MikeyFTW

hey well this program basically is a mathematics game...try the program out for yourself, it works, but im just wondering how to make an reset option so at the end of the program so the user can play the game again. thanks [ICODE]name = raw_input("\t\t\tPlease Enter Your Name: ") print …

Member Avatar for Scuppery
0
627
Member Avatar for devstudio.2007

Dear All, I recently upgraded Python 2.3 to python 2.4 but still now my application searching python2.3 dll in System 32 how to solve this issue........... regards Mani.

Member Avatar for Ene Uran
0
118
Member Avatar for SUBHABRATAIISC

Dear Group, I am trying the following code line: [code] def try2(n): a1=raw_input("PRINT A STRING:") a2=a1.split() a3="God Godess Heaven Sky" for x in a2: a4=a3.find(x) if a4>-1: a5=a3[a4] print a5 elif a4<0: a6=x print "It is not found" print a6 else: print "Error" s=a5+" "+a6 print s [/code] Here, if …

Member Avatar for woooee
0
80
Member Avatar for MikeyFTW

[ICODE]name = raw_input("\t\t\tPlease Enter Your Name: ") print print "\t\t\t\tHello", name print "\t\t\tWelcome to my Mathematics Game" # Selecting the operation of Addition and Substraction followed by the difficulty print operation = str(raw_input("\t\t\tAddition (A) or Substraction (S)")) if operation == "A" or operation == "a": my_op = 'Add' difficulty = …

Member Avatar for woooee
0
119
Member Avatar for docaholic

does anybody know how to make bubble sort work in progressively smaller sizes and determine if a list is sorted on it's first try? i've got the basic bubble sort algorithm down. i just can't figure out the rest of it (my basic bubble sort code below) [code] def bubbleSort(list1): …

Member Avatar for docaholic
0
141
Member Avatar for MikeyFTW

just wanting to know how to implement any background like a picture or something into python programs, i think i can only use .bmp but yeah thanks

Member Avatar for ZZucker
0
115
Member Avatar for fmv2011

Hi guys, I'm quite new to the whole programming schmeal. I have a python program written to generate gaussian graphs. However, I need to obtain the data points from these graphs and put them into a different file. I wanted to know if there is any way I can do …

0
34
Member Avatar for splakhin

Hello to everybody! I'm new in Python ... and have some problem with reading Excel... no matter that I've set format in Excel Text (for all my available data) - it get float value from it... Ok: here is the code: <code> import xlrd book=xlrd.open_workbook("C:/Py/aaa.xls") sh=book.sheet_by_index(0) print sh.cell_value(RowN,CellN) # it …

Member Avatar for splakhin
0
249
Member Avatar for mayapower

Hi, I am trying to create a cutom 'Float' type using built in 'float' type. Here is the code: [code=python] class Attribute(object): """ Common attributes and methods for custom types """ def __init__(self, name=None, type=None, range=None): self.__name = name self.__type = type self.__range = range #Read only attributes name = …

Member Avatar for jrcagle
0
1K
Member Avatar for 2ashwinkulkarni

Hello all, I am new to python programming and the Qs might seem stupid but i would really appreciate some help :-) It is just a for loop that i want to use, but it doesnt seem to work properly. I need to sort a file as per one of …

Member Avatar for 2ashwinkulkarni
0
118
Member Avatar for elhallouf

Hey you all I have a simple question : How do we call a shell script from a python script ? (Windows) I tried this : [CODE]import os os.system('sh C:\temp\script.sh')[/CODE] and this : [CODE]import subprocess subprocess.call("C:\temp\script.sh",shell=True)[/CODE] I played with the sh, adding it, removing it, adding .exe I played with …

Member Avatar for jlm699
0
114
Member Avatar for thatoneguyx

I'm doing some exercises from a book and can't figure out these 2 they're fairly simple but I can't figure them out I have to make the docstrings pass for each function [code] def wordset(wordlist): """ >>> wordset(['now', 'is', 'time', 'is', 'now', 'is', 'is']) ['is', 'now', 'time'] >>> wordset(['I', 'a', …

Member Avatar for jlm699
0
83
Member Avatar for aditi1184

Hi, I am trying to use the 'find' command of twill from within a python code but it seems to return no result. I tried to run that command on the command prompt by running twill and it works fine. But when I try to run the same command from …

Member Avatar for aditi1184
0
388
Member Avatar for db_ozbecool

How to get the NAME of the passed parameter ? Eg. in the example below how to get printed , inside my_func() , value = "test_var" [code] def my_func(aaa): [INDENT]print aaa # <---- this will print the VALUE of passed parameter 'aaa' [/INDENT] [INDENT]# ..... but how to print the …

Member Avatar for ZZucker
0
310
Member Avatar for twix112

Has been working on performance graphs for a cluster of server over the last couple of week for a company with matplot lib and python. The prolem is that the picture that's been published of the graph has a couple of labels that they feel is 'hard to read' 'cause …

Member Avatar for peter_budo
0
65
Member Avatar for BrianK_CA

I'm having a heck of a time sorting a TreeListCtrl. I've found very little documentation on it, so I went out & bought a book called "wxPython In Action". It says something along the lines of "a tree list control is so similar to list control, we won't go into …

0
42
Member Avatar for thatoneguyx

I have 2 problems -- 1. When I try having IDLE list the modules of python it gives me this error: [code]Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> help() File "D:\Programs\Python\lib\site.py", line 346, in __call__ return pydoc.help(*args, **kwds) File "D:\Programs\Python\lib\pydoc.py", line 1648, in __call__ self.interact() File …

Member Avatar for Scuppery
0
118
Member Avatar for swills

I started Python, imported Tkinter assigned Tk() to root, imported snack and initialized it. i then made a sound object, read a sound from the hard drive and then played it. i couldn't hear any sound though. any idea what the problem may be?

Member Avatar for vegaseat
0
73
Member Avatar for safir8100

Hi, I have a program: [code] def AdjacencyMatrix(dim, pairs): matrix1 = (zeros((dim,dim))) for (first,second) in pairs: matrix1[first,second]=1 matrix1[second,first]=1 print '\nAdjacency Matrix\n' print matrix1 [/code] But I get an error: TypeError: 'int' object is not iterable Can anyone help? Thank you!

Member Avatar for vegaseat
0
76
Member Avatar for twix112

Has been working on performance graphs for a cluster of server over the last couple of week for a company with matplot lib and python. The prolem is that the picture that's been published of the graph has a couple of labels that they feel is 'hard to read' 'cause …

0
52
Member Avatar for dinilkarun

Hi, I am unable to set the size of the DirPickerCtrl. The 'Browse' button is getting placed behind the textbox. Please help me out with this if anybody has worked on it. Regards, Dinil

Member Avatar for jlm699
0
143
Member Avatar for Mazille

I get an error when trying to make this program. [code=python] from pointLine import * def calcSlope(x1,y1, x2,y2): slope = (x2-x1)/(y2-y1) return slope def calcPointOnLine(y, m, x, b): if y == (m*x)+ b: return True else: return False print "Point is on a Line? Program" line1 = [(1,7), (7,19)] x1 …

Member Avatar for Mazille
0
135
Member Avatar for linkrulesx10

I need an if statement that will run if the value is not a number. I am unsure how to do this in python I have tried looking around and I can't seem to find what I need. If Input is not <a number> Also if you can help me …

Member Avatar for linkrulesx10
0
5K
Member Avatar for jobs

[code=python] data = unpack('>L', sock.recv(4)) [/code] Does this line of code means, incoming data is big endian and so unpack to endianess of local machine and assign to data. If local machine is little endian, then big endian is automatically converted to little endian format?

Member Avatar for jrcagle
0
58
Member Avatar for Shadow14l

I just need some code that will return a string of the name of the current activated window title/name. I've spent almost hours looking for a simple example though... ================================================================ I've seen other people say to hook windows messages and listen for wm_activate, and others... I already have when to …

Member Avatar for Shadow14l
1
15K
Member Avatar for dz0004455

I have an html file and I am parsing it with regular expressions. I don't want to use any python html libraries, because I am not using it as a website, but as a configuration type file. I am making a basic bookmarks system, the parser works fine, so I …

Member Avatar for dz0004455
0
235
Member Avatar for R.V.

I found: IDLE 1.2.2 >>> x = 157.73 >>> r = x * 100. >>> int(r) 15772 Can I convert more precise?

Member Avatar for R.V.
0
153
Member Avatar for MikeyFTW

Sorry im kinda new at this but anyways... Ok heres the deal i need to make this program that will allow users to practice their addition and subtraction for whole numbers between 1 and 100, 1 and 200 and 1 and 500 (the levels of difficulty). The user will be …

Member Avatar for MikeyFTW
0
190
Member Avatar for myle

I have just begun to learn python, so my question is probably silly. Just for practice I want to write a function which calculates the first n primes. prime computes some prime numbers and keeps them in a list. Then tries another number and if it's not even divisible by …

Member Avatar for myle
0
138
Member Avatar for tommy1988

hi i wanna start programing with python just wondering if any one knew any sites which has python source code? would appreciate any help :)

Member Avatar for AKarnisky
0
213

The End.