No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
15 Posted Topics
I'n trying to convert a dbf file to a csv file(or anything else really). I found this on the interwebs but I get an error import csv from dbfpy import dbf import sys dbf_fn = 'in.dbf' csv_fn = 'out.csv' in_db = dbf.Dbf(dbf_fn) out_csv = csv.writer(open(csv_fn, 'wb')) names = [] for … | |
Re: π/0 Why, Larry? Why??? | |
I'm trying to extract some metadata from a m4v file. I'm looking for the duration, height, width, etc. I do all my programming on a Raspberry Pi and was looking at gexiv2 but could not get it going. I got exiftool working though. My script looks like this: import exiftool … | |
Re: It wont work like that. Exit the Python console and then type `python Server.py' You can't run a script from within the interpreter. | |
I have this: import re subs = [] def subcons(data): match = re.search(r'(<[a-z]{3})', data) if match: subs.append(match.group(0)) data = data.replace(match.group(0), '') subcons(data) else: print data return data, subs input = 'ABC <uvw <xyz some random data' e, f = subcons(input) print e print f The print statement in the else … | |
Hi I am trying my hand at GUI using Python and Tkinter. I know there are probably better options out there but I only have access to Tkinter here at work. My question is this. I have written this: #!/usr/local/bin/python2.6 from Tkinter import * import os root = Tk() root.title("EIMA … | |
I'm working with some really ugly files at the moment When I get them they can look like any of these: All data on one line delimited by ┌ `data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌` Nice data. All the bits I'm interrested already one one line per bit of information: `data1|data2|data3|` `data1|data2|data3|` Mixed: `data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌` `data1|data2|data3|` … | |
My brain is freezing up again. I have a string that looks something like this `1 apple--1 pear--1 peach--2 onion--2 carrot--3 <bee mince--3 <por chops--4 <oth salad:--potato--4 <oth bread:--garlic` Then I have a few dictionaries: dic1 = {'1': 'fruit', '2': 'vegetable', '3': 'meat', '4': 'other'} dic2 = {'bee': 'beef, 'por': … | |
A while ago I created a PHP application that looks at xml files. I have now been tasked with converting this to Python or Django or Turbo gears(anything as long as it's Python something). I am new at Python and while I have played with Django a bit I have … | |
So I have been told by various people on numerous occasions that you cannot parse XML by using regular expressions or any means other than a parser. So, here at work, I have LXML and that is what I have to use. At the moment I am trying to remove … | |
Help needed please. Desperate. I have a 3.somethingGB file that contains records that looks like this: [ICODE]<tag> <number>1</number> <info>blah blah</info> <more>Lorem Ipsum</more> <anothertag>The quick brown fox...</anothertag> <id>32444</id> <yetmore>blah blah</yetmore> </tag> <tag> <number>2</number> <info>qwerty</info> <more>yada yada qwerty</more> <anothertag>yada yada qwerty</anothertag> <id>32344</id> <yetmore>yada yada qwerty</yetmore> </tag> <tag> <number>3</number> <info>yada yada qwerty</info> <more>yada … | |
Hi I have a file with duplicate records they look something like this: [ICODE]<record> <dateadd>012012</dateadd> <nid>R04607295</nid> <reflink></reflink> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>631</num> <author>Anon</author> <title>ON THE WED</title> </record> <record> <dateadd>012012</dateadd> <idref>R04607297</idref> <reflink></reflink> <type>Article</type> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>651</num> <author>Bent, E</author> <title>ENTRANCES AND EXITS</title> </record> <record> <dateadd>012012</dateadd> <nid>R04607295</nid> <reflink></reflink> <FPI>YES</FPI><TPG>NO</TPG><FT>YES</FT> <num>631</num> <author>Anon</author> <title>ON THE WED</title> </record> <record> <dateadd>012012</dateadd> … | |
Hi all. My new job involves writing scripts for people in other departments. I'm pretty much on my own with this and I'm still a beginner with Python(I think my brain is still in PHP mode and I'm still struggling with this object oriented approach). Here is what I have: … | |
Re: That looks great thanks. I have worked Foxpro before but that was a looong time ago. I think the last time I looked at it I exported it and then imported it into a MySQL database. I'l definitely look at this though! | |
I have been asked to look into getting a web framework up and running here at work. I come from a PHP background and have developed a few tools various people use around the office. I have recently become part of a small team of developers who only use Python, … |
The End.