15,190 Topics
![]() | |
Hello In my program I am using a menu that uses a multi-way if statement to do what the user inputs (1 of 3 values). After printing the menu I use a raw input statement to get the user's input. However, is there anyway to define the user's input variable … | |
I am trying to write a program that prints every line of the file until a certain string is found. The file is a plain text file. I put the sample context at the top of the code. But the function gets stuck in an infinite loop. I don't want … | |
Hi, the problem is that: I have a text file with some lines of text in it. I have to search for a particular line in the file and then copy the lines after the searched line into another text file. This search string comes only once in the text … | |
Hi all. There might be a simple solution to this but I've been googling for quite a while for a solution... I want to get the plots generated by the module matplotlib from Python in an interactive window so I can save the graph. I'm using Ubuntu 9.10 and things … | |
Hello I'm writing a python program and need some help. Firstly, is there anyway to include variables in an input prompt? For eg. [variable1 = 4 variable 2= 3 variable= raw_input("Please enter a number between", variable 1, "and", variable2) ] Also, if data is being appended to the end of … | |
hello I was just wondering if anyone knows of a site or someone (or start me off with some code) that could help me with learning about cascade menu's and changing them from a parent into a child, any help would be greatly appreciated. I am making the cascade menu … | |
For my extra credit, I'm supposed to generate the longest chain from 1-1000000, I wan't to know if it is correct..here is my code: the caller [CODE] start = 1 end = 1000000 longest, chain = -1, -1 #choiceX(start) for i in range((end-start)+1): if choiceX(start) > longest: longest=start chain=choiceX(start) start+=1 … | |
Hey people, i was just wondering if anyone knew the code to make a tkinter button... [CODE]def createExample(self): top=self.winfo_toplevel() top.rowconfigure(0, weight=1) top.columnconfigure(0, weight=1) self.rowconfigure(0, weight=1) self.columnconfigure(0, weight=1) self.Button = Button ( self, text=" Example", font=("Arial", 12), bg="white", fg="magenta", cursor="crosshair") self.Button.grid(row=1, column=0, sticky=N+E+S+W)[/CODE] ...and i wanted to know the code that … | |
Hello all! I was bored and upon my father's challenge I made a program that tells you the 20 day SMA for a specific date, I only have 100 days of data but can up that to over 8000 whenever I get my logic sorted out. The problem is I … | |
I am doing a project where I read in a CSV file and I iterate through each row in the file. I then compare a specific column from each row, if a row with the specified column has the same value as another row with the specified column I would … | |
hi, i have a big exe program that i wrote in c# (big means that i have a lot of class in it), i want to write a script in python that will check the program. what is the right way to check the program, convert the c# program to … | |
i want the stars to appear in the night, but it only come out one?? can anyone help me what i should do to make about 50 stars randomly appear in the night?? thank you so much! [CODE]from graphics import * import random def stars(x,y): '''draw white line representing one … | |
Good day, Hi, I'm trying to develop mapping feature for a tool. It has a wx.ScrolledWindow that contains wx.lib.buttons.GenBitmapTextButton as map nodes. When the number of map nodes reached around 50+ the scrolling becomes too slow. Any ideas on how to improve the performance of the scrolling when there are … | |
Hello, for our last assignment we were asked to read an input file then plot this data using a bar chart. we have to make the bar chart using turtle module in python using functions. I really have so little time to do this, if anyone can give me a … | |
I have 3 functions working together, but I only have abundant returned every single time, I don't know what is wrong [CODE]def sumDivisors(n): total = 0 for counter in range(1, n): if (isDivisor(n, counter)): total += counter return total def checkForPerfect(n): total = sumDivisors if (total == n): return 'Perfect' … | |
I want to give command line arguments to a file and then executive that python file from within my master python file. How should I go about this? I don't really care about the standard output. The file that I want to executive from with my file just outputs all … | |
I'm trying to make a script that downloads from a specific website etc... it's done and everything. The problem is I need to compile it to a .exe for people to use and I noticed there isn't a py3exe to do this... So I downloaded python 2, and tried to … | |
Using Python with pylab included, I have created a plot. In the plot's title, I am including a variable from the program. I save the plot as a ps and every thing looks great. However, when I try to print the document to paper or to a pdf, the numbers … | |
I have an old computer that doesn't have internet access. It does have Python 2.6 which supposedly has Tkinter. The problem is, it returns an error that Tkinter module is not installed. I searched the net, and saw that I may have to manually install tcl/tk. Done. I tried [CODE]import … | |
Hey, I have one question though, how do you write on a txt file??? | |
This is a nice command prompt I wrote up a month ago. It's still in the Beta stages however. Anyways, here's a brief overlay of what it does: 1) Takes user input of a function, creates an x/y table and plots it 2) Change the x-range 3) Graph waves (Main … | |
Hi everyone, I'm trying to make a Space Invaders clone with pygame (python SDL library, if you hadn't guessed ;) ). The problem I'm having is that when the space invaders move down and change direction they break formation (some move left/right to far). Here is what I think is … | |
as you know I'm making a text adventure using Python. Should I put the monster's stats into a class or dictionary? Please suggest. All suggestions welcome! | |
can anyone here help me write a code like these graphics:[url]http://www.cs.utk.edu/~booth/[/url] i have been searching how to these, but i only saw you guys using turtle, python.game, etc.. i need a code for only python22 (graphics.py) i can only do stick figures, it would be a great help if someone … | |
can anyone help how to move the car to the traffic lights? and something is wrong with my traffics lights too..it does not seem to change the color after 5 sec..it just stay still?? and my stickfigure is not sticking with the face?? please help! i am using graphics.py [CODE]from … | |
![]() | Hi everyone, I just started learning Python 3.1 (never done programming before). I just wrote this useless little program. It seems to work but I would just like a little bit of feedback as to how well I executed the idea. Basically I want to know if I am making … ![]() |
I am working on a guessing game in Python and would like some feedback on how the code looks. I am struggling a bit with it, particularly with the menu options and getting it to loop back to the menu again after it has written to a high scores txt … | |
This has probably been asked a lot of times, but I tried searching and couldn't find anything relevant. I am building an application in Tkinter that should launch on system start up and stay open until you close it or shut down your computer. The problem is, I don't want … | |
We take a look at the various functions of module time, counting seconds and milliseconds, measuring the time a simple for-loop takes, inspect a list of time data and ways to display it in a useful manner. An attempt is made to find the day of the week, given a … | |
can someone tell me what is wrong with my code?? i cannot make this face. thank you! using graphics.win [code] from graphics import * import time def moveAll(shapeList, dx, dy): for shape in shapeList: shape.move(dx, dy) def moveAllOnLine(shapeList, dx, dy, repetitions, delay): for i in range(repetitions): moveAll(shapeList, dx, dy) time.sleep(delay) … |
The End.