Re: PUT with proxy-support

2011-08-26 Thread Shashwat Anand
On Fri, Aug 26, 2011 at 3:15 PM, Laszlo Nagy gand...@shopzeus.com wrote: Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2ZCa8v/**pycurl-7.19.0/egg-dist-tmp-**DyHFls Using curl-config (libcurl 7.12.1) src/pycurl.c:42:20: Python.h: No such file or directory

PUT with proxy-support

2011-08-25 Thread Shashwat Anand
I want to make a PUT request. I need some headers of my own ( certificates etc ) and I need to mandatorily use a proxy. Also the url is of the form http://www.xyz.com/abc and I don't have permission to put data on http://www.xyz.com while I do have permission to put data on http://www.xyz.com/abc

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
On Thu, Aug 25, 2011 at 4:48 PM, Thomas Jollans t...@jollybox.de wrote: On 25/08/11 13:07, Shashwat Anand wrote: I want to make a PUT request. I need some headers of my own ( certificates etc ) and I need to mandatorily use a proxy. Also the url is of the form http://www.xyz.com/abc

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
certificates in headers. Did not managed to find all of it. Am not sure is supports REST calls with proxy support. Sent from my iPhone On Aug 25, 2011, at 7:07, Shashwat Anand anand.shash...@gmail.com wrote: I want to make a PUT request. I need some headers of my own ( certificates etc ) and I need

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
On Thu, Aug 25, 2011 at 5:22 PM, Laszlo Nagy gand...@shopzeus.com wrote: ** I tried httplib, httplib2, urllib2 with no avail. I managed to do this via command line curl: $ curl http:/xyz.com/testing/shashwat/test.txt -T test.txt -H sw-version: 1.0 -H

Re: Refactor/Rewrite Perl code in Python

2011-07-25 Thread Shashwat Anand
Thanks everyone for the insight. I got the idea as to how and where to start. Guess I need to work in Perl for now, so as to start the conversion process. Regarding Tests, I had already started writing tests before posting. Writing tests for every module will be a pain as well as a nice

Refactor/Rewrite Perl code in Python

2011-07-24 Thread Shashwat Anand
I am working with a huge codebase of Perl. The code have zero documentation and zero unit-tests. It seems like a huge hack. The underlying database schema is horrid. So I want to rewrite the whole of it in Python. How do I start ? The idea is to rewrite module by module. But how to make sure

[issue8252] add a metadata section in setup.cfg

2011-04-03 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: -l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8252 ___ ___ Python-bugs-list

[issue8253] add a resource+files section in setup.cfg

2011-04-03 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: -l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8253 ___ ___ Python-bugs-list

[issue4487] Add utf8 alias for email charsets

2011-04-03 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: -l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4487 ___ ___ Python-bugs-list

Re: Init a dictionary with a empty lists

2011-02-05 Thread Shashwat Anand
On Sat, Feb 5, 2011 at 6:38 PM, Lisa Fritz Barry Griffin lisaochba...@gmail.com wrote: Hi there, How can I do this in a one liner: maxCountPerPhraseWordLength = {} for i in range(1,MAX_PHRASES_LENGTH+1): maxCountPerPhraseWordLength[i] = 0

[issue8013] time.asctime segfaults when given a time in the far future

2011-01-02 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: -l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8013 ___ ___ Python-bugs-list

[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-02 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: -l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list

Language Detection Library/Code

2010-12-27 Thread Shashwat Anand
Can anyone suggest a *language detection library* in python which works on a phrase of say 2-5 words. -- ~l0nwlf -- http://mail.python.org/mailman/listinfo/python-list

Re: Language Detection Library/Code

2010-12-27 Thread Shashwat Anand
On Tue, Dec 28, 2010 at 6:03 AM, Katie T ka...@coderstack.co.uk wrote: On Mon, Dec 27, 2010 at 7:10 PM, Shashwat Anand anand.shash...@gmail.com wrote: Can anyone suggest a language detection library in python which works on a phrase of say 2-5 words. Generally such libraries work by bi

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Shashwat Anand
On Fri, Nov 5, 2010 at 7:26 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Fri, Nov 5, 2010 at 2:43 PM, Matty Sarro msa...@gmail.com wrote: Hey Everyone, Just curious - I'm working on a program which includes a calculation of a circle, and I found myself trying to use

Problem with mechanize redirect

2010-10-16 Thread Shashwat Anand
I was trying some sort of timed programming challenges which require getting the value from url and auto-posting. Here is what I was doing - http://securityoverride.com/challenges/programming/10/index.php Here is the content : In order to complete Programming Challenge 10, you must code a script

Re: list problem...

2010-09-29 Thread Shashwat Anand
On Thu, Sep 30, 2010 at 3:20 AM, Rog r...@pynguins.com wrote: On Wed, 29 Sep 2010 05:52:32 -0700, bruno.desthuilli...@gmail.com wrote: On 29 sep, 14:17, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: On Tue, 28 Sep 2010

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 12:14 AM, Rog r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6,.] Basicly I am trying to place a[0], b[0] in a seperate list IF a[2] and b[2] is present. You are not exactly clear with

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 1:15 AM, rog r...@pynguins.com wrote: Shashwat Anand wrote: On Wed, Sep 29, 2010 at 12:14 AM, Rog r...@pynguins.com mailto: r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6

Re: Python2.7 on OSX

2010-09-25 Thread Shashwat Anand
On Sun, Sep 26, 2010 at 12:32 AM, Jonas Galvez jo...@codeazur.com.brwrote: Just installed Python2.7 on my OSX Leopard with make altinstall. No missing dependencies, but I have one annoying problem: the delete key prints '^H' on the Python shell. Does anyone know how to fix that? Thanks in

Re: Python autocomplete module

2010-09-16 Thread Shashwat Anand
On Thu, Sep 16, 2010 at 5:34 PM, dusans dusan.smit...@gmail.com wrote: Is there a python module to make autocomplete suggestion easy. Try 'rlcompleter' module. Though I haven't tried it myself, just used it in .pythonrc for auto-completion in intepretor mode.

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Shashwat Anand
On Tue, Sep 14, 2010 at 7:54 PM, Gregory Ewing greg.ew...@canterbury.ac.nzwrote: Suppose I have two N+2 dimensional arrays, representing N-d arrays of 2-d matrices. I want to perform matrix multiplication between corresponding matrices in these arrays. I had thought that dot() might do

Re: compare dictionaries

2010-09-07 Thread Shashwat Anand
On Wed, Sep 8, 2010 at 1:56 AM, Baba raoul...@gmail.com wrote: On 7 sep, 22:08, Gary Herron gher...@digipen.edu wrote: On 09/07/2010 12:46 PM, Baba wrote: word= 'even' dict2 = {'i': 1, 'n': 1, 'e': 1, 'l': 2, 'v': 2} Just go through each letter of word checking for its existence in

Re: Reversing a List

2010-09-01 Thread Shashwat Anand
On Wed, Sep 1, 2010 at 6:45 PM, Matt Saxton m...@scotweb.co.uk wrote: On Wed, 1 Sep 2010 09:00:03 -0400 Victor Subervi victorsube...@gmail.com wrote: Hi; I have this code: cursor.execute('describe products;') cols = [item[0] for item in cursor] cols = cols.reverse()

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Shashwat Anand
On Wed, Sep 1, 2010 at 12:27 AM, Alban Nona python.k...@gmail.com wrote: Hi all, Im stuck on this problem: I have a function which return me a list of string (basically the result looks like: [FN067_098_MEN, FN067_098_JIN, FN067_098_BG] In other hand, I have another list full of that kind

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Shashwat Anand
On Tue, Aug 31, 2010 at 9:12 PM, pyt...@bdurham.com wrote: I'm parsing a simple, domain specific scripting language that has commands like the following: *page, *title, *text, *footer, etc. There are about 100 of these '*' commands. When we see a command that we don't recognize, I would like

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Shashwat Anand
On Wed, Sep 1, 2010 at 2:31 AM, Joel Goldstick joel.goldst...@columbuswebmakers.com wrote: pyt...@bdurham.com wrote: I'm parsing a simple, domain specific scripting language that has commands like the following: *page, *title, *text, *footer, etc. There are about 100 of these '*' commands.

Re: Source code for itertools

2010-08-30 Thread Shashwat Anand
On Tue, Aug 31, 2010 at 7:30 AM, vsoler vicente.so...@gmail.com wrote: I'm interested in studying the itertools source code, especially the permutations function. However, I cannot find the library. Where could I find it? Running Python 3.1 Thank you Either you can download it or browse

Re: freq function

2010-08-22 Thread Shashwat Anand
On Sun, Aug 22, 2010 at 1:31 PM, Dirk Nachbar dirk...@gmail.com wrote: Here is a function which takes any list and creates a freq table, which can be printed unsorted, sorted by cases or items. It's supposed to mirror the proc freq in SAS. Dirk def freq(seq,order='unsorted',prin=True):

[issue747320] rfc2822 formatdate functionality duplication

2010-08-18 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue747320 ___ ___ Python-bugs-list

Re: how to change a string into dictionary

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:03 PM, aimeixu aime...@amazon.com wrote: Hi, I am newbie for python ,Here is my question: a = {'a':'1','b':'2'} how to change a into a dictionary ,says, a = {'a':'1','b':'2'} Thanks a lot .Really need help. Parse the string and re-create the dictionary. s =

Re: simple renaming files program

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:14 PM, blur959 blur...@hotmail.com wrote: Hi, all, I am working on a simple program that renames files based on the directory the user gives, the names the user searched and the names the user want to replace. However, I encounter some problems. When I try running the

Re: Performance ordered dictionary vs normal dictionary

2010-07-29 Thread Shashwat Anand
It depends on the problem. A dictionary is a hash table. An ordered dictionary is a binary search tree (BST). Those are different data structures. The main things to note is that: - Access is best-case O(1) for the hash table and O(log n) for the BST. - Worst case behavior is for

Re: rstrip()

2010-07-16 Thread Shashwat Anand
On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman ja...@powerpull.netwrote: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. x.vsd-dir.rstrip(-dir) 'x.vs' I expected 'x.vsd' as a return value.

Re: nicer way to remove prefix of a string if it exists

2010-07-13 Thread Shashwat Anand
On Wed, Jul 14, 2010 at 5:42 AM, MRAB pyt...@mrabarnett.plus.com wrote: News123 wrote: I wondered about a potentially nicer way of removing a prefix of a string if it exists. Here what I tried so far: def rm1(prefix,txt): if txt.startswith(prefix): return txt[len(prefix):]

Re: python namespace question

2010-07-13 Thread Shashwat Anand
On Wed, Jul 14, 2010 at 8:33 AM, chad cdal...@gmail.com wrote: Given the following code... #!/usr/bin/python class cgraph: def printme(self): print hello\n No need to do print hello\n, python is not C, print hello prints hello with a newline. Try it on interpretor. x =

Re: Check if a command is valid

2010-07-13 Thread Shashwat Anand
On Tue, Jul 13, 2010 at 6:59 AM, Kenny Meyer knny.m...@gmail.com wrote: Hello, I have to figure out if a string is callable on a Linux system. I'm actually doing this: def is_valid_command(command): retcode = 100 # initialize if command: retcode =

Re: 500 tracker orphans; we need more reviewers

2010-07-08 Thread Shashwat Anand
On Fri, Jul 9, 2010 at 3:28 AM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 19-6-2010 23:45, Shashwat Anand wrote: Terry: Thanks for bringing this to notice. Mark: Kudos for your effort in cleaning up bugs.python.org Like I've said elsewhere, flattery will get you everywhere. :) I

Re: Argh! Name collision!

2010-07-06 Thread Shashwat Anand
On Wed, Jul 7, 2010 at 8:21 AM, Richard Thomas chards...@gmail.com wrote: On Jul 7, 3:11 am, Alf P. Steinbach /Usenet alf.p.steinbach +use...@gmail.com wrote: Donald Knuth once remarked (I think it was him) that what matters for a program is the name, and that he'd come up with a really

[issue9153] Run tests and demos as part of the test suite

2010-07-05 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9153 ___ ___ Python-bugs-list

[issue9161] add_option in optparse no longer accepts unicode string

2010-07-05 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9161 ___ ___ Python-bugs-list

[issue8470] Let cmd.cmd.intro be unicode friendly

2010-07-04 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Python 2.7 is already released. This is a non-issue on py3.x. Should this issue be closed or we work on it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8470

Re: why python don't support extended slice direct assignment for lists?

2010-07-02 Thread Shashwat Anand
On Sat, Jul 3, 2010 at 4:54 AM, Robert William Hanks astroultra...@gmail.com wrote: why pure python don't support extended slice direct assignment for lists? today we have to write like this, aList=[0,1,2,3,4,5,6,7,8,9] aList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] aList[::2]=

Re: The real problem with Python 3 - no business case for conversion (was I strongly dislike Python 3)

2010-07-02 Thread Shashwat Anand
On Sat, Jul 3, 2010 at 5:27 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 02 Jul 2010 12:07:33 -0700, John Nagle wrote: Where's the business case for moving to Python 3? It's not faster. It doesn't do anything you can't do in Python 2.6. There's no killer app

[issue9085] Version number inconsistency in email package

2010-06-26 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: In python2.5 email version is 4.0.2 In python2.6 email version is 4.0.1 In python 2.7rc2 email version is 4.0.2 I think version number is wrong with 2.5, it should have been 4.0.0 rather than 4.0.2. David: Adding you as nosy so as you

[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2010-06-26 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Can't reproduce. 16:36:36 l0nwlf-MBP:~$ python2.7 Python 2.7rc2+ (trunk:82148M, Jun 22 2010, 10:32:46) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type help, copyright, credits or license for more information. import

[issue4655] during Python installation, setup.py should not use .pydistutils.cfg

2010-06-26 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4655 ___ ___ Python-bugs-list

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Shashwat Anand
why do you need that ? which platform are you onto ? On OSX you can use 'DictionaryServices' API eg., import sys import DictionaryServices word = .join(sys.argv[1:]) print DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word))) Gives the meaning of the input word (works with

[issue1685453] email package should work better with unicode

2010-06-24 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1685453 ___ ___ Python-bugs

[issue9048] no OS X buildbots in the stable list

2010-06-23 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9048 ___ ___ Python-bugs-list

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Shashwat Anand
Josef: Make sure you ask this question on Ruby mailing list too. Just like James I too am personally biased towards python and so will be a lot of people on this list. On Tue, Jun 22, 2010 at 2:50 PM, James Mills prolo...@shortcircuit.net.auwrote: On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
22:26:51 l0nwlf-MBP:~/Desktop$ cat test.py print __file__ 22:26:55 l0nwlf-MBP:~/Desktop$ python test.py test.py On Tue, Jun 22, 2010 at 10:26 PM, Shashwat Anand anand.shash...@gmail.comwrote: you can use __file__ On Tue, Jun 22, 2010 at 10:14 PM, Peng Yu pengyu...@gmail.com wrote: I want

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
you can use __file__ On Tue, Jun 22, 2010 at 10:14 PM, Peng Yu pengyu...@gmail.com wrote: I want to print filename and line number for debugging purpose. So far I only find how to print the line number but not how to print filename. import inspect print inspect.currentframe().f_lineno I

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
begin - import logging logging.basicConfig(level=logging.DEBUG,format=%(asctime)s %(levelname)-5.5s [%(name)s %(module)s:%(funcName)s:%(lineno)d] %(message)s) def run(): x = 5 logging.debug(X = %d % x) run() - end - You can probably use string default concatenation

[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2010-06-22 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: 16:05:57 l0nwlf-MBP:/Applications/Firefox.app/Contents/MacOS$ ./firefox-bin 'http://www.google.com' says firefox is already running as ff is open. After we quit ff, 16:09:05 l0nwlf-MBP:/Applications/Firefox.app/Contents/MacOS$ ./firefox

[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2010-06-22 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: I searched for proxy+firefox on roundup and the only two issue I got was issue 8238 and issue 1160328. None of them seems related to webbrowser. -- ___ Python tracker rep...@bugs.python.org

[issue8252] add a metadata section in setup.cfg

2010-06-22 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Is +gsoc a keyword too ? :O On Tue, Jun 22, 2010 at 7:16 PM, Éric Araujo rep...@bugs.python.org wrote: Éric Araujo mer...@netwok.org added the comment: I’m starting on this now. Monitor http://bitbucket.org/Merwok/distutils2

[issue1349106] email.Generators does not separates headers with \r\n

2010-06-22 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1349106 ___ ___ Python-bugs

[issue8252] add a metadata section in setup.cfg

2010-06-22 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: merwok: Pont noted. I replied it via Gmail, was unaware of the fact that it adds an unnamed file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8252

[issue9033] cmd module tab misbehavior

2010-06-22 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Tested the patch and it works for trunk and python3.2 alpha. Without adding SDK flag with configure readline module failed to build. Python build finished, but the necessary bits to build these modules were not found: _gdbm

Re: 500 tracker orphans; we need more reviewers

2010-06-19 Thread Shashwat Anand
Terry: Thanks for bringing this to notice. Mark: Kudos for your effort in cleaning up bugs.python.org On Sat, Jun 19, 2010 at 10:16 PM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 19/06/2010 03:37, Terry Reedy wrote: Go to the bottom of

[issue9033] cmd module tab misbehavior

2010-06-19 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: It seems readline module is not installed on your system. Quoting Ned Deily's comment from issue8365 which will most probably solve your issue: Issue6877 (and subsequent fixes in Issue8066) allows the Python readline module

[issue9033] cmd module tab misbehavior

2010-06-19 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9033 ___ ___ Python-bugs

[issue8820] IDLE not launching correctly

2010-06-19 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +kbk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8820 ___ ___ Python-bugs-list

[issue8820] IDLE not launching correctly

2010-06-19 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8820 ___ ___ Python-bugs-list

[issue4654] os.path.realpath() get the wrong result

2010-06-19 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4654 ___ ___ Python

[issue4654] os.path.realpath() get the wrong result

2010-06-19 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: No such issue on python 2.6, 2.7, 3.2. print(os.path.realpath('/Users/l0nwlf/Desktop/tmp/../decotest.lnk')) /Users/l0nwlf/Desktop/decotest.lnk I think this issue can be closed. However, I came with a different issue while testing

[issue9018] os.path.normcase(None) does not raise an error on linux and should

2010-06-19 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Following the documentation, os.path.normcase(path) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also

[issue4654] os.path.realpath() get the wrong result

2010-06-19 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: By different issue I meant expected but non-useful output. Although it does exactly what it is supposed to do, but expanding tilde (~) to $HOME could have been the default behavior(more user-friendly I should say). Don't know

[issue9010] Infinite loop in imaplib.IMAP4_SSL when used with Gmail

2010-06-16 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: import imaplib HOST=imap.gmail.com PORT=993 USERNAME=usern...@gmail.com PASSWORD=password server = imaplib.IMAP4_SSL(host=HOST, port=PORT) server.login(USERNAME, PASSWORD) def f(): print server.select(INBOX) print

Re: Community (A Modest Proposal)

2010-06-15 Thread Shashwat Anand
IDEs are seriously over-rated. Vim FTW. The only issue for beginners is they should know touch typing to fully utilize Vim and the initial curve is a bit high as compared to normal editors/IDEs. On Tue, Jun 15, 2010 at 4:16 PM, Andreas Waldenburger use...@geekmail.invalid wrote: On Tue, 15 Jun

Re: pythonize this!

2010-06-15 Thread Shashwat Anand
sum(i*i*(-1)**((i % 5) / 4 + (i + 4) % 5 / 4) for i in range(1,2011)) 536926141 On Tue, Jun 15, 2010 at 6:25 PM, superpollo ute...@esempio.net wrote: superpollo ha scritto: Peter Otten ha scritto: superpollo wrote: goal (from e.c.m.): evaluate

Re: how to build with 2.4 having 2.6 as main python

2010-06-14 Thread Shashwat Anand
You can try a package : python_select On Mon, Jun 14, 2010 at 2:00 PM, Alexzive zasaconsult...@gmail.com wrote: Hello there, my Mandriva has the 2.6.4 python pre-installed (in /usr/lib64/ python2.6/) I need to install numpy 1.4 for python 2.4.3 (I installed it separately from source

Re: Python on Android Mobile?

2010-06-13 Thread Shashwat Anand
Well, AFAIK Nokia N900 supports python fully. On Mon, Jun 14, 2010 at 4:08 AM, Anthony Papillion papill...@gmail.comwrote: Thank you gentleman for your input. I'm starting to look at Python/GTK for desktop development and was hoping there might also be something for Android. Oh well, like

[issue8989] email.utils.make_msgid: specify domain

2010-06-13 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Adrian, Could you generate the diffs from the top level of the checkout and attach it here? -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8989

[issue7370] patch: BaseHTTPServer reinventing rfc822 date formatting

2010-06-13 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Agreed. Attaching the unit test. -- Added file: http://bugs.python.org/file17656/test_httpserver.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7370

[issue8572] httplib getheader() throws error instead of default

2010-06-12 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8572 ___ ___ Python-bugs-list

Re: regarding the dimensions in gui

2010-06-10 Thread Shashwat Anand
Do you realize you are spamming the list. You generally fire one question and wait rather than supplying us a bunch of questions. And please stop using 'sir' for heaven's sake. I realize you are from India and it is a culture there but people don't use it in mailing lists. Thanks. On Thu, Jun

Re: How to read source code of python?

2010-06-09 Thread Shashwat Anand
And if you are interested in source and have no particular goal, start with stdlib. On Thu, Jun 10, 2010 at 6:39 AM, rantingrick rantingr...@gmail.com wrote: On Jun 9, 7:28 pm, Leon qjing...@gmail.com wrote: I'm trying to read the source code of python. I read around, and am kind of lost,

Re: map is useless!

2010-06-06 Thread Shashwat Anand
map is not needed. LC is great :D On Sun, Jun 6, 2010 at 10:32 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: rantingrick rantingr...@gmail.com writes: Python map is just completely useless. [...] import time def test1(): l = range(1) t1 = time.time()

[issue7370] patch: BaseHTTPServer reinventing rfc822 date formatting

2010-06-06 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: Removed file: http://bugs.python.org/file17567/BaseHTTPServer.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7370

[issue7370] patch: BaseHTTPServer reinventing rfc822 date formatting

2010-06-06 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: You could get a minor speedup by doing “from email.utils import formatdate”. I guess I shall do that. Applied the patch and tested it, it does not break anything IMO and should go in python2.7 -- Added file: http

[issue7370] patch: BaseHTTPServer reinventing rfc822 date formatting

2010-06-05 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: Removed file: http://bugs.python.org/file16900/BaseHTTPServer.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7370

[issue7370] patch: BaseHTTPServer reinventing rfc822 date formatting

2010-06-05 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Seems that earlier patch was incorrect. Rectifying and submitting the correct patch. -- Added file: http://bugs.python.org/file17567/BaseHTTPServer.patch ___ Python tracker rep

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: from email.charset.ALIASES most of them failed to be recognize by codecs module. for i in email.charset.ALIASES.keys(): ... try: ... codecs.lookup(i) ... except LookupError: ... print(Not recognized by codecs

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: We need to add aliases for those codecs. The current aliases list only supports the format latinN for N in 1-10. latinN means latin1 to latin10 ? But latin_1 is a recognized alias. codecs.lookup('latin_1') codecs.CodecInfo object

Re:

2010-06-03 Thread Shashwat Anand
I have not much idea but Online Judges like SPOJ/codechef have regular programming-contests and python is one of allowed languages. So yes, it's possible. If I guess right, are you making an Online Judge for python. On Thu, Jun 3, 2010 at 8:39 PM, Amit Sethi amit.pureene...@gmail.comwrote: Hi ,

Re: Help with Regexp, \b

2010-05-29 Thread Shashwat Anand
\b is NOT spaces p = re.compile(r'\sword\s') m = p.match(' word ') assert m m.group(0) ' word ' On Sat, May 29, 2010 at 8:34 PM, andrew cooke and...@acooke.org wrote: This is a bit embarassing, but I seem to be misunderstanding how \b works in regexps. Please can someone explain why

Re: Help with Regexp, \b

2010-05-29 Thread Shashwat Anand
Also what you are probably looking for is this I guess, p = re.compile(r'\bword\b') m = p.match('word word') assert m m.group(0) 'word' On Sat, May 29, 2010 at 8:44 PM, Shashwat Anand anand.shash...@gmail.comwrote: \b is NOT spaces p = re.compile(r'\sword\s') m = p.match(' word

[issue8470] Let cmd.cmd.intro be unicode friendly

2010-05-29 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8470 ___ ___ Python-bugs-list

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +l0nwlf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8845 ___ ___ Python-bugs-list

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Tested this patch, works perfectly fine. Also it suits for the particular use case which David mentioned where there is no better alternate approach. -- Added file: http://bugs.python.org/file17484/dbapi.patch

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: Removed file: http://bugs.python.org/file17484/dbapi.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8845

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: conn = sqlite3.connect('dbdump.sqlite') c = conn.cursor() conn.in_transaction False c.execute('CREATE TABLE foo (id integer, name text)') sqlite3.Cursor object at 0x1004a7730 conn.in_transaction False It gives True for Insert

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: Removed file: http://bugs.python.org/file17485/dbapi.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8845

[issue8845] Expose sqlite3 connection inTransaction as read-only in_transaction attribute

2010-05-28 Thread Shashwat Anand
Shashwat Anand anand.shash...@gmail.com added the comment: Ok then. Uploading unit-test which takes value of in_transaction as False after issuing a Create statement. It passes with the patch applied. -- Added file: http://bugs.python.org/file17486/dbapi.patch

[issue8811] fixing sqlite3 docs for py3k

2010-05-26 Thread Shashwat Anand
Changes by Shashwat Anand anand.shash...@gmail.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8811 ___ ___ Python

Re: launching vi/vim from console

2010-05-24 Thread Shashwat Anand
or in a reverse way you can open vim and use ':shell' followed by python. I prefer it that way generally On Mon, May 24, 2010 at 6:01 PM, adm avinash.ma...@gmail.com wrote: On May 24, 4:59 pm, Jean-Michel Pichavant jeanmic...@sequans.com wrote: adm wrote: I am newbie to python. Is

Re: Chatroom

2010-05-24 Thread Shashwat Anand
seems like an academic project which is worth grades On Tue, May 25, 2010 at 7:01 AM, alex23 wuwe...@gmail.com wrote: Martin P. Hellwig martin.hell...@dcuktec.org wrote: What have you tried so far? Alternatively, how much is it worth to you? --

  1   2   3   >