15,190 Topics

Member Avatar for
Member Avatar for jcmeyer

I know that, in python, to start a file with it's associated application that is located on my hard drive I can simply use os.startfile. However, I want to be able to start a file with it's associated application that is located on an ftp site. Does anyone know how …

Member Avatar for jcmeyer
0
130
Member Avatar for hughesadam_87

Hey everyone, Here is an outline of my problem: I have a working code which defines a class, GeneDict, which reads in data from a special type of file, and stores it as a dictionary. What it is really doing is taking in millions of lines of biological data, and …

Member Avatar for hughesadam_87
0
136
Member Avatar for drjay1627

I have a recursive function. My base case is: [code] somemethod(somelist) [INDENT]if len(somelist) == 0[/INDENT] [INDENT][INDENT]return[/INDENT][/INDENT] ... [/code] This is suppose to return the function to the place where it was called from. [code] main() ... somemethod(somelist) ... [/code] But I get this error: AttributeError: Trie instance has no attribute …

Member Avatar for jlm699
0
96
Member Avatar for tunisia

I'm getting my feet wet with nodebox and Python. What is a real world way to find a library I need, download it, and move it to a directory so that the Import --some library will work? I'm having trouble getting any imports to work from within nodebox. thanks

0
47
Member Avatar for Stefano Mtangoo

To help people who come from console application and who wants to implement GUI, it is better for them to know the real world application made by available toolkit. I suggest this be the place to show real world apps doen by toolkits in Python Language Hope it will help …

Member Avatar for Stefano Mtangoo
0
113
Member Avatar for rustysynate

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 …

Member Avatar for rustysynate
0
87
Member Avatar for Mclovin

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

Member Avatar for Mclovin
0
651
Member Avatar for -Xlayer-

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 …

Member Avatar for -Xlayer-
0
290
Member Avatar for galactica

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 …

Member Avatar for woooee
0
618
Member Avatar for drjay1627

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 …

Member Avatar for scru
0
138
Member Avatar for drjay1627

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 …

Member Avatar for woooee
0
117
Member Avatar for ccandillo

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 …

Member Avatar for woooee
0
141
Member Avatar for njparton

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 …

Member Avatar for njparton
0
644
Member Avatar for luke77

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 …

Member Avatar for sneekula
0
534
Member Avatar for pymatio

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 …

Member Avatar for pymatio
0
107
Member Avatar for Stefano Mtangoo

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

Member Avatar for Stefano Mtangoo
0
989
Member Avatar for sravan953

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

Member Avatar for Stefano Mtangoo
0
131
Member Avatar for rajasekhar1242

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...

Member Avatar for Stefano Mtangoo
0
118
Member Avatar for Shraddha Kiran

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 …

Member Avatar for Shraddha Kiran
0
152
Member Avatar for sciguy77

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 …

Member Avatar for xav.vijay
0
437
Member Avatar for sciguy77

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

Member Avatar for woooee
0
149
Member Avatar for jrex

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

Member Avatar for woooee
0
1K
Member Avatar for seank

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 …

Member Avatar for seank
0
245
Member Avatar for Achayan

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

Member Avatar for vegaseat
0
125
Member Avatar for somekid413

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 …

Member Avatar for vegaseat
0
669
Member Avatar for pupspark

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

Member Avatar for siddhant3s
0
203
Member Avatar for gujjar19

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

Member Avatar for jlm699
0
110
Member Avatar for DimaYasny

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 …

Member Avatar for DimaYasny
0
107
Member Avatar for cgfxcoloneill

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 …

Member Avatar for cgfxcoloneill
0
263
Member Avatar for rasizzle

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 …

Member Avatar for woooee
0
111

The End.