Re: Calling a list of functions

2015-12-13 Thread Anand
On Sunday, December 13, 2015 at 9:26:52 AM UTC-8, Ganesh Pal wrote: > Hi Team, > > Iam on linux and python 2.7 . I have a bunch of functions which I > have run sequentially . > I have put them in a list and Iam calling the functions in the list as > shown below , this works fine for me , please

Re: Localized Type Inference of Atomic Types in Python

2014-02-15 Thread anand
of approval I > am releasing it to the world. You can grab a copy at > http://www.drifty.org/thesis.pdf . Hi, This link seems to be down. Can you point us to some current link? Am trying to contribute to https://code.google.com/p/py2c/ and reading up on type inference for python.

Re: Help me understand this logging config

2011-08-30 Thread anand jeyahar
else: rv = (self.loggerClass or _loggerClass)(name) rv.manager = self self.loggerDict[name] = rv self._fixupParents(rv) finally: _releaseLock() return rv =

Re: packaging a python application

2011-08-28 Thread anand jeyahar
case. == Anand Jeyahar https://sites.google.com/site/<https://sites.google.com/site/aangjie/home/quotes> anandjeyahar == The man who is really serious, with the urge to find out what truth is, has no style at all. He lives only

Re: PUT with proxy-support

2011-08-26 Thread Shashwat Anand
On Fri, Aug 26, 2011 at 3:15 PM, Laszlo Nagy 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 >> src/pycurl.c:43:22: p

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
On Thu, Aug 25, 2011 at 5:22 PM, Laszlo Nagy 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 > "CA-Cert-Auth:v=1;a=yxyz.prod;h=10.10.0.1;t=131

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
tificates 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 wrote: > > I want to make a PUT request. > I need some headers of my own ( certificates etc ) and

Re: PUT with proxy-support

2011-08-25 Thread Shashwat Anand
On Thu, Aug 25, 2011 at 4:48 PM, Thomas Jollans 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://

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

python mysqltuner port

2011-08-16 Thread anand jeyahar
e this. > > Thanks and Regards, > ====== > Anand Jeyahar > https://sites.google.com/site/anandjeyahar > == > The man who is really serious, > with the urge to find out what tru

Re: Idea for pure-python templates using AST.

2011-08-16 Thread anand jeyahar
. Also i never really thought about design. Just blindly/mechanically, translated from perl to python. So criticize and let me know how i can improve this. Thanks and Regards, == Anand Jeyahar https://sites.google.com/site/anandjeyahar

Re: Refactor/Rewrite Perl code in Python

2011-07-24 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 experience.

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 code

Re: Tabs -vs- Spaces: Tabs should have won.

2011-07-16 Thread anand jeyahar
On Sun, Jul 17, 2011 at 08:39, Steven D'Aprano wrote: > > I have reluctantly come to do the same thing. There is a plethora of broken > tools out there that don't handle tabs well, and consequently even though > tabs for indentation are objectively better, I use spaces because it is > less worse t

Re: how to call a function for evry 10 secs

2011-07-02 Thread anand jeyahar
p://packages.python.org/APScheduler/#installing-apscheduler Thanks and Regards, == Anand Jeyahar https://sites.google.com/site/< https://sites.google.com/site/aangjie/home/quotes> anandjeyahar == The man who is

python overloading

2011-06-24 Thread anand jeyahar
ccess? == Anand Jeyahar http://sites.google.com/a/cbcs.ac.in/students/anand == The man who is really serious, with the urge to find out what truth is, has no style at all. He lives only in what is. ~

porting maatkit to python?

2011-06-18 Thread anand jeyahar
need to brainstorm on that too.). Thanks and Regards, == Anand Jeyahar http://sites.google.com/a/cbcs.ac.in/students/anand == The man who is really serious, with the urge to find out what truth is, has no style

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 > maxCountPerPhr

Errors while using strip and remove on a variable.

2011-02-03 Thread anand jeyahar
assignment. please find the script below* a ='oe,eune,eueo, ,u' b = a.split(',') print b c = b.remove('oe') print a print c == Anand Jeyahar http://sites.google.com/a/cbcs.ac.in/students/anand ===

Re: Language Detection Library/Code

2010-12-27 Thread Shashwat Anand
On Tue, Dec 28, 2010 at 6:03 AM, Katie T wrote: > On Mon, Dec 27, 2010 at 7:10 PM, Shashwat Anand > 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/trigra

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: Silly newbie question - Carrot character (^)

2010-11-05 Thread Shashwat Anand
On Fri, Nov 5, 2010 at 7:26 PM, Krister Svanlund wrote: > On Fri, Nov 5, 2010 at 2:43 PM, Matty Sarro 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 pi*radius^2, and getting errors > > that data

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 t

Re: list problem...

2010-09-29 Thread Shashwat Anand
On Thu, Sep 30, 2010 at 3:20 AM, Rog wrote: > On Wed, 29 Sep 2010 05:52:32 -0700, bruno.desthuilli...@gmail.com wrote: > > > On 29 sep, 14:17, Steven D'Aprano > > > wrote: > >> On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: > >> > On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: > >> > >

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 1:15 AM, rog wrote: > Shashwat Anand wrote: > > >> >> 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,

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 12:14 AM, Rog 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 your proble

Re: Python2.7 on OSX

2010-09-25 Thread Shashwat Anand
On Sun, Sep 26, 2010 at 12:32 AM, Jonas Galvez wrote: > 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 advance, > I

Re: Python autocomplete module

2010-09-16 Thread Shashwat Anand
On Thu, Sep 16, 2010 at 5:34 PM, dusans 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. http://docs.python.org/library/rlcompleter.html -- ~l

Re: Numpy: Multiplying arrays of matrices

2010-09-15 Thread Shashwat Anand
On Tue, Sep 14, 2010 at 7:54 PM, Gregory Ewing wrote: > 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 this, but it appears > not

Re: compare dictionaries

2010-09-07 Thread Shashwat Anand
On Wed, Sep 8, 2010 at 1:56 AM, Baba wrote: > On 7 sep, 22:08, Gary Herron 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 > > dict2. Return Fal

Is python is the safest language ...

2010-09-02 Thread Anand Sadasivam
Hi All, Is python is the safest language is my question. I feel its good language, but however java has good occupancy. About four years back I did few python programs and worked with some of add-on product over ZOPE and Plone. The suggestion to me is mostly welcome. Regards, -- Anand.S anand.s

Re: Reversing a List

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

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 '*' c

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, 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 to find the clo

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 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 of entries: >

Re: Source code for itertools

2010-08-30 Thread Shashwat Anand
On Tue, Aug 31, 2010 at 7:30 AM, vsoler 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 it on the net.

Re: freq function

2010-08-22 Thread Shashwat Anand
On Sun, Aug 22, 2010 at 1:31 PM, Dirk Nachbar 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): >#order ca

Re: simple renaming files program

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:14 PM, blur959 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 script, when it

Re: how to change a string into dictionary

2010-08-09 Thread Shashwat Anand
On Mon, Aug 9, 2010 at 3:03 PM, aimeixu 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 = "{'a':'1','b'

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 i

Re: rstrip()

2010-07-16 Thread Shashwat Anand
On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman wrote: > $ 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: Check if a command is valid

2010-07-13 Thread Shashwat Anand
On Tue, Jul 13, 2010 at 6:59 AM, Kenny Meyer 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 = subprocess.call(command

Re: python namespace question

2010-07-13 Thread Shashwat Anand
On Wed, Jul 14, 2010 at 8:33 AM, chad 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 = cgraph

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 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: 500 tracker orphans; we need more reviewers

2010-07-08 Thread Shashwat Anand
On Fri, Jul 9, 2010 at 3:28 AM, Mark Lawrence wrote: > 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

Re: Argh! Name collision!

2010-07-06 Thread Shashwat Anand
On Wed, Jul 7, 2010 at 8:21 AM, Richard Thomas wrote: > On Jul 7, 3:11 am, "Alf P. Steinbach /Usenet" +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 good name, now all he'd > had

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 "kill

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[::

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 pyth

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

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 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 found inspec

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 wrote: > you can use __file__ > > > On Tue, Jun 22, 2010 at 10:14 PM, Peng Yu wrote: > >> I want to print fil

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 wrote: > On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag wrote: > > Before I really di

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 wrote: > On 19/06/2010 03:37, Terry Reedy wrote: > >> Go to the bottom of >> http://bugs.python.org/iss...@template=search&status=1 >> enter 1 in t

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 wrote: > superpollo ha scritto: > > Peter Otten ha scritto: >> >>> superpollo wrote: >>> >>> goal (from e.c.m.): evaluate 1^2+2^2+3^2-4^2-5^2+6^2+7^2+8^2-9^2-1

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 wrote: > On Tue, 15 Jun 2010 17:45:43 +1000 Jam

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 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 on/usr/local/lib/python2.

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 wrote: > 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 Simon said (pardon t

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 10,

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 wrote: > On Jun 9, 7:28 pm, Leon wrote: > > > I'm trying to read the source code of python. > > I read around, and am kind of lost, so where to start? > > Leon, if yo

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 writes: > > > Python map is just completely useless. [...] > > import time > def test1(): > > l = range(1) > > t1 = time.time() > >

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 wrote: > Hi , > > I wish to execute so

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 wrote: > \b is NO

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 wrote: > > This is a bit embarassing, but I seem to be misunderstanding how \b > works in regexps. > > Please can someone explain wh

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 wrote: > "Martin P. Hellwig" wrote: > > What have you tried so far? > > Alternatively, how much is it worth to you? > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.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 wrote: > On May 24, 4:59 pm, Jean-Michel Pichavant > wrote: > > adm wrote: > > > I am newbie to python. > > > Is there a way to launch vi/vim or any othe

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeatifulSoup can be used as one IMO On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: > Shashwat Anand, 15.04.2010 11:55: > > BeautifulSoup > > The OP asked for an XML parser. > > Stefan > > -- > http://mail.python.org/mailman/listinfo/python-list > -

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeautifulSoup On Thu, Apr 15, 2010 at 1:39 PM, Stefan Behnel wrote: > Jo Chan, 14.04.2010 15:28: > > Hi, everyone~~~ I am new. >> What is the most popular xml parser module used on python? Thanks for >> answering... >> > > Why do you want to know? Just out of curiosity, or are you looking for

Re: curious about python version numbers

2010-04-13 Thread Shashwat Anand
It is like releasing window Xp SP3 even if Vista is out. The problem is we should start using python 3.x but many application like django, twisted had not migrated yet. Hence this stuff to support 2.x . 2.7 is the last 2.x version, no more. On Tue, Apr 13, 2010 at 2:28 PM, Alf P. Steinbach wrote

Re: doctests working both in Python 2.X and Python 3.X

2010-04-11 Thread Shashwat Anand
On Sun, Apr 11, 2010 at 1:59 PM, Michele Simionato < michele.simion...@gmail.com> wrote: > I do not want to write two documentations for a module working both in > Python 2.X and Python 3.X. > There are modules which work in both 2.x and 3.x but still behave differently. How will you handle those

Re: help req: installing debugging symbols

2010-04-07 Thread Shashwat Anand
Install python in a different directory, use $prefix for that. Change PATH value accordingly 2010/4/5 sanam singh > Hi, > > I am using ununtu 9.10. I want to install a version of Python that was > compiled with debug symbols. > > But if I delete python from ubuntu it would definitely stop wo

Re: How to output the commands that are executed in a python script?

2010-04-05 Thread Shashwat Anand
You need a debugger here. On Tue, Apr 6, 2010 at 8:41 AM, Lie Ryan wrote: > On 04/06/10 12:38, Peng Yu wrote: > > I want to show what commands have been executed when I run a python > > script. Is there an option which can instruct python to print the > > commands automatically? > > > > (If you

Re: pynotify for python 3.1.. Help Please..

2010-04-02 Thread Shashwat Anand
I guess it is a 3rd party module. Run setup.py with python3.1, however it can happen that the module is not python3 compatible. In that case try using 2to3 if you can. On Fri, Apr 2, 2010 at 3:43 PM, Xavier Ho wrote: > On Fri, Apr 2, 2010 at 8:13 PM, Xavier Ho wrote: > >> Hi Jebamnana, >> > > J

Re: Splitting a string

2010-04-02 Thread Shashwat Anand
>>> s = 'si_pos_99_rep_1_0.ita' >>> res = tuple(re.split(r'(\d+)', s)) >>> res ('si_pos_', '99', '_rep_', '1', '_', '0', '.ita') >>> On Fri, Apr 2, 2010 at 3:42 PM, Thomas Heller wrote: > Maybe I'm just lazy, but what is the fastest way to convert a string > into a tuple containing character se

Re: no module named exceptions?

2010-04-01 Thread Shashwat Anand
There i no module named 'exceptions' in python 2.6 as well as python 3.1 What are you expecting ? On Thu, Apr 1, 2010 at 10:42 PM, Joaquin Abian wrote: > In python 3.1, > > >>> import exceptions > Traceback (most recent call last): > File "", line 1, in >import exceptions > ImportError: No

Re: CPAN for python?

2010-03-30 Thread Shashwat Anand
This has been discussed tons of times. You should have atleast googled it. Python have nothing like CPAN and Cheese Shop (pypi) comes closest to it. On Tue, Mar 30, 2010 at 10:21 PM, Kushal Kumaran < kushal.kumaran+pyt...@gmail.com > wrote: > On Tue, Mar 30, 2010 at 9:53 PM, Someone Something >

Re: Binary Decimals in Python

2010-03-30 Thread Shashwat Anand
The conversion is not supported for decimal integers AFAIK, however '0b123.456' is always valid. I guess you can always get a decimal number convertor onto Python-recipes On Tue, Mar 30, 2010 at 9:05 PM, Grant Olson wrote: > On 3/30/2010 11:13 AM, aditya wrote: > > To get the decimal represent

Re: Binary Decimals in Python

2010-03-30 Thread Shashwat Anand
decimal binary number is not included AFAIK On Tue, Mar 30, 2010 at 8:43 PM, aditya wrote: > To get the decimal representation of a binary number, I can just do > this: > > int('11',2) # returns 3 > > But decimal binary numbers throw a ValueError: > > int('1.1',2) # should return 1.5, throws err

Re: Have you embraced Python 3.x yet?

2010-03-26 Thread Shashwat Anand
2.6.x is what most applications rely on. It is still too early for python 3 On Fri, Mar 26, 2010 at 6:59 PM, Alex Hall wrote: > Because of compatibility, and many modules being built for 2.6 only, I > am still on 2.6.4 (updating to .5 soon). > > On 3/26/10, Harishankar wrote: > > Have you peopl

Re: OT: Meaning of "monkey"

2010-03-26 Thread Shashwat Anand
evolved monkey = human (can relate codemonkey to it) 2010/3/26 Kushal Kumaran > > 2010/3/26 Luis M. González : > > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, > > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... > > > > Monkeys everywhere. > > Sorry fo

Re: Traversing through Dir()

2010-03-25 Thread Shashwat Anand
have you tried os.walk() ? On Fri, Mar 26, 2010 at 5:55 AM, Andrej Mitrovic wrote: > I would like to traverse through the entire structure of dir(), and > write it to a file. > > Now, if I try to write the contents of dir() to a file (via pickle), I > only get the top layer. So even if there are

Re: Advice needed on parallel processing in python

2010-03-24 Thread Shashwat Anand
have you checked hadoop ? On Wed, Mar 24, 2010 at 11:43 PM, Jon Clements wrote: > On 24 Mar, 15:27, Glazner wrote: > > Hi! > > > > I need to replace an app that does number crunching over a local > > network. > > it have about 50 computers as slaves > > each computer needs to run COM that will d

Re: spams

2010-03-24 Thread Shashwat Anand
seems good :) On Wed, Mar 24, 2010 at 9:12 PM, D'Arcy J.M. Cain wrote: > On Wed, 24 Mar 2010 20:47:12 +0530 > Shashwat Anand wrote: > > Lately this list have been spammed a lot. Any workarounds by moderators? > > Not as long as it is gatewayed to Usenet. You can kil

spams

2010-03-24 Thread Shashwat Anand
Lately this list have been spammed a lot. Any workarounds by moderators? ~l0nwlf -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to trim and keep leading and trailing whitespace

2010-03-23 Thread Shashwat Anand
regex is not goto that you should always avoid using it. It have its own use-case, here regex solution is intuitive although @emile have done this for you via string manpulation. On Wed, Mar 24, 2010 at 4:09 AM, Daniel Chiquito wrote: > As far as I know, I don't think there is anything that strip

Re: Python is cool!!

2010-03-23 Thread Shashwat Anand
There is a project PyWhip (renamed as PyKata) which aims for the same purpose. Google AppEmgine + Django does the trick for that. May be you can take an inspiration or two from there especially because all code is open to/for you. ~l0nwlf On Wed, Mar 24, 2010 at 2:54 AM, Patrick Maupin wrote: >

Bug in Python APscheduler module.

2010-03-18 Thread anand jeyahar
sched.unschedule_func(test_func) sched.unschedule_func(tc.test_class1) print "jobs after unschedule" print sched.jobs sched.shutdown() if __name__=='__main__': main() ~ ~ ~ ~ == Anan

Re: using DictionaryServices module to get work with python2.6 #OSXspecific

2010-03-17 Thread Shashwat Anand
> Are you thinking of this? > http://pypi.python.org/pypi/pyobjc-framework-DictionaryServices/2.2 > I get the same IndexError while working with this wrapper. My guess is python2.6 does not support DictionaryServices on Snow Leopard . -- http://mail.python.org/mailman/listinfo/python-list

using DictionaryServices module to get work with python2.6 #OSXspecific

2010-03-17 Thread Shashwat Anand
I wanted to use dictionary in my OSX terminal. So I wrote a function dict() in my ~/.bash_profile dict () { python2.5 -c 'import sys, DictionaryServices; word = " ".join(sys.argv[1:]); print DictionaryServices.DCSCopyTextDefinition(None, word, (0, len(word)))' $@ } here is the output: Shashw

Re: a newbie's question

2010-03-10 Thread Shashwat Anand
Python is one language which is quite easy to get grasp of. one week and you'll start doing productive stuff. Best of luck on your quest. On Thu, Mar 11, 2010 at 10:26 AM, Lan Qing wrote: > hi Cheers, > Think you, that helps me a lot. > > > On Tue, Mar 9, 2010 at 10:00 PM, Simon Brunning >

Re: Slicing [N::-1]

2010-03-05 Thread Shashwat Anand
On Fri, Mar 5, 2010 at 11:42 PM, Arnaud Delobelle wrote: > Joan Miller writes: > > > What does a slice as [N::-1] ? > > > > It looks that in the first it reverses the slice and then it shows > > only N items, right? > > > > Could you add an example to get the same result without use `::` to > > s

Re: Selecting MAX from a list

2010-03-05 Thread Shashwat Anand
On Fri, Mar 5, 2010 at 5:09 PM, Ines T wrote: > I need to select a maximum number from a list use max() > and then call the variable that > identifies that number, for example: > x1,x2=1, y1,y2=4, z1,z2=3 > you mean x1 = y1 = 1 or x1, y1 = 1, 1 right ? > So I need first to find 4 and then

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Shashwat Anand
You may also want to look into mechanize module. On Thu, Mar 4, 2010 at 6:11 PM, Michael Rudolf wrote: > Am 04.03.2010 11:38, schrieb Karen Wang: > > Hi all, >> >> I want to use python to access to https server, like >> "https://212.218.229.10/chinatest/"; >> >> If open it from IE, will see the

Re: Question about typing: ints/floats

2010-03-03 Thread Shashwat Anand
yes you can also try: >>> float(a)/b 0.1 On Thu, Mar 4, 2010 at 5:15 AM, Wells wrote: > This seems sort of odd to me: > > >>> a = 1 > >>> a += 1.202 > >>> a > 2.202 > > Indicates that 'a' was an int that was implicitly casted to a float. > But: > > >>> a = 1 > >>> b = 3 > >>> a

Re: nonunique string replacements

2010-03-02 Thread Shashwat Anand
>>> s = 'PBUSH 201005 K 500 1. 1. 1. 1. 1.'#Your original string here >>> l#Create your desired list ['500.2', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7'] >>> lsep = s.count(' 1.')#Count the occurrence of seperators >>> for i in range(lsep):#Repla

Re: New User

2010-03-01 Thread Shashwat Anand
for beginners : http://openbookproject.net/thinkcs/python/english2e/index.html python cookbook - 2 by alex martelli is fantastic if you have your basics cleared. On Tue, Mar 2, 2010 at 8:09 AM, Niranjan Kumar Das wrote: > Hello Group, > I am starting to programme in python 1st time. Just thought

Re: Looking for an Application

2010-03-01 Thread Shashwat Anand
project sikuli : http://groups.csail.mit.edu/uid/sikuli/ On Mon, Mar 1, 2010 at 8:49 PM, Greg Lindstrom < greg.lindst...@novasyshealth.com> wrote: > A few months ago there was a post dealing with an application that would > power scripts based on graphical snippets of the screen. Essentially, th

Re: python dowload

2010-02-23 Thread Shashwat Anand
PyPdf/pdfminer library will be of help On Wed, Feb 24, 2010 at 1:47 AM, Tim Chase wrote: > monkeys paw wrote: > >> I used the following code to download a PDF file, but the >> file was invalid after running the code, is there problem >> with the write operation? >> >> import urllib2 >> url = 'htt

Re: Files required for porting python

2010-02-22 Thread Shashwat Anand
what do you exactly mean by "port python on to windows" ? Are you talking about your application or python itself :-/ ~l0nwlf On Mon, Feb 22, 2010 at 10:23 PM, KIRAN wrote: > Hi ALL, > > I am newbie to python and wanted to port python on to some RTOS. The > RTOS I am trying to port python is no

Re: Efficiently building ordered dict

2010-02-22 Thread Shashwat Anand
OrderedDict is a class in collection module in python 2.7a3+. Perhaps you can use it from there. >>> dir(collections) ['Callable', 'Container', 'Counter', 'Hashable', 'ItemsView', 'Iterable', 'Iterator', 'KeysView', 'Mapping', 'MappingView', 'MutableMapping', 'MutableSequence', 'MutableSet', 'Orde

  1   2   3   >