15,194 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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] | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … ![]() |
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 … | |
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 … | |
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 … | |
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 | |
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?: … | |
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() … | |
![]() | 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 … ![]() |
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 … | |
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 | |
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. | |
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 … | |
![]() | 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: … ![]() |
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 … | |
#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 + … | |
[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 … | |
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 … | |
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 … | |
Where should your definitions of your functions be in your code? Should they be down below or above? What is the best way? Beginner Question - Thanks for your support. | |
Dear all, I am trying to parse a lot of text. for small amounts of text, the WHILE loop I use to find all spaces in the text works well: markerlist=[] counter=0 while len(markerlist)<text.count(marker): [INDENT]markerlist.append(text.find(marker,counter) counter=text.find(marker,counter)+1[/INDENT] This iterative process is very, very slow when working with a few megabites of … | |
![]() | i have made a simple music player that will randomly choose a song from the list (music) how can i expand this to a whole directory of music without having to make a list with them all in heres the code: [code] import webbrowser, random music = [#music was here] … ![]() |
Has any one tried using pyDAV a webDAV library for Python, I am getting a followind error whilw trying to list the contents of a collection 2009-02-05 17:38:58,092: DEBUG: REQUEST Send OPTIONS for /uc910015/home/ 2009-02-05 17:38:58,092: DEBUG: REQUEST Body: None 2009-02-05 17:38:58,092: DEBUG: REQUEST Header: ('AUTHORIZATION', 'Basic U3Rvc nZUVncjAwMTpJSUtD') 2009-02-05 … | |
i need to design a python program that will calculate these two things. can someone help me out here? | |
Hi, I'm trying to create a 2-Dimensional box in vpython and fill it with circles placed in random positions but the circles cannot overlap. This is how far I have got, but I can't work out how to make the positions not overlap. I'm sure most of what I've done … | |
![]() | hi again im doing the spell checker program in the projects for the beginner thing and i have this code: [ICODE] dict = open("DictionaryE.txt", "r").readlines() test = "Hello my nmae is george" correct = [] for line in test: if line in dict: correct.append(line) print line print correct [/ICODE] but … ![]() |
Whenever I have lists or tuple lists I have something like u' (check sample result). What does this do? [CODE=python](u'03/02/2009', u'Billing for gas', 100.0, 210.0, 200.0) (u'15/04/2009', u'paying fees for OUT', 0.0, 10405.0, 0.0) (u'03/02/2009', u'Billing for gas', 100.0, 210.0, 200.0)[/CODE] | |
[code] def main (): display_message () # get user's first name first_name = raw_input('Please enter your first name: ') print 'Hello', first_name # input total sales total_sales = raw_input('Please enter your total sales: ') # input total hours total_hours = raw_input('Please enter your total hours worked: ') # input total … | |
Can anyone tell me how to write a program that displays all of the cards from a deck of playing cards? i set up two tuples, one with the ranks and the other with the suits. I cant figure out how to make the Ace of spades - King of … | |
I'm trying to grasp SQLite to do some stuffs I want it to do, but it is sometimes too hash to me :) So what i'm I wrong with this code?? [CODE=python] #!/usr/bin/ # SQLite command to be used with the applications import sqlite3 as sqlite import os class SqliteCommands: … | |
I'm trying to auto send a form submission to a website but it isn't working. I've done this before and it worked but for some reason, using the same basic code, it doesn't seem to submit it. I'm using urllib & urllib2 to open the page and re to parse … | |
Hi, i have opened a file from a python sript using built in function 'file'. after reading data from that file, i closed the file descriptor and tried to delete the file but it gives an error that file is being used by another process whereas none of the process … | |
I have this code that manipulates many list (which are a mix of numbers and words) and I need it to print to a text file in rows without brackets. here is the code: ingroup = open("C:\Python25\Drew\subgroup.txt", 'r') outgroup = file ("dID.txt", 'w') ct = 1 rcw = ingroup.readlines() cID=0 … | |
im thinking about how i could manipulate gui windows, so that if I were to have, say two separate programs running in two separate windows and i were to drag one the other would follow. does anyone know how i would begin to go about doing this? I'm actually using … | |
![]() | |
I know python has math functions like 5+6 and 5*6 and 5/6 etc...but I have something like this: x=575124357 and need to add them all together: 5+7+5+1+2+4+3+5+8=40 | |
This function is supposed to take an integer that contains an rgb value, extract the value of each channel, and then return that calculated luminance of the pixel. As it stands, the performance of this function is not fast enough. Looking at it, I can't think of anything else that … | |
I have a randomly generated list of which contains letters, symbols, and numbers and need to separate it into 2 lists -one of numbers and one of the remaining chars. Then I need to separate the numbers into 2 lists-one of composite numbers (4,6,8,9) and one a list of prime … | |
I am hoping to create a pixel based rpg game with the story depth of the elder scrolls series, with graphics similar to PixelMan 3 by pymike, (pygame.org/project/712/). If anyone is interested in helping, let me know! I am a basic level python programmer, so am using this project as … | |
Hi.....I have a long string of letters and symbols and I need to increment their ascii value by 1. How can I do that? Here's an example of the string: s="p@ugdyhtapbcedoamguh?a#vdaxdv$zdoxw?pu$exrbzt evk#n$xjlgpmece??$$@@yyiw##rmn$nmrblruv ?azxdsoh#$@nndkkt?k@ihatywtbazgbq#ykshx" so like # becomes $, etc |
The End.