LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-26-2008, 11:45 AM   #1
deathalele
Member
 
Registered: May 2008
Location: deep dark north wales
Distribution: Zenwalk
Posts: 162

Rep: Reputation: 30
Using python to edit a python file.


I think i have enough python knowledge to start on my first serious python project: a spreadsheet.

my idea is to have on python file with the software(lets call it py1) and so o in it and another wich will contain the info in the spreadsheet(lets call it py2).

eg. family.py
Quote:
A = 'name'
B = 'relation to me'
C = 'Age'

A1 = Mum
B1 = Mother
C1 = 47
A2 = Dad
B2 = Father
C2 = 51
My question is will it be possible to edit py2 using py1?

If it is can u leave examples.
thanks in advance
 
Old 08-27-2008, 04:49 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
what are you trying to do actually?
 
Old 08-27-2008, 12:34 PM   #3
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by deathalele View Post
My question is will it be possible to edit py2 using py1?
Of course.
But then what?

It really is better to parse the "spreadsheet" file yourself with python code. (or maybe have a look at "pickle" if you cannot resist storing "spreadsheets" as python code).

Last edited by Hko; 08-27-2008 at 12:36 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Processing Conflict: python-devel conflicts python< 2.3.4-13.1 guarriman Fedora 2 04-23-2009 07:02 PM
Python: how to import a python file that doesn't end in .py? BrianK Programming 5 04-15-2008 12:35 PM
LXer: Charming Python: Python elegance and warts, Part 2 LXer Syndicated Linux News 0 08-31-2007 08:40 AM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration