15,175 Topics
| |
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! | |
Hi, i am currently developing a standalone aplication in python, i am very new in this language so i don't know much of it... I need your help, i need to know a way to communicate python and AS3 so i can move the animations with some data that comes … | |
I need to know what the command is for setting a specific set of decimal places in an answer, somewhat like the PHP number_format command. Here is what I got coming up in my answer.... 0.7893948 I need it so it says: .789 Anyone have an idea of what the … | |
I am using Python 3.1.2 What is the best way to get numeric (float or int) user input? | |
Hi all. I'm a newbie here so excuse my question if it's a bit dumb. I'm a C programmer but needed to do some text file stripping so was told Pythin would be good for this. I have been messing about with this for about a week now and have … | |
I am learning Python 3 I have several pieces of code that compares dates. The problem is I don't understand how to read a date from a text file and then use it in my code so I can compare it with todays date. I get errors like - int … | |
I know I can accomplish this with Regex, however, being not familiar with RegEX (yet to find a good howto/reference), I was wondering if there's other simple ways to parce XML files, or if there's a tutorial for regex somewhere For example, I want to get the Hello World! from … |
The End.