General :: Python Script Using Tar From A List Returns Error: Has No Attribute 'startswith'

Apr 4, 2011

create a tar file from a list? My script returns the error: AttributeError: 'list' object has no attribute 'startswith' I want to create a compressed tar file containing the directory /usr/lib and the files in the list assigned to variable b.

code:

import tarfile
tar = tarfile.open("backup.gz", "w:gz")

[code]....

View 3 Replies


ADVERTISEMENT

Debian :: Python-pkg-resources Returns Error Code

Apr 9, 2010

The system is Debian Squeeze/Sid with apt.conf set to Squeeze as the default. Most packages are from Squeeze.

I ran apt-get upgrade and it returned an error-code.

It might be it is this bug: Bug#574153: python-pkg-resources: Missing file leaves it unconfigured

I tried aptitude install -f, to hold it and to remove the package python-pkg-resources, but i am getting told the package would be in a very bad stage, and i should re-install it. That doesn't work.

View 1 Replies View Related

Fedora :: Update - Attribute Error Object Has No Attribute 'rsplit'

Aug 30, 2009

Recently installed Fedora 11 from CD on eeepc900HA. Update manager suggested 402 updates available. trying to update I get the following traceback error report:

Traceback (most recent call last):

On trying this process a second time after having selected specific packages I noticed that a prepare machine for upgrade package (not selected by me) seemed to be where the process stalled.

Trying a third time with attempt to upgrade some (random) python packages I get the same result via a system/admin/upgrade or download software .

View 3 Replies View Related

Programming :: Python Error - List Index Out Of Range (Web Scrapper)

Feb 18, 2011

Having a bit of an issue with Python while trying to write a script to download every rar file on a webpage. The script successfully downloads any link that doesn't contain any spaces, etc. But when it hits a url like: [URL] (Classical Spelling).rar. It fails...I'm sure this is something simple, but I'm so new to python I'm not sure what to do!

Code:
import urllib2
import os
os.system("curl [URL] -i rar|cut -d '"' -f 2 > temp.out ")
infile =open('temp.out', 'r')
for url in infile:
print url
#url = "[URL]"

#url = target
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(file_name, 'w')
meta = u.info()
file_size = int(meta.getheaders("Content-Length")[0])
print "Downloading: %s Bytes: %s" % (file_name, file_size)
file_size_dl = 0
block_sz = 8192

while True:
buffer = u.read(block_sz)
if not buffer:
break
file_size_dl += block_sz
f.write(buffer)
status = r"%10d [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
status = status + chr(8)*(len(status)+1)
print status,
f.close()

View 7 Replies View Related

Programming :: Python Regular Expression - AttributeError: 'NoneType' Object Has No Attribute 'group'

Aug 23, 2010

I am trying to scan a website for http references (links) with this script:

Code:

from urllib import urlopen
import re
current_site = urlopen("http://en.wikipedia.org/wiki/").read()
search = re.search('href="[a-zA-Z0-9]"', current_site)

[code]....

I get the following error message:

Code: Traceback (most recent call last): File "C:UsersadminDesktopcrawler.py", line 8, in <mo print search.group(0) AttributeError: 'NoneType' object has no attribute 'group' I have googled the error

View 2 Replies View Related

General :: When Type"import WxPython" In "python Environment It Returns?

Jan 26, 2011

I have installed wxPython on my Ubuntu 9.10. But when I type"import wxPython" in "python environment it returns the followingerror.Does it need a PATH to be added in ".bashrc"? If so what should I write as a PATH for it?

>>> import wxPython
Traceback (most recent call last):
File "<stdin>", line 1, in <module>

[code]....

View 1 Replies View Related

Programming :: Modify 1 Of My Ldap Attribute If Have 2 Same Attribute Under 1 Entry ?

Jan 26, 2011

Assume, I have the below LDAP entry

Code:

Which command should I use programmatically (in ldap.h) to change only ONE of the attributes above? say i only want to change the userPassword from value secret -> notasecret

Do we use?

Code:

And how?

View 1 Replies View Related

General :: Installation Of Wxpython Source Returns - Error

Jan 19, 2010

I am trying to install wxpython from source package when ran ./configure command it came up with a strange message which says

Code:

Code:

View 8 Replies View Related

General :: Shell Script Returns Error When Using 'source'

Mar 21, 2011

For some reason the script below works fine when I run it directly but when I run is using source, I get a not found error?

With source: (line 11 is where the 'test' statement is)

Quote:

gtonder@sydlnx03:~> source set_aliases.sh -v 11:31AM
1
set_aliases.sh

[Code].....

View 6 Replies View Related

General :: Startvnc, Arch, E17, Returns Error, Picture Inside?

Mar 20, 2011

When I type the command

Code:
startvnc
I get the following error

[code]....

View 8 Replies View Related

General :: Booting - Error "Extended Attribute Block 18875430 Has Reference Count 2 - Should Be 1"

Jan 1, 2011

While booting my Linux System (Red hat Enterprises edition 5.1) I am getting a messsage as below , the message is getting generated during file checking on first boot. Extended attribute block 18875430 has reference count 2 , should be 1. and after this system remains in the same sate.

View 1 Replies View Related

Programming :: Create A Script That Returns A List Of The Users Who Have Never Changed Their Password From /etc/shadow

May 17, 2011

I need to create a script that returns a list of the users who have never changed their password from /etc/shadow. As I know on linux there is a command "chage" used for find last password change.

View 2 Replies View Related

Fedora :: YUM Update Error - Object Has No Attribute

Oct 23, 2009

My os is fedora 11. The error message is :

Traceback (most recent call last):
File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 1830, in _runYumTransaction rpmDisplay=rpmDisplay)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3813, in processTransaction
pkgs = self._downloadPackages(callback)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 3837, in _downloadPackages
probs = self.downloadPkgs(dlpkgs)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1372, in downloadPkgs
self.plugins.run('predownload', pkglist=pkglist)
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 177, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/presto.py", line 577, in predownload_hook
(problems, more) = downloadPkgs(conduit, pinfo, download_pkgs)
File "/usr/lib/yum-plugins/presto.py", line 419, in downloadPkgs
cb.start(text="<delta rebuild>", size=rebuild_size)
File "/usr/lib/python2.6/site-packages/urlgrabber/progress.py", line 129, in start self._do_start(now)
File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 2551, in _do_start
self.updateProgress(name, 0.0, "", "")
File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 2593, in updateProgress
pkg = self._getPackage(name)
File "/usr/share/PackageKit/helpers/yum/yumBackend.py", line 2534, in _getPackage
sections = name.rsplit('-', 2)
AttributeError: 'NoneType' object has no attribute 'rsplit'

View 5 Replies View Related

Software :: Exaile Suddenly Not Working - Attribute Error

Apr 6, 2011

I am in Ubuntu 10.04 with its standard desktop environment. Exaile was working great. Now, suddenly it refuses to work. It brings up the splash/loading image and then dies. It works fine under a different user account. I completely restarted, completely uninstalled, completely reinstalled through the Ubuntu Software Center. No luck. I then tried to run it via a terminal.

Here was the output:
wmeler@ubuntu1004:~$ exaile
INFO : Loading Exaile 0.3.1.1...
INFO : Loading settings...
INFO : Setting up deferred idle manager function...
INFO : Loading plugins...
INFO : Loading collection...
INFO : Loading devices...
Traceback (most recent call last):
File "/usr/lib/exaile/exaile.py", line 52, in <module> main()
File "/usr/lib/exaile/exaile.py", line 49, in main exaile = main.Exaile()
File "/usr/lib/exaile/xl/main.py", line 84, in __init__self.__init()
File "/usr/lib/exaile/xl/main.py", line 189, in __init
location=os.path.join(xdg.get_data_dirs()[0], "covers"))
File "/usr/lib/exaile/xl/cover.py", line 121, in __init__self.load()
File "/usr/lib/exaile/xl/cover.py", line 330, in load data = pickle.load(f)
EOFError Exception in thread Thread-4:Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/exaile/xl/hal.py", line 66, in connect logger.warning("Failed to connect to HAL,"
AttributeError: 'NoneType' object has no attribute 'warning'

View 2 Replies View Related

Ubuntu :: Error While Setting Emblems With Gvfs-set-attribute And Cron

Aug 26, 2010

I already posted a link in the ubuntuusers.de Forum (german) [URL].. But I haven't found a solution yet. The problem is, that I wanna set an Emblem in Nautilus via a Script that is called by cron. The problem happens in that line

Code:
/usr/bin/gvfs-set-attribute -t stringv /path/to/file metadata::emblems minus14
thats the error: Error setting attribute: Setting attribute metadata::emblems not supported
I already tried to call the script via /etc/crontab and /var/spool/cron/crontabs/meles, i tired it with
Code:
/path/to/script

[Code]...

View 2 Replies View Related

OpenSUSE Network :: NFS Server Returns Error For Client Mount Calls - Error 13

Mar 21, 2011

I'm working with OpenSusse 11.2. I installed and activated the NFS server via yast2. I exported the relevant directory via yast2 (NFS server configurastion)
I'm trying to setup my Linux target to boot via NFS. The kernel boots up but fails to mount the file system. When looking on a capture from ethereal it can be found that the NFS server return error when client try to mount the /nfstest directory from this server. The returned error is 13

serverip: 192.168.56.130
targetip: 192.168.20.180
gateway: 192.168.20.101

[Code].....

View 1 Replies View Related

Programming :: List Sorting In Python?

May 10, 2011

I have a list of list and I'd like to sort the list according to the last value of each row.

Let's say we have the list

L1 = [ [1,2] , [4,6] , [78,-3] ]

I wish to get

L2 = [ [78,-3] , [1,2] , [4,6] ]

Is there a simple way to do that in python?

View 4 Replies View Related

Programming :: Take A List From A File And Use It In A For Loop In Python?

May 11, 2009

so far I have this

list = open('list.txt')
for x in list:
list.read(x)

View 3 Replies View Related

General :: Python 2.6 Dependencies Error During Installations

Feb 11, 2011

I am trying to install vodafone mobile connect 2.10 (noarch.rpm) but keep getting a python = 2.6 is needed by python-sq*. I had Python 2.6 installed and upgraded to 2.6.6, but still got the error. What could I be doing wrong or what repositories are short on my openSuse 11.0 to have the installation work. I downloaded the correct version of vodafone for my system.

View 1 Replies View Related

Programming :: Python: List Running Audio Processes?

Jul 19, 2010

I am trying to get a list of running processes using audio (using gstreamer), just like in gnome-volume-control, under applications, but have so far been unsuccessful in finding anything in either the gtk or gstreamer library, anyone out there who can point me in the right direction?

View 1 Replies View Related

Programming :: Python: Dynamically Create A List Within A Dictionary?

Jul 9, 2011

how to dynamically create a list within a dictionary using Python.

Code:
dates = defaultdict(int)
array = []
...
dates[m.group(3)] = array.append(date)
dates[m.group(3)] = [array.append(date)]
dates[m.group(3)].append(date)

None of the above works and I've tried everything I can think of.

View 3 Replies View Related

Debian Programming :: Searching For A List Of Strings In File With Python

Oct 14, 2013

I'm trying to search for several strings, which I have in a .txt file line by line, on another file.

So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt.

So far, I've been able to do this, to search for individual strings:

Code: Select allimport re

shakes = open("output.csv", "r")

for line in shakes:
    if re.match("STRING", line):
        print line,

How can I change this to input the strings to be searched from another file?

So far I haven't been able to.

View 3 Replies View Related

Debian Programming :: Return How Many Items Occurs In List (Python)

Jan 29, 2014

I going through the Python course on Codeacademy. I have some trouble understanding what I'm doing wrong. This is my code below:

Code: Select alldef count(sequence, item):
    total = 0
    for x in sequence:
        return x
        if x in sequence:
            total += 1
    return total
print count([1,2,1,1], 1 )

The code gives me an error: "Oops, try again. Your function fails on count([1],7). It returns 1 when it should return 0."

It should be outputting 3 because 1 occurs 3 times in the list.

View 7 Replies View Related

Fedora :: Firefox Will Returns An Error

Mar 11, 2011

I am unable to run firefox on my Hp mini 110 running FC14. This happened, I think, after an update that I have done.

When ever I run firefox I get the following messages.

Code:

View 5 Replies View Related

Fedora :: XAWTV Cannot Run - Returns Error

May 9, 2011

I am using Fedora 14 (64 bit version): Can't Start XAWTV. Returns the error.
$ xawtv
This is xawtv-3.99.rc6, running on Linux/x86_64 (2.6.35.12-90.fc14.x86_64)
xinerama 0: 1920x1080+0+0
WARNING: No DGA direct video mode for this display.
WARNING: keeping fbuf pitch at: 7680, as no base addr was detected
WARNING: couldn't find framebuffer base address, try manual
configuration ("v4l-conf -a <addr>")
v4l2: WARNING: framebuffer base address mismatch
v4l2: me=(nil) v4l=(nil)
Warning: Missing charsets in String to FontSet conversion
Warning: Missing charsets in String to FontSet conversion
Oops: can't load any font

View 1 Replies View Related

OpenSUSE :: Ssh Command Returns Error?

Feb 26, 2010

I have a service on my Suse 11 server which runs an ssh command (using openSSH) on another box.The output below is returned, but legitimate output is also returned as if the command had executed successfully. For example, the service executes an ls command through ssh, gets the error below, but also the contents of the remote directory as output. This is a problem because the service retries the command until it receives no error. I have been unable to replicate this manually from the command line. Does anyone know what might cause this or what this error really means?

View 5 Replies View Related

General :: Get Apt-get To Install Python Packages For A Different Version Of Python?

Oct 27, 2010

in ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out howThings I have tried without success:changing the symlink at /usr/bin/python to point to /usr/bin/python2.7 - even after doing this apt-get still installs stuff to python2.6.Set up python2.7 as the primary alternative using update-alternatives - doesn't work

View 3 Replies View Related

Ubuntu :: Error: E: Type 'sudo' Is Not Known On Line 52 In Source List /etc/apt/sources.list

May 4, 2011

don't know much, but when I tried to update I get this error:

E: Type 'sudo' is not known on line 52 in source list /etc/apt/sources.list E: The list of sources could not be read.

View 2 Replies View Related

Software :: Kdesvn Returns A Nasty Error

Jul 27, 2011

I have installed in my opensuse 11.4 the kdesvn.

When I press the checkout button the program crashes and returns the following message:

View 1 Replies View Related

General :: Error Unknown Tag: Copyright: Modified CNRI Open Source License While Installing Rpm In Python

Apr 9, 2010

while installing ... Installing python2.4-2.4-1pydotorg.src.rpm

warning: user jafo does not exist - using root
warning: group jafo does not exist - using root
warning: user jafo does not exist - using root
warning: group jafo does not exist - using root
error: Legacy syntax is unsupported: copyright

error: line 55: Unknown tag: Copyright: Modified CNRI Open Source License

View 3 Replies View Related







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