Re: what does 'a=b=c=[]' do

2011-12-21 Thread alex23
On Dec 22, 8:25 am, Eric einazaki...@yahoo.com wrote: This surprises me, can someone tell me why it shouldn't?  I figure if I want to create and initialize three scalars the just do a=b=c=7, for example, so why not extend it to arrays. The thing to remember is that everything is an object, and

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-20 Thread alex23
On Dec 21, 10:24 am, Nathan Rice nathan.alexander.r...@gmail.com wrote: The idea is to provide a syntax that lets you do very complex things on collections in a more readable manner, without having 5 or 6 lines of generator expressions. Have you seen PyLINQ? It has a similar approach to

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-19 Thread alex23
On Dec 19, 8:15 pm, Eelco hoogendoorn.ee...@gmail.com wrote: What does that have to do with collection packing/unpacking? It's mocking your insistance that collection unpacking is a type constraint. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-19 Thread alex23
Eelco hoogendoorn.ee...@gmail.com wrote: Having two seperate symbols seperated by whitespace, as in @list args strikes me as a terrible break of normal python lexical rules. You mean like 'is not'? And the upcoming 'yield from'? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-19 Thread alex23
On Dec 20, 7:57 am, Andrew Berg bahamutzero8...@gmail.com wrote: But what about the example he gave about being logged into a customer's machine with only ed available? I suppose such fools would not be worthy of your business. Do you mean directly editing the source code on a production

Re: Newbie Question: Obtain element from list of tuples

2011-12-19 Thread alex23
On Dec 19, 4:46 pm, Frank Millman fr...@chagford.com wrote: Am I missing something? No, I seem to be. I have _no_ idea how I got that original syntax to work :| My apologies, DevPlayer's suggestion is much more sensible, although slices are still handy when dealing with groups of values. --

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-19 Thread alex23
On Dec 19, 2:35 pm, Chris Angelico ros...@gmail.com wrote: Point to note: list,set = set,list  # Request a death sentence from the next maintainer is perfectly legal code. Now, what does your args= line do? ChrisA Why are you directing this at my mocking of the OPs idea when the same issue

Re: IPython 0.12 is out!

2011-12-19 Thread alex23
On Dec 20, 4:07 am, Wanderer wande...@dialup4less.com wrote: The windows installer didn't work but installing from the tar file did. But installing from the tar file doesn't install Ipython in the site-packages directory. It installs it wherever you untar the tar file. I don't remember ever

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-19 Thread alex23
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Nevertheless, I think the suggested syntax @list args is awful. Yep, and it's the least awful part of the entire proposal. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-18 Thread alex23
Evan Driscoll edrisc...@wisc.edu wrote: My problem with it is that it in some sense is forcing me to make a decision I don't care about. Yes, what we have now is less flexible, but I have *never* said man, I wish this *args parameter were a list instead of a tuple. And if you _did_, then one

Re: Newbie Question: Obtain element from list of tuples

2011-12-18 Thread alex23
Roy Smith r...@panix.com wrote: A common convention is that when you're unpacking a tuple (or a list, I suppose) and are only interested in some of the elements, you unpack the others into _. Thus: _, _, _, _, pid, _, _, _ = recs[19] Pre-namedtuple, I used to like using named slices for

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-15 Thread alex23
Eelco hoogendoorn.ee...@gmail.com wrote: To tie it back in with python language design; all the more reason not to opt for pseudo-backwards compatibility. If python wants a remainder function, call it 'remainder'. Not 'rem', not 'mod', and certainly not '%'. Good luck with the PEP. Its the

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-15 Thread alex23
On Dec 16, 3:01 pm, Chris Angelico ros...@gmail.com wrote: And I would be most sorry to see % renamed to mod in Python. Hello, %s! My favourite number is %d. mod (Fred,42)   # This just looks wrong. Finally we can give this operator a more fitting name - I propose 'inject' - and put an end to

PyCharm, .idea, and source control

2011-12-14 Thread alex23
Hey everyone, I've been using PyCharm for the past month and only just hit an issue that I'm hoping someone else may have some experience with resolving. My problem has to do with PyCharm storing project configuration files in its .idea folder inside the project. This is both a mix of

Re: Dynamic variable creation from string

2011-12-12 Thread alex23
On Dec 8, 3:09 am, Massi massi_...@msn.com wrote: in my script I have a dictionary whose items are couples in the form (string, integer values), say D = {'a':1, 'b':2, 'c':3} This dictionary is passed to a function as a parameter, e.g. : def Sum(D) :     return D['a']+D['b']+D['c'] Is

Re: curses (or something) for windows

2011-12-12 Thread alex23
On Dec 13, 7:15 am, Eric einazaki...@yahoo.com wrote: Is there something similar to curses available for the Windows version of Python (2.7, community edition)?  Preferably something built-in. In general, I'm looking to do gui-ish things from within the command window. Also, in particular,

Re: Dynamic variable creation from string

2011-12-12 Thread alex23
On Dec 12, 10:49 pm, 8 Dihedral dihedral88...@googlemail.com wrote: This is the way to write an assembler or to roll out a script language to be included in an app by users. This is a garbage comment that has absolutely nothing to do with the topic at hand _at all_. --

Re: Verbose and flexible args and kwargs syntax

2011-12-12 Thread alex23
On Dec 12, 10:21 pm, Eelco hoogendoorn.ee...@gmail.com wrote:  Modulo is hardly an obscure operation. What's the remainder...? is a  simple question that people learn about in primary school. So is 'how much wood would a woodchucker chuck if a woodchucker could chuck wood?'. But how often

Re: Verbose and flexible args and kwargs syntax

2011-12-12 Thread alex23
On Dec 13, 3:12 am, Eelco hoogendoorn.ee...@gmail.com wrote: But to relate it to the topic of this thread: no, the syntax does not allow one to select the type of the resulting sequence. It always constructs a list. So by this argument, _every_ function that returns a list should take an

Re: I love the decorator in Python!!!

2011-12-12 Thread alex23
On Dec 13, 2:27 am, Robert Kern robert.k...@gmail.com wrote: On 12/12/11 3:36 AM, alex23 wrote: On Dec 9, 8:08 pm, Robert Kernrobert.k...@gmail.com  wrote: On 12/9/11 5:02 AM, alex23 wrote: The 3rd party 'decorator' module takes care of issues like docstrings    function signatures. I'd

Re: Outputting raw MIDI in realtime on Linux

2011-12-11 Thread alex23
On Dec 12, 12:14 pm, Nick Irvine nfirv...@nfirvine.com wrote: What do people use to output live MIDI on Linux, assuming it's possible? Hey Nick, I've yet to try this myself although it's long been on my to-do list. There are a couple of packages on PyPI that emit MIDI:

Re: Dynamic variable creation from string

2011-12-11 Thread alex23
On Dec 11, 4:42 pm, Nobody nob...@nowhere.com wrote: If just you're trying to avoid getting a repetitive strain injury in your right-hand little finger from typing all the [''], you could turn the keys into object attributes, e.g.:         class DictObject:             def __init__(self, d):

Re: I love the decorator in Python!!!

2011-12-11 Thread alex23
On Dec 9, 8:08 pm, Robert Kern robert.k...@gmail.com wrote: On 12/9/11 5:02 AM, alex23 wrote: The 3rd party 'decorator' module takes care of issues like docstrings  function signatures. I'd really like to see some of that functionality in the stdlib though. Much of it is:    http

Re: tracking variable value changes

2011-12-11 Thread alex23
Andrea Crotti andrea.crott...@gmail.com wrote: Not sure if it's exactly pure python but Traits can actually do thishttps://github.com/enthought/traits At an attribute level, absolutely, but not at the variable level like the OP is requesting. It's a great package, though :) --

Re: I love the decorator in Python!!!

2011-12-11 Thread alex23
On Dec 12, 2:51 pm, 8 Dihedral dihedral88...@googlemail.com wrote: To wrap a function properly is different from the 1-line lampda. This is really functional programming. Every function can be decorated to change into a different one easily. There is  a method to replace every return

Re: I love the decorator in Python!!!

2011-12-08 Thread alex23
On Dec 9, 2:38 am, Chris Angelico ros...@gmail.com wrote: One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I was testing this out in IDLE, and the fly help for

Re: Single key press

2011-12-06 Thread alex23
On Dec 6, 3:49 pm, Sergi Pasoev s.pas...@gmail.com wrote: I wonder if it is realistic to get a single key press in Python without ncurses or any similar library. It's possible using Tkinter in the standard library: http://www.daniweb.com/software-development/python/code/216830 --

Re: Questions about LISP and Python.

2011-12-05 Thread alex23
On Dec 6, 2:36 pm, Xah Lee xah...@gmail.com wrote: The python community is full of fanatics with their drivels. You do know that you could just fuck right off and leave us to it, yes? In general, it's the person who is shrilly imposing their minority opinion on a disinterested audience that

Re: Pragmatics of the standard is() function

2011-11-28 Thread alex23
On Nov 29, 5:22 am, Den patents...@gmail.com wrote: On Nov 26, 3:01 pm, Steven D'Aprano steve That is correct. You probably should rarely use `is`. Apart from testing for None, use of `is` should be rare. With respect, I disagree with advice that the use of a language construct should be

Re: sick of distribute, setup, and all the rest...

2011-11-27 Thread alex23
rusi rustompm...@gmail.com wrote: While Ive never seen anything as ridiculous as the debian-rails in the python world, its still always a hobson choice:  use a deb package that will cleanly install, deinstall, upgrade etc but is out of date or use a fresh and shiny egg that messes up the

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-25 Thread alex23
On Nov 25, 6:58 pm, Tim Golden m...@timgolden.me.uk wrote: Do you have the pyreadline module installed? ISTR that that takes over from the standard cmd processing... I'm pretty sure I do. It's really not an issue, though, as I tend to stick to linux iPython where possible :) --

Re: Automatic import of submodules

2011-11-25 Thread alex23
On Nov 25, 11:00 pm, Massi massi_...@msn.com wrote: plugins     |     -- wav_plug           |           -- __init__.py           -- WavPlug.py     -- mp3_plug           |           -- __init__.py           -- Mp3Plug.py ...     -- etc_plug           |           -- __init__.py        

Re: suitability of python

2011-11-24 Thread alex23
Terry Reedy tjre...@udel.edu wrote: This lead to Numerical Python, now Numpy, SciPy, and later Sage and other scientific and Python packages. I believe SciPy has an f2py (fortran to py) module to help with running Fortran under Python (but it has been years since I read the details). Andrew

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-24 Thread alex23
On Nov 24, 6:51 pm, Tim Golden m...@timgolden.me.uk wrote: The Ctrl-Z thing is what *exits* the interpreter on Windows (a la Ctrl-D on Linux). With ActivePython, Ctrl-D works as well, which is a godsend as I'm constantly working across Windows linux. In short - on Windows, within one cmd

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-24 Thread alex23
Tim Golden m...@timgolden.me.uk wrote: The interpreter inherits the command shell's history function: Open a cmd window and then a Python session. Do some stuff. Ctrl-Z to exit to the surrounding cmd window. Do some random cmd stuff: dir, cd, etc. Start a second Python session. up-arrow

Re: sqlalchemy beginner

2011-11-21 Thread alex23
On Nov 22, 10:25 am, Roy Smith r...@panix.com wrote: Everytime I've worked with SQLAlchemy, I've run away screaming in the other direction.  Sure, portability is a good thing, but at what cost? I've never found SQLAlchemy to be anything but sane and approachable. It's really worth understanding

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-21 Thread alex23
W. eWatson wolftra...@invalid.com wrote: Comments? Please don't start multiple threads on the same issue. -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting problem about uuid1

2011-11-21 Thread alex23
On Nov 21, 5:33 pm, sword john...@gmail.com wrote: My colleague asks me an interesting problem about uuid library in python. In multicore system with multiprocessing, is it possible to get the duplicated uuid with uuid1? I just check the RFC 4122, and I can't find anything about multicore

Re: Server Questions (2 of them)

2011-11-20 Thread alex23
On Nov 21, 10:27 am, Christian Heimes li...@cheimes.de wrote: It's possible to sandbox Python code, see http://docs.python.org/library/rexec.html Although this has been deprecated since 2.6 removed from 3.x (and cautioned against for as long as I've used Python). PyPy provides some sandboxing

Re: Is there any way to unimport a library

2011-11-20 Thread alex23
On Nov 21, 1:15 am, Gelonida N gelon...@gmail.com wrote: I wondered whether there is any way to un-import a library, such, that it's occupied  memory and the related shared libraries are released. My usecase is following: success = False try:     import lib1_version1 as lib1     import

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-20 Thread alex23
On Nov 19, 3:59 am, W. eWatson wolftra...@invalid.com wrote: Yes. I tried running it. Got nowhere. Did you run it from the shell? Did it spit out any errors? -- http://mail.python.org/mailman/listinfo/python-list

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-20 Thread alex23
On Nov 19, 8:31 am, Stephen Hansen me+list/pyt...@ixokai.io wrote: Yes, its moderately annoying that you have to do this yourself; maybe you wouldn't if you installed 64-bit python, but I can't be sure. Maybe it has nothing to do with 32 or 64-bitness at all and my guess is wrong. I've got the

Re: staticmethod makes my brain hurt

2011-11-17 Thread alex23
On Nov 17, 1:24 pm, Ethan Furman et...@stoneleaf.us wrote: If you do need to sometimes call it from a method then still leave off the '@staticmethod', and give 'self' a default of 'None':      def _get_next_id(self=None):        [blah, blah, blah]        return id      user_id =

Re: Use and usefulness of the as syntax

2011-11-17 Thread alex23
On Nov 18, 1:48 am, candide cand...@free.invalid wrote: # a.py import math as _math # b.py from a import * print _math.sin(0)       # raise a NameError print math.sin(0)        # raise a NameError so the as syntax is also seful for hiding name, isn'it ? Not exactly. It's the * import

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-17 Thread alex23
On Nov 18, 2:55 am, W. eWatson wolftra...@invalid.com wrote: Comments? Are you using the vanilla installer or ActiveState's ActivePython? I find the latter integrates better with Windows. Also, out of curiousity, 32 or 64 bit Windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to insert my own module in front of site eggs?

2011-11-17 Thread alex23
On Nov 18, 11:36 am, Roy Smith r...@panix.com wrote: What if the first import of a module is happening inside some code you don't have access to? No import will happen until you import something. As long as you change sys.path before you do, all subsequent imports will use that path. --

Re: What exactly is pass? What should it be?

2011-11-17 Thread alex23
On Nov 18, 12:59 pm, Chris Angelico ros...@gmail.com wrote: If you call your dummy function something else, it may help readability/self-documentation too. Or replace the pass with a docstring for the same effect: def silent(*args): Null Object to repress reporting --

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-17 Thread alex23
On Nov 18, 2:21 pm, W. eWatson wolftra...@invalid.com wrote: Because some  people think that's a solution, and ask. It's not. It leads to an error message. No, people are saying manually add IDLE _the correct way that Windows can recognise_, not recommending you stuff random .pyw files into the

Re: staticmethod makes my brain hurt

2011-11-16 Thread alex23
On Nov 17, 12:30 pm, Roy Smith r...@panix.com wrote: class C:     @staticmethod     def foo():         pass     print inside, foo, callable(foo) print outside, C.foo, callable(C.foo) I don't understand.  Why is foo not callable inside of the class definition? Consider this:

Re: python shell that saves history of typed in commands that will persist between reboots

2011-11-16 Thread alex23
On Nov 17, 7:09 am, Ben Finney ben+pyt...@benfinney.id.au wrote: You can then use that functionality in your Python interactive startup file. Here's mine: Awesome, thank you for this. I use iPython where ever possible but there are times where I just can't avoid the default shell and this will

Re: Multilevel dicts/arrays v. tuples as keys?

2011-11-14 Thread alex23
Peter Otten __pete...@web.de wrote: If you need lookup only I'd prefer tuples, but sometimes you may want to retrieve all values with a certain k1 and d[k1] is certainly more efficient than [(k2, v) for (k1, k2), v in d.items() if k1 == wanted] This was the hidden cost of the

Re: all() is slow?

2011-11-13 Thread alex23
On Nov 13, 4:28 pm, Devin Jeanpierre jeanpierr...@gmail.com wrote: which implies that getattr(x, 'a!b') should be equivalent to x.a!b No, it does not. The documentation states equivalence for two particular values It states equivalence for two values _based on the name_. If the string is

Re: Get keys from a dicionary

2011-11-13 Thread alex23
On Nov 11, 11:31 pm, macm moura.ma...@gmail.com wrote: I pass a nested dictionary to a function. def Dicty( dict[k1][k2] ): print k1 print k2 There is a fast way (trick) to get k1 and k2 as string. It might be possible to do something using a reverse dictionary and getting

Re: Get keys from a dicionary

2011-11-13 Thread alex23
On Nov 11, 11:31 pm, macm moura.ma...@gmail.com wrote: I pass a nested dictionary to a function. def Dicty( dict[k1][k2] ): print k1 print k2 There is a fast way (trick) to get k1 and k2 as string. It might be possible to do something using a reverse dictionary and getting

Re: property decorator and inheritance

2011-11-10 Thread alex23
On Nov 11, 2:03 pm, Laurent laurent.pa...@gmail.com wrote: Hi. I couldn't find a way to overwrite a property declared using a decorator in a parent class. class Polite:     @property     def greeting2(self, suffix=, my dear.):         return self._greeting + suffix Here you set up

Re: all() is slow?

2011-11-09 Thread alex23
On Nov 10, 8:16 am, John Nagle na...@animats.com wrote:      CPython is slow. It's a naive interpreter.  There's almost no optimization during compilation.  Try PyPy or Shed Skin. Sometimes people need to understand the performance characteristics of CPython because it's what they have to use.

Re: all() is slow?

2011-11-09 Thread alex23
On Nov 10, 11:26 am, Devin Jeanpierre jeanpierr...@gmail.com wrote: I don't really know anything about him or why people respect him, so I have no reason to share your faith. But you're happy to accept the opinions of random posters saying exec is evil? (And it's really not a good idea to be

Re: understand program used to create file

2011-11-01 Thread alex23
On Nov 2, 5:27 am, pacopyc paco...@gmail.com wrote: Hi, I have about 1 files .doc and I want know the program used to create them: writer? word? abiword? else? I'd like develop a script python to do this. Is there a module to do it? Can you help me? Word documents store metadata inside of

Re: __dict__ attribute for built-in types

2011-10-27 Thread alex23
On Oct 28, 8:52 am, candide cand...@free.invalid wrote: No but I'm expecting from Python documentation to mention the laws of Python ... It's not a law, it's an _implementation detail_. The docs don't tend to mention every such decision made because that's what the source is for. But beside

Re: webapp development in pure python

2011-10-25 Thread alex23
Laszlo Nagy gand...@shopzeus.com wrote: My Python module would connect to a database server and query some data, then display it in a grid. This cannot be compiled into javascript because of the database server connection. So what you want is for everything to happen server-side, with html

Re: Creating very similar functions with different parameters

2011-10-24 Thread alex23
Guido wrote an article on a quick and easy multimethod implementation using a decorator: http://www.artima.com/weblogs/viewpost.jsp?thread=101605 -- http://mail.python.org/mailman/listinfo/python-list

Re: revive a generator

2011-10-24 Thread alex23
On Oct 21, 11:46 am, Yingjie Lan lany...@yahoo.com wrote: I am still not sure why should we enforce that  a generator can not be reused after an explicit  request to revive it? No one is enforcing anything, you're simply resisting implementing this yourself. Consider the following generator:

Re: revive a generator

2011-10-24 Thread alex23
On Oct 21, 12:09 pm, Yingjie Lan lany...@yahoo.com wrote: Secondly, it would be nice to automatically revive it. Sure, it's always nice when your expectation of a language feature exactly matches with its capabilities. When it doesn't, you suck it up and code around it. Because at the very

Re: compare range objects

2011-10-20 Thread alex23
On Oct 21, 12:16 pm, Chris Angelico ros...@gmail.com wrote: Hmm. I wonder would slice objects be appropriate? They're not iterable though They're not hashable either, which kind of surprised me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Benefit and belief

2011-10-18 Thread alex23
DevPlayer devpla...@gmail.com wrote: Ever hear/read the term: It's all good.? A reference to Karma and how things will work out for the better in the end inspite of what you see now... A great example of Everything is Symantics. Semantics. Also: nonsense. You're conflating an ethical system

Re: Benefit and belief

2011-10-18 Thread alex23
On Oct 18, 6:52 am, Ben Finney ben+pyt...@benfinney.id.au wrote: A belief that doesn't match reality is a delusion. That doesn't change when someone thinks it's an epiphany: it's still a delusion. Apparently there was some talk about removing delusional as a classification from the DSM due to

Re: strange comparison result with 'is'

2011-10-18 Thread alex23
On Oct 18, 3:53 am, Terry Reedy tjre...@udel.edu wrote: This has come up enough that I opened http://bugs.python.org/issue13203 I really don't get the new Python user obsession with id(). I don't think I've ever used it, in production code or otherwise. --

Re: type vs. module (part2)

2011-10-17 Thread alex23
On Oct 17, 9:11 am, Shane gshanemil...@verizon.net wrote: I now have two questions: How does Python allow two classes of the same type as evidenced by identical ``print type(class)' output and different id outputs? You are looking at the id of two _instances_ of the class, not of the class

Re: Opportunity missed by Python ?

2011-10-14 Thread alex23
On Oct 13, 8:07 pm, Chris Angelico ros...@gmail.com wrote: Python, as I found out to my detriment, is practically impossible to sandbox effectively. The latest version of PyPy introduces a prototype sandbox: http://pypy.org/features.html#sandboxing It'll be interesting to see how effective

Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-14 Thread alex23
On Oct 14, 4:56 pm, Carl Banks pavlovevide...@gmail.com wrote: But you can see that, fully realized, syntax like that can do much more than can be done with library code. Well sure, but imaginary syntax can do _anything_. That doesn't mean it's possible within CPython. --

Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-14 Thread alex23
On Oct 13, 10:35 pm, Martin P. Hellwig martin.hell...@gmail.com wrote: def do_something():      a = 4      b = 2      c = 1      ooo:          a += 1          b += 2          c += 3      print(a, b, c) What I would expect to happen that all statements within the ooo block may be

Re: Language Enhancement Idea to help with multi-processing (your opinions please)

2011-10-14 Thread alex23
On Oct 15, 12:32 pm, alex23 wuwe...@gmail.com wrote: from functools import partial You can ignore this, sorry, leftover from earlier code :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-14 Thread alex23
Tim Chase python.l...@tim.thechases.com wrote: I'm not sure it can entirely be chalked up to not looking hard enough. It's explicitly cited in the feature list: Raw SQL statement mapping SQLA's object relational query facilities can accommodate raw SQL statements as well as plain result sets,

Re: Python library for generating SQL queries [selects, alters, inserts and commits]

2011-10-11 Thread alex23
On Oct 12, 1:14 am, Alec Taylor alec.tayl...@gmail.com wrote: They look good, but I'm looking for something which can compile down to normal SQL code. Then you're not looking hard enough. SQLAlchemy does this. -- http://mail.python.org/mailman/listinfo/python-list

Re: A tuple in order to pass returned values ?

2011-10-09 Thread alex23
Jean-Michel Pichavant jeanmic...@sequans.com wrote: However, I'm not sure it fixes the main issue: unpacking. Unpacking prevents you from adding any additional fields to your 'tuple' without breaking any line of code that was unpacking the tuple (to oppose to accessing an object attribute).

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-06 Thread alex23
Dennis Lee Bieber wlfr...@ix.netcom.com wrote:         While I wouldn't want to write an FFT in COBOL, one can't deny that laying out fixed width reports and moving blocks of decimal data between record layouts is quite easy in COBOL. Well, sure, but there's still plenty of pain in the

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-05 Thread alex23
Ben Finney ben+pyt...@benfinney.id.au wrote: This mocking is hurtful to people who identify too strongly with COBOL. I wonder whether that means it's intentionally hurtful. Far, _far_ less hurtful than COBOL itself... -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-05 Thread alex23
On Oct 5, 11:10 pm, Chris Angelico ros...@gmail.com wrote: The absence from the language doesn't prove that. All it means is that, on those rare occasions when a goto would have been correct, the programmer had to make do with something else :-) Like the goto module? :)

Re: Convenient filtering in for cycles

2011-10-05 Thread alex23
On Oct 6, 2:55 am, Stefano Maggiolo s.maggi...@gmail.com wrote: I would like to know if there is a (more) convenient way of doing this structure: ===(1)=== for x in l:     if P(x):         do_stuff(x) == map(do_stuff, filter(P, l)) --

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-04 Thread alex23
Zero Piraeus sche...@gmail.com wrote: A dissenting view [and a Kill Bill spoiler, of sorts]: http://www.youtube.com/watch?v=PdWF7kd1tNo A fun diatribe, sure, but still an outsider view that is in direct conflict with how the characters are actually portrayed. --

Re: how to call java methods in python

2011-10-04 Thread alex23
On Oct 4, 4:39 pm, masood shaik masood@gmail.com wrote: Please help me. Please help us help you. You've given us nothing but an error message. (Which seems to indicate that you're trying 'import Calculator'...) What are you using to call Java methods in Python? Can you provide a small

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-04 Thread alex23
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Imported modules are variables like any other, and as they usually exist in the global scope, so they will all need to be explicitly referenced as global. This will get tiresome very quickly, and is a cure far worse than the disease,

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread alex23
rantingrick rantingr...@gmail.com wrote: Why? Well because many times i find myself wondering if this or that variable is local or global -- and when i say global i am speaking of module scope! The globalDOT cures the ill. Given your stated propensity for huge code blocks not chunked into

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread alex23
Sorry for hijacking Alec's response but I didn't see the OP. Aivar Annamaa aivar.anna...@gmail.com wrote: I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` One direct way is to call

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread alex23
rantingrick rantingr...@gmail.com wrote: TrueWiseObserver: Wrong pseudo. Superman will ALWAYS be superman even if he wears a dress and stilettos. Clark Kent is just an assumed identity of Superman. Actually, he identifies with Clark Kent, Superman is the secret identity. You're thinking of

Re: Hermeneutics and computer science [was off-topic, now back on]

2011-09-30 Thread alex23
On Sep 30, 2:34 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: alex23 wrote: I'm slowly seeing more and more interest in applying a discipline that arose out of the study of religious texts. Tell us more, please. Well, it's mostly from real world discussions and may

Re: Motion Tracking with Python

2011-09-30 Thread alex23
On Sep 30, 12:16 pm, Derek Simkowiak de...@simkowiak.net wrote: It's especially neat because my daughter and I worked together on this project. We used it to track her two pet gerbils, as part of her science fair project. She wrote her own (separate) Python script to read the motion tracking

Re: Motion Tracking with Python

2011-09-30 Thread alex23
On Sep 30, 3:31 pm, Chris Angelico ros...@gmail.com wrote: Unless someone's seriously considering porting the Linux kernel to Python... Well, they've certainly asked: http://bytes.com/topic/python/answers/37048-reimplenting-linux-kernel-python And while not Linux kernels, there are two

Re: Suggested coding style

2011-09-30 Thread alex23
On Sep 29, 10:23 pm, rantingrick rantingr...@gmail.com wrote: What is so bad about breaking code in obscure places? On Sep 29, 9:50 pm, alex23 wuwe...@gmail.com wrote: Try coding in PHP across minor release versions and see how you feel about deprecating core functions on a whim

Re: Benefit and belief

2011-09-29 Thread alex23
On Sep 30, 9:37 am, MRAB pyt...@mrabarnett.plus.com wrote: rantingrick: Since, like the bible the zen is self contradicting, any argument utilizing the zen can be defeated utilizing the zen. alex23: And like the Bible, the Zen was created by humans as a joke. If you're taking it too

Re: A Trivial Question

2011-09-29 Thread alex23
On Sep 29, 8:06 am, Chris Rebert c...@rebertia.com wrote: Try this: def trial():     class Foo(object):         def __init__(self):             print(Hello, world!)     Foo() trial() While this will display Hello, world! in the way required, with a slight adjustment you end up with

Re: Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread alex23
Chris Angelico ros...@gmail.com wrote: We may happen to have coincidental interest in (say) music, but just because some group of us (or even all of us) all enjoy music does not mean that it'd be on-topic to have a discussion of the tetrachord of Mercury. As general discussion it would be,

Re: Benefit and belief [was Re: Suggested coding style]

2011-09-29 Thread alex23
Dennis Lee Bieber wlfr...@ix.netcom.com wrote:         Well... We could try for equality in offense -- the Torah or the Koran? Maybe the Tripitaka or Sutras? I always enjoyed the possibly apocryphal claim that the design of VRML was influenced by the story of Indra's Net. Maybe some religious

Re: Suggested coding style

2011-09-29 Thread alex23
On Sep 30, 3:14 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: alex23 wuwe...@gmail.com writes: On Sep 29, 10:23 pm, rantingrick rantingr...@gmail.com wrote: GvR should be texting me every night in hopes that some of my API genius will rub off on him. Are you off your medication

Re: Suggested coding style

2011-09-28 Thread alex23
On Sep 28, 10:12 pm, DevPlayer devpla...@gmail.com wrote: Calling the Bible a joke is used to hurt people, not enlighten them. Y'know, I wouldn't even bother responding to this if Xianists were as open, forgiving and accepting as their messiah told them to be. It was a *flippant remark*. If you

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread alex23
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I googled on SAS PROC FREQ and found this: http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/defau... All the words are in English, but I have no idea what the function does, how you would call it, and what it returns.

Re: Suggested coding style

2011-09-27 Thread alex23
rantingrick rantingr...@gmail.com wrote: Since, like the bible the zen is self contradicting, any argument utilizing the zen can be defeated utilizing the zen. And like the Bible, the Zen was created by humans as a joke. If you're taking it too seriously, that's your problem. If however you

Re: install packages with pip to older Python versions

2011-09-26 Thread alex23
On Sep 27, 6:39 am, Jabba Laci jabba.l...@gmail.com wrote: So, how can I install packages for a specific version of Python (here, v2.5)? With 2.7 I use sudo pip install package_name. It's amazing what you can find when you look at the documentation:

Re: using python in web applications

2011-09-13 Thread alex23
On Sep 10, 1:54 pm, Littlefield, Tyler ty...@tysdomain.com wrote: I'm not feeling particularly masochistic, so I do not want to develop this project in PHP; essentially I'm looking to build a web-based MMO. Google have been promoting the use of appengine along with HTML5 JS to produce games.

Re: Hello, and request for help with 'dynamic grids'

2011-09-05 Thread alex23
On Sep 5, 3:18 pm, Simon Cropper simoncrop...@fossworkflowguides.com wrote: My investigations have generally found that windows/forms/data entry screen can be created for a specific table or view, but these are hard-wired during development. Is there anyway of rapidly defining the grid during

<    1   2   3   4   5   6   7   8   9   10   >