15,175 Topics

Member Avatar for
Member Avatar for LinkMaster03

Using curses, how can I echo and capture input at the current cursor position? I have moved the cursor using scr.move(y,x) and turned on echoing. I can type into it and have it displayed. How can I capture this data as a string after the user presses enter?

Member Avatar for LinkMaster03
0
109
Member Avatar for Bidamin

Hi, I am trying to write a script that takes in a user inputed Excel file and adds/deletes/edits a row and re-saves it. Because xlrd and xlwt dont work together I am forced to combine them together and copy the xlrd workbook to an xlwt workbook. I am using python …

Member Avatar for slate
0
804
Member Avatar for Alien15x

am i correct in assuming that when a computer behind a router with port forwarding opens a port (port 1337, when i run my server), that the router automatically notices and sets itself up to send all port 1337 traffic to that computer? i've got two simple applications, a client …

Member Avatar for Freaky_Chris
0
963
Member Avatar for lllllIllIlllI

Well this is probably a really stupid question but i was doing pygame tutorial and i dont know what a vector is and they keep talking about them, there were special vector classes and things like that, im rather confused, so if someone could teach me what a vector is …

Member Avatar for Ene Uran
0
118
Member Avatar for Ghostenshell

Having trouble with the final loop in this craps program. Any suggestions. Problem starts on line 28. Was thinking about breaking the whole thing into functions but I don't exactly know where to call them at. When I do call them I get accessed before argument errors or something to …

Member Avatar for oldSoftDev
0
124
Member Avatar for MaxManus

Hey, I got an array with float values from 0 - 120. How can I find the first element over 100 and which element it is?

Member Avatar for scru
0
4K
Member Avatar for adam291086

Why wont my cookie set in firefox [CODE]#!/usr/bin/python import Cookie print "Content-type: text/html\n" C = Cookie.SimpleCookie() C["number"] = 7 C["string"] = "seven" print C["number"].value print C["string"].value print C print "Set-Cookie: string=seven; " [/CODE]

Member Avatar for adam291086
0
79
Member Avatar for drone626

I have a simple rational number class which looks roughly like: [CODE] class Rational: def __init__(self, numerator,denominator): self.numerator= numerator self.denominator= denominator more functions... [/CODE] but when I work with really large numbers such as the following example: [CODE] >>>a= Rational(2**64, 1) >>>a [/CODE] python crashes telling me Rational instance has …

Member Avatar for drone626
0
124
Member Avatar for Ghostenshell

First I like to thank everyone that helped me with my work... Please bear with me I don't know how to explain my problem. Trying to get the random number to remain the same through out the length of the program. When the player guess the right number the player …

Member Avatar for Ghostenshell
0
141
Member Avatar for happymadman

Hi, how would I get the timer() class to change time display()'s self.time I'm new to threads and classes and have been sitting here thinking about it for the last half hour and still have know idea Thanks heaps for any help. [code=python] # Count down timer import time import …

Member Avatar for happymadman
0
101
Member Avatar for n0p

First of all I apologize for my bad english I am beginner in writing GUI apps with Glade and python, i am having problem with libglade.. well I know that glade-3 hasn't yet good implementation with gtkbuilder, so python users are saving projects in libglade format, and then we convert …

0
33
Member Avatar for chebude

I have too collect a daily rainfall data from a certain model output. The model ouput gives out each stations daily data separately which I have to collect together and further analyse. [I have tried the following, it works but my data - thousands of pcp_#.txt which makes the process …

Member Avatar for chebude
0
170
Member Avatar for leegeorg07

i looked at the python 3k print module from griboullis and i want to use it for python 2.5 without having to import it every time, i think it needs to be builtin but how can it do this, i don't mind if the old print is still there but …

Member Avatar for leegeorg07
0
84
Member Avatar for Deepak.G

hi im trying to write a python script for a telnet client. So far im able to establish a connection with a server. My problem is that i want to print (at the client) all the activities at the server end. Let me put it this way. Suppose i send …

Member Avatar for Stefano Mtangoo
0
3K
Member Avatar for SoulMazer

Hi, so I just have a question that I at least think will be pretty easy. So, I am making a script that basically gives you a "vocabulary test". There is just one feature I would like to implement that I need help with. I would like to make it …

Member Avatar for SoulMazer
0
237
Member Avatar for mruane

I am preparing for my a+ exams, and am turning all of my notes into a test. I plan on doing this in python, of course. But, I am a little lost at what would be best. Should I create each question as a specific function, calling the next question …

Member Avatar for mruane
0
144
Member Avatar for darkfury18

for example if i write hello on one line and then wanted to write goodbye right underneath what do i have to do? as when i press the enter key it just prints hello

Member Avatar for scru
0
4K
Member Avatar for eyewirejets

Can someone please look at my code and see if I'm writing it efficiently using parameters and return values. Thank you for your support [code] PAY_RATE = 12.75 #This program ask the user for: hours worked, then calculates gross pay. def get_hours(): hours = input("How many hours did you work?: …

Member Avatar for jrcagle
0
261
Member Avatar for Haze

Hey just wondering if you can do something like that with variables for example [CODE] class test(object): a = 55 def dispmenu(self): print self.a instance = test() [/CODE] How would i be able to call "instance.dispmenu()" without having to type that. Some things i have tried [CODE] action1 = instance.dispmenu() …

Member Avatar for jrcagle
0
128
Member Avatar for leegeorg07

hi again ive got more questions for ides i have been using UliPad but it keeps on closing and uninstalling itself im looking for something that can: run code in ide debug syntax lightweight all round simple to use preferably i would like it to have a module lib what …

Member Avatar for leegeorg07
0
72
Member Avatar for ryn670489

This is my code its to calculate book club points earned. i cant see where the error is if any one can help me i would be very gratefull. thank you def main(): books = getBooks points = getPoints printPoints def getBooks(): books = input("enter the books purchased") return books …

Member Avatar for ryn670489
0
316
Member Avatar for starzstar

Are there any equivalent classes in python for the for the following java classes import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.protocol.Protocol; Thanks

Member Avatar for Stefano Mtangoo
0
142
Member Avatar for nclouse

This may be a stupid question but.. I am trying to do something like this.... [code] if not something and not somethineElse and not someOtherThing and not thisThing: print "asdf" [/code] and i get an invalid syntax error. so how do you do that properly? google wasn't much help.

Member Avatar for nclouse
0
76
Member Avatar for klia

hello everyone I am working on my application that deals with photos. well i have created my UI using Qt designer and converted it to python classes using pyuic4 but i am facing problem with the file dailoug where i can browse my directory and choose photos but i can't …

0
55
Member Avatar for leegeorg07

i have this code: [ICODE]import random choices = ['closet', 'lampshade', 'fridge'] print "i have hidden 10,000,000 pounds in one of these places:", choices choice = raw_input("Where do you want to search? ('closet', 'lampshade', 'fridge')") random_c = random.choice(choices) while choice != random_c: choices.del(random_c) for word in choices: if choice == word: …

Member Avatar for leegeorg07
0
92
Member Avatar for starzstar

Hi I am using optparser to design a command line interface.How do I read multiple arguments. For eg if I want to create a folder, I will take the arguments path and folder name something lilke the following main.py --createFolder Tesfolder --path C://Test/Test/... How to read these arguments? I can …

Member Avatar for Murtan
0
152
Member Avatar for anthology

#After user inputs the year they were born I want to break it down using fadic addition like below# birth_year = int(raw_input('Please enter the year you were born')) #User inputs 1953 birth_year = 1953 #What I want is to do this using Fadic addition: birth_number1 = 1 + 9 + …

Member Avatar for anthology
1
257
Member Avatar for shadows09

[URL="http://www.megaupload.com/?d=GZJD9V51"]http://www.megaupload.com/?d=GZJD9V51[/URL] Above is the program spec. and below is what I did so far. [code=python]numStr = raw_input("'p' to be prompted for the secret number or 'g' to have it generated: ") p = numStr print print true = p while true: secret = raw_input("Enter the 'secret' number (five digits, no …

Member Avatar for shadows09
0
114
Member Avatar for jworld2

Maybe I have this all completely wrong because I don't know what I'm doing, but I'm trying to work with win32 programming and I want to get the position of all the items on the desktop. I've found the handle for the desktop and I've found the LVM constants in …

Member Avatar for Stefano Mtangoo
0
576
Member Avatar for jculverwell

I am attempting to write a JSONP application and think that it is not working because the JSON my code is returning has surrounding quotation marks. For example when I call the webapp using [url]http://rest-client.googlecode.com/[/url] it returns the following "callbackfunctionname({'Last': 'Doe', 'First': 'John'})" Comparing this to a public url I …

Member Avatar for jculverwell
0
178

The End.