15,181 Topics
| |
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 ']' … | |
hello all, how can i write a python line of codes that will contain WI-FI, google maps,google android applications on S60 nokia phone using a SKYHOOK wireless device as an acess point and the operating system must be symbian OS. But i have S60 developmental tools and S60wpsapi which i … | |
I'm attempting to search a string for a certain sequence. I have not done anything with re, and it is... a bit confusing. I'm looking for this string: <div class="indexcenter"> (there's a portion of text here using newlines and characters) <!-- end indexcenter --> I am thinking something alone these … | |
Hi all. I'm making a program about 'reading and writing text files' The assignment I have to do is suppose to look like this: [url]http://i39.tinypic.com/5554wi.jpg[/url] But I can't figure it how to make it so when it keeps looping until the user types in 'break' and it will list the … | |
I'm trying to print diff.txt that contains the differences between the 2 log files I have. I want it to print the diff.txt in the current directory, but I get nothing. [code] def difference(dirList1, dirList2): difFile = list(set(dirList1).difference(set(dirList2))) writeDif = open( 'diff.txt', 'w' ) writeDif.write( 'Yadda yadda, intro intro' ) … |
The End.