Re: Global indent

2014-08-23 Thread Rustom Mody
On Sunday, August 24, 2014 2:27:56 AM UTC+5:30, Joshua Landau wrote: > Ay, so is any editor with an API. I use Sublime mostly because it's > pretty, fast and has a Python-based API. The only actual feature it > has that some others don't is multiple selections, and even then a lot > do. You mean

Re: ANN: binario - simple work with binary files

2014-08-23 Thread Rustom Mody
On Saturday, August 23, 2014 9:54:05 PM UTC+5:30, Алексей Саскевич wrote: > binario is the Python package that lets an application read/write primitive > data types from an underlying input/output file as binary data. > Package on PyPI: https://pypi.python.org/pypi/binario > Package on GitHub: ht

Re: GO vs Python

2014-08-25 Thread Rustom Mody
On Monday, August 25, 2014 9:11:39 AM UTC+5:30, Chris Angelico wrote: > Sure. And your reduction of AWS bills sounds great. Just make sure you > don't consume the entire extra coder's time doing things that Python > would have done for you. Go's character model is inferior to Python > 3's (or at l

Re: GO vs Python

2014-08-25 Thread Rustom Mody
On Monday, August 25, 2014 5:36:25 PM UTC+5:30, Roy Smith wrote: > Rustom Mody wrote: > > Heh! You make it sound that the character model is the most important thing > > in choosing a language! > > There are people using Fortran -- with not intention of finding > > a

Re: ANN: binario - simple work with binary files

2014-08-25 Thread Rustom Mody
On Monday, August 25, 2014 3:28:28 PM UTC+5:30, Алексей Саскевич wrote: > Package works directly with files and has similar structure with Java's > DataInputStream/DataOutputStream classes. > Can construct read/write data from files? I guess so. See parse_stream: http://construct.readthedocs.org

Re: GO vs Python

2014-08-25 Thread Rustom Mody
On Monday, August 25, 2014 7:56:55 PM UTC+5:30, Marko Rauhamaa wrote: > Michael Torrie: > > On 08/25/2014 06:24 AM, Rustom Mody wrote: > >>> display artist names like M�tley Cr�e and Beyonc�, I would be more > >> Your mail client seems to be 7-bit ASCII!! &g

Re: This formating is really tricky

2014-08-25 Thread Rustom Mody
On Tuesday, August 26, 2014 1:44:40 AM UTC+5:30, Seymore4Head wrote: > BTW the exercise instructions say to use the choice function. I > assume I had to include all the numbers to choose from instead of > picking a random number from 1-53 or 1-42. > I included my shortcut for pb2. It doesn't wor

Re: ANN: binario - simple work with binary files

2014-08-25 Thread Rustom Mody
On Tuesday, August 26, 2014 6:58:42 AM UTC+5:30, Tim Roberts wrote: > bwatas wrote: > >binario is the Python package that lets an application read/write primitive > >data types from an underlying input/output file as binary data. > >Package on PyPI: https://pypi.python.org/pypi/binario > >Package

Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?]

2014-08-26 Thread Rustom Mody
On Wednesday, August 27, 2014 8:06:24 AM UTC+5:30, Chris Angelico wrote: > On Wed, Aug 27, 2014 at 10:58 AM, Twirlip2 wrote: > > So, please give me a few weeks to improve my code, before posting it. (I > > recently came across somewhere on the Web where you can post code, but I > > forget where.)

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Rustom Mody
On Wednesday, August 27, 2014 5:24:40 PM UTC+5:30, Ned Batchelder wrote: > On 8/27/14 3:50 AM, Frank Millman wrote: > > "Ian Kelly" wrote in message > >> Ugh. There seems to be no public repository, and the only source to be > >> found is from release-versioned tarballs, so there's apparently no >

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Rustom Mody
On Wednesday, August 27, 2014 10:44:37 PM UTC+5:30, Marko Rauhamaa wrote: > Paul Rubin : > > "Frank Millman" writes: > >> I could stick to hg (or git) but I have recently come across fossil, > >> and it seems ideal for my needs. Has anyone used it? > > I've played with it. It's incredibly impressi

Re: hg, git, fossil, ...

2014-08-28 Thread Rustom Mody
On Friday, August 29, 2014 7:54:44 AM UTC+5:30, Chris Angelico wrote: > On Fri, Aug 29, 2014 at 12:20 PM, Ian Kelly wrote: > > But then what do you do if you need to checkout an intermediate > > revision of the project that isn't tagged? This need does arise. You > > can't just checkout the revisio

Re: Keeping python code and database in sync

2014-08-29 Thread Rustom Mody
On Friday, August 29, 2014 6:12:06 PM UTC+5:30, Frank Millman wrote: > Hi all > Now that I have bitten the bullet and published my repository, I am forced > to change my working practices (which is a good thing!). > The project is inherently database-driven. The python code expects to find > ce

Re: This could be an interesting error

2014-08-31 Thread Rustom Mody
On Monday, September 1, 2014 10:42:46 AM UTC+5:30, Chris Angelico wrote: > On Mon, Sep 1, 2014 at 2:55 PM, Larry Hudson wrote: > > While this is definitely OT, I strongly suggest you take the time to learn > > to touch-type. (Actually, I would recommend it for everyone.) It's true > > that it will

Re: ANN: binario - simple work with binary files

2014-09-01 Thread Rustom Mody
On Tuesday, September 2, 2014 6:05:19 AM UTC+5:30, Tim Roberts wrote: > Rustom Mody wrote: > >On Tuesday, August 26, 2014 6:58:42 AM UTC+5:30, Tim Roberts wrote: > >> To the equivalent code with struct: > >> import struct > >> dscrp = "H?fs5B&

Re: I have tried and errored a reasonable amount of times

2014-09-02 Thread Rustom Mody
On Wednesday, September 3, 2014 7:14:14 AM UTC+5:30, Steven D'Aprano wrote: > Grant Edwards wrote: > > I missed the beginning of the thread, but Why are you comparing things > > to True and False? > I don't understand why people do it, but it's *incredibly* common. A couple > of weeks ago at work

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Wednesday, September 3, 2014 11:41:27 PM UTC+5:30, Seymore4Head wrote: > import math > import random > import sys > b=[] > steve = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] > for x in steve: > print (steve[x]) > Traceback (most recent call last): > print (steve[x]) > IndexError: list index

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 7:26:56 AM UTC+5:30, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 11:48 AM, Rustom Mody wrote: > >>>> NO PRINT > Why are you so dead against print? Because it heralds a typical noob code-smell [especially when the OP admits that BASIC is h

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 7:24:19 AM UTC+5:30, Steven D'Aprano wrote: > Marko Rauhamaa wrote: > > Steven D'Aprano: > >> Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ > >> AND)? That's crazy notation. > > That's the classic Boolean algebraic notation. > Says who? (Ap

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 7:56:31 AM UTC+5:30, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 12:10 PM, Rustom Mody wrote: > > On Thursday, September 4, 2014 7:26:56 AM UTC+5:30, Chris Angelico wrote: > >> On Thu, Sep 4, 2014 at 11:48 AM, Rustom Mody wrote: > >> >

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 7:26:56 AM UTC+5:30, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 11:48 AM, Rustom Mody wrote: > >>>> NO PRINT > Yes, or the OP could work with actual saved .py files and the > reliability that comes from predictable execution environments

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 9:20:02 AM UTC+5:30, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 1:22 PM, Rustom Mody wrote: > > | Effect-free programming > > | -- Function calls have no side effects, facilitating compositional > > reasoning > > | -- Variable

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 9:37:05 AM UTC+5:30, Ethan Furman wrote: > Ridiculous argument after ridiculous argument. Please do not waste our time > with nonsense. See my answer (3.) to Chris above. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is going to be hard

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 10:33:38 AM UTC+5:30, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 2:11 PM, Rustom Mody wrote: > > Is there some PEP filed called "Abolish print in python 4" ? > > I dont remember filing any such... > You screamed "NO PRINT"

Re: Python is going to be hard

2014-09-04 Thread Rustom Mody
On Thursday, September 4, 2014 3:59:57 PM UTC+5:30, alister wrote: > On Wed, 03 Sep 2014 19:33:41 -0700, Rustom Mody wrote: > > On Thursday, September 4, 2014 7:56:31 AM UTC+5:30, Chris Angelico > > wrote: > >> When you start a script, you have a consistent environment -

Re: Python is going to be hard

2014-09-04 Thread Rustom Mody
On Thursday, September 4, 2014 12:10:04 PM UTC+5:30, Chris Angelico wrote: > Practicality beats purity. Nice statement! Now where did I see it?? Let me see... I see next to it some others: - Beautiful is better than ugly. - Explicit is better than implicit. - Simple is better than complex. - Com

Re: bicyclerepairman python24 windows idle :(

2014-09-04 Thread Rustom Mody
On Friday, September 5, 2014 2:22:37 AM UTC+5:30, Ned Batchelder wrote: > On 9/4/14 1:51 PM, Stewart Graff (Visual Concepts) wrote: > > Lines 304 - 318 contain non-ascii characters. > > You need to rewrite all of the leading whitespace for the function > > def confirm_buffer_is_saved(self, editwin)

Re: Python is going to be hard

2014-09-04 Thread Rustom Mody
On Thursday, September 4, 2014 7:38:40 PM UTC+5:30, Chris Angelico wrote: > So a fairer comparison is: How many applications produce non-debug > output on stderr or stdout? And that would be a much larger > percentage. Even GUI programs will, in some cases - for instance, try > firing up your favo

Re: Python is going to be hard

2014-09-04 Thread Rustom Mody
On Friday, September 5, 2014 8:01:00 AM UTC+5:30, Chris Angelico wrote: > That's one particular example that's from Unix. I've seen (and > written) Windows GUI programs that use consoles, too. And OS/2 ones. > Can't speak for Mac OS Classic as I've never used it, but I'd be > surprised if it's not

Re: My backwards logic

2014-09-05 Thread Rustom Mody
On Saturday, September 6, 2014 1:37:57 AM UTC+5:30, Paul Rubin wrote: > Juan Christian writes: > > I made this code just for fun and learning, it's working, but would > > this be a good approach? Thanks. ... > > ** ** for number in range(start, stop + 1): > > ** ** ** ** divisors = [(number %

Re: My backwards logic

2014-09-05 Thread Rustom Mody
On Saturday, September 6, 2014 7:25:10 AM UTC+5:30, Juan Christian wrote: > @Mark Lawrence: Sorry to ask, but what do you mean by "don't top post here, > thanks.", I'm not familiar with mailing lists, so I may be doing something > wrong and I don't know. Maybe better to say use this http://en.w

Re: How to turn a string into a list of integers?

2014-09-07 Thread Rustom Mody
On Sunday, September 7, 2014 10:33:26 PM UTC+5:30, Steven D'Aprano wrote: > MRAB wrote: > > I don't think you should be saying that it stores the string in Latin-1 > > or UTF-16 because that might suggest that they are encoded. They aren't. > Of course they are encoded. Memory consists of bytes,

Re: How to turn a string into a list of integers?

2014-09-07 Thread Rustom Mody
On Sunday, September 7, 2014 11:38:41 PM UTC+5:30, Steven D'Aprano wrote: > Rustom Mody wrote: > > On Sunday, September 7, 2014 10:33:26 PM UTC+5:30, Steven D'Aprano wrote: > >> MRAB wrote: > >> > I don't think you should be saying that it stores t

Re: Newer Debian versions of python on older Debian distros?

2014-09-09 Thread Rustom Mody
On Tuesday, September 9, 2014 12:35:27 AM UTC+5:30, Travis Griggs wrote: > (I realize that this may be seen as off topic for as a general > python question, but given my historical experience with the Debian > community's predilection to answer all questions with a grumpy "go > read the very very v

Re: Passing a list into a list .append() method

2014-09-09 Thread Rustom Mody
On Tuesday, September 9, 2014 11:25:29 AM UTC+5:30, JBB wrote: > I have a list with a fixed number of elements which I need to grow; ie. add > rows of a fixed number of elements, some of which will be blank. > e.g. [['a','b','c','d'], ['A','B','C','D'], ['', 'aa', 'inky', ''], ['', > 'bb', 'bink

Re: Newer Debian versions of python on older Debian distros?

2014-09-09 Thread Rustom Mody
On Tuesday, September 9, 2014 2:53:53 PM UTC+5:30, Chris Angelico wrote: > On Tue, Sep 9, 2014 at 6:09 PM, Rustom Mody wrote: > >> Does anyone have experience with using newer versions of python > >> debian packages (in particular, python3 and python3-bson-ext from >

Re: CSV methodology

2014-09-14 Thread Rustom Mody
On Sunday, September 14, 2014 2:09:51 PM UTC+5:30, Cameron Simpson wrote: > If you have a nice regular CSV file, with say 3 values per row, you can go: >reader = csv.reader(f) >for row in reader: >a, b, c - row I guess you meant: a, b, c = row ? Also you will want to do appro

Re: Flask and Python 3

2014-09-26 Thread Rustom Mody
On Friday, September 26, 2014 3:26:34 PM UTC+5:30, Jean-Michel Pichavant wrote: > Though I'm never using videos to learn, they probably can benefit some people. > > Ask you this question : is there a major difference between videos and > presentations, if not how can we justify the money spent o

Re: Leap year

2014-09-29 Thread Rustom Mody
On Saturday, September 27, 2014 9:21:15 AM UTC+5:30, Seymore4Head wrote: > Still practicing. Since this is listed as a Pseudocode, I assume this > is a good way to explain something. That means I can also assume my > logic is fading with age. > http://en.wikipedia.org/wiki/Leap_year#Algorithm >

Re: Teaching Python

2014-09-29 Thread Rustom Mody
On Monday, September 29, 2014 6:59:10 PM UTC+5:30, Chris Angelico wrote: > On Mon, Sep 29, 2014 at 11:18 PM, Gabor Urban wrote: > > my 11 years old son and his classmate told me, that they would like to learn > > Python. They did some programming in Logo and turtle graphics, bat not too > > much. >

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread Rustom Mody
On Tuesday, September 30, 2014 5:18:31 PM UTC+5:30, Chris wrote: > I would actually > quite like to keep the configuration data separate from the code as it > would simplify using the data at the 'home' end of things as I'd just > need to copy the configuration file across. This was why the datab

Re: Python code in presentations

2014-09-30 Thread Rustom Mody
On Tuesday, September 30, 2014 5:21:00 PM UTC+5:30, Jean-Michel Pichavant wrote: > Hello list, > I'm currently writing a presentation to help my co-workers ramp up on new > features of our tool (written in python (2.7)). > I have some difficulties presenting code in an efficient way (with some bas

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread Rustom Mody
On Tuesday, September 30, 2014 8:48:15 PM UTC+5:30, c...@isbd.net wrote: > Rustom Mody wrote: > > On Tuesday, September 30, 2014 5:18:31 PM UTC+5:30, Chris wrote: > > > I would actually > > > quite like to keep the configuration data separate from the code as it > >

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread Rustom Mody
On Tuesday, September 30, 2014 10:22:12 PM UTC+5:30, Chris Angelico wrote: > On Wed, Oct 1, 2014 at 2:39 AM, Rustom Mody wrote: > >> python - just keep config in the modules/classes, not easy to use > >> at 'both ends' (home and remote), otherwise quite s

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread Rustom Mody
On Tuesday, September 30, 2014 10:46:21 PM UTC+5:30, Chris Angelico wrote: > On Wed, Oct 1, 2014 at 3:01 AM, Rustom Mody wrote: > >> And you get expressions for free - simple stuff like > >> "7*24*60*60" to represent the number of seconds in a week (for people >

Re: Restarting Python

2014-10-01 Thread Rustom Mody
On Wednesday, October 1, 2014 6:39:11 PM UTC+5:30, Steven D'Aprano wrote: > Terry Reedy wrote: > > Python does not have 'commands'. > Terry, even experienced Python developers sometimes describe functions and > statements as "commands", e.g. "Use the print command to display results". > I think w

Re: Function passed as an argument returns none

2014-10-01 Thread Rustom Mody
On Thursday, October 2, 2014 4:07:44 AM UTC+5:30, Shiva wrote: > Hi, > I am learning Python (version 3.4) strings.I have a function that takes in a > parameter and prints it out as given below. > def donuts(count): > if count <= 5: > print('Number of donuts: ',count) > else: > print('N

Re: Function passed as an argument returns none

2014-10-02 Thread Rustom Mody
On Thursday, October 2, 2014 3:18:22 PM UTC+5:30, wrote: > Steven D'Aprano wrote: > > between printing output to the screen and returning values from a function, > > and under what circumstances Python will automatically print said returned > > values as a convenience. Conflating the two as "2 kin

Re: Function passed as an argument returns none

2014-10-02 Thread Rustom Mody
On Thursday, October 2, 2014 1:30:03 PM UTC+5:30, Steven D'Aprano wrote: > Chris Angelico wrote: > > wrote: > >> So by now you know there are 2 kinds of return: > >> So the morals in short: > >> 1. Stick to the return that works -- python's return statement -- > >> and avoid the return that seems

Re: How to show a dictionary sorted on a value within its data?

2014-10-02 Thread Rustom Mody
On Thursday, October 2, 2014 4:47:50 PM UTC+5:30, Marko Rauhamaa wrote: > > It's not as if I'm new to programming either, I've been writing > > software professionally since the early 1970s, now retired. I have no > > formal computer training, there wasn't much in the way of university > > courses

Re: Function passed as an argument returns none

2014-10-02 Thread Rustom Mody
On Friday, October 3, 2014 5:41:12 AM UTC+5:30, Steven D'Aprano wrote: > [Rustom] > > Right and the OP subject as well as post are essentially that conflation: > [allegedly Steven] > >> Any idea why 'None' is getting passed even though calling the donuts(4) > >> alone returns the expected value?

Re: Timezones

2014-10-05 Thread Rustom Mody
On Monday, October 6, 2014 3:45:44 AM UTC+5:30, Mark Lawrence wrote: > On 05/10/2014 22:17, Seymore4Head wrote: > > This is not a new video, but it is new to me. > > https://www.youtube.com/watch?v=-5wpm-gesOY > > Any links to some easy to follow time zone math? > My advice is to avoid time zones,

Re: Practice question

2014-10-05 Thread Rustom Mody
On Monday, October 6, 2014 5:04:11 AM UTC+5:30, Skip Montanaro wrote: > On Oct 5, 2014 6:07 PM, Seymore4Head wrote: > > For the record, I don't want a hint.  I want the answer. > > I see a practice question is similar to this. > > 15 <= x < 30  And it wants a similar expression that is equivalent.

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 6:34:27 PM UTC+5:30, Skip Montanaro wrote: > On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > > Sorry Seymore if this sounds condescending -- its not a complaint > > against you but against those who treat the print statement/expression as > &g

Re: Practice question

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: > On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > > Consider the sequence: > > 1. Drives on the wrong side of the road > > 2. Has no clue that there's such a concept as 'wrong side of road&

Re: Representing mathematical equations

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 10:52:40 PM UTC+5:30, Dave Angel wrote: > varun7rs Wrote in message: > > On Monday, 6 October 2014 15:03:44 UTC+2, Varun wrote: > (Deleted all the 8-space quoting. Either use a better email client > or remove the extra 7 lines between every line you > quote.) > >> Ok

Re: Representing mathematical equations

2014-10-06 Thread Rustom Mody
On Monday, October 6, 2014 11:18:55 PM UTC+5:30, Rustom Mody wrote: > >>> sum([(x,y) for (x,y) in L]) > Traceback (most recent call last): > TypeError: unsupported operand type(s) for +: 'int' and 'tuple' > Python just expressing that you are goofing

Re: Practice question

2014-10-08 Thread Rustom Mody
On Tuesday, October 7, 2014 2:19:39 AM UTC+5:30, Steven D'Aprano wrote: > I have fewer issues with your conclusion and analogy than I do with the > basic premise that there is a connection between Seymore's problem here > and the use, or non-use, of print in the interactive interpreter. I don't

Re: Practice question

2014-10-08 Thread Rustom Mody
On Wednesday, October 8, 2014 9:58:11 PM UTC+5:30, Skip Montanaro wrote: > On Wed, Oct 8, 2014 at 11:14 AM, Rustom Mody wrote: > > So pushing beginners away from print can push them up the learning > > curve more quickly > Or more quickly discourage them. I still use prin

Re: Toggle

2014-10-08 Thread Rustom Mody
On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote: > Seymore4Head writes: > > I want to toggle between color="Red" and color="Blue" > It's good to cultivate ongoing familiarity with the standard library And language. In recent python3: >>> class Color(Enum): ... Red = 0 ...

Re: Toggle

2014-10-08 Thread Rustom Mody
On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >>>> Color.Red > >>>> print (Color.Red) > > Color.Red > > # Not sure what to make of that distinction... > Th

trying idle

2014-10-08 Thread Rustom Mody
Been using emacs for over 20 years and teaching python for 10. And getting fed up that my audience looks at me like Rip van Winkle each time I start up emacs... So trying out Idle... Some specific and some general questions: My audience consists of people having linux and windows and macbooks. Do

Re: Toggle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 1:21:49 PM UTC+5:30, Peter Otten wrote: > Rustom Mody wrote: > > BTW is there some flag that can make them identical? > No flag, but you can tweak that P: > >>> import sys > >>> sys.displayhook = print > >>> "f

Re: trying idle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 2:56:56 PM UTC+5:30, Terry Reedy wrote: > > Specific: > > Is there a way to cut-paste a snippet from the interpreter window > > containing ">>> " "... " into the file window and auto-remove the prompts? > > [I have a vague recollection of Terry showing somethin...] > I

Re: trying idle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 2:56:56 PM UTC+5:30, Terry Reedy wrote: > On 10/9/2014 2:52 AM, Rustom Mody wrote: > > My audience consists of people having linux and windows and macbooks. > > Does Idle run on all these? > If macbook runs OSX, and the linux has recent tcl/tk instal

Re: Toggle

2014-10-09 Thread Rustom Mody
On Thursday, October 9, 2014 9:39:07 PM UTC+5:30, Ian wrote: > On Wed, Oct 8, 2014 at 8:34 PM, Rustom Mody wrote: > > On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote: > >> Seymore4Head writes: > >> > I want to toggle between color="Red&

Re: trying idle

2014-10-09 Thread Rustom Mody
On Friday, October 10, 2014 2:19:53 AM UTC+5:30, Terry Reedy wrote: > On 10/9/2014 9:12 AM, Rustom Mody wrote: > > On Thursday, October 9, 2014 2:56:56 PM UTC+5:30, Terry Reedy wrote: > >> On 10/9/2014 2:52 AM, Rustom Mody wrote: > >>> My audience consists of peopl

Re: CLI framework using python

2014-10-10 Thread Rustom Mody
On Thursday, October 9, 2014 9:31:39 PM UTC+5:30, gelonida wrote: > For calling commands in a slightly nicer way than os.system / > sybprocess.Popen you might look at sh or plumbum > https://pypi.python.org/pypi/sh > https://pypi.python.org/pypi/plumbum Both of these look quite nice! [Im looki

Re: Toggle

2014-10-10 Thread Rustom Mody
On Friday, October 10, 2014 12:48:20 PM UTC+5:30, Steven D'Aprano wrote: > Rustom Mody wrote: > > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote: > >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote: > >> >>>> Color

Re: Toggle

2014-10-10 Thread Rustom Mody
On Friday, October 10, 2014 7:54:33 PM UTC+5:30, Rustom Mody wrote: > More telling comments from Alex (same SO post) > 1. Both have mostly useless default implementations > 2. if you override __repr__, that's ALSO used for __str__, but not vice versa > 3. despite the words on the

Re: Parse bad xml file

2014-10-12 Thread Rustom Mody
On Friday, October 10, 2014 6:03:58 PM UTC+5:30, David Jobes wrote: > On Friday, October 10, 2014 8:21:17 AM UTC-4, Peter Otten wrote: > That did it, thank you, and in a lot fewer lines of code than i had, i was > trying to use strings and regex. i will read up more on the xml.etree stuff. Tho

Re: TypeError: 'kwarg' is an invalid keyword argument for this function

2014-10-12 Thread Rustom Mody
Whats the problem?? Seems to work (python 2.7.8) [Ive added a line so that that you can see] class C: def __init__(self): pass class C2(C): def __init__(self, *args, **kwargs): self.dic = kwargs pass x = C2(kwarg='a') y = C2(kwarg='a', kwarg2=8) ==

Re: what is the easiest way to install multiple Python versions?

2014-10-12 Thread Rustom Mody
On Sunday, October 12, 2014 7:06:14 PM UTC+5:30, Albert-Jan Roskam wrote: > Hi, > > A few days ago I needed to check whether some Python code ran with Python > 2.6. What is the easiest way to install another Python version along side the > default Python version? My own computer is Debian Linux

Re: what is the easiest way to install multiple Python versions?

2014-10-13 Thread Rustom Mody
On Monday, October 13, 2014 1:24:27 PM UTC+5:30, Chris Angelico wrote: > On Mon, Oct 13, 2014 at 1:31 PM, Rustom Mody wrote: > > Hearing a bit about docker nowadays. > > Here's why its supposedly better than a VM: > > https://www.docker.com/whatisdocker/ > > Dow

Re: while loop - multiple condition

2014-10-13 Thread Rustom Mody
On Monday, October 13, 2014 9:43:03 PM UTC+5:30, Rob Gaddi wrote: > On Mon, 13 Oct 2014 09:56:02 +1100 > Steven D'Aprano wrote: > > When you have multiple clauses in the condition, it's easier to reason about > > them if you write the clauses as positive statements rather than negative > > stateme

Re: while loop - multiple condition

2014-10-13 Thread Rustom Mody
On Monday, October 13, 2014 10:13:20 PM UTC+5:30, Rob Gaddi wrote: > On Mon, 13 Oct 2014 09:26:57 -0700 (PDT) > Rustom Mody wrote: > > On Monday, October 13, 2014 9:43:03 PM UTC+5:30, Rob Gaddi wrote: > > > On Mon, 13 Oct 2014 09:56:02 +1100 > > > Steven D'A

Re: downloading from links within a webpage

2014-10-14 Thread Rustom Mody
On Tuesday, October 14, 2014 8:12:56 PM UTC+5:30, Shiva wrote: > Hi, > Here is a small code that I wrote that downloads images from a webpage url > specified (you can limit to how many downloads you want). However, I am > looking at adding functionality and searching external links from this page

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Rustom Mody
On Wednesday, October 15, 2014 7:35:18 AM UTC+5:30, Dave Angel wrote: > anurag 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"}, > > "3":{"Key1":"Value1", "Key2

Re: Parsing Python dictionary with multiple objects

2014-10-14 Thread Rustom Mody
On Wednesday, October 15, 2014 9:10:54 AM UTC+5:30, Anurag Patibandla wrote: > 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(rou

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Rustom Mody
On Wednesday, October 15, 2014 9:22:48 PM UTC+5:30, Anurag Patibandla wrote: > 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

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Rustom Mody
On Wednesday, October 15, 2014 9:58:49 PM UTC+5:30, Anurag Patibandla wrote: > 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

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Rustom Mody
On Wednesday, October 15, 2014 10:13:18 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, October 15, 2014 9:58:49 PM UTC+5:30, Anurag Patibandla wrote: > > First the values printed by > > '[(queues[j], json.get(queues[j])) for j in range(len(queues))] ' > > is a list

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Rustom Mody
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(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

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Rustom Mody
On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote: > 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":

python3 on mac-mavericks (was trying idle)

2014-10-16 Thread Rustom Mody
On Thursday, October 9, 2014 2:56:56 PM UTC+5:30, Terry Reedy wrote: > One may have to install activestate tkc/tk on mac, depending on osx > version. This page has details: > https://www.python.org/download/mac/tcltk Ok Ive some more information: The people in the audience using macs are usin

Re: python3 on mac-mavericks (was trying idle)

2014-10-16 Thread Rustom Mody
On Friday, October 17, 2014 3:48:20 AM UTC+5:30, Cameron Simpson wrote: > On 16Oct2014 06:29, rusi wrote: > >On Thursday, October 9, 2014 2:56:56 PM UTC+5:30, Terry Reedy wrote: > >> One may have to install activestate tkc/tk on mac, depending on osx > >> version. This page has details: > >> ht

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-10-16 Thread Rustom Mody
On Tuesday, September 30, 2014 10:09:52 PM UTC+5:30, Rustom Mody wrote: > On Tuesday, September 30, 2014 8:48:15 PM UTC+5:30, c...@isbd.net wrote: > > Rustom Mody wrote: > > > On Tuesday, September 30, 2014 5:18:31 PM UTC+5:30, Chris wrote: > > > > I would actually

Re: Quick Question About Setting Up Pytz

2014-10-18 Thread Rustom Mody
On Sunday, October 19, 2014 8:25:53 AM UTC+5:30, Ben Finney wrote: > Chris Angelico writes: > > Try learning Python itself, rather than playing around with extension > > packages like pytz. > To be fair, "You need to install 'pytz' to work correctly with date and > time values" is correct advice.

Re: Question about PANDAS

2014-10-19 Thread Rustom Mody
On Sun, Oct 19, 2014 at 3:57 PM, Ryan Shuell wrote: > > Thanks guys. I just feel frustrated that I can't do something useful. > I'm reading all about dictionaries, and types, and touples. Then I read > about string manipulation and loops; two of my favorite things to do. Then > I read about logi

formal program verification in python?

2014-10-20 Thread Rustom Mody
A colleague asked me if there were any formal program verification (or derivation) books which are python based. Sometimes known as 'Hoare/Dijkstra logic' I would be pleasantly surprised if there are! Still... In case anyone knows of any -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-22 Thread Rustom Mody
On Wednesday, October 22, 2014 5:01:08 PM UTC+5:30, Ned Batchelder wrote: > On 10/22/14 5:05 AM, buscacio wrote: > > Em quarta-feira, 22 de outubro de 2014 06h29min55s UTC-2, ast escreveu: > >> Hello > >> Is there in Python something like: > >> j = (j >= 10) ? 3 : j+1; > >> as in C language ? > >>

bicycle repair man help

2007-06-23 Thread Rustom Mody
Does someone know that when using bicycle repair man to refactor python code what exactly extract local variable means? -- http://mail.python.org/mailman/listinfo/python-list

emacs for python

2007-06-24 Thread Rustom Mody
I wish to set up emacs for python usage. The specific questions are: 1. Which python mode should one use? It seems there is one from python and one from emacs and both are deliberately named so as to be confusable!! I would like one that gives... 2. Good support for debugging: I hear pdbtrack

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Rustom Mody
Hi folks! Dont want to spoil the fun of a real flame war here but what I want to ask is directly relevant to emacs in python [And the answers may even add some light to the current heat :-) ] I will be training a bunch of kids for using python in a data-center linux-sysadmin context. I intend t

amara bugs

2007-06-25 Thread Rustom Mody
I tried to install amara according to the recommendations on this list. There were evidently compilation errors. The results are below Also the quick reference gives 404 not found errors Thanks $ sudo easy_install amara Searching for amara Best match: Amara 1.2.0.2 Processing Amara-1.2.0.2-py2.

Re: Indenting in Emacs

2007-06-26 Thread Rustom Mody
Ive been struggling with this same question -- which python mode -- for a while but not getting anywhere! I understand (from the emacs list) that the new python mode has better support for debugging (pdbtrack in addition to pdb) but dont know much more. On 6/26/07, John J. Lee <[EMAIL PROTECTED]

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-28 Thread Rustom Mody
On 6/28/07, Andreas Eder <[EMAIL PROTECTED]> wrote: > Twisted> In the other corner, we have just about every Unix application > ever > Twisted> developed. When a user needs help, they may do such things as > manually > Twisted> explore the directories where the application was instal

trouble with sqlite under debian etch

2007-06-30 Thread Rustom Mody
I was trying to follow the sqlalchemy tutorial on my debian etch box and got stuck with installation. Any help/pointers will be welcome. First after installing sqlalchemy needed some sqlite package synaptic showed me packages python-pysqlite, python-pysqlite1.1 and python-pysqlite2. Theres some

How to uninstall packages

2007-06-30 Thread Rustom Mody
Recently I had trouble with the sqlite package under my debian etch box as follows: I first installed the debian package python-pysqlite1.1 using synaptic. Since this seemed too old for other packages (sqlalchemy) I downloaded the sources pysqlite-2.3.4.tar.gz and ran setup install. This gave th

Re: How to uninstall packages

2007-07-01 Thread Rustom Mody
-management systems which invariably quarell with the native apt/rpm or whatever... On 7/1/07, Thomas Jollans <[EMAIL PROTECTED]> wrote: > On Sunday 01 July 2007, Rustom Mody wrote: > > > I first installed the debian package python-pysqlite1.1 using > > synaptic. Since this seemed to

<    11   12   13   14   15   16   17   18   >