15,194 Topics

Member Avatar for
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
172
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
87
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
239
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
147
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
311
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
131
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
78
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
321
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
144
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
77
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
56
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
95
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
154
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
259
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
115
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
581
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
181
Member Avatar for eyewirejets

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.

Member Avatar for Stefano Mtangoo
0
84
Member Avatar for wheatontrue

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 …

Member Avatar for wheatontrue
0
142
Member Avatar for leegeorg07

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] …

Member Avatar for leegeorg07
0
700
Member Avatar for starzstar

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 …

Member Avatar for starzstar
0
114
Member Avatar for abczxy124
Member Avatar for Stefano Mtangoo
0
140
Member Avatar for breatheasier

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 …

Member Avatar for Stefano Mtangoo
0
98
Member Avatar for leegeorg07

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 …

Member Avatar for leegeorg07
0
389
Member Avatar for Stefano Mtangoo

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]

Member Avatar for Stefano Mtangoo
0
132
Member Avatar for jaysonperry22

[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 …

Member Avatar for vegaseat
0
128
Member Avatar for iuessele

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 …

Member Avatar for Stefano Mtangoo
0
107
Member Avatar for Stefano Mtangoo

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: …

Member Avatar for Stefano Mtangoo
0
127

The End.