15,185 Topics
| |
Word Wrap I am new to python and I have no idea how to do this...Can you please help me.. For this option, first ask the user what the maximum number of columns for printing will be. ("How wide should the output be?") Next, the user will enter in a … | |
Hi i just started learning pygame and i was trying to run a simple block of code but an error keeps popping up: import pygame from pygame.locals import * screen = pygame.display.set_mode((640, 400)) when on running i get this error : module 'pygame' from 'C:/Python27/Files\pygame.pyc'> Traceback (most recent call last): … | |
Hello, Is there any way to access a large number of keys in a dictionary efficiently. Perhaps via indexing with an array of lookup values. Some pseudo code may help; dictionary={a:1, b:2, c:3 ...etc} lookup=[a, a, b, c, c ... etc] print dictionary[lookup] thanks, Joe | |
Hello I'm quite new to Python and would require some advice. I'm trying to create a picture viewer that changes pictures with regular intervals. The problem arises when I try to use time.sleep() along my go(), which changes the image. The code first loads images from a folder and uses … | |
Hello, I'm creating a word guess game for an assignment. I am nearly finished, but I am having difficulties with one function in particular. I have a function that checks if a str is part of a list of list of str and returns true of false. Now I am … | |
i need help. i want to make sure that people can ask how many question the want to answer in my quiz. how can i do that? # make input equal to Python3 style input even in Python2 try: input = raw_input except: pass print("Welcome to my yes or no … | |
I'm trying to make it so in my game when you equip your dagger it will change the variable dagger so I can tell if its equipped or not. from sys import exit from random import randint class Game(object): dagger = 0 def __init__(self, start): self.quips = [ "GAME OVER... … | |
how to loop and how to add score? and i want to make sure that people can ask how many question the want to answer in my quiz. how can i do that? # make input equal to Python3 style input even in Python2 try: input = raw_input except: pass … | |
For this option, you will first ask "how many rows?", and get a positive integer from them. Next, you will ask "how many columns?", and get another positive integer from them. The next step is to ask for an alignment of each column. They will enter "L", "C", or "R" … | |
` print "Welcome to my quiz" begin = raw_input("would you like to begin?: ") if begin =="yes": print "A)True" print "B)False" q1 = raw_input("Is Steve Jobs is the founder of Apple?") if q1 == "A" or q1 == "a": print "well done! you got it right!" else: print "thanks for … | |
Hi Guys, I'm currently making the transition from matlab to python and am having some difficulties with nesting for loops. Below is a rough example of what I'm trying to do. However when this executes abc is only returned as [] and not a 1D array of each iteration. Any … | |
**Running The Project Application in Pyramid Python IS NOT WORKING** Hi Every One:) i am a new to Pyramid & Python as per the website documentations i have installed and run the test But **THE MOST IMPORTANT PART "Running The Project Application" IS NOT WORKING** *could you please guide me … | |
Hi Everyone. I'd appreciate your help writing better code. I have a list of ~1000 values: list_of_values = [0x123D, 0x844F, 0x33E9, ....., 0xFFFF, 0xFFFF, 0xFFFF] The last values in the list will always be 0xFFFF, but I don't know how many exactly. What I want is to get rid of … | |
Hey Guys, Firstly like to say this is a great forum and has helped me a great deal in regards to learling a bit about python! But I have two programs which I require help with if possible :( **Program 1 -** *To search a text file for a user … | |
Hello all. I am very excited to have found this place in that I might better my very shoddy coding skills. I am trying to learn Python with a couple of books and some ideas for programs. I am trying to figure out a matter of what I think is … | |
Hey guys, I've been working on a project recently. It's pretty simple and a few friends helped me out with it, but I wanna try to improve it a little bit. I'm trying to add a sound file whenever a player wins/loses. Being brand new to Pygame, I'm not completely … | |
Hi, I'm trying to apply a linear regressipn function to my numpy array and then store the results in a new array. But i have 2 things that are not working for me. def regressioncal(valarray): new_col = [] linregres valarray = numpy.array(valarray) l=20000 for t in xrange(1,5000,10): for j in … | |
Write a nested for loop that displays the following outpout: 1 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 1 1 2 4 8 16 32 16 8 4 2 1 1 2 4 8 … | |
hi , I have a "C" test application which gives the test results in the plain text format. The contents of the test results for each of the test case will be as below. Summary ===================================== Test case id : atc-add-001 Test description: addition of numbers Test result : pass … | |
Hello, I am trying to generate word frequencies using ngrams. I have taken the brown corpus from nltk and changed it for use with ngram calculations by adding <s> and </s> at the beginning and end (in place of period.) I need to try and calculate the frequencies from this … | |
Python experiment to get an image from a web page and save it to an image file. Updated code to work with both Python versions ... | |
Can I append a list obtained from a Class as output outside the class , if Yes how ?? can i use userList for this purpose ? | |
I am creating a network bridge that connects two ethernet cards on the same machine. One of the cards is connected to the LAN and the other is connected to a network device. It looks something like this, [Click Here](http://i.stack.imgur.com/BcoQI.png) I am sniffing packets on both the interfaces and then … | |
I don't want to save all of my python files in the default directory, but if I save them elsewhere, python can't find the path to any modules I might be using. How can I change this to work? | |
Hello all, I have been searching for some time to find the most appropriate enviroment to draw lines and simple tri's / quads in three dimensional space. I have recently experiemented with the floatcanvas class in wxpython and I really like it for 2D work, but extending it into the … | |
Hello everyone, I am learning python from last 6 months, Just few days back i started learning Django. But at the starting only i get stuck. As you people must know that django bundle have a build in deployment server, i also used that only.. The steps which i perform … | |
Hello all, trying to get my program working. The program is to take input from the user in a hh:mmx format (x being p or a, standing for PM and AM) and tell the user how many minutes from midnight that time is. I was able to make it so … | |
I suppose I should post my question about the Twisted http server here, but correct me if I am wrong. I don't know much about python or the twisted server, but I have a project on it and I must install it in my pc. I have googled some stuff … |
The End.