Suggestion Reqd for Designing a Website in Python

2011-02-24 Thread joy99
Dear Group,
I have developed one big Machine Learning software a Machine
Translation system in Python.
Now, I am thinking to make a User Interface of it and upload it in a
web site.

My questions are:
(i) For Designing an interface I am choosing Tkinter. Is it fine?
(ii) How to connect this interface with my Tkinter based interface -
should I have to recode the whole system?
(iii) After designing I want to upload now how to do the server side
scripting?

If anyone can suggest it would be of great help.

Thanks in advance,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Suggestion Reqd for Designing a Website in Python

2011-02-25 Thread joy99
On Feb 25, 12:36 pm, Tim Roberts  wrote:
> joy99  wrote:
>
> >Dear Group,
> >I have developed one big Machine Learning software a Machine
> >Translation system in Python.
> >Now, I am thinking to make a User Interface of it and upload it in a
> >web site.
>
> Do you mean you want people to download this from a web site as an
> executable, and then run it locally on their computers?  Or do you mean you
> want people to use this as a web site, using their web browsers?  The
> answers are very different.
>
> >My questions are:
> >(i) For Designing an interface I am choosing Tkinter. Is it fine?
> >(ii) How to connect this interface with my Tkinter based interface -
> >should I have to recode the whole system?
> >(iii) After designing I want to upload now how to do the server side
> >scripting?
>
> Question (i) implies that you want the first option (download an executable
> and run it).  Question (iii) implies the second (that you want your app to
> run on a web server so people use it through your browser).  Please
> clarify.
> --
> Tim Roberts, [email protected]
> Providenza & Boekelheide, Inc.

Thank you for your kind reply.
I want to design an interface like Google Translate. So that users can
paste text (of any length)-or may browse files which can be uploaded,
and one user interface for filling up form, so that attached files
after translation may be sent back to the given e-mail id as an
attached file(.pdf/.txt).
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Suggestion Reqd for Designing a Website in Python

2011-02-25 Thread joy99
On Feb 25, 8:03 pm, Daniel Fetchinson 
wrote:
> >> >I have developed one big Machine Learning software a Machine
> >> >Translation system in Python.
> >> >Now, I am thinking to make a User Interface of it and upload it in a
> >> >web site.
>
> >> Do you mean you want people to download this from a web site as an
> >> executable, and then run it locally on their computers?  Or do you mean
> >> you
> >> want people to use this as a web site, using their web browsers?  The
> >> answers are very different.
>
> >> >My questions are:
> >> >(i) For Designing an interface I am choosing Tkinter. Is it fine?
> >> >(ii) How to connect this interface with my Tkinter based interface -
> >> >should I have to recode the whole system?
> >> >(iii) After designing I want to upload now how to do the server side
> >> >scripting?
>
> >> Question (i) implies that you want the first option (download an
> >> executable
> >> and run it).  Question (iii) implies the second (that you want your app to
> >> run on a web server so people use it through your browser).  Please
> >> clarify.
> >> --
> >> Tim Roberts, [email protected]
> >> Providenza & Boekelheide, Inc.
>
> > Thank you for your kind reply.
> > I want to design an interface like Google Translate. So that users can
> > paste text (of any length)-or may browse files which can be uploaded,
> > and one user interface for filling up form, so that attached files
> > after translation may be sent back to the given e-mail id as an
> > attached file(.pdf/.txt).
> > Best Regards,
> > Subhabrata.
>
> In this case you are looking for a web application framework. There
> are many written in python, a good place to start would be:
>
> http://wiki.python.org/moin/WebFrameworks
>
> My personal opinion is that the 3 top frameworks to consider are: (1)
> django (2) turbogears (3) web2py. You need to decide for yourself
> which one use choose, you may even choose something other than these
> 3, there are tons more.
>
> Cheers,
> Daniel
>
> --
> Psss, psss, put it down! -http://www.cafepress.com/putitdown

Thank you sir, for your kind help.
-- 
http://mail.python.org/mailman/listinfo/python-list


A Short Question on list

2011-03-03 Thread joy99
Dear Group,
If I have a list of elements, like,
list=[1,2,3,4,5,..]
now, if I want to multiply an increment of subset of the list each
time,
like,

elem1_list=list[0]
elem2_list=list[1]
elem3_list=list[2]
elem4_list=list[3]

multiplysubset1=elem1_list*elem2_list
multiplysubset2=elem1_list*elem2_list
multiplysubset3=elem1_list*elem2_list*elem3_list
…….
………

As I was figuring out doing a for kind of iteration may not help
exactly
Can any one give some idea?

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


A Question on URLLIB

2011-03-14 Thread joy99
Dear Group,
I am trying to construct a web based crawler with Python and for that
I am using the URLLIB module, and  by doing
import urllib and then trying with urllib.urlopen("url).
Am I going fine?
If some one can kindly highlight if I am doing any mistake.
Best Regards,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A Question on URLLIB

2011-03-15 Thread joy99
On Mar 15, 1:49 pm, David Marek 
wrote:
> You are doing fine so far :-)
>
> However, urllib is quite low level module. Do you know 
> mechanizehttp://wwwsearch.sourceforge.net/mechanize/? I have used it in my
> crawler. If you want to crawl a specific site for known data then
> Scrapyhttp://scrapy.org/could be useful too.
>
> David Marek
> [email protected]://davidmarek.cz
>
> On Tue, Mar 15, 2011 at 7:10 AM, joy99  wrote:
> > Dear Group,
> > I am trying to construct a web based crawler with Python and for that
> > I am using the URLLIB module, and  by doing
> > import urllib and then trying with urllib.urlopen("url).
> > Am I going fine?
> > If some one can kindly highlight if I am doing any mistake.
> > Best Regards,
> > Subhabrata Banerjee.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
>

Thanks David,I'll surely try to have a check.
-- 
http://mail.python.org/mailman/listinfo/python-list


Some Minor questions on Class and Functions

2011-03-19 Thread joy99

Dear Group,

I am trying to pose two small questions.

1) I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
1500 32 bit (Intel)] on win32 Type "copyright", "credits" or
"license()" for more information, on WINXP SP2.

As I am writing a code for class like the following:
IDLE 2.6.5
>>> class Message:
def __init__(self,str1):
self.text="MY NAME"
def printmessage(self):
print self.text

It works fine as can be seen in the result:
>>> x1=Message(1)
>>> x1.printmessage()
MY NAME

Now if I open a new window and write the same code value in
printmessage is giving arbitrary or no values.

Am I doing any problem in writing the code?

2) Suppose I have a code:

>>> def hello():
print "HELLO SIR"

Can I write another function where I can call the value of this
function or manipulate it?

If any learned member can slightly help me out.

Thanks in advance,
Best Regards,
Subhabrata.


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


Re: Some Minor questions on Class and Functions

2011-03-19 Thread joy99
On Mar 20, 9:39 am, Steven D'Aprano  wrote:
> On Sat, 19 Mar 2011 16:57:58 -0700, joy99 wrote:
> > Dear Group,
>
> > I am trying to pose two small questions.
>
> > 1) I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
> > 1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()"
> > for more information, on WINXP SP2.
>
> > As I am writing a code for class like the following: IDLE 2.6.5
> >>>> class Message:
> >    def __init__(self,str1):
> >            self.text="MY NAME"
> >    def printmessage(self):
> >            print self.text
>
> > It works fine as can be seen in the result:
> >>>> x1=Message(1)
> >>>> x1.printmessage()
> > MY NAME
>
> > Now if I open a new window and write the same code value in printmessage
> > is giving arbitrary or no values.
>
> The description of your problem does not make sense to me. Can you show
> an example?
>
> > 2) Suppose I have a code:
>
> >>>> def hello():
> >    print "HELLO SIR"
>
> > Can I write another function where I can call the value of this function
> > or manipulate it?
>
> No. The string "HELLO SIR" is a local variable to the hello() function.
> You cannot modify it from outside that function. Since your hello()
> function prints the result, instead of returning it, another function
> cannot capture it either.
>
> Perhaps what you want is something like this:
>
> def hello(message="HELLO SIR"):
>     return message
>
> Now you can call the function, and print the result:
>
> print hello()
>
> If you want to capture the return value, you can:
>
> result = hello()
> print result.lower()
>
> If you want to change the message used, you can pass it to the function
> as an argument:
>
> hello("Greetings and salutations!")
>
> Hope this helps,
>
> --
> Steven

Thanks Steven and Benjamin for your kind time to answer my question. I
am sending the code soon, actual code is pretty long that has so many
variables, it may well take your long time to evaluate, so I am making
a sizable prototype and trying to send it to you.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 11:13 am, joy99  wrote:
> On Mar 20, 9:39 am, Steven D'Aprano 
>
>
> [email protected]> wrote:
> > On Sat, 19 Mar 2011 16:57:58 -0700, joy99 wrote:
> > > Dear Group,
>
> > > I am trying to pose two small questions.
>
> > > 1) I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
> > > 1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()"
> > > for more information, on WINXP SP2.
>
> > > As I am writing a code for class like the following: IDLE 2.6.5
> > >>>> class Message:
> > >    def __init__(self,str1):
> > >            self.text="MY NAME"
> > >    def printmessage(self):
> > >            print self.text
>
> > > It works fine as can be seen in the result:
> > >>>> x1=Message(1)
> > >>>> x1.printmessage()
> > > MY NAME
>
> > > Now if I open a new window and write the same code value in printmessage
> > > is giving arbitrary or no values.
>
> > The description of your problem does not make sense to me. Can you show
> > an example?
>
> > > 2) Suppose I have a code:
>
> > >>>> def hello():
> > >    print "HELLO SIR"
>
> > > Can I write another function where I can call the value of this function
> > > or manipulate it?
>
> > No. The string "HELLO SIR" is a local variable to the hello() function.
> > You cannot modify it from outside that function. Since your hello()
> > function prints the result, instead of returning it, another function
> > cannot capture it either.
>
> > Perhaps what you want is something like this:
>
> > def hello(message="HELLO SIR"):
> >     return message
>
> > Now you can call the function, and print the result:
>
> > print hello()
>
> > If you want to capture the return value, you can:
>
> > result = hello()
> > print result.lower()
>
> > If you want to change the message used, you can pass it to the function
> > as an argument:
>
> > hello("Greetings and salutations!")
>
> > Hope this helps,
>
> > --
> > Steven
>
> Thanks Steven and Benjamin for your kind time to answer my question. I
> am sending the code soon, actual code is pretty long that has so many
> variables, it may well take your long time to evaluate, so I am making
> a sizable prototype and trying to send it to you.
> Best Regards,
> Subhabrata.

Sir,

I am writing the code as below. I am trying to send also the error
messages and my doubts.

class Message:
def __init__(self,string1,string2,lenstr1,lenstr2):
self.string1="MY"
self.string2="NAME"
self.lenstr1=lenstr1
self.lenstr2=lenstr2
def lenstring(self):
lenstr1=len(self.string1)
lenstr2=len(self.string2)
def printstr(self):
print lenstr1
print lenstr2

IDLE 2.6.5
>>>  RESTART 
>>>
>>> x1=Message(1,2,3,4)
>>> x1.printstr()

Traceback (most recent call last):
  File "", line 1, in 
x1.printstr()
  File "D:/Python26/Message3.py", line 11, in printstr
print lenstr1
NameError: global name 'lenstr1' is not defined

My doubts are:
i) Am I doing something wrong? In calling the values/parameters?
ii)As I am calling the class with so many parameters, I must be doing
something very wrong. What is the solution if you can kindly suggest.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 6:18 pm, Noah Hall  wrote:
> > class Message:
> >    def __init__(self,string1,string2,lenstr1,lenstr2):
> >        self.string1="MY"
> >        self.string2="NAME"
> >        self.lenstr1=lenstr1
> >        self.lenstr2=lenstr2
>
> The variables string1 and string2 that you're passing here are in fact
> useless. They don't do anything inside the method. Is there any point
> for them? There's no need to pass __init__ variables just so you can
> assign self.variable_name = "fixed text".
>
> >    def lenstring(self):
> >        lenstr1=len(self.string1)
> >        lenstr2=len(self.string2)
>
> I think you want self.lenstr1 and self.lenstr2 here - otherwise you're
> assigning local variables with the same name as those defined within
> the class, and throwing them away.
>
> >    def printstr(self):
> >        print lenstr1
> >        print lenstr2
>
> Again, I think you want self.lenstr1 and self.lenstr2

Sir,
Thanks for your kind time and suggestion. I'll repair.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Minor questions on Class and Functions

2011-03-20 Thread joy99
On Mar 20, 6:18 pm, Noah Hall  wrote:
> > class Message:
> >    def __init__(self,string1,string2,lenstr1,lenstr2):
> >        self.string1="MY"
> >        self.string2="NAME"
> >        self.lenstr1=lenstr1
> >        self.lenstr2=lenstr2
>
> The variables string1 and string2 that you're passing here are in fact
> useless. They don't do anything inside the method. Is there any point
> for them? There's no need to pass __init__ variables just so you can
> assign self.variable_name = "fixed text".
>
> >    def lenstring(self):
> >        lenstr1=len(self.string1)
> >        lenstr2=len(self.string2)
>
> I think you want self.lenstr1 and self.lenstr2 here - otherwise you're
> assigning local variables with the same name as those defined within
> the class, and throwing them away.
>
> >    def printstr(self):
> >        print lenstr1
> >        print lenstr2
>
> Again, I think you want self.lenstr1 and self.lenstr2

Sir,
It worked. Just Thanks.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


May I discuss here issues on Machine Learning?

2011-03-22 Thread joy99
Dear Group,

My apology to pose this non python question in this forum. I am trying
to develop one Naive Bayes Classifier and one HMM with Python. But my
question is not related to Python, rather to these two models, whether
I am choosing right parameters, etc for these models.

Python is a chosen language for machine learning and as I come here
pretty often I found this room is filled with very nice people. I
thought if some one would be interested to discuss the issues.

If any one wants to discuss personally if he/she can post his/her
name, I would discuss with him/her.

Sincerely sorry if I have broken norms of the room.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: May I discuss here issues on Machine Learning?

2011-03-23 Thread joy99
On Mar 23, 2:57 pm, Brian Blais  wrote:
> On Mar 22, 2011, at 7:18 PM, joy99 wrote:
>
> > My apology to pose this non python question in this forum. I am trying
> > to develop one Naive Bayes Classifier and one HMM with Python. But my
> > question is not related to Python, rather to these two models, whether
> > I am choosing right parameters, etc for these models.
>
> > Python is a chosen language for machine learning and as I come here
> > pretty often I found this room is filled with very nice people. I
> > thought if some one would be interested to discuss the issues.
>
> > If any one wants to discuss personally if he/she can post his/her
> > name, I would discuss with him/her.
>
> > Sincerely sorry if I have broken norms of the room.
>
> I'd say this is not the proper forum, but a closer one would be the scipy and 
> numpy groups.  You may even be using scipy and numpy to do this, and they may 
> be able to suggest more efficient libraries to call for doing these sorts of 
> models.
>
>                 bb
>
> --
> Brian Blais
> [email protected]://web.bryant.edu/~bblaishttp://bblais.blogspot.com/

Thanks Brian. I'll check. I am not using Scipy/Numpy till, I thought
using Decimal module, but float is giving me fine results.
Any issue if I send the two or three questions? You seem to be a
Professor specialized in this area.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Converting an array of string to array of float

2011-03-25 Thread joy99
Dear Group,

I got a question which might be possible but I am not getting how to
do it.

If I have a list, named,
list1=[1.0,2.3,4.4,5.5]

Now each element in the array holds the string property if I want to
convert them to float, how would I do it?

Extracting the values with for and appending to a blank list it would
not solve the problem. If appended to a blank list, it would not
change the property.

If any one of the learned members can kindly suggest any solution?

Thanks in advance.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting an array of string to array of float

2011-03-25 Thread joy99
On Mar 25, 9:19 pm, "[email protected]"
 wrote:
> On 25 mar, 16:19, joy99  wrote:
>
>
>
> > Dear Group,
>
> > I got a question which might be possible but I am not getting how to
> > do it.
>
> > If I have a list, named,
> > list1=[1.0,2.3,4.4,5.5]
>
> > Now each element in the array holds the string property if I want to
> > convert them to float, how would I do it?
>
> > Extracting the values with for and appending to a blank list it would
> > not solve the problem. If appended to a blank list, it would not
> > change the property.
>
> > If any one of the learned members can kindly suggest any solution?
>
> >>> print source
>
> ['0.0', '1.0', '2.0', '3.0', '4.0', '5.0', '6.0', '7.0', '8.0', '9.0']>>> 
> source[:] = map(float, source)
> >>> print source
>
> [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
>
>
>
> Note the "source[:] = " part - it modifies the list in place.

Thanks Bruno. I just missed it. I got it back and thanks Blockhead for
giving me new angle to look into the problem.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some questions on pow and random

2011-03-27 Thread joy99
On Mar 27, 4:36 pm, Mark Dickinson  wrote:
> On Mar 27, 11:07 am, joy99  wrote:
>
> > (b) Suppose we have two distributions p(x1) and p(x2), of the Model M,
> > the E of EM algorithm, without going into much technical details is,
> > P0(x1,x2), P1(x1,x2) 
>
> > Now I am taking random.random() to generate both x1 and x2 and trying
> > to multiply them, is it fine? Or should I take anything else?
>
> Sorry, it's unclear to me what you're asking here.  Can you rephrase
> this as a question about Python's random.random() function?
>
> If you're asking whether it's okay to regard your generated x1 and x2
> as independent, then the answer is yes.
>
> --
> Mark

Dear Mark,
Thank you for kindly allowing your time to put your kind suggestions.
I am trying to rephrase my questions, as you might have asked it.

(i) Suppose we have 8 which is 2^3 i.e., 3 is the power of 2, which we
are writing in Python as,
variable1=2
variable2=3
result=pow(variable1,variable2)

In my first problem p(x) a list of float/decimals and f(x) is another
such.
Here,
variable1=p(x)
variable2=f(x)
so that we can write, pow(variable1,variable2) but as it is a list not
a number and as the size is huge, so would it pow support it?
As I copied the question from word processor to the post, so there was
a slight confusion.

(ii) The second question is, if I have another set of variables,

variable1=random.random()
variable2=random.random()

Now my question is, can I do
result=variable1*variable2

Or should I do anything else?

Best Regards,
Subhabrata.






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


Re: Some questions on pow and random

2011-03-27 Thread joy99
On Mar 27, 8:52 pm, Mark Dickinson  wrote:
> On Mar 27, 3:00 pm, joy99  wrote:
>
> > (i) Suppose we have 8 which is 2^3 i.e., 3 is the power of 2, which we
> > are writing in Python as,
> > variable1=2
> > variable2=3
> > result=pow(variable1,variable2)
>
> > In my first problem p(x) a list of float/decimals and f(x) is another
> > such.
> > Here,
> > variable1=p(x)
> > variable2=f(x)
> > so that we can write, pow(variable1,variable2) but as it is a list not
> > a number and as the size is huge, so would it pow support it?
>
> No:  pow won't work on lists.  It will work on (a) numbers (pow(2, 3) -> 8),
>
> or (b) numpy arrays, e.g.:
>
> >>> import numpy as np
> >>> x = np.array([0.1, 0.5, 0.4])
> >>> y = np.array([3, 24, 18])
> >>> pow(x, y)
>
> array([  1.e-03,   5.96046448e-08,   6.87194767e-08])>>> x ** y # 
> exactly equivalent
>
> array([  1.e-03,   5.96046448e-08,   6.87194767e-08])
>
> > (ii) The second question is, if I have another set of variables,
>
> > variable1=random.random()
> > variable2=random.random()
>
> In this case 'variable1' and 'variable2' are Python floats, so yes,
> you can multiply them directly.  (BTW, you can always experiment
> directly at the Python interactive prompt to answer this sort of
> question.)
>
> Mark

Thanks Mark. Wishing you a nice day ahead.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Some Basic questions on the use of CTRL and ALT Keys

2009-11-27 Thread joy99
Dear Group,

I have written a small and simple program like the following:

def alphabet1(n):
file_open=open("/python26/alphabetlist1.txt","r")
file_read=file_open.read()
file_word=file_read.split()
print file_word

Here, I am using a file “alphabetlist1.txt” which I am reading and
then splitting them into words.

In this file “alphabetlist1.txt” I have arranged few alphabets like
the following:

a A
b B
c C
d D
E e
F f

Where, a/b/c/d/e/f are in  lower case and A/B/C/D/E/F are in upper
case which I can say as
SHIFT+a
SHIFT+b
SHIFT+c
SHIFT+d
SHIFT+e
SHIFT+f

Now, in the list or anywhere in the program if I want to write
CTRL+a/b/c/d/e/f or ALT+a/b/c/d/e/f for which I may assign any value I
may feel not only cut/copy/paste.

How would I represent them?

It may not be a Python specific question but as this room is full with
many expert programmers if someone can help me out.

I copied the above program from .py file to a word processor like MS-
WORD so some indentation might have changed, I am sorry for the same.

Regards,
Subhabrata Banerjee.

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


Re: Some Basic questions on the use of CTRL and ALT Keys

2009-11-27 Thread joy99
On Nov 28, 5:35 am, Steven D'Aprano  wrote:
> On Fri, 27 Nov 2009 12:41:42 -0800, joy99 wrote:
> > Dear Group,
>
> > I have written a small and simple program like the following:
>
> > def alphabet1(n):
> >     file_open=open("/python26/alphabetlist1.txt","r")
> >     file_read=file_open.read()
> >     file_word=file_read.split()
> >     print file_word
>
> > Here, I am using a file “alphabetlist1.txt” which I am reading and then
> > splitting them into words.
>
> > In this file “alphabetlist1.txt” I have arranged few alphabets like the
> > following:
>
> > a A
> > b B
> > c C
> > d D
> > E e
> > F f
>
> > Where, a/b/c/d/e/f are in  lower case and A/B/C/D/E/F are in upper case
> > which I can say as
> > SHIFT+a
> > SHIFT+b
> > SHIFT+c
> > SHIFT+d
> > SHIFT+e
> > SHIFT+f
>
> > Now, in the list or anywhere in the program if I want to write
> > CTRL+a/b/c/d/e/f or ALT+a/b/c/d/e/f for which I may assign any value I
> > may feel not only cut/copy/paste.
>
> > How would I represent them?
>
> This question is badly defined. What are your constraints? Is this meant
> to be a human-readable program? If so, you need to stick to ASCII text
> and probably want something like:
>
> a A CTRL-A ALT-A
> b B CTRL-B ALT-B
> ...
>
> but I'm not sure what the point of that would be.
>
> Normally, control-combinations generate control-characters. For example,
> CTRL-M would normally generate a carriage-return character. Depending on
> your needs, you can write this as any of the following:
>
> a description: CTRL-M
> an escape sequence: \r
> caret notation: ^M
> the standard abbreviation: CR
> the Unicode display glyph: ␍
> or an actual carriage-return character.
>
> Note that in ASCII control characters only have a standard definition for
> the following:
>
> ctrl-@
> ctrl-A through ctrl-Z
> ctrl-[
> ctrl-\
> ctrl-]
> ctrl-^
> ctrl-_
> ctrl-?
>
> See here for more:http://en.wikipedia.org/wiki/Control_characters
>
> As for Alt-combinations, I don't think there is any standard for what
> they are. I believe that they are operating system specific, and possibly
> even program specific.
>
> --
> Steven- Hide quoted text -
>
> - Show quoted text -

Dear Sir,

I was writing a transliteration program from Bengali to English and
vice versa. The program using Unicode chart is giving me perfect
outputs in Bengali and vice versa with Bengali input -> English.
I wanted to add some more power to the key board entry scheme, as I
have developed few fonts also and now trying to work out a windows
based word processor in Bengali.
Thank you for your kind answer.
It helped me lot.
ALT portion I'll work out on my own.
Sorry for a wrongly given problem statement.
Wishing you a happy day ahead,
Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Basic questions on the use of CTRL and ALT Keys

2009-11-27 Thread joy99
On Nov 28, 5:35 am, Steven D'Aprano  wrote:
> On Fri, 27 Nov 2009 12:41:42 -0800, joy99 wrote:
> > Dear Group,
>
> > I have written a small and simple program like the following:
>
> > def alphabet1(n):
> >     file_open=open("/python26/alphabetlist1.txt","r")
> >     file_read=file_open.read()
> >     file_word=file_read.split()
> >     print file_word
>
> > Here, I am using a file “alphabetlist1.txt” which I am reading and then
> > splitting them into words.
>
> > In this file “alphabetlist1.txt” I have arranged few alphabets like the
> > following:
>
> > a A
> > b B
> > c C
> > d D
> > E e
> > F f
>
> > Where, a/b/c/d/e/f are in  lower case and A/B/C/D/E/F are in upper case
> > which I can say as
> > SHIFT+a
> > SHIFT+b
> > SHIFT+c
> > SHIFT+d
> > SHIFT+e
> > SHIFT+f
>
> > Now, in the list or anywhere in the program if I want to write
> > CTRL+a/b/c/d/e/f or ALT+a/b/c/d/e/f for which I may assign any value I
> > may feel not only cut/copy/paste.
>
> > How would I represent them?
>
> This question is badly defined. What are your constraints? Is this meant
> to be a human-readable program? If so, you need to stick to ASCII text
> and probably want something like:
>
> a A CTRL-A ALT-A
> b B CTRL-B ALT-B
> ...
>
> but I'm not sure what the point of that would be.
>
> Normally, control-combinations generate control-characters. For example,
> CTRL-M would normally generate a carriage-return character. Depending on
> your needs, you can write this as any of the following:
>
> a description: CTRL-M
> an escape sequence: \r
> caret notation: ^M
> the standard abbreviation: CR
> the Unicode display glyph: ␍
> or an actual carriage-return character.
>
> Note that in ASCII control characters only have a standard definition for
> the following:
>
> ctrl-@
> ctrl-A through ctrl-Z
> ctrl-[
> ctrl-\
> ctrl-]
> ctrl-^
> ctrl-_
> ctrl-?
>
> See here for more:http://en.wikipedia.org/wiki/Control_characters
>
> As for Alt-combinations, I don't think there is any standard for what
> they are. I believe that they are operating system specific, and possibly
> even program specific.
>
> --
> Steven- Hide quoted text -
>
> - Show quoted text -

It seems the following site:
http://knopok.net/symbol-codes/alt-codes
is quite resourceful on Alt.
Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some Basic questions on the use of CTRL and ALT Keys

2009-11-28 Thread joy99
On Nov 28, 2:22 pm, Lie Ryan  wrote:
> On 11/28/2009 6:20 PM, joy99 wrote:
>
> > I was writing a transliteration program from Bengali to English and
> > vice versa. The program using Unicode chart is giving me perfect
> > outputs in Bengali and vice versa with Bengali input ->  English.
> > I wanted to add some more power to the key board entry scheme, as I
> > have developed few fonts also and now trying to work out a windows
> > based word processor in Bengali.
> > Thank you for your kind answer.
> > It helped me lot.
> > ALT portion I'll work out on my own.
> > Sorry for a wrongly given problem statement.
> > Wishing you a happy day ahead,
> > Regards,
> > Subhabrata.
>
> If I haven't misunderstood you, you want to capture keyboard input
> involving the CTRL and ALT key, am I correct?
>
> Getting keyboard input with modifier keys depends on your GUI widgets.
> Which are you using? Tkinter? wxWidget? PyQT? or plain ol' terminal?

You are very right. I am using IDLE on WinXP and for building GUI-
TKinter.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on Python as career

2009-12-01 Thread joy99
Dear Group,

I am a researcher in India's one of the premier institutes.(Indian
Institute of Science,Bangalore).

I have done one MA in Linguistics, did a PhD in Natural Language
Processing and doing a Post Doctoral now.
Earlier I knew C/C++ and presently work on Python on WinXP.
I use IDLE to as gui.
My area of work are:
(i) Statistical Modeling,
(ii) Neural Networks;
(iii) Machine Learning.

I have developed the following toolkits:
(i) A web based crawler;
(ii) A Bayesian classifier;
(iii) One NER engine;
(iv) One XML parser;
(v) One PoS Tagger;
(vi) One Parser based on CRF;
(vii) One MLE training system;
(viii) One Spell Checker;
(ix) One Transliteration System;

I have developed them either in Python2.5 and Python2.6.

After I complete my Post Doctoral which may be only 2-3 months away,
with this knowledge can I join IT?
Or Do I have to learn anything new?
Are there any India based opportunities- as I checked Python job board
it is very less.
If I get anything after completing my Post Doc with present base of
knowledge what profiles I may expect?
If I have to learn anything what they may be and how much time
generally a person needs to learn them and what may be the profile
expectancy?

As this room is filled up with many expert IT professionals if any
body can suggest me on these.

Best Regards,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Python as career

2009-12-01 Thread joy99
On Dec 2, 2:11 am, Phlip  wrote:
> joy99 wrote:
> > I have developed the following toolkits:
> > (i) A web based crawler;
> > (ii) A Bayesian classifier;
> > (iii) One NER engine;
> > (iv) One XML parser;
> > (v) One PoS Tagger;
> > (vi) One Parser based on CRF;
> > (vii) One MLE training system;
> > (viii) One Spell Checker;
> > (ix) One Transliteration System;
>
> > I have developed them either in Python2.5 and Python2.6.
>
> > After I complete my Post Doctoral which may be only 2-3 months away,
> > with this knowledge can I join IT?
>
> All your items are computer science. IT is about software engineering. That
> means _avoiding_ new research in preference for efficiently implementing
> business solutions.
You are right. But problem is that in our country hardly any people
work in the cutting edge technology. Something has been brought out in
the west and we try to imulate over here. At the end of the day, when
you see you toiled so much for a problem but it is actuallly someone
else's algorithm things are bit frustating. But well, my teachers
taught me whatever they could.

In Indian Institute of Science, well things are only bit better that
some of personal algorithms or revisions get approved.

I may continue with research but why to follow someone else's foot
step althrough life? So, better to earn money do a decent job instead
of doing all these. If I have enough inertia I can do it later too.
Many people do it.
>
> > Or Do I have to learn anything new?
>
> Test Driven Development.
I've to know this.
> Active Record (ORM models)
I've to know this too.
> HTML & webby technologies
I know it bit. HTML,XML,DHTML,SSML I know. I have slight knowledge of
Joomla and SOA.
> platforms & deployment issues
I will check on this.
> GNU, open source, and version controlling
I know it bit.
> Behavior Driven Development
>
> > Are there any India based opportunities- as I checked Python job board
> > it is very less.
>
> Ideally, IT should get the job done using a soft language like Python, Ruby, 
> or
> Lua. IT should not waste its time using a hard language like C++. That is for
> system programming - making the modules that IT reuses.
>
> > If I get anything after completing my Post Doc with present base of
> > knowledge what profiles I may expect?
>
> How about videogames? They always need hard algorithms &
> computer science.

That is a nice thought. Thank you Sir.
But I may have to be expert in Graphics and Animation, too. I am
trying to find out.
>
> --

I was thinking if I need to know Django,any good RDBMS(I know only MS-
Access)

Best Regards,
Subhabrata.
>    Phlip
>    http://c2.com/cgi/wiki?ZeekLand- Hide quoted text -
>
> - Show quoted text -

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


Re: Question on Python as career

2009-12-03 Thread joy99
On Dec 3, 11:16 am, Tim Roberts  wrote:
> joy99  wrote:
>
> >I am a researcher in India's one of the premier institutes.(Indian
> >Institute of Science,Bangalore).
>
> >I have done one MA in Linguistics, did a PhD in Natural Language
> >Processing and doing a Post Doctoral now.
> >...
> >After I complete my Post Doctoral which may be only 2-3 months away,
> >with this knowledge can I join IT?
>
> Wouldn't you say you have already joined IT?
>
> It's difficult for me to believe that you have managed to get all the way
> through a PhD without cultivating close relationships with at least one
> private sector company.  Unless you had planned to stay in research
> throughout your life, wouldn't that have been an obvious step along the
> way?
>
> >Are there any India based opportunities- as I checked Python job board
> >it is very less.
>
> There are very, very few full-time Python jobs anywhere in the world,
> although many people use Python as one tool in their toolbox.
>
> >If I get anything after completing my Post Doc with present base of
> >knowledge what profiles I may expect?
> >If I have to learn anything what they may be and how much time
> >generally a person needs to learn them and what may be the profile
> >expectancy?
>
> I am amazed that a PhD does not already have some clues about the answers
> to these questions.  Your best plan is to start exploiting your network of
> contacts.  If you don't already have a network of commercial contacts, then
> you have a long, hard road ahead of you.
> --
> Tim Roberts, [email protected]
> Providenza & Boekelheide, Inc.

I worked for quite sometime in IT, for few months I was a fellow to
IBM,too. Our institute/lab has close collaboration with Carnegie
Mellon or Massachussets Institute, but I ported to Python, and I am
the only one in my lab using it others stick to Java. I got wonderful
results doing work in Python. So, I was thinking if I could make a
career in Python. And it is a room for expert Pythoner/programmers
around the world.

You are right, Python is seen more as a tool somepeople even find it
good scripting language,too.

Surely, I'll solve this on my own.
Happy Day Ahead,
Best Regs,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Python as career

2009-12-04 Thread joy99
On Dec 4, 6:53 pm, Michele Simionato 
wrote:
> After 5 years of postdoc in Physics I decided to changecareerand to
> move to IT. I decided to learn Object Oriented Programming first. I
> chosePythonsince it was already installed on my Linux machine and it
> was easy to tackle for a beginner. In the process of learningPythonI
> began posting to this newsgroup: first asking questions, then
> answering them. I also wrote a few papers aboutPython. After a year
> or so I was kind of known in thePythonworld, with a respectable
> curriculum. Then I got my first job by answering a job offer on
> comp.lang.python. My advice is to contact some localPythonuser
> group, to go to conferences and to make yourself known in a way or
> another.
> It takes time. Good luck!
>
>        Michele Simionato

Dear All,
This really came out to be a resourceful discussion. Every one tried
to help me with some nice idea(s). Now, it is my time to act. Let me
first summarize them and proceed on them suiting my need and
capability.
Wishing you all a nice day ahead,
Best Regards,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list


How to iterate the input over a particular size?

2009-12-27 Thread joy99
Dear Group,

I am encountering a small question.

Suppose, I write the following code,

input_string=raw_input("PRINT A STRING:")
string_to_word=input_string.split()
len_word_list=len(string_to_word)
if len_word_list>9:
 rest_words=string_to_word[9:]
 len_rest_word=len(rest_words)
 if len_rest_word>9:
  remaining_words=rest_words[9:]


In this program, I am trying to extract first 9 words from an
indefinitely long string, until it reaches 0.
Am I writing it ok, or should I use while, or lambda?
If any one can suggest.

Hope you are enjoying a nice vacation of Merry Christmas. If any one
is bit free and may guide me up bit.

Wishing you a happy day ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to iterate the input over a particular size?

2009-12-27 Thread joy99
On Dec 27, 8:42 pm, Benjamin Kaplan  wrote:
> On Sun, Dec 27, 2009 at 9:44 AM, joy99  wrote:
> > Dear Group,
>
> > I am encountering a small question.
>
> > Suppose, I write the following code,
>
> > input_string=raw_input("PRINT A STRING:")
> > string_to_word=input_string.split()
> > len_word_list=len(string_to_word)
> > if len_word_list>9:
> >             rest_words=string_to_word[9:]
> >             len_rest_word=len(rest_words)
> >             if len_rest_word>9:
> >                      remaining_words=rest_words[9:]
>
> > In this program, I am trying to extract first 9 words from an
> > indefinitely long string, until it reaches 0.
> > Am I writing it ok, or should I use while, or lambda?
> > If any one can suggest.
>
> > Hope you are enjoying a nice vacation of Merry Christmas. If any one
> > is bit free and may guide me up bit.
>
> > Wishing you a happy day ahead,
> > Best Regards,
> > Subhabrata.
> > --
>
> You want the first 9 words? string_to_word[:9]
> You want the last 9 words? string_to_word[-9:]
>
> If you want the groups of words, use a loop- that's the only way to
> get all of them for any length list.
>
>
>
> >http://mail.python.org/mailman/listinfo/python-list- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Dear Group,
Answers were good. But I am looking for a smarter solution like:

for i[:2] in list:


etc. or by doing some looping over loop.
Do not worry I'll work out the answer.

Wishing you a happy day ahead,
Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Author of a Python Success Story Needs a Job!

2009-12-28 Thread joy99
On Dec 28, 12:32 pm, Andrew Jonathan Fine 
wrote:
> To whom it may concern,
>
> I am the author of "Honeywell Avoids Documentation Costs with Python
> and other Open Standards!"
>
> I was laid off by Honeywell several months after I had made my
> presentation in the 2005 Python Conference.
>
> Since then I have been unable to find work either as a software
> engineer or in any other capacity, even at service jobs.  I've sent
> resumes and have been consistently ignored.
>
> What I have been doing in the meantime is to be a full time homemaker
> and parent.   As a hobby to keep me sane, I am attempting to retrain
> part time at home as a jeweler and silversmith, and I sometimes used
> Python for generating and manipulating code for CNC machines.
>
> For my own peace of mind, however, I very much want to be doing
> software work again because I feel so greatly ashamed to have
> dedicated my life to learning and working in the field only to now
> find myself on the scrap heap.
>
> I find it highly ironic that my solution is still being advertised on
> the Python web site but that I, the author of that solution, am now a
> long term unemployment statistic.
>
> Please, if there is anyone out there who needs a highly creative and
> highly skilled software designer for new and completely original work,
> then for the love of God I implore you to contact me.
>
> A mind is a terrible thing to waste.
>
> Sincerely,
>
> Andrew Jonathan Fine
> BEE, MSCS, 15 years experience, 5 in Python, the rest in C/C++,
> about 1/3 embedded design and device drivers, and 2/3 in applications.

Dear Sir,
It seems it is pretty tough situation for you. I heard US/EU are badly
wriggling through slump and all. But I never heard of this kind.

But in India, things are bit different. All major concerns are
recruiting. But well, I do not know whether it will match your living
standards. In India major technology is C/C++ or Java. You can find
out even Honeywell has a big set up in India.

I know one person of e-mail id "[email protected]", he is most
probably has lot of Python profiles. I got this contact from this room
only. You can have a try. Python job board also has lot of offerings.
What about them? Can you think earning from some open projects for
time being. Rentacoder may be tried. Though I feel their process is
bit complicated and time-taking.

Hope coming new year will be good for you.
Wishing you a happy and prosperous new year.

Regards,
Subhabrata.
Delhi,
India.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to iterate the input over a particular size?

2009-12-28 Thread joy99
On Dec 28, 5:28 pm, Vlastimil Brom  wrote:
> 2009/12/27 joy99 :
>
> > Dear Group,
> > Answers were good. But I am looking for a smarter solution like:
>
> > for i[:2] in list:
> > 
>
> > etc. or by doing some looping over loop.
> > Do not worry I'll work out the answer.
>
> > Wishing you a happy day ahead,
> > Regards,
> > Subhabrata.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> Hi,
> maybe just something like:
>
> >>> input_list = range(10)
> >>> n = 3
> >>> [input_list[i:i+n] for i in range(0, len(input_list), n)]
>
> [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
>
> ?
> (possibly using xrange and generator expression instead of the list
> comprehension)
>
>  vbr

vbr,
Just Brilliant.
I manipulated it bit but I got the key, but thanks to all for giving
me lots of solutions and lots of insights over Python. Everytime I
visit this room I learn so much. Thank you all.

Wishing a Great Day ahead,

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


A silly question on file opening

2010-02-10 Thread joy99
Dear Group,

I was using Python with IDLE as GUI for quite some time. My Operating
System was Windows XP with Service Pack2.
Recently I changed the Operating System to Windows XP with Service
Pack3. I had to reinstall Python for which I downloaded
"python-2.6.4.msi"and loaded it in my D drive.

Here, as I am trying to open the file if I am giving a statement like,
  file_open=open("python26/file","r")
It is showing an error,
On checking how the files are stored it is showing that it is storing
in D drive directly but not in Python folder in D drive there is no
Python folder at all.
I tried to change the location to D:\file and as I saw in Python Docs
the file reading option is now "r+" so I changed the statement to
   file_open=open("D:\file","r+")
but it is still giving error.
Did I install it wrongly?
If you can please help it out.
Best Regards,
Subhabrata.

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


Re: A silly question on file opening

2010-02-12 Thread joy99
On Feb 11, 1:57 am, Anthony Tolle  wrote:
> On Feb 10, 3:42 pm,joy99 wrote:
>
> > Dear Group,
> > [snip]
> > I tried to change the location to D:\file and as I saw in Python Docs
> > the file reading option is now "r+" so I changed the statement to
> >    file_open=open("D:\file","r+")
> > but it is still giving error.
>
> Only use "r+" if you need to also write to the file.  "r" is still
> good for opening for reading.
>
> Without seeing a traceback, I can only assume the error is caused by
> using a backslash in the path without escaping it.  Try either the
> following:
>
> file_open=open("D:\\file","r+")
>
> file_open=open(r"D:\file","r+")
>
> For an explanation, see the Python documentation:
>
> http://docs.python.org/reference/lexical_analysis.html#string-literals

Dear Group,

I am sorry I could not report. I was trying your solutions, I could
try only one or two, they are working. My problem got solved. Thank
you for your suggestions. But soon I find time, I would try all of
them, so that I can learn more and what I try to do in this room to
get better angles over any problem from experts like you. Thank you
for giving me your valuable time despite your busy schedule.

Wishing you happy day ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Few Small Questions Regarding CGI

2010-02-15 Thread joy99
Dear Group,

I am trying to learn CGI. I was checking Python Docs. There are
multiple modules. Which one to start with?
Is there any other material or URL for step by step learning of CGI.

My next question is:
I want to test it. I have a small personal computer. I have internet
but is connected by a service provider. I do not have personal web
page. Can I use my personal computer as a client as well as a server?

If your kind time permits to answer me these questions, I would be
hugely benefited.
Wishing you a happy day ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Few questions on SOAP

2010-02-18 Thread joy99
Dear Group,

I was reading on SOA or Service Oriented Architecture for last few
days and got some questions. As this is a room for the expert computer
scientists, if you can help me solve my queries.

As per I read and felt SOA is an architecture, which relies on few
basic principles as,
the system must be modular, the modules must be distributive, module
interfaces must be clearly defined and documented, module that
implements a service can be swapped out for another module that offers
the same service and interface, service provider modules must be
shareable.
SOA is an architecture which is now a days governed like XML by W3C.
The latest version is SOAP 1.2.
SOA is implemented mainly in a client/server environment, where
applications have the use of service, thus we can say it is a service-
oriented architecture.
It is a step towards cloud computing with its sister WSDL and BPM.

If both client/server are following the SOA then they can communicate
and exchange information without worrying for platform.

SOAP is a software implementation of Python,.NET,J2EE based on this
principle.
SOAPPy is a Python implementation.

My questions are:
(i) Am I understanding correctly?
(ii)Does SOAP has any standard architecture like UML other than the
W3C one?
(iii)   Can I write short programs to check the SOAP using my personal
computer as client as well as Server?
(iv)Is SOAPpy fine?
(v) What is the difference among SOAP, WSDL and BPM.
(vi)As SOAP is for communication with a server if I pick a URL and
start to communicate with Google/Yahoo would they allow?
(vii)   Can I design a web based robot/crawler with SOAP?

Wishing you a Happy Day Ahead,
Best Regards,
Subhabrata.

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


Re: Few questions on SOAP

2010-02-19 Thread joy99
On Feb 19, 8:49 am, Steve Holden  wrote:
> Brendon Wickham wrote:
> > On 19 February 2010 08:07, Mark Lawrence  wrote:
> >> Muhammad Alkarouri wrote:
> >>> Your question is borderline if not out of topic in this group. I will
> >>> make a few comments though.
> >> This might be a Python group, but threads often drift way off topic, which
> >> added to the language itself make this a great group to read.  If you don't
> >> like the way a thread goes, you can always skip it.
>
> > Perhaps...but he answered the question very well and with great, IMO, 
> > patience.
>
> +1
> --
> Steve Holden           +1 571 484 6266   +1 800 494 3119
> PyCon is coming! Atlanta, Feb 2010  http://us.pycon.org/
> Holden Web LLC                http://www.holdenweb.com/
> UPCOMING EVENTS:        http://holdenweb.eventbrite.com/

Dear Group,
Thank you for taking your time to discuss the issue, esp. to Mohammad
for his great patience and solving each aspect in a great way.
That's I frequent this group and I just learn lot. If it is bit
diverted topic,sorry.
Wishing you Happy Day Ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Few early questions on Class

2010-03-03 Thread joy99
Dear Group,

I was practising some early example of class if you can kindly let me
know where I was going wrong.

I am pasting directly from IDLE. There may be slight indentation
problem. I am using Python 2.6.4 on Windows XP Service Pack 3.

The Code and the output:

>>> class Student:
def _init_(self,name):
self.name=name
self.attendance=0
self.marks=[]
number_of_marks=len(self.marks)
print number_of_marks


>>> b=Student("Bobby")

Traceback (most recent call last):
  File "", line 1, in 
b=Student("Bobby")
TypeError: this constructor takes no arguments
>>> Class Shape:

SyntaxError: invalid syntax
>>> class Shape:
def _init_(self,x,y):
self.x=x
self.y=y
description="This Shape is not been described Yet"
author="Nobody has Claimed it Yet"
def area(self):
return self*x+self*y
def perimeter(self):
return 2*self.x+2*self*y


>>> rectangle=Shape(100,45)

Traceback (most recent call last):
  File "", line 1, in 
rectangle=Shape(100,45)
TypeError: this constructor takes no arguments
>>> rectangle=Shape()
>>> print rectangle.area()

Traceback (most recent call last):
  File "", line 1, in 
print rectangle.area()
AttributeError: Shape instance has no attribute 'area'
>>>
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Interesting bug

2011-01-01 Thread joy99
Dear Group,

Hope all of you are fine and spending nice new year evenings.

I get a bug in Python over the last 4 years or so, since I am using
it. The language is superb, no doubt about it. It helped me finish
many a projects, with extraordinary accuracy. But long since, I was
getting an interesting bug. In the initial days, I thought it may be
my learning error or usability error. It comes every now and then. The
bug is suppose I am calling a library or using some logical operator,
it works fine initially but if I want to copy the code to some other
modules, same line of codes do not run at all.

The remedy I do is,
(a) I take the code from file and test it in GUI, more astonishingly
in 99% of the cases I found the code llines, are correct.
Then I apply a brute force technique I rewrite the whole code again.
For small codes this technique is okay, but if I write mammoth code,
and all on a sudden some interesting behavior came out, well it really
feels bad. I keep now a days some time out that I have to do this, but
is there any definite solution? I believe there is some, as I do not
know them, as it happens, unnecessarily get upset.

I use Python on WinXP service pack2, I started to use Python2.5.1, and
now I am using Python2.6.5, IDLE as GUI.

Best Regards,
Subhabrata
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interesting bug

2011-01-01 Thread joy99
On Jan 1, 6:22 pm, Daniel Fetchinson 
wrote:
> > Dear Group,
>
> > Hope all of you are fine and spending nice new year evenings.
>
> > I get a bug in Python over the last 4 years or so, since I am using
> > it. The language is superb, no doubt about it. It helped me finish
> > many a projects, with extraordinary accuracy. But long since, I was
> > getting an interesting bug. In the initial days, I thought it may be
> > my learning error or usability error. It comes every now and then. The
> > bug is suppose I am calling a library or using some logical operator,
> > it works fine initially but if I want to copy the code to some other
> > modules, same line of codes do not run at all.
>
> > The remedy I do is,
> > (a) I take the code from file and test it in GUI, more astonishingly
> > in 99% of the cases I found the code llines, are correct.
> > Then I apply a brute force technique I rewrite the whole code again.
> > For small codes this technique is okay, but if I write mammoth code,
> > and all on a sudden some interesting behavior came out, well it really
> > feels bad. I keep now a days some time out that I have to do this, but
> > is there any definite solution? I believe there is some, as I do not
> > know them, as it happens, unnecessarily get upset.
>
> > I use Python on WinXP service pack2, I started to use Python2.5.1, and
> > now I am using Python2.6.5, IDLE as GUI.
>
> > Best Regards,
> > Subhabrata
>
> An AI bot is playing a trick on us.
> Focus and don't let your guards down!
>
> Cheers,
> Daniel
>
> --
> Psss, psss, put it down! -http://www.cafepress.com/putitdown

Thanks for the suggestion. I'll keep it checked. Some useless fellows
forget their own business and poke nose into others business.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on Python Freelance Projects in NLP and Machine Learning

2011-01-28 Thread joy99
Dear Room,

I am a Python programmer from India. I am looking for some freelance
Python projects, preferably in Natural Language Processing and Machine
Learning. If any one knows of it, please let me know.

Best Regards,
Subhabrata Banerjee.
-- 
http://mail.python.org/mailman/listinfo/python-list


Looking for Remote Python Project

2011-01-29 Thread joy99
Dear Room,

I am a Python Programmer from India(New Delhi Region), and I worked
for quite a long time in Bangalore. I have been working in Python for
the last 4 years or so. I have successfully built around 15 projects
in Python. I am looking for some remote Python Projects, which can be
done from home.

If any one knows of anything, I may be helpful enough.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for Remote Python Project

2011-01-29 Thread joy99
On Jan 30, 2:49 am, Ben Finney  wrote:
> joy99  writes:
> > I am looking for some remote Python Projects, which can be done from
> > home.
>
> > If any one knows of anything, I may be helpful enough.
>
> One of the best ways to begin contributing is to fix bugs and provide
> patches. For Python itself, see the Python bug tracker
> http://bugs.python.org/>; for other projects, see the project's
> site and browse its bug tracker.
>
> --
>  \                “Please to bathe inside the tub.” —hotel room, Japan |
>   `\                                                                   |
> _o__)                                                                  |
> Ben Finney

Thanks Ben for a nice reply and suggestion. This experience will
surely be rewarding one.
But do you know whether it would be a paying one, I am looking to be a
freelancer.
>From this room of expert Python programmers, developers I am trying to
get nice suggestions.

Wishing You a Happy Day Ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on Creating exe file with py2exe

2011-02-12 Thread joy99
Dear Room,

I am using Windows XP (SP2) and a Python Version "Python 2.6.5
(r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
win32".

I was looking to create exe files. Reviewing various posts here, I
felt py2exe may be the best thing I can opt for.

But for Python2.6 I found the following note in the py2exe tutorial:
"For Python 2.6, the DLL you need is called MSVCR90.dll. Py2exe is not
able to automatically include this DLL in your dist directory, so you
must provide it yourself.

To complicate things, there is more than one version of this DLL in
existance, each with the same filename. You need the same version that
the Python interpreter was compiled with, which is version
9.0.21022.8. Through the remainder of these instructions, hover your
mouse over the dll file (or the vcredist_x86.exe installer executable)
to confirm which version you've got. "

My questions are:
(i) From where I can download "MSVCR90.dll" ? Is there any trusted
site?
(ii) How to install the same?
(iii) Would py2exe work fine if I install it?
(iv) Is there any other exe creating program which does not have all
these problems?

As it is a room for expert python developers, I felt to ask you, if
any one can kindly find some time to resolve my query, I would be
honored.

Thanks in Advance,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Creating exe file with py2exe

2011-02-12 Thread joy99
On Feb 13, 1:29 am, aspineux  wrote:
> Hi
>
> I'm releasing a .exe made with py2exe myself an got this problem too.
> 99% of the time the required DLL is already installed by another
> application and you don't need to care about it.
> The 1% is about empty or fresh windows install (server most of the
> time)
> For them, I provide a link to the M$ vcredist and a warning in my
> download page asking them to install it them self.
>
> Take a look at my site for the vcredist link 
> :http://www.magikmon.com/mksbackup/download.en.html
>
> Regards
>
> Alain
>
> On Feb 12, 9:06 pm, joy99  wrote:
>
> > Dear Room,
>
> > I am using Windows XP (SP2) and a Python Version "Python 2.6.5
> > (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
> > win32".
>
> > I was looking to create exe files. Reviewing various posts here, I
> > felt py2exe may be the best thing I can opt for.
>
> > But for Python2.6 I found the following note in the py2exe tutorial:
> > "For Python 2.6, the DLL you need is called MSVCR90.dll. Py2exe is not
> > able to automatically include this DLL in your dist directory, so you
> > must provide it yourself.
>
> > To complicate things, there is more than one version of this DLL in
> > existance, each with the same filename. You need the same version that
> > the Python interpreter was compiled with, which is version
> > 9.0.21022.8. Through the remainder of these instructions, hover your
> > mouse over the dll file (or the vcredist_x86.exe installer executable)
> > to confirm which version you've got. "
>
> > My questions are:
> > (i) From where I can download "MSVCR90.dll" ? Is there any trusted
> > site?
> > (ii) How to install the same?
> > (iii) Would py2exe work fine if I install it?
> > (iv) Is there any other exe creating program which does not have all
> > these problems?
>
> > As it is a room for expert python developers, I felt to ask you, if
> > any one can kindly find some time to resolve my query, I would be
> > honored.
>
> > Thanks in Advance,
> > Best Regards,
> > Subhabrata.
>
>

Hi Alain,
Thank you for your product information. But, with my problem
installation is okay.
The first two steps:
"from distutils.core import setup
 import py2exe"
but as I am giving
"setup(console=['file.py'])"

the setup file is not being generated. It is giving some error
messages.
Any suggestions?
Best Regards,
Subhabrata.

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


Question on using cx_freeze

2011-02-13 Thread joy99
Dear Room,
I was trying to build an .exe file for my sample python scripting file
"hello1.py". I felt using cx_freeze as py2exe was giving some problems
for Python2.6, which I am using.

I gave the following commands:
>>> import sys
>>> from cx_Freeze import setup, Executable
>>> base = None
if sys.platform == "win32":
base = "Win32GUI"

>>> setup(
name = "hello1",
version = "0.1",
description = "Sample hello1 script",
executables = [Executable("hello1.py", base = base)])

I am getting the following error messages:
Traceback (most recent call last):
  File "", line 5, in 
executables = [Executable("hello1.py", base = base)])
  File "D:\Python26\lib\site-packages\cx_Freeze\dist.py", line 360, in
setup
distutils.core.setup(**attrs)
  File "D:\Python26\lib\distutils\core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" %
msg
SystemExit: usage:  [global_opts] cmd1 [cmd1_opts] [cmd2
[cmd2_opts] ...]
   or:  --help [cmd1 cmd2 ...]
   or:  --help-commands
   or:  cmd --help

error: no commands supplied

My questions are:
(i) What is the problem I am doing?
(ii) How to overcome this error?

I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information on
Windows XP (SP 2).

If any one can help me out I may be hugely helpful.
Thanks in Advance,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on running exe file in Python

2011-02-13 Thread joy99
Dear Room,

I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
1500 32 bit (Intel)] on win32 on Windows XP (SP2).

Trying to create an .exe file of my scripting file I had saved it
as .exe instead of .py file. It seems created. But how to run it? I
tried command prompt, seems unresponsive.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on running exe file in Python

2011-02-13 Thread joy99
Thanks for your reply.
On Feb 13, 6:58 pm, Chris Rebert  wrote:
> On Sun, Feb 13, 2011 at 4:56 AM, joy99  wrote:
> > Dear Room,
>
> Just a friendly FYI: that's a strange salutation; comp.lang.python AKA
> python-list isn't a chat room, at least in the normal sense of the
> term.
I know that. It is a highly technical room. I have been visiting this
room for last 4 yrs or so, greeted people in the same way, but someone
felt hurt I saw for the first time!
>
> > I am using Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.
> > 1500 32 bit (Intel)] on win32 on Windows XP (SP2).
>
> > Trying to create an .exe file of my scripting file I had saved it
> > as .exe instead of .py file. It seems created. But how to run it? I
> > tried command prompt, seems unresponsive.
>
> You can't compile things to executables (i.e. machine code, i.e. .exe
> files) just by changing the file extension; you have to use a compiler
> to generate the .exe. Additionally, Python is normally an interpreted
> language; hence, it does not normally produce independent executables
> (unless possibly you're using a non-CPython implementation of Python).
> You can however generate self-contained executables for Python
> programs using special tools such as py2exe, cx_freeze, etc., which
> judging by your other post, you're already aware of. So, if you want
> to generate a .exe, you'll need to get one of those tools working.
>
> (Renaming a text .py file to a .exe results in your CPU trying to
> treat the text like it's binary machine code; since it's not machine
> code, the CPU ends up executing gibberish instructions, resulting in
> an error, freeze, or similar that causes the unresponsiveness you're
> observing.)
>
> Cheers,
> Chris
> --http://blog.rebertia.com
All you have to get a solution. That's the goal. Not how approach
should be.
You may be more learned, but doing an .exe file works. I googled out
and found the answer.
But somehow, I am finding the people visiting this forum have either
downsized, or their quality degraded.
I often find a web search gives better answers.
You can save as .pyw for .dll files. For .exe files, saving as .exe
simply works, you can get the result by
importing os, or by simply executing it from command prompt.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on Python Function

2010-05-24 Thread joy99


Dear Group,

I have a small question on function.

If I write two functions like the following:

IDLE 2.6.5
>>> def function1(n):
element1=5
element2=6
add=element1+element2
print "PRINT THE ADDITION",add


>>> def function2(n):
element3=7
element4=22
mult=element3*element4
print "PRINT THE MULTIPLICATION",mult

Can I now write a third function where the above two functions can be
passed as argument or parameter?

Best Regards,
Subhabrata.

NB: As I copied the code from IDLE to MS-Word befor posting here,
codes may have slight indentation errors.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Python Function

2010-05-24 Thread joy99
On May 25, 1:56 am, Vlastimil Brom  wrote:
> 2010/5/24 joy99 :
>
>
>
>
>
>
>
> > Dear Group,
>
> > I have a small question on function.
>
> > If I write two functions like the following:
>
> > IDLE 2.6.5
> >>>> def function1(n):
> >        element1=5
> >        element2=6
> >        add=element1+element2
> >        print "PRINT THE ADDITION",add
>
> >>>> def function2(n):
> >        element3=7
> >        element4=22
> >        mult=element3*element4
> >        print "PRINT THE MULTIPLICATION",mult
>
> > Can I now write a third function where the above two functions can be
> > passed as argument or parameter?
>
> > Best Regards,
> > Subhabrata.
>
> > NB: As I copied the code from IDLE to MS-Word befor posting here,
> > codes may have slight indentation errors.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> Hi,
> while it is quite unclear to me, what you are trying to achieve (what
> are the passed n arguments supposed to do?), you can well pass an
> already defined function as an argument to another function; if you
> want to select a function for the needed operation, if can be e.g.:
>
> def compute(arg1, arg2, fn):
>     fn(arg1, arg2)
>
> - supposing you don't want to "return" the result but just print it as
> your functions do;
> is it what you were after or did I miss something more complex?
>
> hth
>   vbr- Hide quoted text -
>
> - Show quoted text -

Dear Vlastimil,

You are right. Your approach will do to me. I was trying Python Doc
either I do not know where to check, or I could not find.
I am trying to work out. Numbers I can pass, I was checking the last
example in Python Docs with "def cheeseshop(kind, *arguments,
**keywords):" if that gives me any clue.

If you can kindly try.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Python Function

2010-05-24 Thread joy99
On May 25, 1:56 am, Vlastimil Brom  wrote:
> 2010/5/24 joy99 :
>
>
>
>
>
>
>
> > Dear Group,
>
> > I have a small question on function.
>
> > If I write two functions like the following:
>
> > IDLE 2.6.5
> >>>> def function1(n):
> >        element1=5
> >        element2=6
> >        add=element1+element2
> >        print "PRINT THE ADDITION",add
>
> >>>> def function2(n):
> >        element3=7
> >        element4=22
> >        mult=element3*element4
> >        print "PRINT THE MULTIPLICATION",mult
>
> > Can I now write a third function where the above two functions can be
> > passed as argument or parameter?
>
> > Best Regards,
> > Subhabrata.
>
> > NB: As I copied the code from IDLE to MS-Word befor posting here,
> > codes may have slight indentation errors.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> Hi,
> while it is quite unclear to me, what you are trying to achieve (what
> are the passed n arguments supposed to do?), you can well pass an
> already defined function as an argument to another function; if you
> want to select a function for the needed operation, if can be e.g.:
>
> def compute(arg1, arg2, fn):
>     fn(arg1, arg2)
>
> - supposing you don't want to "return" the result but just print it as
> your functions do;
> is it what you were after or did I miss something more complex?
>
> hth
>   vbr- Hide quoted text -
>
> - Show quoted text -

Dear Vlastimir,

As pointed out by Alister, I can print the values of function1 and
function2 with the help of another function3, but my target is to call
the "add" value of function1 and "mult" value of function2 in a third
function or the values and parameters of the third function in fourth
function. While calling, I am looking not only to print, but to use
them or manipulate them.

I hope I am bit clear now.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on Python Function

2010-05-27 Thread joy99
On May 25, 12:18 pm, Peter Otten <[email protected]> wrote:
> Kushal Kumaran wrote:
> > On Tue, May 25, 2010 at 3:38 AM,joy99 wrote:
> >> 
>
> >> Dear Vlastimir,
>
> >> As pointed out by Alister, I can print the values of function1 and
> >> function2 with the help of another function3, but my target is to call
> >> the "add" value of function1 and "mult" value of function2 in a third
> >> function or the values and parameters of the third function in fourth
> >> function. While calling, I am looking not only to print, but to use
> >> them or manipulate them.
>
> >> I hope I am bit clear now.
>
> > If you need to use the values in another function, you need a way to
> > let that function get its hands on the values.  Your function1 and
> > function2 should return the values they compute instead of printing
> > them out.
>
> For example:
>
>  >>> def add(x, y):
> ...     return x + y
> ...>>> def mul(x, y):
>
> ...     return x * y
> ...>>> def sum_of_squares(x, y):
>
> ...     return add(mul(x, x), mul(y, y))
> ...>>> sum_of_squares(3, 4)
>
> 25
>
> OP: If that addresses your question I suggest that you work through some
> introductory text about python. The python wiki has a few suggestions, see
>
> http://wiki.python.org/moin/BeginnersGuide
>
> Peter

Hi Peter and Other Kind Contributors of the Group,

I got lot of insights from the discussion in the group. Though I did
not get the exact answer but from Peter's link I could work them out.
Thank you, Peter, for kindly referring me the link. I like to thank
others of the group also for kindly spending their valuable time. I
wanted to define one function and call the value of that function to
be used by another function. If I misquoted the problem, I am sorry.

Wishing You all a Great Day Ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Two minor questions on Class

2010-07-30 Thread joy99
Dear Group,

Hope everyone is fine.

I was trying some examples of Python class.
I took the following example from Ubuntu forum[http://ubuntuforums.org/
showthread.php?t=578930]
class Person(object):
def _init_(self,name,age):
self.name=name
self.age=age

as i wrote the code using IDLE on WinXP SP2, with Python2.6.5, I am
getting the following error:

>>> p=Person('Subha',40)

Traceback (most recent call last):
  File "", line 1, in 
p=Person('Subha',40)
TypeError: object.__new__() takes no parameters

My question is, why the error is coming? Any problem in writing it?
Can arguments be passed to class (other than inheritance) directly
like this?

As I was practising some early examples on class, does Python exist
with any built in class, like the rich library of built in functions?
Any good URL to learn examples?

If any one can help, I would be grateful. As I pasted the code from
GUI to notepad, there may be slight indentation problem, sorry for the
same.

Thanks in advance,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Problem Regarding Handling of Unicode string

2009-08-10 Thread joy99
Dear Group,

I am using Python26 on WindowsXP with service pack2. My GUI is IDLE.
I am using Hindi resources and get nice output like:
एक
where I can use all the re functions and other functions without doing
any transliteration,etc.
I was trying to use Bengali but it is giving me output like:
'\xef\xbb\xbf\xe0\xa6\x85\xe0\xa6\xa8\xe0\xa7\x87\xe0\xa6\x95'
I wanted to see Bengali output as
অনেক
and I like to use all functions including re.
If any one can help me on that.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem Regarding Handling of Unicode string

2009-08-16 Thread joy99
On Aug 11, 1:17 pm, John Machin  wrote:
> On Aug 10, 9:26 pm, joy99  wrote:
>
> > Dear Group,
>
> > I am using Python26 on WindowsXP with service pack2. My GUI is IDLE.
> > I am using Hindi resources and get nice output like:
> > एक
> > where I can use all the re functions and other functions without doing
> > any transliteration,etc.
> > I was trying to use Bengali but it is giving me output like:
>
> WHAT is giving you this output?
>
> > '\xef\xbb\xbf\xe0\xa6\x85\xe0\xa6\xa8\xe0\xa7\x87\xe0\xa6\x95'
>
> In a very ordinary IDLE session (Win XP SP3, Python 2.6.2, locale:
> Australia/English, no "Hindi resources"):
>
> >>> x = '\xef\xbb\xbf\xe0\xa6\x85\xe0\xa6\xa8\xe0\xa7\x87\xe0\xa6\x95'
> >>> ux = x.decode('utf-8')
> >>> ux
>
> u'\ufeff\u0985\u09a8\u09c7\u0995'>>> print ux
>
> অনেক # looks like what you wanted; please confirm>>> import unicodedata
> >>> for c in ux:
>
>         print unicodedata.name(c)
>
> ZERO WIDTH NO-BREAK SPACE # this is a BOM
> BENGALI LETTER A
> BENGALI LETTER NA
> BENGALI VOWEL SIGN E
> BENGALI LETTER KA
>
>
>
> > I wanted to see Bengali output as
> > অনেক
> > and I like to use all functions including re.
> > If any one can help me on that.
>
> "I am using Hindi resources" doesn't tell us much ... except to prompt
> the comment that perhaps if you want to display Bengali script, you
> may need Bengali resources. However it looks like I can display your
> Bengali data without any special resources.
>
> It seems like you are not doing the same with Bengali as you are doing
> with Hindi. We can't help you very much if you don't show exactly what
> you are doing.
>
> Have you considered asking in an Indian Python forum? Note: you will
> still need to say what you are doing that works with Hindi but not
> with Bengali.
>
> Cheers,
> John

Dear Group,
I have already worked out my solution but everyone of yours' answers
helped me to see different solutions from different angles. Thank you
for the same. I am building some social network program in Bengali. I
just gave the transliteration problem which was giving me problem, I
thought as you are very expert pythoners so it would be minutes'
matter. By your answers I saw I was not wrong. But as I solved the
problem so I checked it bit late. Sorry for the same.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Questions on XML

2009-08-21 Thread joy99
Dear Group,

I like to convert some simple strings of natural language to XML. May
I use Python to do this? If any one can help me, on this.

I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
use Python to help me in this regard?

How can I learn good XML aspects of Python. If any one can kindly name
me a book or URL.

I am using Python2.6 on Windows XP with IDLE as GUI.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Questions on XML

2009-08-21 Thread joy99
On Aug 22, 10:53 am, Stefan Behnel  wrote:
> Rami Chowdhury wrote:
> >> I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I
> >> use Python to help me in this regard?
>
> > I can say from experience that Python on Windows (at least, Python 2.5
> > on 32-bit Vista) works perfectly well with UTF-8 files containing
> > Bangla. I have had trouble with working with the data in IDLE, however,
> > which seems to prefer ASCII by default.
>
> Defaults almost never work for encodings. You have to be explicit: add an
> encoding declaration to the top of your source file if you use encoded
> literal strings in your code; use the codecs module with a suitable
> encoding to read encoded text files, and use an XML parser when reading XML.
>
> Stefan

Dear Group,
Thanx for your reply. Python works perfectly for Hindi and Bangla with
Win XP. I never had a trouble.
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Questions on XML

2009-08-22 Thread joy99
On Aug 22, 12:16 pm, Rami Chowdhury  wrote:
> > encoding declaration to the top of your source file if you use encoded
> > literal strings in your code
>
> Any tips for how to set the encoding in IDLE? printing the Unicode  
> strings works -- trying to repr() the variable chokes with a  
> UnicodeDecodeError, and trying to enter the literals inside IDLE just  
> gets me '?' characters instead.
>
> (this is Python 2.5 + IDLE installed from the Python-2.5.msi on  
> python.org)
>
> -
> Rami Chowdhury
> "Never assume malice when stupidity will suffice." -- Hanlon's Razor
> 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
>
> On Aug 21, 2009, at 22:53 , Stefan Behnel wrote:
>
>
>
> > Rami Chowdhury wrote:
> >>> I am using primarily UTF-8 based strings, like Hindi or Bengali.  
> >>> Can I
> >>> use Python to help me in this regard?
>
> >> I can say from experience that Python on Windows (at least, Python  
> >> 2.5
> >> on 32-bit Vista) works perfectly well with UTF-8 files containing
> >> Bangla. I have had trouble with working with the data in IDLE,  
> >> however,
> >> which seems to prefer ASCII by default.
>
> > Defaults almost never work for encodings. You have to be explicit:  
> > add an
> > encoding declaration to the top of your source file if you use encoded
> > literal strings in your code; use the codecs module with a suitable
> > encoding to read encoded text files, and use an XML parser when  
> > reading XML.
>
> > Stefan
> > --
> >http://mail.python.org/mailman/listinfo/python-list- Hide quoted text -
>
> - Show quoted text -

Dear Sir,

There is no big issue for this. I simply downloaded Python2.5 and
using IDLE on Windows XP with service pack 2. I used Python 2.5
earlier and presently using Python 2.6 and it is also perfectly fine.
I am not using it for small programs but machine learning programs,
where code itself runs few million lines over some terabytes of Hindi
and Bengali data, and I never found any problem. What is the exact
nature of problem you are getting? If you can kindly specify. If
possible, with some sample codes. And printing is also never been a
problem, all good printers like HP,Epson,Xerox,Canon are printing
Hindi or Bengali data finely.
If you can kindly specify the problem.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


File Handling Problem

2009-09-04 Thread joy99
Dear Group,

I have a file. The file has multiple lines. I want to get the line
number of any one of the strings.
Once I get that I like to increment the line number and see the string
of the immediate next line or any following line as output. The
problem as I see is nicely handled in list,

like list_one=["god","earth","sky","cloud","rain"]
  list_one[0]="god"
  list_one[2]="sky"

but can it be for string and file?

I can generally put a cursor and move it back and forth for my need
using index/find and then re. But, I was looking to use some built-in
methods. Can I use fileinput or ast? But, I was not finding any good
resources, using http://docs.python.org/library/fileinput.html#fileinput.input,
etc. did not help much.

If any one can kindly help me out.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: File Handling Problem

2009-09-06 Thread joy99
On Sep 5, 11:49 am, Chris Rebert  wrote:
> On Fri, Sep 4, 2009 at 11:39 PM, 
> SUBHABRATABANERJEE wrote:
>
> 
>
> > And one small question does Python has any increment operator like ++ in C.
>
> No. We do  x += 1  instead.
>
> Cheers,
> Chris
> --http://blog.rebertia.com

Thanx for your kind reply.
Warm Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Question on File Input and AST

2009-09-06 Thread joy99
Dear Group,

I have a file "test1.txt". Now, as I do the file handling, i try to do
any one of the following operations.

1. open_file=open("/python26/test1.txt","r") # FOR READING
2. open_file=open("/python26/test1.txt","r+") # FOR READING AND
WRITING BOTH
[Either of 1 or 2 to open as the need be]
3. read_file=open_file.read()
etc...

But how to work with "fileinput" or "ast".

I tried to read python docs and some backlog question answer in the
group but it did not help much.

If any one can kindly give one or two small examples. It would help me
much.

Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question on File Input and AST

2009-09-08 Thread joy99
On Sep 6, 1:49 pm, Steven D'Aprano  wrote:
> On Sun, 06 Sep 2009 00:53:43 -0700,joy99wrote:
> > Dear Group,
>
> > I have a file "test1.txt". Now, as I do the file handling, i try to do
> > any one of the following operations.
>
> > 1. open_file=open("/python26/test1.txt","r") # FOR READING 2.
> > open_file=open("/python26/test1.txt","r+") # FOR READING AND WRITING
> > BOTH
> > [Either of 1 or 2 to open as the need be] 3. read_file=open_file.read()
> > etc...
>
> > But how to work with "fileinput" or "ast".
>
> > I tried to read python docs and some backlog question answer in the
> > group but it did not help much.
>
> At the interactive interpreter, do this:
>
> >>> import fileinput
> >>> help(fileinput)
>
> and read the help text. It gives you an example:
>
>     [quote]
>     Typical use is:
>
>         import fileinput
>         for line in fileinput.input():
>             process(line)
>
>     This iterates over the lines of all files listed in sys.argv[1:],
>     defaulting to sys.stdin if the list is empty.  If a filename is '-' it
>     is also replaced by sys.stdin.  To specify an alternative list of
>     filenames, pass it as the argument to input().  A single file name is
>     also allowed.
>     [end quote]
>
> If there is something unclear about that, then please try to be specific
> about what you don't understand. Try some code, and report what errors
> you get.
>
> As far as ast, there's an example here:
>
> http://docs.python.org/dev/whatsnew/2.6.html#the-ast-module
>
> and a discussion here:
>
> http://stackoverflow.com/questions/768634/python-parse-a-py-file-read...
> ast-modify-it-then-write-back-the-modified
>
> If you explain what you want to do, perhaps there's somebody out there
> who knows the ast module and can answer.
>
> --
> Steven- Hide quoted text -
>
> - Show quoted text -

Dear Sir,

Thank you for your kind reply. I will have a check on them soon.

Warm Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list


Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-11 Thread joy99
Dear Group,

I am trying to download the following files,
a) lxml,
b) numpy,
c) scipy, and
d) django.

I am trying to include them in C\python26\Lib

But they are giving error report, as I am trying to use them by
importing.

I am using IDLE as GUI, my OS is WinXP SP2, and my Python version 2.6.

If any one suggest what is the problem, I am doing?

Best Regards,
Subhabrata
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with the inclusion of new files like lxml, django, numpy, etc.

2009-09-12 Thread joy99
On Sep 11, 10:19 pm, Robert Kern  wrote:
> On 2009-09-11 11:39 AM,joy99wrote:
>
>
>
>
>
> > Dear Group,
>
> > I am trying to download the following files,
> > a) lxml,
> > b) numpy,
> > c) scipy, and
> > d) django.
>
> > I am trying to include them in C\python26\Lib
>
> > But they are giving error report, as I am trying to use them by
> > importing.
>
> > I am using IDLE as GUI, my OS is WinXP SP2, and my Python version 2.6.
>
> > If any one suggest what is the problem, I am doing?
>
> Exactly what steps are you doing? Are you following the detailed installation
> instructions for each package? You cannot just download the packages and drop
> them into Lib. Exactly what errors are you seeing? Please copy-and-paste
> complete error messages; do not paraphrase.
>
> Do one package at a time, and write to each package's mailing list if you need
> help installing that package.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>   that is made terrible by our own mad attempt to interpret it as though it 
> had
>   an underlying truth."
>    -- Umberto Eco- Hide quoted text -
>
> - Show quoted text -

Dear Group,

The case for Django:

As I read the note for Django it says:

“How to install Django
This document will get you up and running with Django.
Install Python
Being a Python Web framework, Django requires Python.
It works with any Python version from 2.3 to 2.6….”
As Python is a prerequisite, I have already installed it and
successfully running.
The document further says, it needs a DBMS and as I am running
Python2.6 Sqllite is already installed.
It is said for the Windows system, “
1.  On Windows systems, the same result can be achieved by copying the
file django-trunk/django/bin/django-admin.py to somewhere on your
system path, for example C:\Python24\Scripts.
You don't have to run python setup.py install, because you've already
carried out the equivalent actions in steps 3 and 4.”
Now , there is a word about installing apache. Should I have to
install apache as Django is a web server.

Now, what I did.
i)  I have downloaded Django and it is a winrar file.
ii) I have extracted it to C\Python26\Lib\site-packages.
iii)I tried C\Python26\Scripts from command prompt it is coming upto
c:\python26> but as I am giving dir command or writing cd Scripts it
is giving a message “The system can not find path specified” and in
giving dir I am not seeing any Django file
iv) In IDLE when I am giving the input
IDLE 2.6
>>> from django.db import models

I am getting the following error message.

Traceback (most recent call last):
  File "", line 1, in 
from django.db import models
ImportError: No module named django.db
>>>
What is the problem I am doing?
2) lxml:
I went to the site: http://codespeak.net/lxml/installation.html and
tried to read the paragraph >>MS WINDOWS. I have run the binary
distribution for Python2.6 from the site : 
http://users.skynet.be/sbi/libxml-python/
and tried the following command on IDLE
IDLE 2.6
>>> from lxml import etree
but it is giving me the error message
Traceback (most recent call last):
  File "", line 1, in 
from lxml import etree
  File "C:\Python26\lib\lxml\etree.py", line 7, in 
__bootstrap__()
  File "C:\Python26\lib\lxml\etree.py", line 3, in __bootstrap__
import sys, pkg_resources, imp
ImportError: No module named pkg_resources
But as I give
>>> from lxml import*
it is showing no error.

Is lxml inbuilt or got installed? But why etree command is not getting
executed, then?

I am trying to send the numpy and scipy problem in detail, soon.

Best Regards,
Subhabrata.









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


Question regarding handling of Unicode data in Devnagari

2009-09-12 Thread joy99
Dear Group,

As per the standard posted by the UNICODE for the Devnagari script
used for Hindi and some other languages of India, we have a standard
set, like from the range of 0900-097F.
Where, we have numbers for each character:
like 0904 for Devnagari letter short a, etc.
Now, if write a program,

where
ch="0904"
and I like to see the Devnagari letter short a as output then how
should I proceed? Can codecs help me or should I use unicodedata?

If you can kindly help me.

Best Regards,
Subhabrata.

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


Some Machine Learning related questions

2010-11-13 Thread joy99
Dear Group,

Hope every one is fine.

I am trying to put some questions.

I am developing some tool boxes for support vector machine (SVM) and
hidden markov model (HMM).
For HMM I was following the tutorial by Leeds University Computer
Science Department, available online in HTML format, and for SVM I was
following a book on Neural Networks by Simon Haykin.

After comprehending them, I thought to cross check my knowledge with
the original works. I referred to 1989 Rabiner paper for HMM and SVM
society's tutorial for SVM.

Here, I am getting some confusions.

I am looking for a forum, especially an active forum, like this one (I
searched for few in Google, but all seem to be very lazy), where I can
post these questions.

I felt this room consists of very expert people and I visit it often
moreover it is very active -everytime I posed some question people
solved it very nicely.

If any one can suggest a solution to my queries taking his/her
valuable time, I would be grateful enough.

Thanks in advance.

Apology if it is an unrelated question of the forum.

Wishing you all a happy winter.

Best Regards,
Subhabrata.


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


Re: Some Machine Learning related questions

2010-11-13 Thread joy99
On Nov 13, 7:39 pm, joy99  wrote:
> Dear Group,
>
> Hope every one is fine.
>
> I am trying to put some questions.
>
> I am developing some tool boxes for support vector machine (SVM) and
> hidden markov model (HMM).
> For HMM I was following the tutorial by Leeds University Computer
> Science Department, available online in HTML format, and for SVM I was
> following a book on Neural Networks by Simon Haykin.
>
> After comprehending them, I thought to cross check my knowledge with
> the original works. I referred to 1989 Rabiner paper for HMM and SVM
> society's tutorial for SVM.
>
> Here, I am getting some confusions.
>
> I am looking for a forum, especially an active forum, like this one (I
> searched for few in Google, but all seem to be very lazy), where I can
> post these questions.
>
> I felt this room consists of very expert people and I visit it often
> moreover it is very active -everytime I posed some question people
> solved it very nicely.
>
> If any one can suggest a solution to my queries taking his/her
> valuable time, I would be grateful enough.
>
> Thanks in advance.
>
> Apology if it is an unrelated question of the forum.
>
> Wishing you all a happy winter.
>
> Best Regards,
> Subhabrata.

Thanx Robert,

It seems a good site.

Wishing You A Happy Day Ahead,
Best Regards,
Subhabrata.
-- 
http://mail.python.org/mailman/listinfo/python-list