15,185 Topics

Member Avatar for
Member Avatar for Cosmo_Kramer

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 …

Member Avatar for Cosmo_Kramer
-1
293
Member Avatar for Cosmo_Kramer

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

Member Avatar for Cosmo_Kramer
0
188
Member Avatar for MissAuditore

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 …

Member Avatar for Lardmeister
0
230
Member Avatar for ashley9210

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

Member Avatar for woooee
0
196
Member Avatar for krystosan

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 …

Member Avatar for extr3mex
0
143
Member Avatar for mmpal78

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 …

Member Avatar for mmpal78
0
267
Member Avatar for ashley9210

I am trying to make this pattern in python but stuck, any help please? Ashley http://images.colourbox.com/thumb_COLOURBOX3492089.jpg

Member Avatar for Gribouillis
0
145
Member Avatar for Melly3

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

Member Avatar for TrustyTony
0
176
Member Avatar for Frensi

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 …

Member Avatar for Lardmeister
0
165
Member Avatar for giancan

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 …

Member Avatar for Lardmeister
0
468
Member Avatar for luck12

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 …

Member Avatar for luck12
0
1K
Member Avatar for krystosan

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 …

Member Avatar for krystosan
0
169
Member Avatar for vegaseat

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 …

Member Avatar for Lardmeister
4
248
Member Avatar for darkwing

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 …

Member Avatar for Lardmeister
0
173
Member Avatar for ohmang841

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 …

Member Avatar for Lardmeister
0
9K
Member Avatar for krystosan

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 …

0
57
Member Avatar for elrond

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!

Member Avatar for Lardmeister
-1
124
Member Avatar for BigPaw

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

Member Avatar for Lardmeister
0
267
Member Avatar for Vusumuzi

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

Member Avatar for Vusumuzi
0
153
Member Avatar for Monster Killer

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

Member Avatar for Padiamon
0
9K
Member Avatar for nnekymoe

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 …

Member Avatar for <M/>
-2
305
Member Avatar for ashley9210

![image_(2)](/attachments/small/4/image_(2).jpeg "align-left") ![image_(2)](/attachments/large/4/image_(2).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 …

Member Avatar for woooee
-1
92
Member Avatar for ashley9210

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 …

Member Avatar for woooee
0
493
Member Avatar for biscayne

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 …

Member Avatar for biscayne
0
2K
Member Avatar for krystosan
Member Avatar for krystosan
0
141
Member Avatar for Bluescreendeath

Hi all I have been asked to calculate days in a week. I know there is not 24 hours but 23 hours 56 minutes in a siderial day. How do I express that fraction in interactive mode. For example: print 60*23/56/60*7 or something to that effect. Anyone? Glenn.

Member Avatar for Gribouillis
0
234
Member Avatar for darnold4014

I was promted with this problem, and cant even seem to figure out where to start??? Any help appreciated. Thanks. Write an algorithm for each of the following python operations and test you algorithm by writing a it up in a suitable function. You are not allowed to use the …

Member Avatar for TrustyTony
0
114
Member Avatar for LSangalli

Hey everyone. I really need help with a question in Python. I have been trying for several days to figure this out. Any help will be much appreciated! Here is the question: Body Mass Index (BMI) is a good indicator of boy fatness for most people. The formula for BMI …

Member Avatar for TrustyTony
0
333
Member Avatar for Nethral

Hi :) I'm writing a simple program where I need to create multiple lists when i start (from a file) and write them to the file when I quit. I've googled and found that the best way is to put all the lists into a tuple and then write that …

Member Avatar for HiHe
0
3K
Member Avatar for Gribouillis

This python 2.7 snippet adds a thin layer of sugar on the itertools module's api, allowing many of its functions to be used as decorators and adding some new functions. Enjoy !

Member Avatar for Gribouillis
3
328

The End.