Re: Help with Python Multiprocessing

2014-11-23 Thread Anurag
Hey Socha, Your solution works. But then, all my 3 workers are running in a single command window. How do I make them run in three different command windows? -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 2:22:29 PM UTC-5, Gary Herron wrote: > On 11/13/2014 10:07 AM, Anurag wrote: > > I am having trouble understanding the Multiprocessing module. > > I need to run three different files 'Worker1' , 'Worker2', 'Worker3'

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 2:18:50 PM UTC-5, sohca...@gmail.com wrote: > On Thursday, November 13, 2014 10:07:56 AM UTC-8, Anurag wrote: > > I am having trouble understanding the Multiprocessing module. > > I need to run three different files 'Worker1' , 'Worker

Re: Help with Python Multiprocessing

2014-11-13 Thread Anurag
On Thursday, November 13, 2014 1:07:56 PM UTC-5, Anurag wrote: > I am having trouble understanding the Multiprocessing module. > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > once. Currently I am doing this : > > fr

Help with Python Multiprocessing

2014-11-13 Thread Anurag
I am having trouble understanding the Multiprocessing module. I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at once. Currently I am doing this : from multiprocessing import Process import Worker1.py import Worker2.py import Worker3.py p1 = Process(target=Worker1.py)

Re: Problem adding a Key Value pair

2014-11-04 Thread Anurag Patibandla
On Tuesday, November 4, 2014 2:37:49 PM UTC-5, Anurag Patibandla wrote: > I am trying to add a key value pair of ("Priority":"1") to queue1, > ("Priority":"2") to queue2, and ("Priority":"3") to queue3. > When I just add (

Problem adding a Key Value pair

2014-11-04 Thread Anurag Patibandla
I am trying to add a key value pair of ("Priority":"1") to queue1, ("Priority":"2") to queue2, and ("Priority":"3") to queue3. When I just add ("Priority":"1") to queue1, it works. But when I run the above code, ("Priority":"3") is being added to all the queues. This looks trivial and I don't

Re: Parsing Python dictionary with multiple objects

2014-11-03 Thread Anurag Patibandla
json_split = {} value = {"Status": "Submitted", "m_Controller": "Python"} a = range(31) del a[0] for i in a: json_split[i] = value keys = json_split.keys() order = list(keys) q1 = int(round(len(keys)*0.2)) q2 = int(round(len(keys)*0.3)) q3 = int(round(len(keys)*0.5)) b = [q1,q2,q3] n=0 threedic

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
On Wednesday, October 15, 2014 1:41:13 PM UTC-4, Dave Angel wrote: > Anurag Patibandla Wrote in message: > > > Thanks for the response. > > > Here is the code that I have tried. > > > > > > from operator import itemgetter > > > keys = json.

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
On Wednesday, October 15, 2014 1:35:43 PM UTC-4, Rustom Mody wrote: > On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote: > > > Here is my sample dict if that helps: > > > > > > > > > > > > json = {"

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
Here is my sample dict if that helps: json = {"1": {"Status": "Submitted", "Startdate": ["01/01/2011"], "Enddate": ["02/02/2012"], "Job_ID": 1, "m_Quantile": "80", "m_Controller": "Python", "m_Method": "Distributed", "Allocation_3": ["50"], "Allocation_2": ["30"], "Allocation_1": ["20"], "Note"

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
On Wednesday, October 15, 2014 1:10:41 PM UTC-4, Rustom Mody wrote: > On Wednesday, October 15, 2014 10:30:49 PM UTC+5:30, Anurag Patibandla wrote: > > > keys = json.keys() > > > order = list(keys) > > > q1 = int(round(len(keys)*0.2)) > > > q2 = int(roun

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
keys = json.keys() order = list(keys) q1 = int(round(len(keys)*0.2)) q2 = int(round(len(keys)*0.3)) q3 = int(round(len(keys)*0.5)) b = [q1,q2,q3] n=0 for i in b: queues = order[n:n+i] n = n+i lists = [(queues[j], json.get(queues[j])) for j in range(len(queues))] dicts

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
keys = json.keys() order = list(keys) q1 = int(round(len(keys)*0.2)) q2 = int(round(len(keys)*0.3)) q3 = int(round(len(keys)*0.5)) b = [q1,q2,q3] n=0 for i in b: queues = order[n:n+i] n = n+i #print queues #print [(queues[j], json.get(queues[j])) for j in range(len(queues))

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
First the values printed by '[(queues[j], json.get(queues[j])) for j in range(len(queues))] ' is a list, so I tried to convert it into a dict using dict(). And then I tried doing dict[0] but there is an error which says: 'type' object has no attribute '__getitem__' -- https://mail.python.org/mail

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Anurag Patibandla
Thanks Rustom for the advice. I am new to Python and getting struck at some basic things. How do I assign the values that I am printing to 3 variables say dict1, dict2, dict3? When I try to assign them before the print statement like this: d1, d2, d3 =[(queues[j], json.get(queues[j])) for j in ran

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Anurag Patibandla
'json' has my original larger dict -- https://mail.python.org/mailman/listinfo/python-list

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Anurag Patibandla
Thanks for the response. Here is the code that I have tried. from operator import itemgetter keys = json.keys() order = list(keys) q1 = int(round(len(keys)*0.2)) q2 = int(round(len(keys)*0.3)) q3 = int(round(len(keys)*0.5)) b = [q1,q2,q3] n=0 for i in b: queues = order[n:n+i] n =

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Anurag Patibandla
On Tuesday, October 14, 2014 5:33:01 PM UTC-4, Skip Montanaro wrote: > Shuffle the keys, then grab the first 20 for one dictionary, the next 30 for > the second, and the last 50 for the third. > > Skip Could you please be more specific? -- https://mail.python.org/mailman/listinfo/python-list

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Anurag Patibandla
On Tuesday, October 14, 2014 12:59:27 PM UTC-4, Dave Angel wrote: > anuragpatiband...@gmail.com Wrote in message: > > > I have a dictionary that looks like this: > > > {"1":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"}, > > > "2":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"}, > >

Re: MySQL with Python

2012-10-15 Thread Anurag Chourasia
Don't worry about what book you have (or don't have) in your Library..And let this not dictate your technology stack. PostgreSQL is one of the popular choice and you will never be short of documentation...Just Google and you will find lot of helpful tutorials... Regards, Anurag O

Re: MySQL with Python

2012-10-15 Thread Anurag Chourasia
Yes you can. There are libraries available in python to make this happen. Read this for a starter http://dev.mysql.com/usingmysql/python/ Regards, Anurag On Oct 15, 2012 10:53 AM, "রুদ্র ব্যাণার্জী" wrote: > Dear friends, > I am starting a project of creating a database usin

Re: webapp development in pure python

2011-10-25 Thread Anurag Chourasia
Have you considered Django ? http://www.djangoproject.com/ <https://www.djangoproject.com/> Regards, Anurag On Tue, Oct 25, 2011 at 7:20 PM, Laszlo Nagy wrote: > > Hi, > > Anyone knows a framework for webapp development? I'm not talking about > javascript/html com

Re: User Authentication

2011-06-23 Thread Anurag
Regards, Anurag On Jun 23, 12:52 pm, Tim Golden wrote: > On 23/06/2011 06:02, Anurag wrote: > > > On Jun 22, 7:01 pm, Adam Tauno Williams > > wrote: > >> On Wed, 2011-06-22 at 06:34 -0700, Anurag wrote: > >>> Hi All, > > >>> I am working on

Re: User Authentication

2011-06-22 Thread Anurag
On Jun 22, 7:01 pm, Adam Tauno Williams wrote: > On Wed, 2011-06-22 at 06:34 -0700, Anurag wrote: > > Hi All, > > > I am working on application which needs to do a authentication against > > LDAP, if LDAP not installed then local system account (administrator > > us

User Authentication

2011-06-22 Thread Anurag
Hi All, I am working on application which needs to do a authentication against LDAP, if LDAP not installed then local system account (administrator user in windows and root user in Linux). This should work on both Windows and Linux. Which library I should use for that. Regards, Anurag -- http

Re: How to build an application in Django which will handle Multiple servers accross network

2011-05-02 Thread Anurag Agarwal
g that can be integrated with python and django. 4. ZenOSS - It is for managing some IP based devices on network.. I don't know how it will help me. Please give me some ideas on python even it needs some development effort. Regards, Anurag On Apr 29, 5:21 pm, Adam Tauno Williams wrote: &g

How to build an application in Django which will handle Multiple servers accross network

2011-04-28 Thread Anurag (anu) Agarwal
graphs I should use with Django (open source + paid) If you guys can help me in desiging a very high level Architecture of this application. Thanks for reading so long. Please help me in this. If I am not clear on something then please write back. Thanks & Regards, Anurag -- http://mail.python

Re: Connecting to remote Oracle db via Python

2011-02-17 Thread Anurag Chourasia
Apart from that, you could also use a shorter format which is a correction over what you were trying with earlier. Here.. uid = "scott" pwd = "tiger" service = "//10.5.1.12:1521/PR10" db = cx_Oracle.connect(uid + "/" + pwd + "@" + service)

Re: Connecting to remote Oracle db via Python

2011-02-17 Thread Anurag Chourasia
Try this please and it should work. Connection_String = 'scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.1.12)(PORT=1521)))(CONNECT_DATA=(SID=PR10)))' db = cx_Oracle.connect(Connection_String) I'm sorry i missed a bracket there. Regards, Anurag On Th

Re: Connecting to remote Oracle db via Python

2011-02-17 Thread Anurag Chourasia
Could you try by using a connecting string in the standard format as below? Connection_String = 'scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.1.12(PORT=1521)))(CONNECT_DATA=(SID=PR10)))' db = cx_Oracle.connect(Connection_String) Regards, Anurag On Thu, Fe

Re: FTP problem

2011-01-14 Thread Anurag Chourasia
Please make the below change to get past this problem Change *ftp.*indexftp.barcap.com to indexftp.barcap.com Regards, Anurag On Fri, Jan 14, 2011 at 5:25 PM, Thomas Philips wrote: > I'm using ftplib for the first time, and am having trouble getting it > to work. I type > >

Re: Digitally Signing a XML Document (using SHA1+RSA or SHA1+DSA)

2010-12-28 Thread Anurag Chourasia
something else out there that could help meet my requirement. Regards, Anurag On Tue, Dec 28, 2010 at 6:36 AM, Adam Tauno Williams wrote: > On Tue, 2010-12-28 at 03:25 +0530, Anurag Chourasia wrote: > > Hi All, > > > I have a requirement to digitally sign a XML Document using SH

Digitally Signing a XML Document (using SHA1+RSA or SHA1+DSA)

2010-12-27 Thread Anurag Chourasia
/documentation that I could utilize. Thanks a lot for your help. Regards, Anurag -- http://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2010-12-22 Thread Anurag Chourasia
if 5 in A: ... print 'Yes' ... else: ... print 'No' ... Yes >>> Regards, Anurag On Thu, Dec 23, 2010 at 6:52 AM, Maurice Shih wrote: > Dear python-list@python.org, > Thank you for taking the time to listen to my request. I'm a beginner > programmer and

Re: using python ftp

2010-12-22 Thread Anurag Chourasia
cwd(remote_directory) files_list=glob.glob(file_search_pattern) for file in files_list: try: ftp.storlines('STOR ' + file, open(file)) except Exception, e: print ('Failed to FTP file: %s' %(file)) ftp.close() Regards, Anurag On Thu, Dec 23, 2010 at 5:

Re: Sending XML to a WEB Service and Getting Response Back

2010-12-21 Thread Anurag Chourasia
l.sax._exceptions.SAXParseException: :1:62: syntax error >>> [3] + Stopped (SIGTSTP)python This seems to be a old problem passing versions. Regards, Anurag On Wed, Dec 22, 2010 at 12:40 AM, John Nagle wrote: > On 12/20/2010 11:45 PM, Ian Kelly wrote: >> >> On 12/2

Re: **** httplib.InvalidURL: nonnumeric port ****

2010-12-20 Thread Anurag Chourasia
port: '8041/DteEnLinea/ws/EnvioGuia.jws' Do i need to use some other library to be able to send XML Data (and get a response back) to this Kind of Web Service address i.e. http://joule:8041/DteEnLinea/ws/EnvioGuia.jws ? Regards, Anurag On Tue, Dec 21, 2010 at 12:42 AM, Kev Dwyer wrote

Sending XML to a WEB Service and Getting Response Back

2010-12-20 Thread Anurag Chourasia
operations: sendNCR This web service has no callbacks. I have pasted the complete WSDL for this WEB Service below my email. I would appreciate if someone could guide me with sample code using a Python Library suitable to fulfill this requirement of mine. Regards, Anurag http://www.openuri.org

**** httplib.InvalidURL: nonnumeric port ****

2010-12-20 Thread Anurag Chourasia
i/wm/python241/lib/python2.4/httplib.py", line 594, in _set_hostport raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) httplib.InvalidURL: nonnumeric port: '8041/DteEnLinea/ws/EnvioGuia.jws' How could we avoid this problem? Regards, Anurag -- http://mail.python.org/mailman/listinfo/python-list

***locale.Error: unsupported locale setting***

2010-12-09 Thread Anurag Chourasia
gt;>> import locale >>> locale.setlocale(locale.LC_ALL, 'en_US') 'en_US' >>> locale.format("%d", 1255000, grouping=True) '1,255,000' Regards, Anurag -- http://mail.python.org/mailman/listinfo/python-list

Python make fails with error "Fatal Python error: Interpreter not initialized (version mismatch?)"

2010-11-27 Thread Anurag Chourasia
Hi All, During the make step of python, I am encountering a weird error. This is on AIX 5.3 using gcc as the compiler. My configuration options are as follows ./configure --enable-shared --disable-ipv6 --with-gcc=gcc CPPFLAGS="-I /opt/freeware/include -I /opt/freeware/include/readline -I /opt/fr

Re: AIX 5.3 - Enabling Shared Library Support Vs Extensions

2010-11-27 Thread Anurag Chourasia
ov 25, 2010 at 3:41 PM, Stefan Krah wrote: > Anurag Chourasia wrote: > > When I configure python to enable shared libraries, none of the > extensions are getting built during the make step due to this error. > > > > building 'cStringIO' extension > > gcc -pth

AIX 5.3 - Enabling Shared Library Support Vs Extensions

2010-11-25 Thread Anurag Chourasia
lease guide me in getting past this error. Thanks for your help on this. Regards, Anurag -- http://mail.python.org/mailman/listinfo/python-list

collect2: library libpython2.6 not found while building extensions (--enable-shared)

2010-11-24 Thread Anurag Chourasia
lease guide me in getting past this error. Thanks for your help on this. Regards, Anurag -- http://mail.python.org/mailman/listinfo/python-list

Error Starting Python(Django) App using Apache+Mod_Wsgi

2010-11-22 Thread Anurag Chourasia
All, I have a problem in starting my Python(Django) App using Apache and Mod_Wsgi I am using Django 1.2.3 and Python 2.6.6 running on Apache 2.2.17 with Mod_Wsgi 3.3 When I try to access the app from Web Browser, I am getting these errors. [Mon Nov 22 09:45:25 2010] [notice] Apache/2.2.17 (Unix

Re: using subprocess module in Python CGI

2009-01-08 Thread ANURAG BAGARIA
submitted as input tar file. Thanking you once again for your valuable time. Regards. On Wed, Dec 24, 2008 at 1:54 AM, Matt Nordhoff wrote: > ANURAG BAGARIA wrote: > > Hello, > > > > I am a Python Newbie and would like to call a short python script via > > brow

Re: using subprocess module in Python CGI

2008-12-23 Thread ANURAG BAGARIA
no 2] No such file or directory Looking forward to any kind of help or suggestion in this regard. Thanks. On Tue, Dec 23, 2008 at 7:00 AM, Chris Rebert wrote: > On Mon, Dec 22, 2008 at 2:02 AM, ANURAG BAGARIA > wrote: > > Hello, > > > > I am a Python Newbie and would like

using subprocess module in Python CGI

2008-12-22 Thread ANURAG BAGARIA
Hello, I am a Python Newbie and would like to call a short python script via browser using a CGI script, but initially I am trying to call the same python script directly through python command line. The script intends to perform a few command line in a pipe and I have written the script (a short

Re: Iteration for Factorials

2007-10-30 Thread Anurag
What about this no map, reduce, mutiplication or even addition Its truly interative and You will need to interate till infinity if you want correct answer ;) def factorial(N): """ Increase I ...and go on increasing... """ import random myNumer = range(N) count = 0 I =

Re: tarfile...bug?

2007-10-09 Thread Anurag
Hi, Have any one faced such problem, I assume it must be common if it can be replicated so easily , or something wrong with my system Also if I use tar.members instead of tar.getmembers() it works so what is the diff. between tar.members and tar.getmembers() rgds Anurag -- http

tarfile...bug?

2007-10-09 Thread Anurag
python Python 2.4.3 import tarfile bigFilePath = "/tmp/bigFile" bigFileTGZ = "/tmp/big.tar.gz" # create a big file print "Creating big file...",bigFilePath f = open(bigFilePath,"w") for i in xrange(100): f.write("anurag"*1024*1024) f.clos

Re: marshal bug?

2007-09-28 Thread Anurag
Thanks for the reply. It seems problem is due to """ Any string in Python can be "interned" or not, the difference being how/where the value is stored internally. The marshal module includes such information in its output. What you are doing is probably considered a misuse of the marshal module.

marshal bug?

2007-09-27 Thread Anurag
123) marshal.dumps(s) != marshal.dumps(marshal.loads(marshal.dumps(s))) rgds Anurag -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-26 Thread Anurag
ownloder script and it doesn't have '+' operator lets remove it! -Anurag -- http://mail.python.org/mailman/listinfo/python-list