15,181 Topics
| |
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 … | |
hey I'm making my own adventure text game and I need help. [CODE]def getEnergyAndMana(magicExp, energyExp, maxYourMana, bonus, energyLevel, bonus1): magicLevel = 0 if magicExp >= 0: magicLevel = 0 maxYourMana = 50 + bonus if magicExp >= 550: magicLevel = 1 maxYourMana = 100 + bonus if magicMax >= 1150: … | |
Hi, I am now trying to extend my program to allow the events in the file to be sorted by any of the fields (date, time, title, description, location and to have an optional list of attendees) Whether the attendees are present or not I need to allow either an … | |
Hello I am new to python...I met with this simple problem [CODE] def search(path,filename,extension): name=' ' listdir=os.listdir(path) print listdir flname=filename+'.'+extension i=0 match='' while(i<len(listdir)): if(listdir[i]==flname): match='YES' print 'got the match' break i=i+1 if(match=='YES'): assign(filename) else: name = filename+'.'+extension print 'the filename is',name return name lets_text=search(path,filename,extension) print 'the name we gt is',lets_text … | |
I have found a module pycrypto which has an AES encryption and decryption function, in commandline everything works fine both encryption and decryption, but if I want to implement it in my program, it fails =( [code=python]def aes(txt): global crypt message="".join(txt) #format the message which has to be encrypted/decrypted to … | |
Hi! I have a program with two QSpinBoxes with integers in them. When user clicks one spinbox it should affect to the other one. And vice versa. I can't use valueChanged() signal because it causes an endless loop that won't stop until the maximum values of the boxes have been … | |
Hi all, I'm very new to Python and I am already very proud what I've created ;) Unfortunately it doesn't work so I need your help. I've created a xml-file at C:\temp\ I want to upload the file to a ftp-server, but when I run my code I continiously receive … | |
hey all. i need some help with my calculator and i was wondering if anyone knew how to make it so if you click on a button it would pop up the value of that button in the entry screen. [CODE]## -*- coding: utf-8 -*- ## SDD, Major Project, Extreme … | |
Hi, so I've been programming with Python (2.x) for a while now, and I was wondering about what people thought of 3.x. From just a few quick searches, some people recommend that people get used to it quickly as it is the future, and others say to just stay with … | |
Does anyone know the code to click a button widget and get the value of that button to show up on an entry screen. I'll show you my code. [CODE]class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.grid() self.createEdit() self.createView() self.createHelp() self.createQuit() self.createOnOff() self.createDelete() self.createClear() self.createSeven() self.createEight() self.createNine() self.createDivide() self.createFour() self.createFive() … | |
Hello Everyone!! Is there a way to find the window handles pertaining ONLY to the current top level window & not its child windows. Using win32gui i am able to get the handles but it returns the handles of all the top level as well as its child windows. Any … | |
I am creating a program which takes in fields for events, saves them to file and then loads & displays them on separate lines. The 'date' field in my program should be in the format yyyy/mm/dd when it is entered. I have managed to implement this however my program still … | |
Hi, I am new to Python. I have written a routine and am trying to compile the code for distribution. I went to [URL="http://sourceforge.net/projects/py2exe/files/"]http://sourceforge.net/projects/py2exe/files/[/URL] and downloaded the file py2exe-0.6.9.win32-py2.6.exe. I am running Python 2.6 on a Win-XP Pro OS. I assume this file is a self-extracting exe. The trouble is … | |
Is it possible to have a function run at the beginning of every function of a class without explicitly writing it? I'm going to have a class with 20 or so methods, and though I can just copy and paste, I was wondering if there was an easier way to … |
The End.