15,190 Topics

Member Avatar for
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
89
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
82
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
Member Avatar for zoro007

Hello, I want ask something about Python CGI How can i use python on web application to run commands on the server For example : like in php when you will use "exec" function #!/usr/bin/python import os print "Content-Type: text/html\n" os.mkdir("/root/folder") print "done" this simple script working good if you …

Member Avatar for ShadyTyrant
0
122
Member Avatar for ziashahid

Hi, I am zipping a folder and an error occurred in below code which says : ==> AttributeError: 'builtin_function_or_method' object has no attribute 'tell' [B]zipfile.py:[/B] [CODE] def write(self, filename, arcname=None, compress_type=None): ... zinfo.header_offset = self.fp.tell() # Start of header bytes ... ... [/CODE] FYI:I have tried using "from zipfile import …

Member Avatar for baki100
0
1K
Member Avatar for erunways

Sockets are one of the most popular means of network communication and they follow client-server architecture. I have created two programs, one to run on a client computer and the other on the server computer. In my program I am showing how using a sockets client program can communicate to …

0
110
Member Avatar for ribot

Hello! My application is crashing randomly, and I thought it might have to do with it manipulating widgets that are not yet mapped, despite them being already gridded. Have you experienced this problem? I supply some code that shows that the print function happens before tkinter recognizes the button being …

Member Avatar for ribot
0
106
Member Avatar for manathisbest

I made this Rock Paper Scissors Game with GUI. It works fine. But what can I do to make it simpler? Anybody? [CODE]import random class RPC: def __init__(self): self.comChoice = '' self.choices = ['Rock','Paper','Scissors'] def chooseCom(self): self.comChoice = self.choices[random.randint(0,2)] return self.comChoice def player(self, choice, Com): if choice == 'rock' and …

Member Avatar for manathisbest
0
2K
Member Avatar for d8m9

Hi, I want to change a variable in a definition everytime it is called. for example: when I click on button, it will print 1 when I click on button again, it will print 2 Is this possible? I have written this code but it doesnt work :) [CODE]k=0 def …

Member Avatar for d8m9
0
124
Member Avatar for hondros

Okay, so what I want to do, is to take the following code, and make it so that way it keeps continuning for all of the word. [CODE]keycode = raw_input() matrix = [0, 0, 0, 0] for x in range(0, len(keycode)): y = ord(keycode[x]) if x > 3 and x …

Member Avatar for hondros
0
99
Member Avatar for rajeshwari_ib

Hi all, I have 2 jpeg files. I want to merge them into single file. How to achieve this using python. please help me

Member Avatar for sneekula
0
53
Member Avatar for baskar007

I have two questions on python threading: 1: is there is any speed performance or difference between Thread module and Threading module? 2: Is there is any other major difference between Thread module and threading module? I used thread module for my download manager project. i think this thread module …

Member Avatar for baskar007
0
80
Member Avatar for etypaldo

I am writing a pygame program that has a moving background which is a sprite. I was wondering if/how you can make sprites appear on top of others (some kind of priority in what appears on top of what). I know the order they appear on top of one another …

Member Avatar for jimothy
0
84
Member Avatar for rehber344

hi everyone my rule ıs /sbin/iptables -A INPUT -p tcp --dport 111 -j DROP and ı want to forbıd tıll the port no 800.and ı donw want to wirte ıt down one by one. so ı want to make a loop that wıll change port adress(whıch ıs 111) add port …

Member Avatar for jlm699
0
88
Member Avatar for afireinside7710

hey guys, first post. I have a program that takes a file from a windows box, and FTP's it to a unix/linux box. The program works fine, however there is something i want to add to it. I want the program to send 2 commands to the unix box while …

Member Avatar for programmersbook
0
197
Member Avatar for johni12

Hey, I'm sorry for being such a python newb, but thanks for helping me out with the last one! Hopefully you guys will help a newb out again :) This time, I need to use a recursive function to basically do the same thing that the .replace function for strings …

Member Avatar for johni12
0
135
Member Avatar for HalpMe

Hey Guys, I have a test tomorrow and this question is going to be dead similar to my test question, and I'm a mech.E major but for some damned reason Python is a mandatory course for us. Please if any one could solve this I would be very grateful. Please …

-1
59
Member Avatar for dinfadi

Hi everyone! I have difficulties solving a plot issue: I have these two datas in an array: np.array([Q-value, length]) Q-value......length A.................60 B.................40 C.................90 B................150 C................230 A................220 I want to plot these like: Q-value..........total length A...................280 B...................190 C...................230 Though it seems easy above my "real" array contains a lot more values. …

Member Avatar for dinfadi
0
131

The End.