15,190 Topics
![]() | |
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 … |
The End.