15,194 Topics
![]() | |
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) … | |
Hello everybody, I'm new to Python wx and I'm trying to make an application which requires the use of database content. I've already made the input data frame. I need to make a frame where to list the database content. I need to create a label for each row like … | |
can anyone help me draw a five star using graphics.py?? i keep trying, but it comes out unbalance. Thank you so much for your help! | |
Each time I create a new GUI, the bit that I always hate, is the bit where the buttons and entries look like I am working on a Windows 98 machine, isn't there a way to make my buttons and entries look like Qt would look like? They're well squary … | |
I have a code in which the user should pass something through raw_input, this works fine for strings less then one line, but when I copy-paste a longer string, only the first line is passed by raw_input, how can I also past the rest of the string? | |
I'm using the rsa module (easy_install rsa), and if I use it from command line: [code=python]import rsa public,private = rsa.gen_pubpriv_keys(3) cipher=rsa.encrypt("test",public) rsa.decrypt("cipher",private)[/code] this will return test again. (like expected) but in my code it gives a zlib error -3 incorrect headers [code=python]def RSA(txt): global crypt if crypt=="en": key=raw_input("Public key:") ciphertext=rsa.encrypt(txt,eval(key)) … | |
I'm stuck on this part of my program, im using graphics.py to implement a linear regression line. I think I'm making a stupid error but cant wrap my head around it. The BIG part I'm stuck on is that im supposed to make a "button" in the lower left corner … | |
UnboundLocalError: local variable 'gold' referenced before assignment ...[CODE]if chooseItem == "1": gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer = bloodXHealerZZ.buy(gold, arrows, whip, cannnonballs, heartPotions, megaHeartPotion, infinityPotion, infinityXPotion, duelBloodXXHealer, bloodXHeal, energyYPotion, basicRainbowHealer)[/CODE] | |
I'm making an archery game and I need to shoot 5 arrows and assign a point value to each spot of the target. Bulls eye is worth 9 and each ring out from there is worth 2 less. I am having trouble figuring out how to assign a score to … | |
just need some advice on making a list containing values for Tkinter buttons. thankyou :) | |
I have this list, all the elements are float. Now i want to join them together with certain format for example exponent notation, so that I can print them out in one line. So I did this [CODE] for line in fileinput.input(filename): old_line = line.split() new_line = [float(s) for s … | |
can you guys please shorten this code for me... I need to do the same thing for all 8 potions [CODE]def fightItems(yourHp, yourHpMax, heartPotion, megaHeartPotion,bloodXHealer, duelBloodXXHealer,energyYPotion, rainbowBasicHealer, attackXXXPotion, defenceXXXPotion): while karidQuest1chooseFightOptiion == "2": print '1. Heart Potion(',heartPotion,'remaining)' time.sleep(0.5) print '2. Mega Heart Potion(' , megaHeartPotion ,'remaining)' time.sleep(0.5) print '3. Blood … | |
hi all, actually i have made a gui in my application..there is a button in it. i want that when the button is clicked,a file should open up and i can see through its contents..how will that be done...please give ideas..thanks in advance..:) | |
Dear Community, hopefully someone can explain this to me in simple terms: I would like to store raw input from a User without waiting for him to press Enter. And would it be possible to still check if the response is one of the predefined options? My raw input consists … | |
Im trying to get this menu to be inside my of my canvas but so far ive only had 2 windows open and now all im getting is an error, any help is greatly appreciated Im using Tkinter as my GUI [CODE] from Tkinter import * def startMenu(): top_tk = … | |
how do i create wall tiles like the one in the attachment below using turtle graphics in python and loops? sorry, i dont know how to post the picture directly :( | |
I'm using Tkinter as the GUI for my Software Design and Development Major Project, This is only to be a 'screen' shot of what the final GUI interface might look like, however. I have been having quite a hard time with Tk. My reference manual is from New Mexico Tech … | |
hello, i have completed making the wx python csheet and now i need to enter data in it and save it and than print it as well.but i am not sure how to do that:( any help or example regarding this problem will b highly appreciated. Thank you Regards punter | |
I have a CSV file where fields are delimited with a comma. The fields of this CSV file contains the attributes of Permanent Survey Marks and I’ve created a GIS python script to convert it to a table that is stored it in our Enterprise GIS Spatial Database (SQL Server). … | |
Hi I am relatively new to Python so forgive me if I have missed an elephant in the room so to speak. My code has worked for the whole day, but this afternoon I have begun receiving the error [CODE]Traceback (most recent call last): File "C:\Documents and Settings\King Alex\My Documents\Summer … | |
I'm not sure what this means... TypeError: 'NoneType' object is not iterable here's the code [CODE]day, season, help4, myGame = karidInn(day, season, help4, myGame)[/CODE] that's where are call the def function [CODE]def karidInn(day, season, help4, localGame): if chooseLocation == "13": print chooseLocation while help4 == 2: print 'Welcome back to … | |
Hi guys, this is my first post. In the past I found a lot of answers here so I decided to join you. My problem is this: I am using scapy in my software and It works fine using Ethernet connection. But I have to use a 3G key and … | |
Hi, Can someone help me how to test the webpages with W3C validator using python script..? I need to test company url with [url]http://validator.w3.org/[/url] and need to fetch the results back. I am using urllib and urllib2 modules . For urlencode, I can give the value for the 'Address', but … | |
Hello all, I just bought a book on Python, and started to go through it (bought it for my children and myself). I'm having a problem importing 'easygui'. I am new to programming. I am trying to program on my Mac. I downloaded easygui to the following:/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ When I go … | |
what is the program to find the given number is python or not? using only for loop. | |
write python function,which takes one argument, which is a file name [as a string],and computes and prints out each word,followed by alist of lines(numbers),which contain that word. eg the file is called("sample-text,txt") and then prints something like: all:[20,30,40,48,50,59] code:[34] consider:[7] found:[48] | |
Hi, so I'm in the process of writing a music player with a GUI. I would like to be able to print a statement after I am done playing a song. I originally through I could just get away with getting the song's length and time.sleep'ing for that long. Since … |
The End.