15,190 Topics

Member Avatar for
Member Avatar for jozz3

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 …

Member Avatar for vegaseat
0
108
Member Avatar for pyprog

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 …

Member Avatar for IsharaComix
0
7K
Member Avatar for minimagician

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 …

Member Avatar for rohini.vangury
0
7K
Member Avatar for emitan

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 …

0
63
Member Avatar for jozz3

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 …

Member Avatar for jozz3
0
111
Member Avatar for ChargrO

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 …

Member Avatar for pythonNerd159
0
164
Member Avatar for persianprez

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 …

Member Avatar for persianprez
0
93
Member Avatar for pythonNerd159

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 …

Member Avatar for pythonNerd159
0
141
Member Avatar for Mensa180

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 …

Member Avatar for Mensa180
0
167
Member Avatar for tran0191

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 …

-1
53
Member Avatar for Oron123

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 …

Member Avatar for jcao219
0
138
Member Avatar for Lylywhatever

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 …

Member Avatar for vegaseat
0
96
Member Avatar for duomaximus

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 …

Member Avatar for duomaximus
0
423
Member Avatar for jjrrmm

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 …

0
62
Member Avatar for persianprez

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

Member Avatar for persianprez
0
201
Member Avatar for archb

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 …

Member Avatar for Tech B
0
202
Member Avatar for Enders_Game

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 …

Member Avatar for jcao219
0
151
Member Avatar for a.w.howell

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 …

Member Avatar for woooee
0
143
Member Avatar for txwooley

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 …

Member Avatar for woooee
0
158
Member Avatar for jeffery12109
Member Avatar for HiHe
0
98
Member Avatar for hondros

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 …

Member Avatar for hondros
0
218
Member Avatar for pymatio

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 …

Member Avatar for pymatio
0
610
Member Avatar for jeffery12109

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!

Member Avatar for jcao219
0
137
Member Avatar for Lylywhatever

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 …

Member Avatar for Lylywhatever
0
378
Member Avatar for Lylywhatever

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 …

0
72
Member Avatar for revellution

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 …

Member Avatar for revellution
0
121
Member Avatar for Simes

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 …

Member Avatar for Simes
0
144
Member Avatar for simplySH

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 …

0
43
Member Avatar for vegaseat

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 …

Member Avatar for Kanem
2
2K
Member Avatar for Lylywhatever

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

Member Avatar for tbone2sk
0
2K

The End.