Re: anomaly

2015-05-11 Thread alex23
On 12/05/2015 1:39 AM, zipher wrote: On Monday, May 11, 2015 at 10:34:24 AM UTC-5, Grant Edwards wrote: That Python, like COBOL, is an eminently practical language. LOL! Good one. I would make an incredibly substantial wager that you've never developed anything of note in either Python or

Re: A question on the creation of list of lists

2015-04-27 Thread alex23
On 23/04/2015 2:18 AM, subhabrata.bane...@gmail.com wrote: I have a list of file names of a directory, I want to read each one of them. After reading each one of them, I want to put the results of each file in a list. These lists would again be inserted to create a list of lists. While there's

Re: Automation of Windows app?

2015-03-31 Thread alex23
On 23/03/2015 1:43 PM, Michael Torrie wrote: As near as I can tell the standard go-to utility for this is a program called AutoIt. https://www.autoitscript.com/site/autoit/ Nothing to do with Python, and its scripting language is maybe not that appealing to many, but it does the job, and does i

Re: An object is an instance (or not)?

2015-01-27 Thread alex23
On 28/01/2015 10:24 AM, Mario Figueiredo wrote: In other words, the object know as "Sub class" is not an instance object. True, it is an instance of the object 'type'. >>> class Foo: ... pass ... >>> isinstance(Foo, type) True >>> isinstance(Foo, object) True A

Re: An object is an instance (or not)?

2015-01-27 Thread alex23
On 28/01/2015 10:35 AM, Mario Figueiredo wrote: I admit it was a contrived example. I couldn't think of a way to demonstrate that a class object does not participate in its own inheritance rules. Only instances of it can. A class object isn't an instance of itself, it's an instance of the Clas

Re: Python is DOOMED! Again!

2015-01-23 Thread alex23
On 22/01/2015 7:37 PM, Nicholas Cole wrote: Still, it would have been nicer to be able to write something like this (where the Unions are implicit): Coincidentally, you also demonstrate what makes this a lesser idea :) def handle_employees(employees, rasie):

Re: What killed Smalltalk could kill Python

2015-01-22 Thread alex23
On 22/01/2015 1:23 PM, Steven D'Aprano wrote: Modern games *are* part of "today's complex application systems", and games developers may need the same skills used by "serious developers" I wish more game developers would understand this. I've lost count of the number of games that have failed

Re: What killed Smalltalk could kill Python

2015-01-22 Thread alex23
On 22/01/2015 11:45 AM, Chris Angelico wrote: It's not a terrible justification for getting into programming. But writing games is (almost always) a terrible way to start programming. However, modifying games, I would argue, is a great way. The ComputerCraft mod for Minecraft, for example, add

Re: How to "wow" someone new to Python

2015-01-18 Thread alex23
On 17/01/2015 1:03 AM, Chris Angelico wrote: Scenario: You're introducing someone to Python for the first time. S/he may have some previous programming experience, or may be new to the whole idea of giving a computer instructions. You have a couple of minutes to show off how awesome Python is. Wh

Re: List of "python -m" tools

2015-01-14 Thread alex23
On 14/01/2015 7:33 PM, Albert-Jan Roskam wrote: You say "Python 2.7.9 and 3.x comes with an easy way to install pip. Run python -m ensurepip and pypi is at your service." . But here https://docs.python.org/3/library/ensurepip.html it says that "This module does not access the internet. All of t

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread alex23
On 11/01/2015 7:31 PM, Steven D'Aprano wrote: If that isn't a form of stupidity, I don't know what is. Maybe you're just eternally optimistic that people can change for the better. -- https://mail.python.org/mailman/listinfo/python-list

Re: If One Line

2014-12-25 Thread alex23
On 26/12/2014 1:37 PM, Steven D'Aprano wrote: One approach is to use a function in the condition to do the assignment: Let me fix that for you: /s/approach/bad idea/ I never said it was a _good_ approach ;) And you don't even save any lines! Instead of a one-liner, you have six lines! Wh

Re: If One Line

2014-12-25 Thread alex23
On 26/12/2014 1:18 AM, JC wrote: Is it possible in python: if ((x = a(b,c)) == 'TRUE'): print x One approach is to use a function in the condition to do the assignment: x = None def assign_to_x(val): global x x = val return val def a(x, y):

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-25 Thread alex23
On 24/12/2014 9:50 PM, alister wrote: what feels like 3 or 4 chapters in & it is still trying to set the scene, an exercise in stylish writing with very little content so far. even early scifi written for magazines on a per word basis were not this excessive (because if they were they would proba

Re: OFF TOPIC Snow Crash [was Re: Hello World]

2014-12-25 Thread alex23
On 24/12/2014 2:20 AM, Grant Edwards wrote: And even _with_ all the technical jibber-jabber, none of it explained or justified the whole "writing a virus to infect the brain through the optic nerve" thing which might just have well been magick and witches. While I love SNOW CRASH, I do think it

Re: How to fix those errors?

2014-11-21 Thread alex23
On 19/11/2014 1:40 PM, Chris Angelico wrote: On Wed, Nov 19, 2014 at 2:02 PM, alex23 wrote: The first time I got a T_PAAMAYIM_NEKUDOTAYIM error, I just about flipped my desk in rage. If that were Hebrew for "scope resolution operator", would it be less rage-inducing? Not esp

Re: PyWart: "Python's import statement and the history of external dependencies"

2014-11-20 Thread alex23
On 16/11/2014 3:01 PM, Rick Johnson wrote: Python's attempt to solve the "external dependencies problem" has yet to produce the results that many people, including myself, would like. I'd say this was an argumentum ad populum, only you didn't cite anything that shows the "many" you claim you s

Re: How to fix those errors?

2014-11-18 Thread alex23
On 17/11/2014 1:06 PM, Chris Angelico wrote: You could then name it in Hebrew: Paamayim Nekudotayim. There is excellent precedent for this - it's done by a language in whose footsteps Python strives to follow. The first time I got a T_PAAMAYIM_NEKUDOTAYIM error, I just about flipped my desk in

Re: [Python-Dev] Dinamically set __call__ method

2014-11-04 Thread alex23
On 11/04/2014 08:52 AM, Roberto Martínez wrote: I am trying to replace dinamically the __call__ method of an object using setattr. Example: $ cat testcall.py class A: def __init__(self): setattr(self, '__call__', self.newcall) def __call__(self): print("OLD") d

Re: % symbol in python

2014-10-28 Thread alex23
On 29/10/2014 2:41 PM, satishmlm...@gmail.com wrote: > kindly let me know what is $ROWS$ along with % symbol's meaning It's a token, a static value added to the template to indicate where additional data will be added. So $ROW$ in this section: key $ROWS$ > Will be replaced by wh

Re: Anyone know the solution

2014-10-28 Thread alex23
On 29/10/2014 11:28 AM, Anton wrote: Can you elaborate why it is an NP-complete problem or maybe a link to description of problem you are referring to? While not the exact problem, it's tangentially related to: http://kenlevine.blogspot.com.au/2011/03/reducing-humor-to-equation.html -- https

Re: Anyone know the solution

2014-10-27 Thread alex23
On 28/10/2014 1:10 AM, emmanuel...@gmail.com wrote: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating whether the names wer

Re: I am out of trial and error again Lists

2014-10-22 Thread alex23
On 23/10/2014 10:02 AM, Seymore4Head wrote: On Thu, 23 Oct 2014 00:44:01 +0100, Mark Lawrence wrote: One more question. if y in str(range(10) Why doesn't that work. I suggest you try str(range(10)) from the interactive prompt and see exactly what you get, as it's nothing like what you expect :

Re: Is there an easy way to control indents in Python

2014-10-15 Thread alex23
On 16/10/2014 12:32 AM, Chris “Kwpolska” Warrick wrote: It should parse this as else: print 'false' print 'done' Why? Because things like `print 'done'` usually have an empty line before it: if True: print 'true' else: print 'false' print 'done' That should be parsed the way you w

Re: Is there an easy way to control indents in Python

2014-10-15 Thread alex23
On 15/10/2014 12:23 PM, Juan Christian wrote: Using PyCharm is easy: File > Settings > (IDE Settings) Editor > Smart Keys > Reformat on paste > choose "Reformat Block" This isn't as straight forward as you imply. Say I have misindented code like this: if True: print 'true' els

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

2014-10-13 Thread alex23
On 13/10/2014 8:04 PM, Dave Angel wrote: It would also help to spell it the same. In the OP's implementation, he defined kwargs, and tried to use it as kwarg. That's perfectly okay, though: if `kwargs` is the name used to reference the dictionary of keyword arguments, `kwarg` would be an

Re: Need help in pulling SQL query out of log file...

2014-10-13 Thread alex23
On 14/10/2014 11:47 AM, Sagar Deshmukh wrote: I have a log file which has lot of information like..SQL query.. number of records read...records loaded etc.. My requirement is i would like to read the SQL query completly and write it to another txt file.. Generally we encourage people to post

Re: Love to get some feedback on my first python app!!!

2014-09-22 Thread alex23
On 23/09/2014 4:25 AM, Chris Angelico wrote: On Tue, Sep 23, 2014 at 4:24 AM, Chris Kaynor wrote: But the thing that requires the comment is the "2", not the "print" or the "cells". And that comes to a more common issue: any number other than 0 or 1 in code most likely needs a comment (that com

Re: Python vs C++

2014-08-26 Thread alex23
On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly mailto:ian.g.ke...@gmail.com>>: It would be just as easy or easier in Python, or one could save a lot more effort by just using RPG Maker like every other indie RPG developer seems to do. I don't thi

Re: Switching from nose to unittest2 - how to continue after an error?

2014-08-25 Thread alex23
On 26/08/2014 6:12 AM, Mark Lawrence wrote: Whatever happened to "There should be one-- and preferably only one --obvious way to do it."? :) Ignoring for a moment that "one obvious way" only applies to Python-the-language, when it comes to libraries, there's a few factors (IMO) that affect th

Re: Working with decimals part 2

2014-08-25 Thread alex23
On 26/08/2014 3:55 AM, Seymore4Head wrote: I changed the program just a little to give myself a little practice with number formats. The main thing I wanted to do was make the decimal points line up. The problem I am having is with the print (count)(payment)(balance) line. While I don't want

Re: Why can not initialize the class?

2014-08-24 Thread alex23
On 23/08/2014 1:17 AM, Steven D'Aprano wrote: Luofeiyu, you are getting stuck on basic questions. Before working with advanced features like properties, you should learn the simply features. Has luofeiyu ever actually acknowledged any such comment or request people have made? I see we've given

Re: Python vs C++

2014-08-24 Thread alex23
On 24/08/2014 7:14 PM, Robert Kern wrote: On 2014-08-22 01:26, Chris Angelico wrote: Every time Cython gets discussed, I get a renewed desire to learn it. Trouble is, I don't have any project that calls for it - there's nothing I'm desperately wanting to do that involves both Python and C/C++. A

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread alex23
On 21/08/2014 7:30 PM, icefap...@gmail.com wrote: On Thursday, August 21, 2014 2:27:08 AM UTC-7, Marko Rauhamaa wrote: In practice, your proposal would not make life easier for Python programmers. neither did the lambda, yours truly supposes? alex23 disagrees. alex23 finds the lambda

Re: Topological Overlap

2014-08-17 Thread alex23
On 17/08/2014 4:10 AM, lavanya addepalli wrote: Actually it is a huge project and topological overlap is one part in that inputfile: 0_node_1 0_node_2 w0 1_node_1 1_node_2 w1 2_node_1 2_node_2 w2 3_node_1 3_node_2 w3 4_node_1 4_node_2 w4 5_node_1 5_node_2 w5 2 nodes in pair and w is the

Re: Suitable Python code to scrape specific details from web pages.

2014-08-17 Thread alex23
On 13/08/2014 7:28 AM, Roy Smith wrote: Second, if you're going to be parsing web pages, trying to use regexes is a losing game. You need something that knows how to parse HTML. The canonical answer is lxml (http://lxml.de/), but Beautiful Soup (http://www.crummy.com/software/BeautifulSoup/) is

Re: Captcha identify

2014-08-15 Thread alex23
On 15/08/2014 5:43 AM, Eric S. Johansson wrote: On 8/14/2014 2:37 PM, Peter Pearson wrote: "Which of the following eight sentences are sarcastic in tone?" and responses on this list alone show problems with detecting sarcasm (or snark). It can be especially difficult for people on the autism

Re: how to write file into my android phone?

2014-08-13 Thread alex23
On 10/08/2014 7:08 PM, Chris “Kwpolska” Warrick wrote: 2) the phone isn't necessarily visible on a pc as a drive at all. For example the Samsung gs4. This is actually true for ALL android devices, starting with Android 3.0. This isn't true for my Samsung gs2 running Android 4.1.2. -- https:

Re: Wikibooks example doesn't work

2014-08-06 Thread alex23
On 7/08/2014 1:25 PM, Seymore4Head wrote: This part was added as an exercise. A counter is added to give 3 tries to guess the number. It is supposed to stop after count gets to 3. It doesn't. It just keeps looping back and asking for another guess. You've misread the exercise: Modify the hig

Re: Making every no-arg method a property?

2014-08-05 Thread alex23
On 6/08/2014 9:49 AM, Ben Finney wrote: Christian Calderon writes: I like that in ruby I don't have to type parenthesis at the end of each function call if I don't need to provide extra arguments. Having the same name sometimes refer to “get this as a value” and other times “call this as a f

Re: Question about Pass-by-object-reference?

2014-07-24 Thread alex23
On 23/07/2014 10:27 AM, Terry Reedy wrote: When you call a function, Python binds function parameter names to argument objects in the function's local namespace, the same as in name assignments. Given def f(a, b): pass a call f(1, 'x') starts by executing a, b = 1, 'x' in the local namespace.

Re: Python 3 is killing Python

2014-07-17 Thread alex23
On 18/07/2014 10:45 AM, Andrew Berg wrote: Maybe he's too busy working on RickPy 4000 (or whatever it was called). I believe the new working name is PypeDream. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 is killing Python

2014-07-17 Thread alex23
On 18/07/2014 10:26 AM, Mark Lawrence wrote: I'm looking forward to see the massive number of fixes that come from rr I'm still waiting for RickPython, the One True Python. Remember when he used to rant as if he was actually working on it and not just pissing in the wind? -- https://mail.py

Re: Python 3 is killing Python

2014-07-17 Thread alex23
On 17/07/2014 1:14 PM, Steven D'Aprano wrote: There will never be a Python 2.8. When push comes to shove, the people bitching about Python 3 will not do the work necessary to fork Python 2.7 and make a version 2.8. +1 The idea that forking and maintaining Python 2.8 is somehow _less effort_ t

Re: Multiple python versions, one dev environment???

2014-07-17 Thread alex23
On 18/07/2014 9:44 AM, Roy Smith wrote: In article , Ned Batchelder wrote: Virtualenv is definitely the right way to isolate different Python environments from each other. Absolutely. Don't even consider any other alternative. Just do it. Not even buildout? :) -- https://mail.python.org

Re: Python 3 is killing Python

2014-07-16 Thread alex23
On 15/07/2014 11:57 PM, Kevin Walzer wrote: The number of language revisions that result in deliberate, code-level incompatibility out there is pretty small. People rightly expect that code written for version 2.x of a language will continue to work with version 3.x, even if 3.x is designed to go

Re: initializing "parameters" class in Python only once?

2014-07-16 Thread alex23
On 15/07/2014 3:28 PM, Steven D'Aprano wrote: # === module params.py === class Params(object): a = 1 b = 2 @property def c(self): return self.a**2 + self.b**2 - self.a + 1 params = Params() del Params # hide the class Then callers just say: from params import pa

Re: Create flowcharts from Python

2014-06-17 Thread alex23
On 18/06/2014 1:32 AM, Nagy László Zsolt wrote: Is there a library for Python that can easily create flowcharts using a simple API? The diagram application Dia comes with a Python API: https://wiki.gnome.org/Apps/Dia/Python -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: This Swift thing

2014-06-09 Thread alex23
On 6/06/2014 9:11 PM, Alain Ketterlin wrote: The nice thing with optional type annotations and an hypothetical Python compiler would be that you could, e.g., continue using the interpreter during development and then compile for production use. s/annotations/decorators/ and you effectively have

Re: Everything you did not want to know about Unicode in Python 3

2014-05-12 Thread alex23
On 13/05/2014 11:39 AM, Chris Angelico wrote: On Tue, May 13, 2014 at 11:18 AM, Steven D'Aprano wrote: - have a bytes version of sys.argv (bargv? argvb?) and read the file names from that; argb? :) I tried and failed to come up with an "argy bargy" joke here so decided to go for a meta-

Re: a better way to operate svn with python(better than pysvn)?

2014-05-12 Thread alex23
On 13/05/2014 1:16 AM, xs.nep...@gmail.com wrote: > ... Rather than just send an empty message, why not explain what you don't like about pysvn so that someone could provide more pertinant advice? But since you didn't: https://pypi.python.org/pypi?%3Aaction=search&term=svn&submit=search -- h

Re: Teaching python to non-programmers

2014-04-13 Thread alex23
On 11/04/2014 3:42 PM, Rustom Mody wrote: On Friday, April 11, 2014 10:41:26 AM UTC+5:30, Chris Angelico wrote: On Fri, Apr 11, 2014 at 2:37 PM, Rustom Mody wrote: Right. Its true that when I was at a fairly large corporate, I was not told: "Please always top post!" What I was very gently and

Re: [OFF-TOPIC] How do I find a mentor when no one I work with knows what they are doing?

2014-04-09 Thread alex23
On 9/04/2014 6:55 PM, Mark Lawrence wrote: And the worst thing about terrible code is when you first realise just how bad it is and wonder why you wrote it like that in the first place. For me, it's nearly always due to time constraints. Usually caused by a comment like: "we absolutely need th

Re: Keeping track of things with dictionaries

2014-04-08 Thread alex23
On 9/04/2014 12:33 PM, Chris Angelico wrote: Unfortunately I seem to be missing antidisestablishmentarianism, because the longest words in my dict are only 24 characters, excluding the '\n'. Should I ask for my money back? I think you should. That's a fundamental flaw in the dictionary. Everyon

Re: Keeping track of things with dictionaries

2014-04-08 Thread alex23
On 8/04/2014 6:31 PM, Frank Millman wrote: Here is an idea, inspired by Peter Otten's suggestion earlier in this thread. Instead of defaultdict, subclass dict and use __missing__() to supply the default values. When the dictionary is set up, delete __missing__ from the subclass! Ugly, but it see

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-08 Thread alex23
On 8/04/2014 6:21 PM, Steven D'Aprano wrote: Functions which are intended to return a value may be named as verbs: [...] or as nouns: int Shorthand for 'integerise'. str 'stringify' dict 'dictionarate' coordinate array These are both verbs. ...I'll get me coat. -- https://mail.

Re: [OFF-TOPIC] How do I find a mentor when no one I work with knows what they are doing?

2014-04-08 Thread alex23
On 9/04/2014 3:29 AM, Chris Angelico wrote: My code would make for terrible PHP. :) Don't feel bad about that. It's a truism for every language, including PHP. -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread alex23
On 4/04/2014 2:38 AM, Mark H Harris wrote: If I speak of the python community, and I rarely do Maybe you speak "of" them rarely but you claim to speak "for" them fairly often. Python3 is not perfect; but python3 is *way* more consistent than python2 and consequently *way* more useful th

Re: Compact way to assign values by slicing list in Python

2014-04-03 Thread alex23
On 3/04/2014 11:50 PM, Marco Buttu wrote: I prefere this one: bar = ['a','b','c','x','y','z'] v1, _, _, v2, v3, _ = bar I also like the solution with itemgetter: v1, v2, v3 = itemgetter(0, 3, 4)(bar) but I think it is less readable than the previous one What if you wanted the 2nd, 37th, and

Re: Python to be replaced by the new language called Cookie !

2014-04-02 Thread alex23
On 2/04/2014 3:42 PM, Chris Angelico wrote: Python 2.8 is supported only on Windows XP 64-bit, and you should upgrade to 32-bit Python That would be Python 1.4 -- https://mail.python.org/mailman/listinfo/python-list

Re: meta language to define forms

2014-03-27 Thread alex23
On 28/03/2014 6:56 AM, Sells, Fred wrote: The idea is to use a nice clean syntax like Python to define form content, then render it as HTML but only as a review tool for users, The actual rendering would go into a database to let a vendor's tool generate the form in a totally non-standard syn

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-25 Thread alex23
On 25/03/2014 12:39 PM, Mark H Harris wrote: my version semantically is "how it is perceived" by the user Could you please stop claiming to have insight into the comprehension of anyone other than yourself? Hasty generalisations don't help your argument. -- https://mail.python.org/mailman/lis

Re: running python 2 vs 3

2014-03-20 Thread alex23
On 3/20/2014 3:07 PM, John Gordon wrote: There are two ways (at least!) to run a python script: > On 21/03/2014 8:05 AM, Terry Reedy wrote: 3. [...] "Our chief weapon is..." -- https://mail.python.org/mailman/listinfo/python-list

Re: Balanced trees

2014-03-11 Thread alex23
On 11/03/2014 8:12 PM, Marko Rauhamaa wrote: Python should let skilled professionals do their work. Thankfully, for the most part, it does. Skilled professionals don't solely rely on the standard library, either. If you know you need a balanced tree, you'll also know where to find an implemen

Re: Reference

2014-03-05 Thread alex23
On 6/03/2014 10:52 AM, Marko Rauhamaa wrote: I was just saying talking about id() as a memory address isn't all that bad. It's a bit like rolling down your power windows or turning up the volume, when there's nothing to roll or turn. There's no risk of getting your program wrong. Unless you're

Re: Reference

2014-03-04 Thread alex23
On 5/03/2014 4:10 PM, Rustom Mody wrote: A python programmer who needs/wants to think of same/is in this sense should probably be using C or assembly Any programmer who is obsessing about some idea of philosophical purity should probably not be using Python. -- https://mail.python.org/mailma

Re: Reference

2014-03-04 Thread alex23
On 5/03/2014 3:47 PM, Rustom Mody wrote: That python is a hll means that machine reprs are intended to be abstracted away. 'is' fails to do that -- proof of that being the discrepancy between is and == The "discrepancy" is because _they're fundamentally different_: >>> a = b = [1,2] >>

Re: How do I process this?

2014-03-04 Thread alex23
On 4/03/2014 2:03 PM, Igor Korot wrote: Hi, ALL, I have a csv file which depending on how it was produced gives 2 different strings as shown in the example below (test1 and test2). I am only interested in the first field in test1 and obviously in the whole string of test2. >>> test1 = "a" >

Re: Coding a simple state machine in python

2014-03-02 Thread alex23
On 25/02/2014 8:01 PM, Peter Otten wrote: alex23 wrote: No, the _easy_ solution is [find a suitable package on PyPI] Easy? By the time I have evaluated these I've written my own ;) It's never writing a solution that's the problem...it's maintaining it ove

Re: end quote help for a newbie

2014-02-27 Thread alex23
On 27/02/2014 8:41 PM, Chris Angelico wrote: On Thu, Feb 27, 2014 at 9:30 PM, Peter Clark wrote: # Dragons and dungeons, based on CP/M program messages from ca. 1966 # This version designed and produced by peter clark beginning in December 2013 def startandload(n):# introduce program and all

Re: [Baypiggies] Class decorator to capture the creation and deletion of objects

2014-02-24 Thread alex23
On 25/02/2014 12:34 PM, Chris Angelico wrote: On Tue, Feb 25, 2014 at 1:24 PM, Alex Martelli wrote: At this point, all entries in the table should be deleted; query should return an empty list! You can't actually depend on del resulting in __del__ being called. Mind those attributions, Chri

Re: Coding a simple state machine in python

2014-02-24 Thread alex23
On 25/02/2014 1:27 PM, Tim Daneliuk wrote: On 02/24/2014 08:55 PM, William Ray Wing wrote: On Feb 24, 2014, at 8:30 PM, Ronaldo wrote: How do I write a state machine in python? >> Stackoverflow has a couple of compact examples here: Now you're making it TOO easy Bill ;) No, the _easy_ so

Re: Functions help

2014-02-23 Thread alex23
On 24/02/2014 11:09 AM, Mark Lawrence wrote: On 24/02/2014 00:55, alex23 wrote: for _ in range(5): func() the obvious indentation error above Stupid cut&paste :( -- https://mail.python.org/mailman/listinfo/python-list

Re: Functions help

2014-02-23 Thread alex23
On 23/02/2014 3:43 PM, Scott W Dunning wrote: I had a question regarding functions. Is there a way to call a function multiple times without recalling it over and over. Meaning is there a way I can call a function and then add *5 or something like that? The same way you repeat anything in P

Re: Wikipedia XML Dump

2014-01-28 Thread alex23
On 28/01/2014 9:45 PM, kevinglove...@gmail.com wrote: I have downloaded and unzipped the xml dump of Wikipedia (40+GB). I want to use Python and the SAX module (running under Windows 7) to carry out off-line phrase-searches of Wikipedia and to return a count of the number of hits for each searc

Re: Need Help with Programming Science Project

2014-01-27 Thread alex23
On 24/01/2014 8:05 PM, theguy wrote: I have a science project that involves designing a program which can examine a bit of text with the author's name given, then figure out who the author is if another piece of example text without the name is given. This sounds like exactly the sort of thin

Re: Newbie question. Are those different objects ?

2013-12-22 Thread alex23
On 21/12/2013 2:00 AM, Mark Lawrence wrote: Shall I write a PEP asking for a language change which requires that that stupid = sign is replaced by a keyword reading something like thenameonthelefthandsideisassignedtheobjectontherighthandside ? I propose: tag with -- https://mail.python.o

Re: Figuring out what dependencies are needed

2013-12-16 Thread alex23
On 12/12/2013 4:53 PM, sal i wrote: This is the entire testing file along with the error at the bottom. data = load_from_yahoo() You're _still_ not passing into `load_from_yahoo` either `indexes` or `stocks` parameters, as I tried to point out by highlighting: assert indexes is not None

Re: Comparing values of counter in python 3.3

2013-12-15 Thread alex23
On 12/12/2013 5:49 PM, Amjad Syed wrote: Hello, I have 2 counters generated from list using Collections.counter() I want to print only key,values in Counter2 which have values > then corresponding value in Counter1. E.g Counter1={97:1,99:2,196:2,198:1} Counter2={97:1 ,99:3, 196:1,198:1} # O

Re: load_module for import entire package

2013-12-11 Thread alex23
On 11/12/2013 5:28 PM, Sergey wrote: def get_obj(): pkg = load_package_strict("tmp", basedir) from tmp import main return main.TTT() It is working, but if package code changes on disc at runtime and I call get_obj again, it returns instance of class, loaded for the first time previous

Re: Figuring out what dependencies are needed

2013-12-11 Thread alex23
On 11/12/2013 10:44 PM, s...@nearlocal.com wrote: I'm a Python beginner. I want to use it for stats work, so I downloaded Anaconda which has several of the popular libraries already packaged for Mac OS X. Now I'd like to use the backtesting package from zipline (zipline.io), but while runnin

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread alex23
On 11/12/2013 8:45 PM, Chris Angelico wrote: A round of applause for jmf, folks, for doing a brilliant impression of the uninformed-yet-fanatical Knight Templar villain! Jacques de Molay, thou are avenged! -- https://mail.python.org/mailman/listinfo/python-list

Re: interactive help on the base object

2013-12-10 Thread alex23
On 10/12/2013 7:37 PM, Mark Lawrence wrote: One of the great joys of reading this list is how wonderfully OT it can get. I have the right to make this statement as I started *THIS* thread. Now what *WERE* we talking about? :) The God Object (or Higgs Object for the non-theists). -- https://m

Re: [OT] Managing Google Groups headaches

2013-12-03 Thread alex23
On 3/12/2013 5:13 PM, Steven D'Aprano wrote: You poor fools you, this is what happens when you give control of the tools you use to a (near) monopolist whose incentives are not your incentives. To paraphrase Franklin: those who would give up control to purchase convenience deserve neither. A l

Re: [OT] Managing Google Groups headaches

2013-12-02 Thread alex23
On 3/12/2013 11:17 AM, Michael Torrie wrote: And Gmail is also becoming less useful to me. I don't want to use hangouts; xmpp and google talk worked just fine. But alas that's disappearing. I really hate Hangouts. If I wanted to use Skype I would be using Skype. I'm also still unable to unde

Re: Extending the 'function' built-in class

2013-12-01 Thread alex23
On 2/12/2013 5:18 AM, G. wrote: Hi, I can't figure out how I can extend the 'function' built-in class. I tried: class test(function): def test(self): print("test") but I get an error. Is it possible ? Others have pointed out that you cannot subclass the function type. Could you

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-27 Thread alex23
On 27/11/2013 7:12 PM, Antoon Pardon wrote: However that there is no perfect solution doesn't imply we can't expect some effort from those with english as a mother tongue to search for ways in which to express themselves that are more likely to be understood by those who had to learn english as a

Re: Access and write .mp3 metadata/tags using Python 3

2013-11-26 Thread alex23
On 27/11/2013 1:41 AM, andonefi...@gmail.com wrote: I also want to be able to read the length of the mp3. For this, try the eyed3 library: >>> import eyed3 >>> mp3 = eyed3.load(r'pygame\examples\data\house_lo.mp3') >>> mp3.info.time_secs 7 https://pypi.python.org/pypi/eyeD3/0.

Re: Python classes for reading/writing/parsing MIDI files

2013-11-19 Thread alex23
On 20/11/2013 12:12 AM, Chris Angelico wrote: On Wed, Nov 20, 2013 at 12:50 AM, Annmarina Nagy wrote: the command label gets "stuck" A bit of context would help hugely. Are you replying to someone else's post? All we have is a subject line. They appear to be resurrecting a 12 year old threa

Re: If you continue being rude i will continue doing this

2013-11-19 Thread alex23
On 19/11/2013 2:15 AM, Ferrous Cranus wrote: [...] Any chance you could stop acting like a troll and generating new email addresses in an apparent attempt to get around people's filters? You claim you're acting in good faith, so stop appearing to do otherwise. -- https://mail.python.org/mailma

Re: How can I get the variable to subtract the input please?

2013-11-18 Thread alex23
On 19/11/2013 9:56 AM, Ed Taylor wrote: This will be very simple to most of you I guess but it's killing me! print ("Please type in your age") age = input () leave = 16 print ("You have" + leave - age + "years left at school") I want to have an input where the users age is inserted and then su

Re: Most discussion on comp.lang.python is about developing with Python

2013-11-13 Thread alex23
On 14/11/2013 9:48 AM, Steven D'Aprano wrote: I believe that whatever negative effect Nikos the help-vampire is having, it is long ago overwhelmed by the negative of the anti-Nikos vigilantes. I don't know, the anti-Nikos-vigilante vigilantes are beginning to give them a run for their money, e

Re: datetime question

2013-11-11 Thread alex23
On 12/11/2013 2:49 PM, Grant Edwards wrote: Don't forget that there are also some differences between American and Imperial whitespace. Since it's ASCII whitespace, you should probably assume American... >>> sys.getsizeof(' ') 34 >>> sys.getsizeof(u' ') 52 bad by design -- https://mail.python

Re: توقيت وموعد اذاعة مباراة الزمالك ووادى دجلة فى نهائى كأس مصر اليوم السبت 9/11/2013 والقنوات الناقلة

2013-11-11 Thread alex23
On 12/11/2013 6:32 AM, Tony the Tiger wrote: May your woman betray you, your son be gay, and your daughter screw pigs for a living. Now go eat some pork and choke on it, like a good little terrorist. This is completely unacceptable and has no place on this list. -- https://mail.python.org/mail

Re: Code with random module faster on the vm than the vm host...

2013-11-10 Thread alex23
On 11/11/2013 11:19 AM, Robert Kern wrote: On 2013-11-11 00:49, alex23 wrote: The random module uses os.urandom, No, it doesn't. random.random() is an alias to the random() method on the random.Random class, which uses the Mersenne Twister to generate values. os.urandom() gets called i

Re: Code with random module faster on the vm than the vm host...

2013-11-10 Thread alex23
On 9/11/2013 3:48 AM, Pascal Bit wrote: from random import random > [...] Running on win7 python 2.7 32 bit it uses around 30 seconds avg. Running on xubuntu, 32 bit, on vmware on windows 7: 20 seconds! The code runs faster on vm, than the computer itself... The python version in this case is

Re: Show off your Python chops and compete with others

2013-11-07 Thread alex23
On 8/11/2013 11:54 AM, Roy Smith wrote: Dead code doesn't count. Neither do shifting goalposts. -- https://mail.python.org/mailman/listinfo/python-list

Re: Show off your Python chops and compete with others

2013-11-07 Thread alex23
On 8/11/2013 11:02 AM, Roy Smith wrote: Well, if you want to be truly pedantic about it (*), this defines a function without an explicit return and which does not return None: def foo(): raise Exception In [2]: import dis In [3]: dis.dis(foo) 2 0 LOAD_GLOBAL 0 (Ex

Re: To whoever hacked into my Database

2013-11-07 Thread alex23
On 8/11/2013 7:39 AM, Ian Kelly wrote: Unless the Python installation on Nikos' system has become self-aware and is actively objecting to his code, I think that messages like "Read a manual" and "Learn to code" inserted into a database (as seen in the images that Nikos linked earlier) would norma

Re: Python Practice Problems

2013-11-04 Thread alex23
On 4/11/2013 12:06 PM, yungwong@gmail.com wrote: Hi, who has some problems to practice using Python? Try http://projecteuler.net/ -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >