CentOS 5 :: Python Files Displayed As Text?

Dec 31, 2010

I have CentOS 5 32 bit and I wish to be able to use Python as it is required by a web script I am installing.The Apache however handles the test Python scripts as text. I have Apache/2.2.3 installed and I followed this tutorial: [URL]installed mod_python, edited the httpd.conf file, restarted the Apache, it restarted ok - no change at all. I tried other suggestions I googled but in vain.

View 4 Replies


ADVERTISEMENT

Programming :: Formatting Fields And Text Being Displayed From Text File?

Feb 9, 2011

I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:

sampleLog.txt

Code:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.

The desired output should look like this:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.

View 15 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

CentOS 5 :: Text User Interface To Configure Text Files

Nov 5, 2009

I would like to write a text user interface (TUI) to adjust some text config files etc. Is there a tool or application for creating TUIs like this. I�m talking about those types of config tools which you see executed at first boot.

View 19 Replies View Related

Programming :: Using Python To Merge Two Text Files Line For Line

Jul 6, 2010

I'm a bit new to Python programming and hoped that someone might be able to help with a problem I'm having. What I essentially want to do is to combine two text files line for line. I know how to do this in a bash script so to give you a better idea here's the code for that:

Code:

This is basically for adding on values to the end of a CSV file that uses ';' as the delimiter. So say file1 said:

And file2 said:

Then running this command would create merged_file1_and_file2 which would be:

The code I'm using at the moment is:

Code:

As I'm sure any experienced python programmer will see, this prints out the first line of the file "csvraw" and then all of the lines of "stamps" and then the remainder of "csvraw".

What I'd like to do is something like: (pseudo code, I know it's not python ;-))

Code:

Is this possible? I've tried googling and my Python Pocket Reference hasn't been much help. I've looked at pickling but that doesn't seem appropriate.

View 1 Replies View Related

CentOS 5 :: The Centos-release-notes Package Simply Contains A Bunch Of Text/html Files That Nothing Else Relies Upon?

Apr 3, 2009

Why does centos-release-notes have any dependancies ?

I can see no reason why centos-relese-notes should depend on centos-release when I try "yum erase centos-release-notes" I am told there are 72 dependancies including completely irrelevant packages such as tar all because of this unnecessary dependancy.

The centos-release-notes package simply contains a bunch of text/html files that nothing else relies upon, so why the dependancies ?

View 4 Replies View Related

Ubuntu :: Contents Of Text Documents Displayed In Their Icons?

May 1, 2010

but not all, of my text documents show their contents as their icons, instead of using my theme's designated icons for text files. For example, in the above image, the bottom-right file contains: "hello ubuntu forums / this is my problem / how can we fix it? / thank you" and it's icon displays some of this message so that it may be read without opening the file As you can see, the problem occurs with some filetypes, like .txt and .html, but not with others, like .doc or .rtf. How can I force all text files to use my theme's designated icons?

View 2 Replies View Related

Software :: Join 2 Text Files Based On First Number Present In Every Line Of The 2 Text Files?

Jan 22, 2010

I have 2 text files : file1.txt and file2.txt

cat file1.txt

15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces

cat file2.txt

2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2

I would like to join these 2 files. The result should look as follows :

cat joinedfile.txt

2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2

==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?

View 4 Replies View Related

CentOS 5 :: Yum - Python-devel / Python Dependency

Jan 7, 2011

yum dependency problem please? I am running Centos 5.5. I need to install python-devel, but when I do so I get:

[Code]....

View 2 Replies View Related

CentOS 5 :: Upgrade Python-2.4.3 To Python-2.5?

Mar 30, 2011

How can I upgrade python-2.4.3 to python-2.5?

View 1 Replies View Related

Ubuntu :: Python : Remove Some Lines From A Text File?

Sep 6, 2010

I am creating my own address book Python program and I want to create a nction that removes some specified entries. The code looks like this now.

Code:
def remove():
delentry= raw_input('Enter the entry name to delete: ')

[code]...

View 1 Replies View Related

Software :: Use Text-voice And Vice-versa Using Python?

Jun 9, 2011

how can I use text-voice and vice-versa using python , one that looked on Python's Burrow (python.org):[URL]

View 1 Replies View Related

Ubuntu :: Displayed A Pop-up Window Saying That Autioaudiosink Element Is Missing And The Terminal Displayed?

Jan 12, 2010

i'm not able to play music at all. videos videos seem to crash my browser and using either rhythmbox or banshee they crash too.i ran rhythmbox by typing sudo rhythmbox and tried to play a file and it displayed a pop-up window saying that my autioaudiosink element is missing and the terminal displayed this:

code: (rhythmbox:8415): rhythmbox-warning **: unable to grab media player keys: could not get owner of name 'org.gnome.settingsdaemon': no such name
warning: unhandled message: interface=org.freedesktop.dbus.introspectable, path=/, member=introspect

[code]....

View 1 Replies View Related

Red Hat :: Change The Default Text That Is Displayed On The Default BASH Logon (attached)?

Sep 12, 2010

How is it possible to change the default text that is displayed on the default BASH logon (attached)?

View 1 Replies View Related

Server :: Parse The Bunch Of Values Displayed By The Socket Program Into The Php File So That Further It Can Be Displayed In HTML Page?

Apr 15, 2011

How to parse the bunch of values displayed by the socket program into the php file so that further it can be displayed in HTML page

View 1 Replies View Related

OpenSUSE :: Get Fileproperties To Be Displayed While Hovering Over The Files?

Sep 8, 2011

I have installed OpenSuse 11.4, KDE 4.6. In konqueror filemanagement I don't get fileproperties when hovering over the files with the mouse. Only right click -> properties will give me the properties. Now properties are not too much a concern but it is the preview I want. Dolphin does give me properties and preview.What can I do to get fileproperties to be displayed while hovering over the files?

View 2 Replies View Related

Software :: Use Sed To Include A Text File In The Beginning Of Other Text Files Inside A Folder And Its Subfolders?

Jun 1, 2010

Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.

View 4 Replies View Related

CentOS 5 :: Gnome Desktop Not Displayed After 5.3 Upgrade

May 18, 2009

I upgraded to 5.3 and on the next login I was placed in a basic xwindows desktop. Running /etc/init.d/gdm give me the response "GDM already running. Aborting!" Not sure where to look next.

View 2 Replies View Related

Ubuntu :: After Power Loss Files Not Displayed But Still Using Space / Fix It?

May 31, 2011

After a power outage my external hard drive that I use to serve a DLNA server with content lost all the files.
The parent directories are still displayed, but there is nothing inside them, and I cannot write anything into them. (creating any file in them does not work.)
I assume that I have a corrupted drive but I was hoping to find a way to recover the content. Most of it is backed up, but I have become a bit lazy in the past month, and have not backed up so there are a number of videos I don't want to lose.
It seams odd that the directories show up, but the files don't. The drive properties also show that the correct amount of the drive space is taken up (for the videos to be present) so I haven't reformatted because I assume that will wipe out all traces of the data.

View 5 Replies View Related

CentOS 5 :: Splash Screens Displayed During The Boot Process?

Aug 6, 2009

Google has not found the information I ws looking for. Does anyone have any information how to adjust the variouse splash screens displayed during the boot process?

We are working on an applience project where we would like to add a company logo to the boot and desktop screens. (Worked out the desktop already)

View 4 Replies View Related

General :: Loop Append Text To Text Files?

Jan 15, 2010

may be an advanced question but I need to know how to do this. Here at work I am in charge of recruiting and we have about 1,000 resumes in already. All of the resumes are in a .pdf format. I need to rename every .pdf in the following format:{firstnameLastname}.pdfThe only way I know how to do this is to convert all the .pdf files to text, extract the name out of the first few lines of text, import into excel, and then use VBA to rename the files in mass:Here is my logic so far:~Deskop/a = houses all the .pdfresumesOpen terminal: Code: cd ~/Desktop/afor f in *.pdf; do pdftotext -raw $f; done That will convert all of the preceding resumes into text filesNow I would like to append the name of the text file into the last line of the text file. So, for example, for Resume1.txt, I want to append "Resume1.txt" to the last line within Resume1.txt. So after I run the command I open Resume1.txt and on the last line within I want to see "Resume1.txt" on the last line, at the end of the resume.How can I do this? I would like to use a loop and have the terminal append the filename to the body of the text file until all of the have been appended.

View 1 Replies View Related

General :: Search Text In All Text Files Of All The Sub-directories?

Apr 21, 2010

Currently, when I'm searching text in files of my PHP project, I use this line :

Code:

grep -r 'myTextToFind' *

But now, I would like to search only in ".lang" files. How can I do that ?

View 7 Replies View Related

Ubuntu Multimedia :: Jittery DVD Playback - Local Files Displayed The Same Effects

Jan 28, 2011

I'm having jittery DVD playback, and I don't know what the problem is. I tried switching to metacity, but that didn't help. I tried copying the whole disk to local drive with dvdbackup, but the local files displayed the same effects. I tried mplayer and vlc, but no difference. Totem, however, is really bad with jitters. With totem, I tried checking 'Disable deinterlacing of interlaced videos', which I saw someone recommend in another thread, but that didn't help either. I also have all the codecs from this forum's how-to sticky. A video capture of the jitters while playing with vlc: [URL] I'm using Ubuntu 10.10 Desktop 32-bit.

View 9 Replies View Related

Ubuntu :: Cant Found My Downloaded Files And Home Folder Contents Are Displayed In Desktop

Jun 29, 2010

I started my computer and i goto home/downloads. i found all downloaded are deleted. and every folder and file in home folder are displayed in desktop.

View 6 Replies View Related

CentOS 5 :: Upgrade Python Via Yum/rpm?

Apr 9, 2009

I'm using centos5 hiab with qmail and apache and i'm trying to install Mailman via: ./configure --prefix=/home/admin/mailman --with-mail-gid=qmail --with-cgi-gid=apache

and I get the error:

***** Distutils is not available or is incomplete for /usr/bin/python
***** If you installed Python from RPM (or other package manager)
***** be sure to install the -devel package, or install Python
***** from source. See sec. 15.1 of the Installation Manual for
***** details

Doing an rpm -qa | grep python
yields the following:
python-2.4.3-19.el5
libxml2-python-2.6.26-2.1.2

[Code]....

So it seems to me that the only thing I need to is upgrade(new install??) python-devel-2.4.3-19.e15

View 2 Replies View Related

Programming :: Command For Find/Replace In Text Files (inc. Files In Sub-folders)?

Oct 11, 2010

I found this command that works great finding and replacing a simple string to another in files located in that folder and all sub-folders.

Code: find . -name '*.php' | xargs perl -pi -e 's/OldText/NewText/g'

The problem I have is that I need to replace a more complex string, like this: Old string: /mnt/stor6-wc2-dfw1/627896/982574/ New string: /mnt/stor8-wc2-dfw1/369587/302589/ There I don't know how to do it... since the / is what separates the old from the new strings, and the strings that I want to replace have / in it. Also, I would like to know how to specify under what folder replace the files, for example, I want that it search/replaces all files under /var/www/mysite/htdocs folder.

View 1 Replies View Related

Software :: Differentiate Two Large Text Files Using Shell Script / Files Are Like Below?

Jan 20, 2009

I want to automate this using script.How to automate it?

File1:
s.no# 1 name:aaaaaa
city:abcd

[code]...

View 1 Replies View Related

Fedora :: Compression Ratio For Text Files / Binary Files

Apr 15, 2011

Fedora provides several compression techniques. E.g tar, tar.gz, zip etc. I want to know which among them provides

1. the best compression ratio for text files

2. the best compression ratio for binary files

3. fastest compression

View 6 Replies View Related

General :: Convert Open Office (odt) Files To Text Files?

May 25, 2011

How do you convert Open Office (ODT) documents to Text files?
I have made a report using libre office. Now I wish to continue editing the document using lyx (latex front end). So the ODT file needs to be saved as some .tex file.

I don't see an option to do this in File menu (export/save as). So is there any other plugin to do this?

View 1 Replies View Related

CentOS 5 :: Hplip Wants Dbus-python 0.80+?

Dec 27, 2008

I have an HP printer and have installed hplip in the hope of resolving some printing problems and having nicer, more consistent print dialog boxes. Unfortunately it wants dbus-python version .80+ and the current version is .70

I'm aware that centos is about stability and I'm guessing that a new version of dbus-python isn't likely to happen until centos 6-- right? So what's the best option? Can I find a newer dbus-python package that works with centos 5.2 or is that defeating the purpose of the OS? Do I have to choose between stability with printing problems and instability with better printing functionality?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved