Depricated String Functions in Python

2006-07-19 Thread Anoop
Hi All

Can any one help me out with the various depricated string functions
that is followed in Python.

For example how will be string.lower depricated.

As far as string.lower('PYTHON') is concerned it is depricated as
'PYTHON'.lower(). Both of them would return an output : >>> python

Thanks for your inputs

Regards

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Depricated String Functions in Python

2006-07-20 Thread Anoop
Thanks Stefen

let me be more specific how would i have to write the following
function in the deprecated format

map(string.lower,list)

Thanks Anoop


Stefan Behnel wrote:
> Anoop wrote:
> > Can any one help me out with the various depricated string functions
> > that is followed in Python.
> >
> > For example how will be string.lower depricated.
> >
> > As far as string.lower('PYTHON') is concerned it is depricated as
> > 'PYTHON'.lower(). Both of them would return an output : >>> python
>
> I don't quite see the question in your post, but, yes, the module level
> functions of the "string" module are deprecated in favour of the methods of
> the str and unicode objects.
> 
> Stefan

-- 
http://mail.python.org/mailman/listinfo/python-list


Checking File permissions

2006-07-20 Thread Anoop
Hi All

Please tell me how to check the existence of a file and the read
permission to the file using python script

Thanks for ur inputs

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Checking File permissions

2006-07-20 Thread Anoop
Hi All

Please tell me how to check the existence of a file and the read
permission to the file using python script

Thanks for ur inputs

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Checking File permissions

2006-07-20 Thread Anoop
Hi All

Please tell me how to check the existence of a file and the read
permission to the file using python script

Thanks for ur inputs

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Help in string.digits functions

2006-07-24 Thread Anoop
Hi All

I am getting two different outputs when i do an operation using
string.digits and test.isdigit(). Is there any difference between the
two. I have given the sample program and the output

Thanks for ur inputs

Anoop

#1:
~~
import string

test='121206'

if test not in string.digits:
print "I am Not Digit"
else:
print "I am Digit"

#2:
~~
import string

test='121206'

if not test.isdigit():
print "I am Not Digit"
else:
print "I am Digit"

Output
~
#1:I am Not Digit
#2:I am Digit

Thnks and Rgds 

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help in string.digits functions

2006-07-25 Thread Anoop
Hi All

Thankyou verymuch for ur inputs.

Hope u might have come across the string deprecation thought of in
Python 3.0 as a result of which we need to use all of these as some
objects

For example : string.lower(str) needs to be some thing like
str.lower().

Can u tell me whether such a change in the common python would require
these string.digits to be changed. If so wat would be ur suggestions

Thanks and regards

Anoop

John McMonagle wrote:

> On Mon, 2006-07-24 at 22:19 -0700, Anoop wrote:
> > Hi All
> >
> > I am getting two different outputs when i do an operation using
> > string.digits and test.isdigit(). Is there any difference between the
> > two. I have given the sample program and the output
> >
> > Thanks for ur inputs
> >
> > Anoop
> >
> > #1:
> > ~~
> > import string
> >
> > test='121206'
> >
> > if test not in string.digits:
> > print "I am Not Digit"
> > else:
> > print "I am Digit"
> >
> > #2:
> > ~~
> > import string
> >
> > test='121206'
> >
> > if not test.isdigit():
> > print "I am Not Digit"
> > else:
> > print "I am Digit"
> >
> > Output
> > ~
> > #1:I am Not Digit
> > #2:I am Digit
> >
> > Thnks and Rgds
> >
> > Anoop
> >
>
>
> string.digits is the string constant '0123456789'
>
> So your test, "if test not in string.digits:" will evaluate True because
> '121206' is not in '0123456789'.
>
> Whereas test.isdigit() returns true if all the characters in test are
> digits.
>
> So yes, there is a big difference between the two.
>
> Regards,
>
> John
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

-- 
http://mail.python.org/mailman/listinfo/python-list


String.digits help!!!

2006-08-08 Thread Anoop
Hi All

Hope u all might have come across the string deprecation thought of in
Python 3.0.

For example : string.lower(str) needs to be some thing like
str.lower().

Can some one help me out whether such a change in the common python
would require
"string.digits" to be changed. If yes wat would be ur suggestions

Thanks for ur inputs

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


Deprecation in String.joinfields()

2006-09-25 Thread Anoop
Hi All,

I am getting the following error while trying to use deprecation

Please help

>>> li = ["a", "b", "mpilgrim", "z", "example"]
>>> newname = string.joinfields (li[:-1], ".")
>>> newname
'a.b.mpilgrim.z'
>>> newname = li[:-1].joinfields(".")
Traceback (most recent call last):
  File "", line 1, in ?
AttributeError: 'list' object has no attribute 'joinfields'

>>> newname1 = string.join (li[:-1], ".")
>>> newname1
'a.b.mpilgrim.z'
>>> newname = li[:-1].joinfields(".")
Traceback (most recent call last):
  File "", line 1, in ?
AttributeError: 'list' object has no attribute 'join'

Thank you for your help

Anoop

-- 
http://mail.python.org/mailman/listinfo/python-list


String operations

2004-12-01 Thread Anoop Rajendra
Hi. I'm trying to resolve an issue with strings.

The command(inclusive of the back-slashes)

condor_q -l -constraint "ProjectId==\"anoopr_samadams.fnal.gov_161903_30209\""

is the only way the command returns the right result. 
I'm trying to run this command from inside a python program.
The way I can get it work is by: 

os.system('condor_q -l -constraint 
"ProjectId==\\\"anoopr_samadams.fnal.gov_161903_30209\\\""')

But, I'd rather use the os.exec functions to get the output. But 

os.execvp("condor_q",["condor_q","-l","-constraint",'"ProjectId==\\\"anoopr_samadams.fnal.gov_161903_30209\\\""'])

doesnt work. Its definately a problem with one of the million
backslashes and quotes present, but I'm not able to figure it out.
What am I doing wrong?

Thanks,
Anoop ///

The happiest time of a person's life is after his first divorce.
  -- J.K. Galbraith 


-- 
http://mail.python.org/mailman/listinfo/python-list


Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Anoop Thomas Mathew
With my heartfelt condolence, I'd like to inform you all the unfortunate
demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
strong advocate of Python, Django and Free Software in India.
He had served as the President of IPSS(Indian Python Software Society),
which initiated the PyCon India, done a lot of workshops on Python and was
an active member in the Django user group.

Anoop Thomas Mathew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Demise of Mr. Kenneth Gonsalves

2012-08-03 Thread Anoop Thomas Mathew
Chronic Asthma. He was hospitalized yesterday, and passed away today.




On 3 August 2012 20:45, Marcin Tustin  wrote:

> What happened to him? He was posting on this list in the last week?
>
> On Fri, Aug 3, 2012 at 11:12 AM, Anoop Thomas Mathew wrote:
>
>> With my heartfelt condolence, I'd like to inform you all the unfortunate
>> demise of Mr.Kenneth Gonsalves (KG - law...@thenilgiris.com), who was a
>> strong advocate of Python, Django and Free Software in India.
>> He had served as the President of IPSS(Indian Python Software Society),
>> which initiated the PyCon India, done a lot of workshops on Python and was
>> an active member in the Django user group.
>>
>>
>> Anoop Thomas Mathew
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Marcin Tustin
> Tel: 07773 787 105
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pylagiarism -- Need help now! Please provide code...

2012-08-14 Thread Anoop Thomas Mathew
On 14 August 2012 12:04, Simon Cropper
wrote:

> Hi Everyone,
>
> I just had a great idea for a new python module. I haven't bothered
> googling it or doing any research.
>
> I need help putting together some code; today preferably, my boss is on my
> back. Can someone please contribute a functioning module showing me how to
> do it?
>
> Once I have all your submissions, I will compile a functioning  package,
> which I hope to sell. Don't worry, no one will be at risk of being sued, I
> don't intend to credit you with the code and you will not know anything
> about what I have done because I don't intend to post and feedback to the
> list. Licenses are not a problem either, I don't believe in them and even
> if you find out I have plagiarized your stuff you have bub-kiss chance of
> suing me as I am in another jurisdiction.
>
> So, now you know where I am coming from, I would like to thank you for all
> your help. Remember though, I need help now, so please stop what you are
> doing and submit something quickly. I'm waiting...
>
> Still waiting...
>
> Hey, stop reading and get on with writing some code, I don't have all day!


Let the boss wait. Learn some mailing list etiquette first. It will help
you for sure.


>
>
> --
> Simon
>
> Disclaimer  :) Please don't flame me, I have written this with my tongue
> in my cheek and a light hearted take on some people request for assistance
> on a range of mail lists. It was not meant to target anyone in particular
> only to exaggerate how some people's requests appear to lurkers and
> contributors on many fora I frequent.
> --
> http://mail.python.org/**mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simple client data base

2012-09-03 Thread Anoop Thomas Mathew
Hi,

You can make use of sqlite database also.
And for the structure, you can create a single table and different columns
for the fields like name, number etc.
You can get more details over here.
http://docs.python.org/library/sqlite3.html

Thanks,
Anoop Thomas Mathew

atm
___
Life is short, Live it hard.




On 3 September 2012 19:51, loïc Lauréote  wrote:

>
> Hi,
>
> You can try gadfly !
> This system is based on SQL.
>
> Loïc
> *
> ***
>
>
>
> > From: markrri...@aol.com
> > Subject: simple client data base
> > Date: Mon, 3 Sep 2012 10:12:11 -0400
> > To: python-list@python.org
>
> >
> > Hello all, I am learning to program in python. I have a need to make a
> > program that can store, retrieve, add, and delete client data such as
> > name, address, social, telephone number and similar information. This
> > would be a small client database for my wife who has a home accounting
> > business.
> >
> > I have been reading about lists, tuples, and dictionary data
> > structures in python and I am confused as to which would be more
> > appropriate for a simple database.
> >
> > I know that python has real database capabilities but I'm not there
> > yet and would like to proceed with as simple a structure as possible.
> >
> > Can anyone give me some idea's or tell me which structure would be
> > best to use?
> >
> > Maybe its a combination of structures? I need some help.
> >
> > Thanks for your help.
> > --
> > http://mail.python.org/mailman/listinfo/python-list
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Script Works Locally But Not Remotely with SSH

2012-04-02 Thread Anoop Thomas Mathew
Hi,
You can try using  ssh -X  xxx.xxx.xxx.xxx for GUI ssh connection.

Thanks,
Anoop Thomas Mathew
atm
___
Life is short, Live it hard.




On 28 March 2012 06:21, goldtech  wrote:

> Hi,
>
> I have a WinXP PC running an SSH server and I have a Linux PC with an
> SSH client  and logged into the XP seemingly OK. It's all on my
> personal LAN, the connection seems OK.
>
> I have a py file on the XP that I run via SSH from the Linux, it's:
>
> import webbrowser
> webbrowser.open('www.google.com')
>
> This runs OK started on the local XP PC, the browser Firefox opens and
> goes to the site, or it opens a tab to the site. But executing that
> same file via SSH does not open Firefox...doing it via SSH starts
> Firefox ( I see it begin in the process manager and I see web
> activity) but Firefox does not open it's window.
>
> Why the does the window not open when the script is started remotely?
>
> Thanks.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: string to list

2012-06-14 Thread Anoop Thomas Mathew
Hi,

You can use literal_eval from ast package.

>>> from ast import literal_eval
>>> list(literal_eval("'aa','bb','cc'")

this will return ['aa', 'bb', 'cc']

Thanks,
Anoop Thomas Mathew

atm
___
Life is short, Live it hard.




On 14 June 2012 12:28, Shambhu Rajak  wrote:

> This will do you job:
>
> >>> a = 'AAA,",,",EEE,FFF,GGG'
> >>> b = []
> >>> for x in a.split(','):
> ... if (x.find("\"") > -1):
> ... x = x.strip("\"")
> ... b.append(x)
>
> If you want reduce the lines of code u can go for this option:
> b = [x.strip("\"") for x in a.split(',')]
>
>
> So Just Cheerz,
> -Shambhu
>
> -Original Message-
> From: bruce g [mailto:bruceg113...@gmail.com]
> Sent: 14/06/2012 8:00 AM
> To: python-list@python.org
> Subject: string to list
>
> What is the best way to parse a CSV string to a list?
>
> For example, how do I parse:
>'AAA,",,",EEE,FFF,GGG'
> to get:
>['AAA','BBB,CCC,','EEE','FFF','GGG']
>
> Thanks,
> Bruce
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: string to list

2012-06-14 Thread Anoop Thomas Mathew
@group: Sorry for the mistake.
@Hemanth: Thank You for pointing out.
I just realized that, we should not copy paste from the console. :)

atm
___
Life is short, Live it hard.




On 14 June 2012 13:09, Hemanth H.M  wrote:

> @Annop Nice one, but you seem to have missed a parenthesis.
>
> >>> list(literal_eval("'aa','bb','cc'")  should have been >>>
> list(literal_eval("'aa','bb','cc'"))
>
-- 
http://mail.python.org/mailman/listinfo/python-list


REG: Interactive Python (ipython notebook) Tutorial for Beginners

2013-11-08 Thread Anoop Thomas Mathew
Hi All,

Lately, I've been working on a ipython notebook tutorial for beginners. The
idea is that, those who have basic idea about computers should be able to
pick up python very easily.

https://bitbucket.org/atmb4u/python-live/

I have completed 25 chapters. Would love some reviews, suggestions and
corrections.
I seriously think there are some loose ends for beginners. Will be awesome
if someone can fill in some beginner perspectives on it. Especially on the
getting started part.
Feel free to fork, make corrections and send a pull request.

Expecting some serious feedback through  pull requests.

Thanks and Regards,
ATM
-- 
https://mail.python.org/mailman/listinfo/python-list