Logical Query JSON

2015-07-30 Thread subhabrata . banerji
Dear Group, I am trying to query JSON with Logical operators. I tried to experiment lot with it, but could not do much. I came many times pretty close but missed it almost. I tried to experiment with json, jsonquery, jsonschema, jsonpipe, objectpath, requests. I got a good example from

Logical Query in Python

2015-07-30 Thread subhabrata . banerji
Dear Group, I am trying to query JSON with Logical operators. I tried to experiment lot with it, but could not do much. I came many times pretty close but missed it almost. I tried to experiment with json, jsonquery, jsonschema, jsonpipe, objectpath, requests. I got a good example from

Re: Logical Query JSON

2015-07-30 Thread subhabrata . banerji
On Thursday, July 30, 2015 at 9:20:35 PM UTC+5:30, Denis McMahon wrote: On Thu, 30 Jul 2015 06:32:01 -0700, subhabrata.banerji wrote: I am trying to query JSON with Logical operators. Your post was an excellent example of asking for help without explaining what your problem was at all.

Re: Logical Query in Python

2015-07-30 Thread subhabrata . banerji
On Thursday, July 30, 2015 at 8:35:08 PM UTC+5:30, Steven D'Aprano wrote: On Thu, 30 Jul 2015 11:28 pm, wrote: Dear Group, I am trying to query JSON with Logical operators. What does that mean? I tried to experiment lot with it, but could not do much. I came many times pretty

How may I learn Python Web Frameworks

2015-07-24 Thread subhabrata . banerji
Dear Group, I am slightly new in Python Web Frameworks. I could learn bit of Django, Flask and Bottle. But I am looking for a good web based tutorial like Python or NLTK. Somehow, I did not find documentations for web frameworks are very good, one has to do lot of experiments even to learn

Search in Flask Restful

2015-07-23 Thread subhabrata . banerji
Dear Group, I am trying to build one REST framework using Restful Flask. To put or get I am trying to use the requests module, as given in the following lines. var2=requests.put('http://127.0.0.1:5000/todos/todo1', data={'task': 'It is my challenge'})

File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
Dear Group, I am trying to learn Rest framework through Restful Flask. My initial exercises went fine with https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html Now I want to upload file through Restful Flask. I tried to check the web for reference. I got these urls, (i)

Re: File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
, Subhabrata Banerji -- https://mail.python.org/mailman/listinfo/python-list

Re: File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
= requests.post(url, files=files) r.text u'{\nmessage: Method Not Allowed, \nstatus: 405\n}\n' Regards, Subhabrata Banerji OK, so that message is telling you that whatever server is sitting behind 127.0.0.1 is not allowing you (your code) to POST to it. There are many reasons

Combing Search Engine with REST

2015-07-10 Thread subhabrata . banerji
Dear Group, I am trying to make a search engine. I used Whoosh to do it. I want to add documents to it. This is going fine. Now, I want to add documents in the index with REST framework. I could learn Flask well. My task is to use Flask to add documents (by using put/post) to index. I am

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 6:50:48 PM UTC+5:30, Chris Angelico wrote: On Wed, Jun 17, 2015 at 11:10 PM, wrote: Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux has Python builtin but in Non

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote: On Wed, Jun 17, 2015 at 1:17 AM, wrote: Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code, import sys sys.stderr = sys.stdout class

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 7:25:39 PM UTC+5:30, Laura Creighton wrote: In a message of Wed, 17 Jun 2015 06:10:45 -0700, w rites: Dear Group, Thank you all. It seems going fine now. I have one additional question if I run the .exe files created in Non Python Windows environment. Linux

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice. But if I try to make exe for

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 7:47:59 PM UTC+5:30, rand...@fastmail.us wrote: On Wed, Jun 17, 2015, at 09:33, hamilton wrote: However, the python source can be read by anyone. As a .exe, the source can not be read. Just because the interpreter is open source, does not mean my

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 8:52:16 PM UTC+5:30, Laura Creighton wrote: In a message of Wed, 17 Jun 2015 07:16:33 -0700, w rites: On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, wrote: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around

Re: Creating .exe file in Python

2015-06-17 Thread subhabrata . banerji
On Wednesday, June 17, 2015 at 9:09:32 PM UTC+5:30, Steven D'Aprano wrote: On Wed, 17 Jun 2015 11:52 pm, Chris Angelico wrote: If you truly want to protect your code from prying eyes, therefore, there's only one way to do it: host it on a server, and let people access the server without

Re: Creating .exe file in Python

2015-06-16 Thread subhabrata . banerji
On Monday, June 15, 2015 at 9:59:33 PM UTC+5:30, Laura Creighton wrote: I don't have a windows system, so my knowledge of such things is minimal. But looks like this person had the same problem you have, and got some suggestions on how to fix it.

Re: Creating .exe file in Python

2015-06-16 Thread subhabrata . banerji
On Tuesday, June 16, 2015 at 8:35:39 PM UTC+5:30, Laura Creighton wrote: In a message of Tue, 16 Jun 2015 06:56:12 -0700, writes: ii) In a class how may I include if __name__ == __main__: with multiple methods? But I think this is easy question there should be lot of web help. If anyone

Re: Creating .exe file in Python

2015-06-16 Thread subhabrata . banerji
On Tuesday, June 16, 2015 at 9:33:58 PM UTC+5:30, Chris Angelico wrote: On Wed, Jun 17, 2015 at 1:17 AM, wrote: Thanks. The scipy issue seems solved. But this silly issue is giving so much of time. I am checking. Please see a sample code, import sys sys.stderr = sys.stdout class

Re: Creating .exe file in Python

2015-06-16 Thread subhabrata . banerji
On Monday, June 15, 2015 at 9:59:33 PM UTC+5:30, Laura Creighton wrote: I don't have a windows system, so my knowledge of such things is minimal. But looks like this person had the same problem you have, and got some suggestions on how to fix it.

Creating .exe file in Python

2015-06-15 Thread subhabrata . banerji
Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice. But if I try to make exe for larger programs with methods and classes I am getting error. If any one of the esteemed

Re: Creating .exe file in Python

2015-06-15 Thread subhabrata . banerji
On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice. But if I try to make exe for

Re: Creating .exe file in Python

2015-06-15 Thread subhabrata . banerji
On Monday, June 15, 2015 at 6:32:33 PM UTC+5:30, Laura Creighton wrote: In a message of Mon, 15 Jun 2015 04:42:09 -0700, w rites: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample

Re: Creating .exe file in Python

2015-06-15 Thread subhabrata . banerji
On Monday, June 15, 2015 at 8:02:21 PM UTC+5:30, Thierry Chappuis wrote: Hi, The question is why to you want to create an exe from your python project? Setuptools is capable to create small .exe launchers in the Scripts dir of your python install. These launchers start a python script

Re: Creating .exe file in Python

2015-06-15 Thread subhabrata . banerji
On Monday, June 15, 2015 at 5:12:24 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program went nice. But if I try to make exe for

Re: How may I Integrate Python Code with REST

2015-06-13 Thread subhabrata . banerji
On Saturday, June 13, 2015 at 2:17:43 AM UTC+5:30, Laura Creighton wrote: In a message of Fri, 12 Jun 2015 10:52:19 -0700, w rites: Dear Group, I wrote a Python code. In the code there are two modules where we may insert data from outside. They are updating some training module and

How may I Integrate Python Code with REST

2015-06-12 Thread subhabrata . banerji
Dear Group, I wrote a Python code. In the code there are two modules where we may insert data from outside. They are updating some training module and updating index. As a standalone code this is working fine. I need to port this code to REST. I tried to learn Flask. My Practice for Flask is

Error in or

2015-06-11 Thread subhabrata . banerji
Dear Group, In the following script, inp1=raw_input(PRINT YOUR INPUT:) if (AND in inp1) or (OR in inp1) or (NOT in inp1) or ( in inp1) or ( in inp1) or (MAYBE in inp1) or (( in inp1) or (* in inp1): if write this it is working fine, but if I write if (AND in inp1) or (OR in

Re: Error in or

2015-06-11 Thread subhabrata . banerji
On Thursday, June 11, 2015 at 9:20:59 PM UTC+5:30, Ian wrote: On Thu, Jun 11, 2015 at 9:40 AM, if write this it is working fine, but if I write if (AND in inp1) or (OR in inp1) or (NOT in inp1) or ( in inp1) or ( in inp1) or (MAYBE in inp1) or (( in inp1) or (* in inp1) or ('''

Re: Error in or

2015-06-11 Thread subhabrata . banerji
On Thursday, June 11, 2015 at 10:18:33 PM UTC+5:30, Ian wrote: On Thu, Jun 11, 2015 at 10:39 AM, wrote: On Thursday, June 11, 2015 at 9:20:59 PM UTC+5:30, Ian wrote: On Thu, Jun 11, 2015 at 9:40 AM, if write this it is working fine, but if I write if (AND in inp1) or (OR in

Model Dumping Pickle

2015-05-30 Thread subhabrata . banerji
Dear Group, If I use pickle to dump my model as follows, from gensim.models import Word2Vec from nltk.corpus import brown, movie_reviews, treebank b = Word2Vec(brown.sents()) import pickle f = open('my_classifier5.pickle', 'wb') pickle.dump(b, f) f.close() f1=

Inverted Comma Search

2015-05-29 Thread subhabrata . banerji
Dear Group, I am trying to implement two searches, inverted comma search and search within brackets. I am trying to implement them in Whoosh, but not finding good tutorial or examples. If any one may kindly help me with. Regards, Subhabrata Banerjee. --

REST framework Editor in Python

2015-05-20 Thread subhabrata . banerji
Dear Group, I am trying to put one search engine interface in REST. To do this I am trying to learn Restframework and Django. One question occurred to me is, whether there is any Restframework editor which may do this job. Is there any? I was trying to find out

Re: Flask Post returning error

2015-05-19 Thread subhabrata . banerji
On Tuesday, May 19, 2015 at 10:34:35 AM UTC+5:30, Miki Tebeka wrote: If anyone may kindly suggest what is the error I am doing. It's close to impossible to know without seeing the server side code. Dear Sir, I am trying to paste the code from: from flask import Flask from flask_restful

Flask Post returning error

2015-05-18 Thread subhabrata . banerji
Dear Group, I am trying to practice Flask and trying to correspond with it with through requests. I am being able to DELETE, GET. But as I am doing POST it is not posting the data rather returning null. I tried to search Flask and requests tutorials but did not get much. I am newly

Integrating Python Code with Django

2015-05-13 Thread subhabrata . banerji
Dear Group, I am trying to learn Django. My initial exercise seems fine. I want to create an API with REST on Django for an interactive Python code. REST framework on Django I am understanding more or less. I am looking for a simple example to start with. I am using Python 2.7+ on MS-Windows

IDLE Restoration

2015-05-08 Thread subhabrata . banerji
Dear Group, In many applications there is a facility to restore its previous sessions, especially if they close accidentally. Does IDLE have any such facility? If it is there, how may I use it? If someone may kindly suggest it. Regards, Subhabrata Banerjee. --

Re: Fast way of extracting files from various folders

2015-05-02 Thread subhabrata . banerji
On Saturday, May 2, 2015 at 2:52:32 PM UTC+5:30, Peter Otten wrote: wrote: I have several millions of documents in several folders and subfolders in my machine. I tried to write a script as follows, to extract all the .doc files and to convert them in text, but it seems it is taking too

Problem in Handling MySql Data.

2015-05-02 Thread subhabrata . banerji
Dear Group, I am trying to write the following script to call around 0.3 million files from a remote server. It is generally working fine, but could work only upto 65 to 70 files. After this, it is just printing the file names and not processing anything. If anyone may kindly suggest what I

Re: Fast way of extracting files from various folders

2015-05-02 Thread subhabrata . banerji
On Friday, May 1, 2015 at 5:58:50 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I have several millions of documents in several folders and subfolders in my machine. I tried to write a script as follows, to extract all the .doc files and to convert them in text, but it seems it

Fast way of extracting files from various folders

2015-05-01 Thread subhabrata . banerji
Dear Group, I have several millions of documents in several folders and subfolders in my machine. I tried to write a script as follows, to extract all the .doc files and to convert them in text, but it seems it is taking too much of time. import os from fnmatch import fnmatch import

Accessing file from Remote location

2015-04-29 Thread subhabrata . banerji
Dear Group, I have a good amount of data in a remote location. It is in MySql Database. I am trying to access it as, import pymysql import pymysql.cursors ... ... with connection.cursor() as cursor: # Read a single record sql = SELECT candidateid,cnd.FirstName,

Boolean Operator Confusion

2015-04-24 Thread subhabrata . banerji
Dear Group, I am trying to understand the use of Boolean operator in Python. I am trying to write small piece of script, as follows, def input_test(): str1=raw_input(PRINT QUERY:) if AND or OR or NOT in str1: print It is a Boolean Query elif AND or OR or

Re: Boolean Operator Confusion

2015-04-24 Thread subhabrata . banerji
On Friday, April 24, 2015 at 8:45:04 PM UTC+5:30, Steven D'Aprano wrote: On Sat, 25 Apr 2015 12:50 am,wrote: Dear Group, I am trying to understand the use of Boolean operator in Python. I am trying to write small piece of script, as follows, def input_test():

Boolean Search using Strings

2015-04-23 Thread subhabrata . banerji
Dear Group, I want to do the Boolean search over various sentences or documents. I do not want to use special programs like Whoosh, etc. May I use any other parser? If anybody may kindly let me know. Regards, Subhabrata Banerjee. -- https://mail.python.org/mailman/listinfo/python-list

Re: May I drop list bracket from list?

2015-04-23 Thread subhabrata . banerji
On Thursday, April 23, 2015 at 3:57:28 PM UTC+5:30, Peter Otten wrote: Dear Group, I am trying to read a list of files as list_of_files = glob.glob('C:\Python27\*.*') Now I am trying to read each one of them, convert into list of words, and append to a list as. list1=[]

May I drop list bracket from list?

2015-04-23 Thread subhabrata . banerji
Dear Group, I am trying to read a list of files as list_of_files = glob.glob('C:\Python27\*.*') Now I am trying to read each one of them, convert into list of words, and append to a list as. list1=[] for file in list_of_files: print file fread1=open(file,r).read()

Re: Opening Multiple files at one time

2015-04-22 Thread subhabrata . banerji
On Monday, April 20, 2015 at 5:30:15 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I am trying to open multiple files at one time. I am trying to do it as, for item in [ one, two, three ]: f = open (item + world.txt, w) f.close() This is fine. But I was

A question on the creation of list of lists

2015-04-22 Thread subhabrata . banerji
Dear Group, I am trying to open a bunch of files from a directory and trying to put the results in list of lists that is to say, that is to say, I have a list of file names of a directory, I want to read each one of them. After reading each one of them, I want to put the results of each file

Re: A question on the creation of list of lists

2015-04-22 Thread subhabrata . banerji
On Wednesday, April 22, 2015 at 9:48:44 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I am trying to open a bunch of files from a directory and trying to put the results in list of lists that is to say, that is to say, I have a list of file names of a directory, I want to read

Re: Opening Multiple files at one time

2015-04-21 Thread subhabrata . banerji
On Tuesday, April 21, 2015 at 4:20:16 AM UTC+5:30, Dave Angel wrote: On 04/20/2015 07:59 AM, wrote: Dear Group, I am trying to open multiple files at one time. I am trying to do it as, for item in [ one, two, three ]: f = open (item + world.txt, w) f.close()

Opening Multiple files at one time

2015-04-20 Thread subhabrata . banerji
Dear Group, I am trying to open multiple files at one time. I am trying to do it as, for item in [ one, two, three ]: f = open (item + world.txt, w) f.close() This is fine. But I was looking if I do not know the number of text files I would create beforehand, so not trying

Converting text file to different encoding.

2015-04-17 Thread subhabrata . banerji
I am having few files in default encoding. I wanted to change their encodings, preferably in UTF-8, or may be from one encoding to any other encoding. I was trying it as follows, import codecs sourceEncoding = iso-8859-1 targetEncoding = utf-8 source = open(source1,w)

Re: Converting text file to different encoding.

2015-04-17 Thread subhabrata . banerji
On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, subhabrat...@gmail.com wrote: I am having few files in default encoding. I wanted to change their encodings, preferably in UTF-8, or may be from one encoding to any other encoding. I was trying it as follows, import codecs

Re: Converting text file to different encoding.

2015-04-17 Thread subhabrata . banerji
On Friday, April 17, 2015 at 7:36:46 PM UTC+5:30, Oscar Benjamin wrote: wrote: On Friday, April 17, 2015 at 6:50:08 PM UTC+5:30, wrote: I am having few files in default encoding. I wanted to change their encodings, preferably in UTF-8, or may be from one encoding to any other encoding.

Re: How to convert .doc file to .txt in Python

2015-04-09 Thread subhabrata . banerji
On Thursday, April 9, 2015 at 4:23:55 PM UTC+5:30, Tim Golden wrote: On 09/04/2015 11:25, wrote: Dear Group, I was trying to convert .doc file to .txt file. I got of python-docx, zipfile but they do not seem to help me much. You may kindly suggest how to convert from .doc to

Re: How to convert .doc file to .txt in Python

2015-04-09 Thread subhabrata . banerji
On Thursday, April 9, 2015 at 3:56:09 PM UTC+5:30, subhabrat...@gmail.com wrote: Dear Group, I was trying to convert .doc file to .txt file. I got of python-docx, zipfile but they do not seem to help me much. You may kindly suggest how to convert from .doc to .docx/.html/.pdf/.rtf as

How to convert .doc file to .txt in Python

2015-04-09 Thread subhabrata . banerji
Dear Group, I was trying to convert .doc file to .txt file. I got of python-docx, zipfile but they do not seem to help me much. You may kindly suggest how to convert from .doc to .docx/.html/.pdf/.rtf as from them I am being able to convert to .txt. If any one of the Python experts may

How to handle file in Whoosh?

2015-03-31 Thread subhabrata . banerji
I am trying to build a search engine, I started with Whoosh. The tutorial and web based materials are fine. Web has sizable question and answers. The initial experiments seem going fine. But I want to handle files located in various parts of my machine. I found from whoosh.filedb.filestore

Enthought Canopy

2015-03-19 Thread subhabrata . banerji
Hi, I was trying to download Python2.7 in a new machine. I found Python2.7.9. I tried to install few libraries like Numpy, Sympy, Scipy, NLTK etc. I was trying to use http://www.lfd.uci.edu/~gohlke/pythonlibs/ to download the libraries. Initially there were some problems to download Numpy.