15,185 Topics

Member Avatar for
Member Avatar for SandD

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 …

Member Avatar for vegaseat
0
159
Member Avatar for yogesh.sdot

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): …

Member Avatar for vegaseat
0
221
Member Avatar for findlay

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

Member Avatar for woooee
0
268
Member Avatar for Kerma

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 …

Member Avatar for woooee
0
303
Member Avatar for CharlyJ

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 …

Member Avatar for naresh123
0
930
Member Avatar for dean.ong.14

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 …

Member Avatar for dean.ong.14
0
100
Member Avatar for Mogworld937

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... …

Member Avatar for woooee
0
570
Member Avatar for dean.ong.14

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 …

Member Avatar for dean.ong.14
0
135
Member Avatar for dean.ong.14
Member Avatar for dezirike
Member Avatar for SSeema

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" …

Member Avatar for SSeema
-1
193
Member Avatar for dean.ong.14

` 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 …

Member Avatar for 铃
0
113
Member Avatar for Mitch275

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 …

Member Avatar for TrustyTony
0
177
Member Avatar for tushg

**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 …

0
94
Member Avatar for valorien

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 …

Member Avatar for valorien
0
151
Member Avatar for nabzlfc

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 …

Member Avatar for nabzlfc
0
106
Member Avatar for Wire.Crisis

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 …

Member Avatar for Lardmeister
0
403
Member Avatar for sgeep

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 …

Member Avatar for vegaseat
0
317
Member Avatar for weblover

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 …

Member Avatar for weblover
0
296
Member Avatar for ised

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 …

Member Avatar for ised
0
3K
Member Avatar for rajashekharv

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 …

Member Avatar for abc0502
0
139
Member Avatar for rmbrown09

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 …

Member Avatar for rmbrown09
0
158
Member Avatar for vegaseat

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 ...

Member Avatar for snippsat
5
2K
Member Avatar for Inshu

Can I append a list obtained from a Class as output outside the class , if Yes how ?? can i use userList for this purpose ?

Member Avatar for Schol-R-LEA
0
205
Member Avatar for sHoM

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 …

0
308
Member Avatar for jworld2

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?

Member Avatar for vegaseat
0
5K
Member Avatar for elbarto

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 …

Member Avatar for TrustyTony
0
2K
Member Avatar for sun_2588

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 …

0
58
Member Avatar for Lyled93

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 …

Member Avatar for woooee
0
584
Member Avatar for nyxie

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 …

Member Avatar for abc0502
0
151

The End.