15,185 Topics
| |
Hi, I am new to programming with python. I want to make a image rotate dynamically corresponding to the CPU usage in ubuntu. I searched everywhere but couldnot find any post for it.All i have found is a static rotation with the PIL. If anyone could help me in this … | |
Hi! I'm about to rename a hole bunch of files in different folders and want to use Python to do it. The problem is that I want to keep parts of the file name from the old file and insert it into the new file in another location. for example: … | |
The basic set-up is: [CODE=python] class A(): def __init__(self): self.var = 1 @staticmethod def do_stuff_with_var(self): # A method which uses self.var ... class B(A): def __init__(self): A.__init__(self) b1 = B() b2 = B() list_of_B_instances = [b1, b2] for instance in list_of_B_instances: instance.do_stuff_with_var(instance) [/CODE] However the last line of code raises … | |
Hi Forum, I am a total newbie, so please be gentle!! I am trying to extract data in many text files that looks like this: 0.0 -0.9 0.3 -0.4 0.6 -1.0 0.9 0.3 These colums always appear on the same line number. What I want to do is to get … | |
hello, I wanna create a struct in python. the struct needs to have a char and an array of chars. eg. (ruby code): [code] Somestruct = Struct .new(:character, :characterArray) structure = Somestruct.new(" ", []) [/code] How do I do this. I made a Trie in ruby and now I wanna … | |
Follows, I need some help with fixing a bug in my program. I can't post the entire code here as its an on going assignment. I'm building a Tree in Python. [code] class Tree: def __init__(self, f, r): self.first = f self.rest = r [/code] This is my Tree. I … | |
I cannot seem to figure this out. This part of a larger script that I am writing. I have a list that looks like this. The fields are servername, port and program. How do I sort it to get a tally of what servers are listening on what ports. This … | |
I'm having a problem parsing a webpage to extract data from a table. Ideally I'm trying to extract the table with id="ctl00_ctl00_MainContent_PM_MainContent_gv_Portfolio" (see html below) I don't have a problem entering the website and downloading the html, it's beautiful soup that's tripping me up. My python code and downloaded html … | |
Hi guys, I'm new to programming and am trying to get better by writing "useful" things. Here is a very simple stock portfolio tracker that I started yesterday. It is not very complex and I feel like I'm not really improving my skills since it uses mostly beginner concepts, but … | |
I'm using python & i am trying to match ";" in a line: [CODE] for page in css: f = open(page, "r") lines = f.readlines() count = 1 obcount = 0 ebcount = 0 probwithfile = False for line in lines: [B]if not re.match("^{$", line) or not re.match("^}$", line): if … | |
Hi, I'm working on little phone book program with wxPython and SQLite. I can get database populated and can retrieve back the phones and names, but when I do fill them in ListCtrl it throws cruel errors :) Here is the retrieved data from database: [(1, u'Steve', u'Giddy', u'0654743553'), (2, … | |
| I have some code here: [CODE]import urllib import subprocess import time open_site=urllib.urlopen("http://www.freewebs.com/sravan953/command_python.html") read_site=open_site.read() site_list=[] for a in read_site: if a=='<': break elif a!='<': site_list.append(a) site_list.remove('\n') site_list.remove('\n') site_list.remove('\r') for a in site_list: site_string=''.join(site_list) def run_program(): current=time.asctime() print 'Runnning program'+' ['+current+']' subprocess.call(site_string) def check_argument(): current=time.asctime() if str=='': print 'No command given'+' ['+current+']' … |
Hi friends, I am using python 2.5 idel on mac. But now it is not working when i click on idle icon on my desktop. Just i am getting IDLE bounce in dock and disappearing... please give a valuable reply on that one... | |
hey people i wud really really appreciate a hand here ohk dis is my task i have been given a bunch of urls to webpages containing blog posts i need to extract the authorname,date,content of blogpost and meta data and put it into a database. Here is wat i thought … | |
I finished making a basic web server a little while ago, however I cannot access it at all. I ran it on my mac, which didn't work. I then ran it on my PC and tried to access it from my mac using Firefox. This is the code I have … | |
Hi, I'm making a password program that I want to launch every time I turn on my computer. Anyone know how I'd do this? Also, is it possible to make it so that the user is prompted to enter the password before any other files or applications can be accessed? … | |
I am having trouble with a list that doesn't want to append like they normally do. I have been messing around with it for the last couple of days off and on. For the life of me I can't seem to figure out what I am doing wrong. n=range(0,31) x=[] … | |
I have python 2.4.4 installed on Ubuntu for use with Zope 2.9.8 (plone). I am moving my zope/python install from a hosted server to a new server of my own. I am setting up everything from scratch for the first time. When testing my installation, I get an error message … | |
Hi All I think this is my post in DW . I need a help from you guys . I have a data [code] ['\x1a', '\x05'] [/code] , and how i can convert this to ascii ?? Any ideas , please give a hint :) thanks | |
I am using python portable on a thumb drive and on some computers my script works normally, on others it does not. I Checked the paths and it had the _imaging.pyc file and the path was set up for it correctly on all computers. Is this because 1 computer has … | |
[CODE]print "INSERT QUIZ INTRO" choices1(); def choices1(): print "The SNES Star Fox games ran off of/was used to advertise what advancement?" print "1: 32 Bit color" print "2: Argonaut's Super FX Chip" print "3: Voice-like sound effects" print "4: Higher Frame rates" 001();[/CODE] There's code past this but I imagine … | |
Hi; > If I have a srt file (lines in similar format given below). 42 00:02:21,085 --> 00:02:22,709 Just tell Cuddy you've got an urgent case. 43 00:02:22,709 --> 00:02:24,680 - You had to leave early. - That would be lying. 44 00:02:24,680 --> 00:02:26,119 And that would be wrong. … | |
Guys, I'm stumped here. Trying to retrieve a row from mysql using MySQLdb, I receive the number of matching rows found, not the data itself. here's the code: [CODE] def getKbd(kb_num): query="SELECT kbd_name, kbd_data, kbd_ps FROM kbd_ WHERE kbd_number = %d " % kb_num a = c.execute(query) return a print … | |
I am starting to learn python and since I have had some programming before ( intro to java last semester and intro to c++ a couple years ago) the teacher gave me an interesting problem to solve. It is an equation called the Prandtl equation from fluid flow measurement it … | |
i'm trying to create a simple minimum function by comparing items in a list to each other. [code] list1 = [4,20,2,19,3254,234,21,03] for i in list1: if list[0] < list[0+i]: print i [/code] basically my thought process in pseudocode is for all items in the list if item n is less … | |
Is it possible? If yes, how? | |
I'm really kind of stuck here, and would really appreciate some help. I have a function that reads from a csv that can get quite large, and it will block some other routines from running in there allocated time slice. I need to make this code “non-blocking”. I think there … | |
Hi, I am using Python's urllib2 with Tor as a proxy to access a website. When I open the site's main page it works fine but when I try to view the login page (not actually log-in but just view it) I get the following error... URLError: To counteract this … | |
Is it possible? I need to use them with wxpython and I'd want to make a standalone program that contains them into the exe file. | |
Hi, I hope you can help; I get this error when I compile a "C" sub module (NOT POSIX) 27 ! regmatch_t pmatch[2]; ===========> ............a......b............................................... *=ERROR===========> a - CCN3766 The universal character name "[" is not in the allowable range for an identifier. *=ERROR===========> b - CCN3275 Unexpected text ']' … |
The End.