15,181 Topics
| |
Hi, i am basically from QA. So what we do each morning is open a web browser with the address [url]http://11.12.13.27:8080/cruisecontrol[/url]. Then we click on the build with last nights date. Then we click on a folder say client. Then in that folder we click on an exe file say … | |
Hello! I was writing a code and got an unexpected result, I broke it down in order to analyse it and in the end I have 8 rows of code. The problem I have is that I print x and it gives me the value 0.9 then if I say: … | |
I am trying to get some data off a Brazilian government website. The data is accessible through a form with some javascript. I am able to get the form and fill it out, but have trouble submitting it (a button needs to be clicked). I am using the library mechanize … | |
I have 2 lists: a=[0,1,5,7] b=[2,10,6,3] I need to get this list : c=[(b[0]+a[0]),(b[0]+b[1]),(b[0]+b[1]+b[2]),(b[0]+b[1]+b[2]+b[3])] I tried doing this using a for loop: [CODE] c=[(b[0]+a[0])] for i in range(0,(len(b)-1)): for p in range(i+1,len(b)): if i==0: c.append((b[i]+b[p])) else: c.append((c[i]+b[p]))[/CODE] I am supposed to get [2,12,18,21] but I am getting [2, 12, 12, … | |
I am trying to write a function that returns true if the number of vowels in a word are equal to the consonants or false if otherwise, but I keep on getting an error that the word is not defined, I need help to debug my code [code] def word(n): … | |
Hi, i need your expertise in this one. i am new to python, i want to write an algorithm that takes a string as input and determines whether or not it is a palindrome. please point me to the right direction. Thanks in advance. sabiut | |
I would like some feed back on my code. It is an IRC bot written in Python 2.6. What I might be doing wrong/inefficient. Better ways of doing something. And anything that will help sharpen my skills. I know I probably should have wrapped it into a class, and the … | |
write a python function called getAP which: has three input parameters: an array of measured voltages, the number of measurements n and the threshold voltage for an action potential; and returns an array with n entries, containing a 0 if no action potential occurred at the corresponding time step, and … | |
How to recursively walk directory & rename files & directories with Python 3.1 on windows? [CODE]#!c:/Python31/python.exe -u import os path = "test" for (path, dirs, files) in os.walk(path): print (path) print ("-----------------") if "monitoring" in path: dst = path.replace("monitoring", "managing", 10) print (dst) os.rename(path, dst) print ("path----") for file in … | |
This script uploads the pics in the specified directory into the specified album in picasa. The script requires gdata libraries installed. Check [I]code.google.com[/I]. I had written and tested the code in linux platform. Hasn't been tested in windows. Any suggestions to add more functionality, or add a UI or any … | |
Hey Guys, This seems like a basic problem with an easy answer but I simply cannot figure it out no matter how much I try. I am trying to create a line graph based on two lists. For my x-axis, I want my list to be a set of strings. … | |
This function I did to improve calculator program by eliminating problems with Pythons problem of dividing integer with integer and giving integer division result. | |
Hey! I created my first project on Google Code. Let me introduce myself. I'm Kevin, 18 years old. Next year I'll study computer science in Holland. I'm interested in computers ofcourse, and also in artificial intelligence and natural language processing and internet. So I created a new project. But I … | |
I am looking for very beginner programming software for my 12 y/o grandson for his birthday. He wants to program his own video games eventually but needs to start with basics. Is this a good software for that? If not, any suggestions? I am not technically savvy wise, so please … | |
I need this code to ask if you finished the current quest, if your say YES you have, i must check your inventory to see if you have the necessary items to complete it. What will check if inventory contains flour and eggs in this case? Thanks, (code below) [CODE]#Tavern … | |
I tried this super simple class example from net. (Yes I am a beginner in implementation of object oriented features in Python) UPDATE: Now from fresh start of IDLE it did not crash, but did not quit properly still. Hmm. TaskManager any (or dozen) python zombies hanging around?? No only … | |
Hi, I'm trying to save elementtree back into an xml file and it bahaves really strange. I have a function which takes some QTextEdit text arguments (obviously QStrings) and if I save a node property as a QString, it saves the file fine, but if I try to save a … | |
Hi, I have been searching high and low on google, and I cannot seem to figure out how to convert unicode to integers. Take the unicode codepoint, u'3001', for example. I know in utf-8, this is suppose to be ideographic comma. The hexadecimal representation is 0xE38081. I know if I … | |
Hi everybody! I want to get list of files and folders with permission from ftp! This is my code: [CODE] from ftplib import FTP ftp=FTP('ftp.domain.com','username','pass') a=ftp.dir('') [/CODE] after runnig : (Output) drwxrwxrwx 1 user group 0 Mar 01 14:29 Backup drwxrwxrwx 1 user group 0 Mar 01 14:29 logs drwxrwxrwx … | |
A short look at creating lists of file names or full path names using the versatile Python module glob. Glob follows the standard wildcard protocol. | |
Hello, i have proplem with the following excercise: There's a txt file which contains tab seperated words like: [CODE] Name N1 N2 Type FFapple 11 15 fruit ZZbanana 33 45 fruit ZZcarrot 22 25 vegetable FFapricot 10 30 fruit ZZmelon 22 50 fruit FFbroccoli 16 40 vegetable[/CODE] i want to … | |
hi expert, i'm newbie for python, anywhere i'm learning from internet sample, i got doubt here, i found below sample for thread import threading def hello(): print "Hello" t = threading.Timer(2, hello).start() t = threading.Timer(2, hello) t.start() this working fine when run manually ( python thread.py) but i try to … | |
Hi i am new at python,i am getting problem in the above code,the problem reads as follows: Having several accounts on several servers, one has to remember many passwords. You can imagine a situation where someone forgets one of them and he or she only remembers that it consisted of … | |
The directory layout looks like this [CODE] base -- + parcer -- + parcer.py log -- + log.py [/CODE] I want to import log.py from parcer.py. How would I do that? | |
| Can someone help me resolve the following error or point me in the right direction? An incomplete value is returned if ' is in the list value. Thanks for any help. [CODE] def FindName(self,name,list1): """ searches for a patten in the list, returns the complete list entry. Is case sensitive. … |
Hi Folks I have the following code in one of my classes along with checks when the code does not eval: [code]filterParam="self.recipientMSISDN==tmpBPSS.split('_')[3].split('#')[0] and self.recipientIMSI==tmpBPSS.split('_')[3].split('#')[1]" if eval(filterParam): print "Evalled" else: print "Not Evalled\nfilterParam\n'%s'\ntmpBPSS\n'%s'\nself.recipientMSISDN\n'%s'\nself.recipientIMSI\n'%s'" % (filterParam, tmpBPSS, self.recipientMSISDN, self.recipientIMSI)[/code] I am not getting anything to 'eval'. Here are the results: [code] Not … | |
I'm writing a slideshow program with Tkinter, but I don't know how to go to the next image without binding a key. [CODE=python]import os, sys import Tkinter import Image, ImageTk import time root = Tkinter.Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, h)) root.focus_set() root.bind("<Escape>", lambda e: e.widget.quit()) … | |
I'm fairly sure this will be my second thread to make me facepalm when I realise what I've missed, but oh well. If I have a list, for example L=[0,1,2,3,4], can I take the values out so that, again for example, t1 = 0, t2=1, etc.? The easy way would … | |
the program I had looks like this: def wordToNumber(word): if word == "one": return 1 elif word == "two": return 2 elif word == "three": return 3 elif word == "four": return 4 elif word == "five": return 5 elif word == "six": return 6 elif word == "seven": return … | |
Hi all. I'm taking a beginner python course and have an assignment to write code using a 'for loop' + 'named variable' + 'branching logic' Trouble is, I have no idea what 'branching logic' is - if anyone has the time to respond, I'd really appreciate it! |
The End.