15,175 Topics
| |
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 … | |
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 … | |
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 … | |
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 == "": … | |
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 … | |
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 … | |
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: … | |
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! | |
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 … | |
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 | |
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 … | |
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 ... | |
>>> 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 | |
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? | |
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 … | |
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: ") … | |
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 … | |
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, … | |
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 … | |
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 … | |
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 … | |
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. | |
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. | |
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 … | |
| 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 … |
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 … | |
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) | |
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. | |
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 … | |
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 … |
The End.