15,175 Topics

Member Avatar for
Member Avatar for stymiee

I use [url=http://www.en.wampserver.com/]WAMP[/url] to develop my PHP/MySQL applications locally before moving them to a production server. I want to start teaching myself Python and wish to add Python to my installation. I have downloaded and installed Python 2.5 and also installed mod_python. Unfortunately getting Apache to recognize that Python is …

Member Avatar for tweetychums
0
3K
Member Avatar for teenspirits

I made this code: [CODE]import random wish = "j" max_multiplications = 10 while wish == "j": multi = 0 right_answer = 0 while max_multiplications != multi: randomint1 = random.randint(1, 10) randomint2 = random.randint(1, 10) print randomint1, "*", randomint2, "=" ik = float(raw_input ("Insert your answer ")) multi += 1 answer …

Member Avatar for teenspirits
0
90
Member Avatar for cnuzzo

I have been teaching myself python for several months and have started working on an rpg project. Right now I am trying to code an armor class for a basic character. I am not sure if my approach is even a correct way to go about implementing this class. The …

Member Avatar for Mathhax0r
0
341
Member Avatar for fatalblade

hi , I have my python code but I couldn't solve it. here my sample loop: [CODE= python]import os import sys whileloop = True while(whileloop): initial_drive = "C:\\" inputline = input(initial_drive) <<< PROBLEM... if inputline == "exit": whileloop = False elif inputline == "about": print("no input") elif inputline == "": …

Member Avatar for fatalblade
0
166
Member Avatar for explorepython

Can you please tell me why i can't run this sample test program?? [CODE]from PyQt4 import QtGui class testui(QtGui.QTabWidget): def __init__(self,parent=None): QtGui.QTabWidget.__init__(self) def test(self): QtGui.QMessageBox.warning(self,"Hello","This is a test message") def frun(objec): time.sleep(8) print('hello') objec.test() app=QtGui.QApplication(sys.argv) obj=testui() obj.show() threading.Thread(target=frun,args=(obj,)).start() app.exec_()[/CODE] But in real i want to receive messages from the threads …

Member Avatar for explorepython
0
602
Member Avatar for bunkus

I have written code to use the automatic CD-Burn routine inside WinXP and above. But I cannot start the CD Writing Wizard by python code. Has anybody any idea how to do it? This is my code so far: [CODE]#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys import …

Member Avatar for bunkus
0
273
Member Avatar for hondros

Okay, I am in the middle of creating a rather large console RPG. It'll include ability to equip armor, weapons, interacting with NPC's, battles, saving/loading characters, etc. I don't want to save all of my classes and functions in the same file, for easier readability. I have a few questions: …

Member Avatar for vegaseat
0
86
Member Avatar for badboy00z

Hi everyone. I'm new to Python and programming in general. I'm currently reading [URL="http://www.dickbaldwin.com/tocpyth.htm"]this[/URL] tutorial. In the scripts section he mentions "setting the path" and that it needs to be done in order for scripts to work. How do I set the path in Windows XP? Thanks!

Member Avatar for vegaseat
0
113
Member Avatar for jcao219

This code is IronPython! Won't work with CPython. IronPython - Hello World [CODE] import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import Application, Form, Label form = Form(Text="Hello World Form") label = Label(Text="Hello World!") form.Controls.Add(label) Application.Run(form) [/CODE] Editor's note: This post moved from Python GUI Programming sticky thread. Please follow the rules of …

Member Avatar for jcao219
0
117
Member Avatar for mdawaina

I need to know more about turbogears as one tools used to develop web by python (rapid development ). if any person know more information about this topic

Member Avatar for Stefano Mtangoo
0
48
Member Avatar for ShadyTyrant

Hi there daniweb, im looking for some help. I have two classes MainWindow(wx.Frame), and AddTask(wx.Dialog). MainWindow contains a listbox called task_list. When AddTask is created I want the user to fill out the required info and and then click a button activating an on_click event. In that event I want …

Member Avatar for ShadyTyrant
0
110
Member Avatar for vegaseat

Python uses the Mersenne Twister as the core random generator. The module random contains a fair number of methods (or functions) that help you to do random things. Here are some examples ...

Member Avatar for sainandan
1
218
Member Avatar for WOPR

>>> from os import * >>> a = [] >>> a = listdir('.') >>> f = open(a[0],'r') Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> f = open(a[0],'r') TypeError: an integer is required doesn't work, please help me

Member Avatar for WOPR
0
87
Member Avatar for Destray

I'm working with Tkinter and I need to make 600 buttons in a grid of 6x100. Is there a way to produce generic variables by going through a for loop? Or do I have to type all 600?

Member Avatar for Destray
0
205
Member Avatar for Scuppery

If you are on school and you are taking algebra like me or just want to find the missing length of one side of the triangle than this program should help you out. Pythagorean Theorem Calculator is great and extremely essay to use thanks to this little program I pass …

Member Avatar for hondros
-2
2K
Member Avatar for monstercameron

need help correcting! first day,first 2 hours, first python program,(only had a little dark basic) [CODE]active="on" def ondamenu(): print "" print "enter integer 1 or 2" print "" print "opt.1 find the circumference" print "opt.2 find the radius" print "opt.3 quit calculator.py" print "" return input ("enter your choice: ") …

Member Avatar for woooee
0
151
Member Avatar for harpalss

hi there got a couple of probs, say in my text file i have: abase abased abasement abasements abases -------- This coding below is meant to find a word in a file and print all the lines to the end of the file. But it doesnt, it only prints out …

Member Avatar for d5e5
0
129
Member Avatar for Indran

Hi Gentlemen, I have an error, which was non existant when i used wxpython 2.8.7.1. When i upgraded to 2.8.10.1, basically the GUI got messed up.I am using Python 2.52 environment. The error seems to be from the fact that the parent, in this case MyFrame(wx.aui.AuiMDIParentFrame), is the default frame, …

Member Avatar for snippsat
0
318
Member Avatar for punter999

hello, i am new to python and i want to do development in python now. my problem is that: tell me what should be install in the system to start python development? tell me which is the best editor that can help to edit and run python code efficiently? tell …

Member Avatar for vegaseat
0
122
Member Avatar for JuvenileMango

How can I write a definition for a function that is passed a list of numbers and returns the sum of the numbers in that list using a while loop? I'm trying this, but it's not working def sumList(): num = [1,2,3] sum = 0 while num != str: for …

Member Avatar for JuvenileMango
0
88
Member Avatar for pith

Hello, I need help with editing this program: [code]#!/usr/bin/env python """ Monte Carlo simulation for the Monty Hall Problem: http://en.wikipedia.org/wiki/Monty_Hall_problem. """ import sys from random import randrange, shuffle, choice DOORS = ['car', 'goat', 'goat'] def pick_door(): """Return a number representing the player's first choice.""" return randrange(3) def reveal_door(pick): """Return the …

Member Avatar for pith
0
131
Member Avatar for thenewguy111

For my project I am coding battleship. I don't know how i should go about 1. mapping the board spots (dictionaries?) 2. randomizing ship placement any advice would be greatly appreciated PS. I am using pygame as well.

Member Avatar for Seten
0
123
Member Avatar for JuvenileMango

What is the difference between [CODE]file = open("name.txt")[/CODE] and [CODE]file = open("name.txt", 'r')[/CODE]? I can still use the methods: read(n), readline(n), and readlines(n) without adding the "r" in the open method.

Member Avatar for JuvenileMango
0
93
Member Avatar for letlet_pogs

Hello good day guys. I just want to ask for help in my java python. I am just new in this language. MY first java language is java. However, for me to make it easier to code in python, i need to code it in java first and then convert …

Member Avatar for vegaseat
-2
102
Member Avatar for leegeorg07

Hi again, I am trying a competition entry (its old, purely to test myself) and I have come against a problem, this is the description for the competition: In a word game each letter has a score based on its position in the alphabet, A scoring 1 through to Z …

Member Avatar for leegeorg07
0
191
Member Avatar for yvos91

Hello everybody, I made a wonderfull software, using Windows / python26 / tkinter / tkSnack. As long as I'm on my computer, it works fine. I try to distribute it, using py2exe. And I've not found the way to include tkSnack in the distribution. I tried also with pyInstaller, with …

Member Avatar for Stefano Mtangoo
0
82
Member Avatar for donjones77

I haven't been able to get my version of IDLE to open since I upgraded to snow leopard. Is this my unique problem? Or does snow leopard require a special version of IDLE? Thanks for any help. Don Jones (donjones77)

Member Avatar for Stefano Mtangoo
0
39
Member Avatar for vegaseat

The module tkSnack from our friends at KTH in Stockholm, Sweden allows you to play a variety of sound files using the Tkinter GUI. Supported sound files are WAV, MP3, AU, SND and AIFF formats.

Member Avatar for yvos91
0
1K
Member Avatar for Stefano Mtangoo

Hi guys, I have always wanted to write MP3 encoder in Python. I heard of Py-lame but I have never had hands on it and it is, to me a myth. Ok after trying thinking in ctypes, I thought the best way would be using lame.exe and subprocess. But as …

Member Avatar for Stefano Mtangoo
0
81
Member Avatar for python.noob

Hello all, One simple question.. We can set Tab bar for the tab widget in pyqt... I want to place a push button on tab1.. In what way i can do that??? Should i have to add this in the first tab in tab bar or in the tab widget …

0
56

The End.