15,190 Topics
![]() | |
3 1 100 80 2 100 70 3 110 60 4 140 50 5 140 200 6 230 10 7 235 200 8 240 20 9 240 30 10 240 30 I am inputting the above in a simulator that simulates people in line at a store. The 3 means … | |
My problem with my TIC TAC TOE game is that it does not save end the game when someone has won if they have more than four moves. THe method of my code to check if someone has won is that it goes over a list of list. The list … | |
i want to make sure that people can quit in the middle of the game and the question is random not in order... please help me.. # make input equal to Python3 style input even in Python2 import random try: input = raw_input except: pass question =" " print("Welcome to … | |
Hello all, I was just wondering if anyone has code snippet for a function that is a multi-queue.....this is for python 2.3 or 2.4 I think so it has to be a bit primitive. The program is simulating people at a store arriving at the checkout, the input from a … | |
I stuck at the part about how many question they want for their game.This is the requrirement. Write a program for an application that let the user host a quiz game. The application will have a collection of questions with short answers. The program should ask the user how many … | |
So I am done with the code below, I will run it like this "python hw3.py < code.txt" I think I have a problem with the indentation or something. the code.txt has a mixed up text in it that is offset using a caesar cipher but it has to be … | |
def random(fileName) setup = open(fileName, "r" ) z = setup.readline() waiting = stack() for line in setup: customerNum, arrivalTime, serviceTime = line.split() plane = Customer(customerNum, arrivalTime, serviceTime) push(waiting, plane) setup.close() print "The data file specifies a", z, "-server simulation." print "There are", len(waiting) , "arrival events in the data file." … | |
Hi guys, Having a bit of a problem with reading and writing to a file. I have a file that has a lot of symbolic stuff I want to remove. And get a new kinda clean file with just the numbers and names. And it finds the line where it … | |
I am creating a bar graph essentially **just by only using the graphics module**. I am stuck with it. Below is my code that I have done which creates a perfect square. (10 x 10) so for every one bar I was it to decrease by 10. def drawRectanglePatch(win, x, … | |
How can i locate a file or a folder using python like some when we right click in downloaded files using firefox and open containing folder,and it opens the explorer and pre selects the file downloaded. how can this functionaly be implemented using python standard library ? however this code … | |
Hi, Im new to programming and to Python. Im making a program to get weather information from online, parse it the way I want to, then have Festival read it aloud to me. I got the weather info and parsing done exactly how I want but am getting an error … | |
I am trying to make this pattern in python but stuck, any help please? Ashley http://images.colourbox.com/thumb_COLOURBOX3492089.jpg | |
` This is the code of Tic Tac Toe from Python the absolute beginner. How could I edit the global constants so the user could pick the pieces or should I just remove them all together? # global constants X = "X" O = "O" EMPTY = " " TIE … | |
I'm having a little problem. The challenge is this: "Modify the program so that different shapes are drawn at each angle rather than a small filled circle". So I'm trying to change the middle shape when the second hand hits 12, 3, 6, and 9. I've got some code, but … | |
Dear members, i have a question. I created my software (with windows made with wxpython) and with py2exe I embed the icon into the exe. Since I would like to add the same icon file (or any other image) also as decoration in the window but I don't want to … | |
I am trying to add collision detection to this simple game, but I am a little lost on where to begin. I know I need to use rects to do this but I am struggling to find out what I need to code to make this work. Any pseudocode or … | |
Today i was reading someone written code and trying to understand it, but I have encountered so many times that programmers override builtin methods or set new properties , the code below is from a tutorial i came accross , I hope some one can help me out how code … | |
Let's say you have a whole bunch of nicely named lists and want to save them all and their names in a pickle file. One solution can be to store these lists and their names in a Bag container class and pickle the bag instance object. Now you can use … | |
I have a video program that use gstreamer and wxwidgets. Before Ubuntu 9.10, the program works fine. But since I upgraded to 9.10 (or 10.04), it keeps getting crashes when trying to view video. The error is usually Fatal X11 IO error. I googled and found that GTK+ implementation is … | |
Hi guys...I'm new to python so I've no idea what I'm doing but I need to write a function that 1) asks the user how many strings they would like to input. 2)Stores the strings in a list 3) sorts the list 4) Displays the sorted list 5) Displays the … | |
I have made a package with the name MaPySan that has `__init__.py` file and other files namely, DockedGUI.py and poseManager.py and inside `__init__.py` i have, `import poseManager` which is my app that I want to run so how should I have it run from script editor that I do not … | |
a program that asks user to enter number of people their birth year date and month and sorts it i got the algorithm figured out its just the code thats not hitting me! | |
Which is the most popular editor on these forums, please? Especially so, an editor that takes Python to the maximum of what it is capable of achieving. I'm hoping that I won't need such-and-such an editor to do this, and such-and-such an editor to do that... An all-in-one if possible. … | |
Question Enter a code that will test if player 'A' for team A or 'B' for team B was entered Call the procedure display_player( , ) with the relevant variables Enter the code that request the user to enter the positon My failes answer is: def diplay_player(team, position): team = … | |
Hello. I have a python script to post news a website but i want to know how i can pass variables from php to the python script and run the script from php. Python script: (I didn't create this, was done by a friend) [CODE] import urllib2, urllib USER = … | |
Hi:) Would any of you know how to solve one of the following problems? I dont't care which one!! 1. Write a program that reads in student marks until –1 is entered then display the highest mark, the lowest mark, and the class median. 2. Setting up matches for a … | |
.jpeg "align-left") .jpeg "image_(2)") Hi There, I'm having a problem looping text I have attached an image of what I want. Thanks in advance, Ashley def drawPatch(win, x, y, colour): for i in range(5): for j in range(5): topLeftX = x + i * 20 topLeftY = y + j … | |
Hi there, I am trying to repeat my triangle on 100px by 100px; Any help is much appreciated. Many thanks, Ashley def drawTrianglePatch(win, x, y, colour): for i in range(5): for j in range(5): if (i + j) % 2 == 0: triangle = i * 20 triangle = y … | |
When trying to load csv file data into Scribus it only takes the data of the last row. I'm using ScribusGenerator.py by Ekkehard Will and my best guess is that the cause of the problem is somewhere in this part of the code: def replaceVariablesWithCsvData(self, headerRow, row, lines): # lines … | |
what are site directories in python ? are these some special folders ? |
The End.