05-26-2011
Help with Python. Please and thanks.
Hi everybody,
I've been experimenting with Python lately and for the most part it's been a smooth ride. I have one little problem that maybe one of you can help me with.
PROBLEM:
I have list with one word per line.
EXAMPLE
apples
oranges
pears
grapes
etc...
I also have a shell command containing a variable that I want to execute within the python code.
EXAMPLE
"
do something with this $variable"
I need to execute the command for each item on the list. with each item on the list being equal to the variable in consecutive sequence.
Any help would be much appreciated
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have written a small practice Python script to determine the prime numbers between 2-10, for practice. Although I have pored over this script numurous times, I have not found the problem.
The problem is: Python will not print "is a prime" when a number is a prime. After examining the code... (4 Replies)
Discussion started by: Furtoes00
4 Replies
2. Shell Programming and Scripting
I heard that its a new programming language but ill like to get a deeper explaination of it. (1 Reply)
Discussion started by: kprescod4158
1 Replies
3. Programming
Hello,
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
>>> import subprocess
>>> help(subprocess)
...
...
I'm hoping so as I hate scrolling and love how less works with... (0 Replies)
Discussion started by: Narnie
0 Replies
4. Ubuntu
i just found python 3.1 in the Ubuntu Software Center today... yes i know, i've probably been under a rock... but my question is, would installing 3.1 cause any conflicts with the 2.6 installation in terms of retro compatibility with python based apps?
i don't know if 3.1 is supposed to replace... (0 Replies)
Discussion started by: Sterist
0 Replies
5. SuSE
Okay, so I have had this problem on openSUSE, and Debian systems now and I am hoping for a little help. I think it has something to do with Python but I couldn't find a proper Python area here.
I am trying to redirect the output of "ssh suse-server 'python -V'" to a file. It seems that no matter... (3 Replies)
Discussion started by: Druonysus
3 Replies
6. UNIX for Dummies Questions & Answers
Hi all...
Not sure where to put this so I put it here...
All comments welcome...
1) Is the Python language now considered a part of the *NIX transient command structure much like Perl, (and awk)?
2) If so which OSes now have it as part of a "default" install - NOT an extra to be... (5 Replies)
Discussion started by: wisecracker
5 Replies
7. Shell Programming and Scripting
I am working on requirement on spreadsheet in python scripting.
I have a spreadsheet containing cell values and with background color.
I am able to read the value value but unable to get the background color of that particular cell.
Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies
8. Windows & DOS: Issues & Discussions
Hi all,
I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine..
Below is the code I am trying:
#!/usr/bin/env python
import wmi
c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies
9. Programming
Hi all...
As you know I like making code backwards compatible for as many platforms as possible.
This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies
LEARN ABOUT DEBIAN
dh_pycentral
DH_PYCENTRAL(1) Debhelper DH_PYCENTRAL(1)
NAME
dh_pycentral - use the python-central framework to handle Python modules and extensions
SYNOPSIS
dh_pycentral [debhelper options] [-n] [-Xitem] [-V version] [module dirs ...]
DESCRIPTION
dh_pycentral is a debhelper program that will scan your package, detect public Python modules and move them in /usr/share/pycentral so that
python-central can byte-compile those for all supported Python versions. Extensions are kept into the original installation location.
Moving the files to the pycentral location and adding symbolic links to /usr/lib/pythonX.Y/*-packages can be done by setting the
environment varibale DH_PYCENTRAL to a string containing the string include-links.
Moving the files to the pycentral location can be disabled by setting the environment varibale DH_PYCENTRAL to a string containing the
string nomove.
The functionality to shorten the time of unavailabilty of files during unpack and configure has been removed (symlinking files in the
preinst and not removing the symlinked files on upgrade) in version 0.6.9.
You must have filled the XS-Python-Version header to indicate the set of python versions that are going to be supported. dh_pycentral
expects the XB-Python-Version for each binary package it is supposed to work on.
dh_pycentral will also generate substitution variables: the ${python:Provides} variable will contain versioned provides of the package (if
the package's name starts with "python-"). A python-foo package could provide "python2.3-foo" and "python2.4-foo" at the same time. Python
extensions have to provide those whereas it's only option for pure python modules.
The ${python:Versions} variable should be used to provide the required XB-Python-Version field listing the python versions supported by the
package.
OPTIONS
module dirs
If your package installs python modules in non-standard directories, you can make dh_pycentral check those directories by passing their
names on the command line. By default, it will check /usr/lib/$PACKAGE, /usr/share/$PACKAGE, /usr/lib/games/$PACKAGE,
/usr/share/games/$PACKAGE, /usr/lib/python?.?/site-packages and /usr/lib/python?.?/dist-packages.
Note: only /usr/lib/python?.?/site-packages and the extra names on the command line are searched for binary (.so) modules.
-V version
If the .py files your package ships are meant to be used by a specific pythonX.Y version, you can use this option to specify the
desired version, such as 2.3. Do not use if you ship modules in /usr/lib/site-python.
With the new policy, this option is mostly deprecated. Use the XS-Python-Field to indicate that you're using a specific python version.
-n, --noscripts
Do not modify postinst/postrm scripts.
-Xitem, --exclude=item
Exclude files that contain "item" anywhere in their filename from being taken into account to generate the python dependency. You may
use this option multiple times to build up a list of things to exclude.
CONFORMS TO
Python policy, version 0.4.1 (2006-06-20)
SEE ALSO
debhelper(7)
This program is a part of python-central but is made to work with debhelper.
AUTHORS
Raphael Hertzog <hertzog@debian.org>
Also includes bits of the old dh_python written by Josselin Mouette <joss@debian.org> who used many ideas from Brendan O'Dea
<bod@debian.org>.
2011-04-14 DH_PYCENTRAL(1)