15,190 Topics
![]() | |
hello im learning twill,but have some problem with unicode. whenever i use twill's follow function which emulate webbrowser link click function,it can work well with english link,but can't work with unicode. does anybody some know about this probelm? thank in advance follow is sample # -*- coding: cp949 -*- import … | |
hi everyone. to put it plainly, I was writing some python code that used the itunes scripting interface to control itunes. so I got all of my functions down, and now I wanted to have these actions occur on a specific mouse press. thanks to Tech B, I used the … | |
hi everyone. just recently I've been messing around with controlling itunes with python (you should check it out on google; some pretty fun stuff to mess with :D). I've already got all of my functions down, but my questions is that how would I go about grabbing keyboard/mouse input (mouse … | |
I'm having a problem sizing down this block of code: [CODE] if POS == 1: POS1 = "->" else: POS1 = " " if POS == 2: POS2 = "->" else: POS2 = " " if POS == 3: POS3 = "->" else: POS3 = " " if POS == … | |
hello i have some problem to send POST value by use mechanize. i can't write my article to my blog site. here is full source. and what i want to do is, im posting my article to my blog site. thanks in advance. [code] # -*- coding: cp949 -*- import … | |
Hello! I've been messing with tkinter and now have tried to make a MPG calculator using sliders. My problem is that no matter how I move the sliders it does not update the mpg, I'm not sure what to tell the label to do for it to update. I know … | |
I have an application running on a server, which can be accessed through a web interface. For that I use the module BaseHTTPServer. On my LAN, this all works perfect without any flaw. However, when accessing throught the internet, only the first requested page is reaching the server (and honoured). … | |
I need to prompt a user to type in a text file name and then take that file and and count the amount of words in the file. I have this code which counts the words in a file(that may not be "perfectly" written). I cannot figure out how to … | |
Hi How do you find out the first letter or number of string in a list? I have a list and I want to find whether any of the strings in the list start with a capital or little C. The code I have is: [ICODE] def isCMD(self): for word … | |
I am making a poker game using pyGTK. My problem right now is that the other players won't let me play! Each player has a function for betting and they go in order such as amandaBet(), playerBet(), billBet()... where player is you. Since this is a GUI game, I am … | |
Hi all, I plan to make a PRACTICAL dictionary and need help on just ideas. basically you can use dict datatype for simple dictionary and use dicy->key to retrieve but does that work for larger data queried from database? Or should I implement a database of key --->value? Any Idea … | |
Hi, I'm brand new to Python and am completely clueless in this assignment. This is the 3rd assignment, but the first without hints on how to import, etc.. The objective of this assignment was to decode a file we are supposed to use the python hw.py < code.txt command with. … | |
I want to make my characters move in realtime with NO pre-existing animation. The characters will move according to what is in front of them or if a enemy enters, etc. Are there any examples of this? Battlingmaxo | |
Hi i have this section of code that looks for user info on another table... this code works fine querying the database locally... but i need it to work remotely can anyone see what im doing wrong... [CODE]from sqlite3 import dbapi2 as sqlite import MySQLdb as mysql from mud.common.persistent import … | |
Ok trying to work with zipFile library how do you flatten the file hierarchy what works [CODE] zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w') for picId, pathname in enumerate(pic_list): if start <= picId and picId <= end: zip.write(filedir+'/'+pathname) zip.close() [/CODE] what i am trying [CODE] zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w') for picId, pathname in … | |
![]() | So I have a couple strings [code]first = input("Enter a starting integer: ") last = input("Enter an ending integer: ") last = last + 1 [/code] How do I make another assignment to a string "n" that I want to take the value of each individual integer in the range? … |
I am working with classes for the first time in Tkinter. I have no experience working with classes before this, although I have had experience with basic coding syntax before. I am trying to make a function plotter. If I have a class PlotApp. This is my the class that … | |
I am trying to build a histogram. So far I have coded the following: from Tkinter import * def plot(data): numberOfBins = len(data) root = Tk() width, height = 200, 630 #taille de la fenetre die = Canvas(root, width = width, height = height) die.pack() numberOfStripes = 2 * numberOfBins … | |
Maybe someone can help me with this. I've been working with python for less than a week, and it's my first programming language. I'm looking to figure out some basic things in python for an algorithm I wrote in a pseudo-code. I'd like to know how I can take an … | |
Hi, I have a internet connection at home. I have installed Python2.6.1 on my laptop in C:\Python26 directory. I have written a script named "TestUtil_SendMail.py" and my intension is to send a mail to the given mail id. But when am running the script I am getting an error: "[Errno … | |
Hello, I'm very new to python but made this as a sort of exercise. It is a loan calculator that takes into account user input. [code=Python] r = input('What is your interest rate? ') t = input('How many payments will you make? ') la = input('What was the amount of … | |
Hi everybody i want write a checksum function using python but i cant .. #example #find the checksum of string_data string_data="0123456789abcdef" cksum=checksum(string_data) the checksum will be sum of 01+23+45+...+ef (adding each byte) then next result = ~result and finally result = result+1 def checksum(data): .......... return result my main problem … | |
![]() | I've done a bit of searching but didn't come up with anything. Is there a way to use multiple placeholders and then use a list with as it assignment. i.e. [CODE] l = [1,2,3] l2 =['blah',50] print('%i isnt %i isnt %i which isnt %i' %(l[:],l2[1]))[/CODE] So if the first list … ![]() |
![]() | Hey guys, I was just making a tiny program, where I need the user to enter numbers. My question is, how do get numbers? I tried: [code='python'] self.panel=wx.Panel(None,-1) self.n=wx.TextCtrl(self.panel,-1,"Number") self.get=int(self.n.GetValue()) [/code] -but that didn't work... so how do I do it? |
Sorry if this isn't the right place for this type of question (I'm pretty new to Python). If there is a better venue for this kind of thing, please let me know: I tried to run a few PyQwt demo, but it complained that there was no module named PyQt4. … | |
Hello all, I have been doing some work on my HTML editor lately, and I have come to a (what seams like a) dead end. The file its self is about 3.7kb smaller than my text editor, ProssesIT, and yet it fails to run any where near as smoothly. When … | |
Im really new to Python and I just learnt about Quadratic equations in maths, and so i made it made it my project to make a quadratic solver. But i have a problem i have a line [iCODE]if tocontinue == n:[/iCODE] I try to run it in IDLE and i … | |
Here's my code: [CODE]metres = float(raw_input("Enter the height (in metres): ")) total_inches = 39.37 * metres feet = int(total_inches/12) inches = int(round(total_inches - feet*12)) if inches < 0.5: print "Sorry, you have entered a height that is less than 1/2 inches," \ " please re-enter a new height." elif feet … | |
I've got the codes all done; so its looks like this: [code]public class RightTriangle { public static void main(String[] args) { Triangle shape = new Triangle(); shape.setBase(4.0); shape.setHeight(5.0); System.out.println("The base of the right triangle is " + shape.getBase()); System.out.println("The height of the right triangle is " + shape.getHeight()); System.out.println("The area … | |
I had asked this question and thought that I had it solved but I could not get the text defined as variables. Below is the text file. I would like to specify a line and the length and set that to a variable. In the Example below the items in … |
The End.