15,175 Topics

Member Avatar for
Member Avatar for lewashby

I am currently reading two books, one on PHP and one on Python. Not that I'M good at ether. I'M about half way through the book on PHP or less and almost done with the one on Python. Though I haven't actually read anything web related in this particular Python …

Member Avatar for pythopian
0
630
Member Avatar for saikeraku

I'm just wondering what do I have to add to the code [code] print "Hello World" [/code] to output H e l l o W o r l d like there's spaces in between each letter? Thanks.

Member Avatar for pythopian
0
124
Member Avatar for trihaitran

Hi I am running OS X 10.5 Leopard. It ships with Python 2.5.1 and I just installed Python 2.5.4 from python.org. The site-packages directory for 2.5.1 is located at /Library/Python/2.5/site-packages The 2.5.1 interpreter is located at /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 The 2.5.4 interpreter is located at /Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 The thing is that now that …

Member Avatar for pythopian
0
184
Member Avatar for fallopiano

hi everyone. Just out of curiosity more than anything; does anyone know of a library that can grab microphone input (on windows)? I'm looking into how to write a kind of VoIP (voice ip) program. I know how to use sockets for sending/receiving data, but I just need the microphone …

Member Avatar for Stefano Mtangoo
0
273
Member Avatar for klactose

Hello, Does python 3 have built in libraries that include support for the HTTP methods other than GET and POST? I couldn't find an answer to this looking through the urllib documentation on the python.org site or in numerous google searches. I am not a python expert by any stretch …

0
133
Member Avatar for EAnder

I've noticed there is at least 1 thread regarding to artificial intelligence. I assume most people new and old to python would be interested in artificial intelligence and the even greater goal of artificial life. I personally do not know anything about them. If you have ever had any experience …

Member Avatar for lrh9
0
153
Member Avatar for bobbyoutlaw

Ok Here's what the teacher's assignment to me was....In most actual Blackjack games the dealer starts with one upcard showing. Your task is to calculate the dealer's bust probability for each possible starting value. Your program should report a value for each possible starting card from Ace (1) to Ten. …

0
46
Member Avatar for Chromana

Hey. I'm importing an array in a text file via [icode]array=numpy.loadtxt("testdata.txt")[/icode]. Is there an easy way to count the number of rows and columns? Maybe something like [icode]x=numpy.countrow(array)[/icode]? I've had a look around and couldn't find anything suitable. Thanks, Alex

Member Avatar for Chromana
0
302
Member Avatar for jaison2

This is graphics.py from the zelle book. The following code seemed to be working but when i added the parameters to the function def drawEye(win, centre, radius): i get an error when i try to execute it Traceback (most recent call last): File "C:\Documents and Settings\Compaq_Owner\Desktop\t.py", line 22, in <module> …

Member Avatar for vegaseat
0
313
Member Avatar for ljvasil

I am having problems with my reverse polish calculator code. The code is as follows: [CODE]import operator OPERATORS = { '+': operator.add, '-': operator.sub, '*': operator.mul, '/': operator.div, } class Stack(object): "Creates a stack to enter numbers or operators into" def __init__(self): self.storage = [0,0,0,0] self.sptn = -1 def push(self, …

Member Avatar for vegaseat
0
617
Member Avatar for pyprog

Assume I have a file of the following format: a,1 b,2 c,3 d,4 Here is my code: [CODE]def junk(f): d1 = {} d2 = {} for line in f: columns = line.split(",") letters = columns[0] numbers = columns[1] d1[letters] = numbers d2[numbers] = letters return (d1, d2) def something(): print …

Member Avatar for vegaseat
0
237
Member Avatar for vegaseat

Python can use its COM support and the OCX of the WindowsMediaPlayer to play mp3 music files. Make sure that your Python installation has the win32com folder. Check [url]http://starship.python.net/crew/mhammond/win32/Downloads.html[/url] for the latest win32com support. [COLOR="Red"]This code relies on file WMPlayer.OCX which MS has removed on newer versions of Windows. See …

Member Avatar for vegaseat
1
2K
Member Avatar for TheManual

I need to only allow integers and the letters "d" and "r" from raw input otherwise I need to run an exception. For example: [I]You entered 's' this is invalid[/I] I have tried to use try/except statements but can't work it out. Is this the best way? Can someone help? …

Member Avatar for vegaseat
0
122
Member Avatar for pyprog

Assume I have a file of the following format: a,1 b,2 c,3 d,4 Here is my code: [CODE] def junk(f): d1 = {} d2 = {} for line in f: columns = line.split(":") letters = columns[1] numbers = columns[2] d1[letters] = numbers d2[numbers] = letters return (d1, d2) def something(): …

Member Avatar for vegaseat
0
324
Member Avatar for gangster88

I have to get pthagaros to get the distance between 2 points. so the function distanceBetweenPoints(Point(1, 2), Point(4, 6)) should result in 5.0. the parameters are supposed to be P1, P2, which i think i have done?. The get an error when i try to execute this?.. help please def …

Member Avatar for gangster88
0
174
Member Avatar for herebutfortea

As many people new to python i seem to have run into a bit of a snag with an alarm program i was making. I wanted to make something that would play a song (.wav) at a given time and would not stop unless you played a little game, guess …

Member Avatar for woooee
0
137
Member Avatar for jaison2

hi basically i have to write a function which draws 4 rectangles next to eachother(consisting of spcaes then hashes then spaces then finally hashes, all of the same height). the rectangles final The rectangles common height,and the width of the four rectangles should be parameters, e.g.(3, 0, 5, 4, 2) …

Member Avatar for jaison2
0
133
Member Avatar for kartal

Hi I have started using Eclipse as my ide. I would like to integrate python help into eclipse for convenience. Is it possible to replace internal Eclipse help with Python help? thanks

Member Avatar for patrickwang
0
259
Member Avatar for Fo_Be_La

Hi everyone, I'm trying to write some code for this question. I believe I have the right answer but it says it isn't. Anyways here is the question. 1) Given that dict1 refers to a dictionary, change the value mapped to by the key 'Boo' to 'Hoo' . My code …

Member Avatar for Fo_Be_La
0
157
Member Avatar for Kruptein

If I run the following code the textCtrl's aren't updated, they stay empty, but if I do [icode]print self.extra201.GetValue()[/icode] I get the value that is set with the code beneath. [code]self.extra101.SetValue(names[1]) self.extra201.SetValue(names[2]) self.extra111.SetValue(str(money[1])) self.extra211.SetValue(str(money[2]))[/code] Why isn't it update !! :(

Member Avatar for Kruptein
-1
164
Member Avatar for nevets04

How do I make something like [code] x = 5 while 0 < x b = raw_input("something: ") [/code] However each time it loops, I want it to change, like: first loop - b = raw_input("something: ") second loops - c = raw_input("something: ") third loop - d = raw_input("something: …

Member Avatar for nevets04
0
181
Member Avatar for vickkeshav
Member Avatar for thines01
0
85
Member Avatar for nevets04

I know Remembering secure passwords is difficult. So I made this. [code] import random, os a= ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','1','2','3','4','5','6','7','8','9','{',':','>','?','}','|','!','@','#','$','%','^','&','*','(',')','-','+'] z = int(raw_input("How many words in your password?: ")) os.system("clear") List = [] for x in xrange(z): List.append(random.choice(a)) print "".join(List) print "1) Yes" print "2) No" b = int(raw_input("Would you like to save …

Member Avatar for sneekula
0
162
Member Avatar for moazmizo

hi, i have to make a sudoku solver using python quickdraw, i've started on it and this is what i got so far here is the link to the assignment [url]http://pages.cpsc.ucalgary.ca/~zongpeng/CPSC231/assignments/A4/a4.pdf[/url] [CODE] def solveRows(): """eliminates solved numbers by row""" for x in range(0, 81, 9): row = puzzle[x : x+9]#loops …

0
53
Member Avatar for parsifal67

Hi friends !! I'm neophite about python, my target is to create a programa that find a specific string in text file. How can do it? Thanks fel

Member Avatar for mitsuevo
0
255
Member Avatar for Kruptein

1. Is it possible to draw a border line around a table and/or a cell 2. Is it possible to draw a color to the background of a label. 2bis If not, is there an other element that can have background colors 3 How can I set the default height …

Member Avatar for Kruptein
0
134
Member Avatar for Judgment

1. I need to make a program that creates a list that contains the first n perfect squares. All I know is that it starts with n = int(raw_input("How many squares? ")) and ends with print squares An example of how this program should work is: How many squares? 5 …

Member Avatar for vegaseat
-1
148
Member Avatar for ChaseRLewis

Newbie Here Edit: This is not homework, I am a chemical engineering student and a math minor. I'm doing programming on the side to help me automate certain calculations later in my career. Also always had a healthy interest in programming. I just read the not doing homework for people …

Member Avatar for vegaseat
0
214
Member Avatar for krishna_sicsr

------------------------------------ ----------- --------- ------------------------------------ ----------------------------- ------- PRODUCT KIT TYPE STATE MAINTENANCE REFERENCED BY ------------------------------------ ----------- --------- ------------------------------------ ----------------------------- ------- HP I64VMS ACUXE V6.40-11P09A Full LP Installed HP I64VMS AVAIL_MAN_BASE V8.3-1H1 Full LP Installed HP I64VMS OPENVMS V8.3-1H1 HP I64VMS CDSA V2.3-306 Full LP Installed HP I64VMS OPENVMS V8.3-1H1 HP I64VMS …

Member Avatar for vegaseat
0
166
Member Avatar for truekid

Hello all. My name is Younis, I am a computer science newb. I occasionally browse this website reading some fascinating threads. I have a simple project at hand which i am finding the extra credit portion to be somewhat difficult. The project is very simple, the project takes a number …

Member Avatar for truekid
0
319

The End.