url lib

2009-03-20 Thread CSUIDL PROGRAMMEr
Hello I am a novice python progammer I am just writing a script that will automatically write my /etc/ yum.repos.d/* files in linux. the problem is i am trying to connect to a secure repo and pass username and password to the baseurl . here is the baseurl baseurl=http://USERNAME:passw...@ydl.net

RPM error

2007-04-24 Thread CSUIDL PROGRAMMEr
Hi folks I am new to python I am trying to write a program that will install rpm using rpm -ivh xxx.rpm I want to know if python has in-built exceptions to catch no- dependencies error. If not how can i build them thanks -- http://mail.python.org/mailman/listinfo/python-list

RPM error

2007-04-24 Thread CSUIDL PROGRAMMEr
Hi folks I am trying to write a program that will install RPM. IS there any built in Exception in python that will catch the faied dependencies in python. Also if not how can i write one ?? thanks -- http://mail.python.org/mailman/listinfo/python-list

defining user exceptions

2007-04-24 Thread CSUIDL PROGRAMMEr
I am trying to write a user defined exception that will catch for failed dependencies when a rpm is installed try: rpm -ivh xxx.rpm --force; except RPMError: print RPM failed dependency Can some one tell me how to define this RPMError. I looked at python docs but they were not useful. -

Redirection problem

2007-04-23 Thread CSUIDL PROGRAMMEr
I am new to python. so be patient with me I am trying to redirect the output of os.popen command to a file. I want to append to that file. but instead of appending. The file only shows last command that was writtenn to it. filehandle= open("/root/yhpc-2.0/installer/yhpc-log" ,"a+"); fileh

Re: getting from command line options to file

2007-04-20 Thread CSUIDL PROGRAMMEr
On Apr 16, 1:08 pm, Michael Hoffman <[EMAIL PROTECTED]> wrote: > CSUIDL PROGRAMMEr wrote: > > hi folks > > I am new to python. I have a module does call a os.command(cmd) where > > cmd is a rpm command. > > Instead of using os.command and getting the results on c

getting from command line options to file

2007-04-16 Thread CSUIDL PROGRAMMEr
hi folks I am new to python. I have a module does call a os.command(cmd) where cmd is a rpm command. Instead of using os.command and getting the results on command line , i would like to dump the output in a file. Is os.command(cmd > filename) the most efficient command?? thanks -- http://mail

parsing a file name

2007-01-12 Thread CSUIDL PROGRAMMEr
I have a filename cairo-2.3.4.src.rpm Is there any way i can only get 2.3.4 from this file name thanks -- http://mail.python.org/mailman/listinfo/python-list

getting the name of hyperlinks in a file

2007-01-12 Thread CSUIDL PROGRAMMEr
folks, I am trying to write a script that would open a download server and download all the files and store them in a list for example Download server is http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/SRPMS/ is there any way this can be done in python?? -- http://mail.pytho

looping through two list simultenously

2006-10-29 Thread CSUIDL PROGRAMMEr
folks I have two lists i am trying to loop thorough them simultenously. Here is the code i am using f1 = os.popen('ls chatlog*.out') data1=f1.readlines() f1.close() data1=[x.strip() for x in data1] f1 = os.popen('ls chatlog*.txt') data=f1.readlines() f1.close() for eachline in data1 and line

stripping parts of elements in a list

2006-10-28 Thread CSUIDL PROGRAMMEr
folks, I am new to python. I have a list made of elements ['amjad\n', 'kiki\n', 'jijiji\n'] I am trying to get rid of '\n' after each name. to get list as ['amjad','kiki','jijiji'] But list does not have a strip function as string does have. is there any solutions Is there a way this can be

Regular expression worries

2006-10-11 Thread CSUIDL PROGRAMMEr
folks I am new to python, so excuse me if i am asking stupid questions. I have a txt file and here are some lines of it Document Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keywordhttp://mail.python.org/mailman/listinfo/python-list

Replacing line in a text file

2006-09-22 Thread CSUIDL PROGRAMMEr
Folks I am trying to read a file This file has a line containing string 'disable = yes' I want to change this line to 'disable = no' The concern here is that , i plan to take into account the white spaces also. I tried copying all file int list and then tried to manipulate that list But the se