Decorators inside of class and decorator parameters

2007-01-13 Thread MR
Hello All, I have a question about decorators, and I think an illustration would be helpful. Consider the following simple class: #begin code class Foo: def fooDecorator(f): print "fooDecorator" def _f(self, *args, **kw): return f(self, *args, **kw) retur

Re: Decorators inside of class and decorator parameters

2007-01-14 Thread MR
laces I've seen decorators called like fooDecorator() must be using some default arguments in the function signature...so that part makes a lot more sense now too. Thanks again! Gabriel Genellina wrote: > "MR" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAI

Re: Decorators inside of class and decorator parameters

2007-01-14 Thread MR
Wow. Really neat stuff there. memoize seems especially cool since you can get lots of nice dynamic programming benefits "for free" (sorry if I just stated the obvious, but I thought was was especially cool.) Michele Simionato wrote: > Gabriel Genellina wrote: > > see this article by M. Simoniato

Re: Is there a better algorithm?

2009-01-02 Thread mr
As has been noted, the best is to fix the input to be regular-3- tuples. For the fun of it, here's another variation of a solution: tuples = [(1, 2), (3, 4, 5), (6, 7)] def triple_or_pair(seq): u = None try: k, u, v = seq except ValueError: k, v = seq return k, u,

Re: Installation of Py3.0rc1 fails on Mac OS X with bad locale

2008-11-08 Thread mr
On Nov 1, 4:40 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > It would be best if a Mac user could propose a patch for that problem > before the release of Python 3.0. Not sure if this would qualify as a patch, but a workaround that seems to be working for me is to change the bash environmen

Re: ValueError: unknown locale: UTF-8

2008-06-02 Thread mr
On Jun 1, 8:43 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > ValueError: unknown locale: UTF-8 > > > This is on open bug or is there more to it? > > Do you have an environment variable set who is named > either LANG or starts with LC_? Actually, yes: LC_CTYPE=UTF-8 where is it coming from

Differences of "!=" operator behavior in python3 and python2 [ bug? ]

2013-05-12 Thread Mr. Joe
I seem to stumble upon a situation where "!=" operator misbehaves in python2.x. Not sure if it's my misunderstanding or a bug in python implementation. Here's a demo code to reproduce the behavior - """ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function class DemoClass

Re: Debugging difficulty in python with __getattr__, decorated properties and AttributeError.

2013-05-14 Thread Mr. Joe
Sorry for digging this old topic back. I see that my "'property' does not play well with polymorphic code" comment generated some controversy. So here's something in my defense: Here's the link to stackoveflow topic I am talking about: http://stackoverflow.com/questions/237432/python-properties-a

Re: Debugging difficulty in python with __getattr__, decorated properties and AttributeError.

2013-05-15 Thread Mr. Joe
On Wed, May 15, 2013 at 12:15 PM, dieter wrote: > > If Python would automatically redecorate overridden methods in a derived > class, I would have no control over the process. What if I need > the undecorated method or a differently decorated method (an > uncached or differently cached met

New Python implementation

2021-02-11 Thread Mr Flibble
Hi! I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language. I envision this implementation to be significantly faster than the currently extant Python implementations (which isn't a stretch given ho

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 15:13, Chris Angelico wrote: On Thu, Feb 11, 2021 at 11:36 PM Mr Flibble wrote: Hi! I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language. Is it your intention to supp

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 16:31, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 4:35 AM Mr Flibble wrote: Hi! I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language. I envision this implementa

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 18:03, Chris Angelico wrote: In any case, it's not Python if it can't handle arbitrarily large numbers. Python is an excellent language for mathematics. I am also creating Ada and Haskell implementations which have a similar requirement. /Flibble -- 😎 -- https://mail.python.or

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 18:06, Chris Angelico wrote: On Fri, Feb 12, 2021 at 5:01 AM Mr Flibble wrote: On 11/02/2021 16:31, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 4:35 AM Mr Flibble wrote: Hi! I am starting work on creating a new Python implementation from scratch using "neos" my

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 18:24, Paul Bryan wrote: On Thu, 2021-02-11 at 17:56 +, Mr Flibble wrote: Actually it is a relatively small task due to the neos universal compiler's architectural design.  If it was a large task I wouldn't be doing it. When do you estimate this task will be comp

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 21:13, Dan Stromberg wrote: Does your project have a name yet? I'd like to follow it through google alerts or an announcement mailing list. "neos" - https://neos.dev/ https://github.com/i42output/neos /Flibble -- 😎 -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 22:25, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 2:00 PM Mr Flibble wrote: On 11/02/2021 21:13, Dan Stromberg wrote: Does your project have a name yet? I'd like to follow it through google alerts or an announcement mailing list. "neos" - https://

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 23:12, Greg Ewing wrote: On 12/02/21 11:33 am, Mr Flibble wrote: neos isn't a Python package so that isn't a problem. It might be a bit confusing if it ever becomes part of the wider Python ecosystem, though. Python is but one language that neos will implement.

Re: New Python implementation

2021-02-11 Thread Mr Flibble
On 11/02/2021 23:05, Paul Rubin wrote: Mr Flibble writes: "neos" - https://neos.dev/ https://github.com/i42output/neos Good luck, let us know when it is done. What is there doesn't look like a credible start so far, but maybe you will surprise us. Have you actually written

Re: New Python implementation

2021-02-12 Thread Mr Flibble
On 12/02/2021 02:45, Terry Reedy wrote: On 2/11/2021 5:33 PM, Mr Flibble wrote: On 11/02/2021 22:25, Dan Stromberg wrote: On Thu, Feb 11, 2021 at 2:00 PM Mr Flibble wrote: On 11/02/2021 21:13, Dan Stromberg wrote: Does your project have a name yet?  I'd like to follow it through g

Re: New Python implementation

2021-02-12 Thread Mr Flibble
On 12/02/2021 00:15, Alan Gauld wrote: On 11/02/2021 12:30, Mr Flibble wrote: I am starting work on creating a new Python implementation from scratch using "neos" my universal compiler that can compile any programming language. Can i clarify that? Are you saying that you ar

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 13/02/2021 00:01, Alan Gauld wrote: On 12/02/2021 21:46, Mr Flibble wrote: The neos Python implementation will consist of a schema file which describes the language plus any Python-specific semantic concepts So the schema file is some kind of formal grammar definition of the language

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 13/02/2021 18:11, Alan Gauld wrote: On 13/02/2021 16:09, Mr Flibble wrote: On 13/02/2021 00:01, Alan Gauld wrote: I'm assuming it's a new executable interpreter that can run any valid python code. Is that correct? It is a universal *compiler* so it compiles the python code to

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 13/02/2021 23:30, Igor Korot wrote: Hi, But most importantly - what is the reason for this ? I mean - what problems the actual python compiler produce? Thank you. I am creating neos as I need a performant scripting engine for my other major project "neoGFX" and I want to be able to support

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 00:19, Chris Angelico wrote: On Sun, Feb 14, 2021 at 11:14 AM Mr Flibble wrote: On 13/02/2021 23:30, Igor Korot wrote: Hi, But most importantly - what is the reason for this ? I mean - what problems the actual python compiler produce? Thank you. I am creating neos as I need

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 00:51, Ned Batchelder wrote: On Saturday, February 13, 2021 at 7:19:58 PM UTC-5, Chris Angelico wrote: On Sun, Feb 14, 2021 at 11:14 AM Mr Flibble wrote: On 13/02/2021 23:30, Igor Korot wrote: Hi, But most importantly - what is the reason for this ? I mean - what problems the

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 03:35, Paul Rubin wrote: Mr Flibble writes: I am creating neos as I need a performant scripting engine for my other major project "neoGFX" and I want to be able to support multiple popular scripting languages including Python. Is something wrong with Guile for that pu

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 02:54, Mark Lawrence wrote: On Sunday, February 14, 2021 at 2:18:03 AM UTC, Mr Flibble wrote: On 14/02/2021 00:51, Ned Batchelder wrote: The OP has been making these claims on IRC for a while (at least two years). He has never cared to substantiate them, or even participate

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 00:52, Alan Gauld wrote: On 14/02/2021 00:07, Mr Flibble wrote: On 13/02/2021 18:11, Alan Gauld wrote: You are going to create a Python compiler that will take existing Python code and output a byte code file. No neos is not a Python compiler: it is a *universal* compiler

Re: New Python implementation

2021-02-13 Thread Mr Flibble
On 14/02/2021 03:26, Grant Edwards wrote: On 2021-02-14, Ned Batchelder wrote: On Saturday, February 13, 2021 at 7:19:58 PM UTC-5, Chris Angelico wrote: At the absolute least, show that you have something that can run Python code. The OP has been making these claims on IRC for a (at least t

Sketch

2021-02-13 Thread Mr Flibble
CPython *is* the dead parrot. It's time for Python to evolve out of the primordial soup. /Flibble -- 😎 -- https://mail.python.org/mailman/listinfo/python-list

Re: Sketch

2021-02-13 Thread Mr Flibble
On 14/02/2021 05:04, Mark Lawrence wrote: On Sunday, February 14, 2021 at 5:01:46 AM UTC, Mr Flibble wrote: CPython *is* the dead parrot. It's time for Python to evolve out of the primordial soup. /Flibble -- 😎 Says the bloke(?) who doesn't use mailing lists but does get h

Re: Sketch

2021-02-14 Thread Mr Flibble
On 14/02/2021 09:10, Michał Jaworski wrote: Wow, that thread is entertaining. It seems that neos is one of it’s kind. What I hope is that it will support TempleOS. Going back going back to your original question Mr. Fibble. If ISO standard is what you really need to finish your project you

Re: Sketch

2021-02-14 Thread Mr Flibble
On 14/02/2021 09:10, Michał Jaworski wrote: Wow, that thread is entertaining. It seems that neos is one of it’s kind. What I hope is that it will support TempleOS. Going back going back to your original question Mr. Fibble. If ISO standard is what you really need to finish your project you

Re: Change first occurrence of character x in a string - how?

2021-02-14 Thread Mr Flibble
On 14/02/2021 21:14, Chris Green wrote: What's the easiest way to change the first occurrence of a specified character in a string? By using a grown up (i.e. non-toy) programming language. /Flibble -- 😎 -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-14 Thread Mr Flibble
On 14/02/2021 23:00, Christian Gollwitzer wrote: Am 14.02.21 um 11:12 schrieb Paul Rubin: Christian Gollwitzer writes: He wants that neoGFX is scriptable in Python, but instead of linking with CPython, he will write his own Python implementation instead, because CPython is slow/not clean/ what

neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Mr Flibble
neoPython : Fastest Python Implementation: Coming Soon Message ends. /Flibble -- 😎 -- https://mail.python.org/mailman/listinfo/python-list

Re: neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Mr Flibble
On 05/05/2021 17:02, Chris Angelico wrote: On Thu, May 6, 2021 at 2:01 AM Mr Flibble wrote: neoPython : Fastest Python Implementation: Coming Soon Message ends. /Flibble My breath: not being held. Message ends. Why? The currently extant Python implementations contribute to climate

Re: neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Mr Flibble
On 05/05/2021 17:02, Chris Angelico wrote: On Thu, May 6, 2021 at 2:01 AM Mr Flibble wrote: neoPython : Fastest Python Implementation: Coming Soon Message ends. /Flibble My breath: not being held. Message ends. Why? The currently extant Python implementations are so inefficient they

Re: neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Mr Flibble
On 05/05/2021 17:33, Mark Lawrence wrote: On Wednesday, May 5, 2021 at 4:57:13 PM UTC+1, Mr Flibble wrote: neoPython : Fastest Python Implementation: Coming Soon Message ends. /Flibble -- 😎 Dedicated to you and all like you https://www.youtube.com/watch?v=X15PsqN0DHc ORLY? If anyone is

Re: neoPython : Fastest Python Implementation: Coming Soon

2021-05-05 Thread Mr Flibble
On 05/05/2021 17:36, Igor Korot wrote: Hi, On Wed, May 5, 2021 at 11:27 AM Mr Flibble < flib...@i42.invalidwibblegrok.co.uk> wrote: On 05/05/2021 17:02, Chris Angelico wrote: On Thu, May 6, 2021 at 2:01 AM Mr Flibble wrote: neoPython : Fastest Python Implementation: Coming Soon M

Python doesn't work

2021-05-30 Thread Mr . Incognito
Hello I downloaded the latest versioon of Python and tried to open several .py files, but it doesn't open. It opens for a sec, then closes itself. I tried uninstalling and reinstalling, but it doesn't work. I hope you can help me! Saadetud Windows 10 rakendusest [1]Meil

Looking for the best way to make this

2016-10-05 Thread mr . marydavid
http://www.qualicode.com/EN/images/ScheduleGrid.png looking to add schedule like that to my software trying with Qt but not sure how to . -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for the best way to make this

2016-10-05 Thread mr . marydavid
Here is another example http://www.codetwo.com/media/images/exchange-sync-screencast-5.jpg -- https://mail.python.org/mailman/listinfo/python-list

Meta classes - real example

2016-10-17 Thread Mr. Wrobel
Hi, I am looking for an example of metaclass usage. Especially I am interestet in manipulating instance variables, for example: My class: class MrMeta(type): pass class Mr(object): __metaclass__ = MrMeta def __init__(self): self.imvariable

Re: Meta classes - real example

2016-10-17 Thread Mr. Wrobel
W dniu 17.10.2016 o 18:16, Chris Angelico pisze: On Tue, Oct 18, 2016 at 3:03 AM, Mr. Wrobel wrote: Hi, I am looking for an example of metaclass usage. Especially I am interestet in manipulating instance variables, for example: My class: class MrMeta(type): pass class Mr(object

Re: Meta classes - real example

2016-10-17 Thread Mr. Wrobel
W dniu 17.10.2016 o 23:23, Ethan Furman pisze: On 10/17/2016 09:23 AM, Mr. Wrobel wrote: W dniu 17.10.2016 o 18:16, Chris Angelico pisze: On Tue, Oct 18, 2016 at 3:03 AM, Mr. Wrobel wrote: I am looking for an example of metaclass usage. Especially I am interestet in manipulating instance

Re: Meta classes - real example

2016-10-20 Thread Mr. Wrobel
W dniu 18.10.2016 o 16:42, Ethan Furman pisze: On 10/17/2016 11:44 PM, Mr. Wrobel wrote: Ok,so in general, we could say that using Metclasses is ok for manipulating __new__ but not that what is setting by __init__. Am I right? No and yes. In this code (python 2 syntax): #untested class

[Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objective-C. As my explanation, I have answered that there is a a lot of useful APIs, language is modern, has advanced objective architecture, and what is the most important -

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
W dniu 05.11.2016 o 22:17, Ben Bacarisse pisze: Steve D'Aprano writes: On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote: Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objective-C. Here's the &quo

Metaclasses - magic functions

2016-12-20 Thread Mr. Wrobel
Hi, Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? I see that __new__ can be used mostly when I want to manipulate with class variables that are stored into dictionary. But when to use __init__? Any example? Thanx, M -- https://mail.python.

Re: Metaclasses - magic functions

2016-12-23 Thread Mr. Wrobel
W dniu 21.12.2016 o 02:51, Ethan Furman pisze: On 12/20/2016 03:39 PM, Ben Finney wrote: "Mr. Wrobel" writes: Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? Use ‘__new__’ to do the work of *creating* one instance from nothing;

Re: Metaclasses - magic functions

2016-12-23 Thread Mr. Wrobel
W dniu 23.12.2016 o 15:14, Ian Kelly pisze: (...) cls.added_in_init = 'test' Man, you are awsome genius! Finally somebody was able to explain me what is the power of __new__ and difference between __init__ !!! So what I wanted to achieve was adding some new attributes to the class ins

Re: Your IDE's?

2019-03-27 Thread Mr Zaug
On Monday, March 25, 2019 at 5:38:41 PM UTC-4, John Doe wrote: > What is your favorite Python IDE? "Your IDE's?" is not a question, nor is any word in English made plural with an apostrophe s. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Resources related with web security

2019-11-26 Thread Mr. Gentooer
> > On Mon, 25 Nov 2019 21:25:12 + (UTC), Pycode > > declaimed the following: > > > > comp.lang.python gmane.comp.python.general how do you access these in a reasonable way? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Resources related with web security

2019-11-26 Thread Mr. Gentooer
On Tue, Nov 26, 2019 at 03:29:48PM -0500, Joel Goldstick wrote: > On Tue, Nov 26, 2019 at 2:23 PM Mr. Gentooer wrote: > > > > > > On Mon, 25 Nov 2019 21:25:12 + (UTC), Pycode > > > > declaimed the following: > > > > > > > > comp.lang.p

Re: gmail access with python!

2005-01-30 Thread Mr Follower
Did you try the CVS version of libgmail? While none of the "release versions" (i.e. up 0.0.8) currently work, as of a week ago the CVS version handled the two recent modifications to Gmail. --Phil. (Author libgmail) -- http://mail.python.org/mailman/listinfo/python-list

py_compile vs. IndentationError

2005-03-26 Thread Mr. Magoo
Why does py_compile print IndentationError in a different format than SyntaxError? It makes it harder to parse the output in a non-python program. Sorry: IndentationError: ('unindent does not match any outer indentation level', ('foo.py', 19, 17, '\t\t\t return 0.0 \n')) instead of File

How to get TabError?

2005-03-27 Thread Mr. Magoo
Can someone provide a snippet which, when run, generates a TabError? I can only seem to get SyntaxError and IndentationError. Thanks, M -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get TabError?

2005-03-27 Thread Mr. Magoo
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > "Mr. Magoo" wrote: > > > Can someone provide a snippet which, when run, generates a TabError? > > > > I can only seem to get SyntaxError and IndentationError. >

Re: How to get TabError?

2005-03-27 Thread Mr. Magoo
In article <[EMAIL PROTECTED]>, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > $ python -t test.py > test.py: inconsistent use of tabs and spaces in indentation > hello > goodbye On more question. When using py_compile from with a script, is there any way to force the -t flag? M -- http://mail.

Generate config file from template using Python search and replace.

2015-11-28 Thread Mr Zaug
I need to generate a config file based on an existing "template" file. I need to replace a set of strings with other strings globally in the generated file. Here is a snippet of the template file, where CONTENT_PATH and DAMPATH are two "placeholders" or variables. There are several other such pl

Re: Generate config file from template using Python search and replace.

2015-11-28 Thread Mr Zaug
I should mention the template file is small, just 98 lines long and the working config file will be the same size. -- https://mail.python.org/mailman/listinfo/python-list

Re: Generate config file from template using Python search and replace.

2015-11-29 Thread Mr Zaug
When I run this script on OS X El Capitan, I see, # permission sensitive cache $include "_dispatcher_shared_auth-checker: Was I supposed to incorporate it into the script I posted? -- https://mail.python.org/mailman/listinfo/python-list

I can't understand re.sub

2015-11-29 Thread Mr Zaug
I need to use re.sub to replace strings in a text file. I can't seem to understand how to use the re module to this end. result = re.sub(pattern, repl, string, count=0, flags=0); I think I understand that pattern is the regex I'm searching for and repl is the thing I want to substitute for what

Re: I can't understand re.sub

2015-11-29 Thread Mr Zaug
Thanks. That does help quite a lot. -- https://mail.python.org/mailman/listinfo/python-list

Re: I can't understand re.sub

2015-11-29 Thread Mr Zaug
On Sunday, November 29, 2015 at 8:12:25 PM UTC-5, Rick Johnson wrote: > On Sunday, November 29, 2015 at 3:37:34 PM UTC-6, Mr Zaug wrote: > > > The items I'm searching for are few and they do not change. They are > > "CONTENT_PATH", "ENV" and "

Re: Generate config file from template using Python search and replace.

2015-11-29 Thread Mr Zaug
On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote: > Mr Zaug wrote: > > > When I run this script on OS X El Capitan, I see, > > > > # permission sensitive cache > > $include "_dispatcher_shared_auth-checker: > > > > Was

Re: Generate config file from template using Python search and replace.

2015-11-29 Thread Mr Zaug
On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote: > Mr Zaug wrote: > > > When I run this script on OS X El Capitan, I see, > > > > # permission sensitive cache > > $include "_dispatcher_shared_auth-checker: > > > > Was

Re: Generate config file from template using Python search and replace.

2015-11-30 Thread Mr Zaug
On Monday, November 30, 2015 at 4:14:48 AM UTC-5, Peter Otten wrote: > Mr Zaug wrote: > > > On Sunday, November 29, 2015 at 5:50:51 PM UTC-5, Peter Otten wrote: > >> Mr Zaug wrote: > >> > >> > When I run this script on OS X El Capitan, I see, >

Re: Generate config file from template using Python search and replace.

2015-12-01 Thread Mr Zaug
Oh, that's much easier to read. Thanks! -- https://mail.python.org/mailman/listinfo/python-list

Re: Generate config file from template using Python search and replace.

2015-12-01 Thread Mr Zaug
Actually, I don't understand what you mean by "all other braces." What braces are you talking about? The placeholders in the template file (the file being read in) have braces around them but they are not escaped. Also, do I really need curly braces to tell Python what my placeholders are? --

Re: Generate config file from template using Python search and replace.

2015-12-01 Thread Mr Zaug
That makes sense. So I still can't see how to write the string object to a file whist naming the file with whatever values I provided for the NNN and BRAND variables. Printing the contents of the string object is working with all the expected substitutions. Do I need to convert the string obje

Re: Generate config file from template using Python search and replace.

2015-12-01 Thread Mr Zaug
Ye, this does work. Many thanks! filename = "{NNN}_{BRAND}_farm.any".format(BRAND=brand, NNN=nnn) with open(filename, "w") as outstream: outstream.write(data) -- https://mail.python.org/mailman/listinfo/python-list

Re: Can I trust downloading Python?

2013-09-11 Thread Mr. Roboto
On Saturday, September 7, 2013 9:17:46 PM UTC-4, Aaron Martin wrote: > Hi, I am thinking about getting a software but it requires python, so that > brought up a few questions. Is it safe do download python, and does it come > with spam or advertisements? If it doesn't then should I get the latest

numpy array product driving me mad

2015-03-20 Thread Mr. Twister
Hi everyone. Hope you can help me overcome this "noob" issue. I have two numpy arrays: >>> P array([[[ 2, 3], [33, 44], [22, 11], [ 1, 2]]]) >>> R array([0, 1, 2, 3]) the values of these may of course be different. The important fact is that: >>> P.shape (1, 4, 2) >>>

Re: numpy array product driving me mad

2015-03-20 Thread Mr. Twister
>> I think that you want >> >> P * R[;,None] > > Sorry, I meant > > P * R[:, None] > > Manolo Muchísimas gracias, Manolo. Eres un genio y me has ayudado mucho. Te debo una. -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-29 Thread mr . smittye
On Wednesday, March 25, 2015 at 4:39:40 AM UTC-7, Marko Rauhamaa wrote: > A lot of discussion was generated by the good, old fibonacci sequence. I > have yet to find practical use for fibonacci numbers. However, the > technique behind a sudoku solver come up every now and again in > practical situa

Debugging difficulty in python with __getattr__, decorated properties and AttributeError.

2013-05-02 Thread Mr. Joe
Is there any way to raise the original exception that made the call to __getattr__? I seem to stumble upon a problem where multi-layered attribute failure gets obscured due to use of __getattr__. Here's a dummy code to demonstrate my problems: """ import traceback class BackupAlphabet(object):

Re: Debugging difficulty in python with __getattr__, decorated properties and AttributeError.

2013-05-03 Thread Mr. Joe
Thanks for clearing up. Developers of python should address this issue, in my opinion. 3.4/3.5 maybe, but better late than never. Recently, I've been beaten back for using some exotic features of python. One is this[ Took me hours to get to the bottom ]. The other one is 'property' decorator. I wa

Problems with WX and program loop...

2006-01-11 Thread Mr BigSmoke
Hi everybody... I have an app that has to controll some ascii files every 10/30 seconds... I was planning to have an GUI using wxpython. The problems is that i wasn't able to manage my application loop and the wxApp loop, so my interface is always freezing... My app do something like this: - create

Re: Problems with WX and program loop...

2006-01-12 Thread Mr BigSmoke
Great! Tnx!! -- http://mail.python.org/mailman/listinfo/python-list

About Embedding PyWin or wxPython

2006-07-24 Thread Mr. Roboto
o speak 3) Exceptions: No clue. Need to closely read Extending/Embedding Python for more guidance 4) Deployment: Bite the disk space bullet and use PyWin or wxPython as is Anyway, that's the beginning of the conversation. If you have any observations or suggestions, please feel free.

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Mr. Roboto
Steve: Thanx for reminding me. I have that book around here *someplace*. Never finished it, but will dig it out pronto. As you so aptly point out, I want to develop more than experiment and who better to learn from than the author of PyWin itself Steve Holden wrote: > You almost certainly

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Mr. Roboto
Simon: Good idea, but I'm not yet .NET-compatible and can't handle that learning curve in addition to everything else. IronPython is an option I hadn't considered, but yours is a good idea for the next project Simon Hibbs wrote: > Have you considered IronPython? > > This is of course only an

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Mr. Roboto
Phillipe: Actually, it's not performance of the core app that concerns me. I'm thinking more about UI/form *design* productivity. I've done a lot of Access work over the years and while the stand-alone VB form designer isn't quite as thorough, it's still one of the slickest out there. Unfortuna

Re: Py2exe for packaging installers?

2006-07-28 Thread Mr BigSmoke
> > However, it's not platform independant -- it'll be for windows only. > Yeah, u'll have to use py2exe similars for mac (should be py2app, if i remember right). py2exe is a Python distutils extension which converts python scripts into executable windows programs cheers Fabio -- http://ma

Re: War chest for writing web apps in Python?

2006-07-28 Thread Mr BigSmoke
For IDEs i recommend Wing IDE (its really good but comercial.. :( ), pydev for eclipse and also SPE. For GUI designer... it depends of wich kind of app u'll develop. For web apps try cherrypy.. it's wonderfull and simple... U can also try zope and plone (the they are less simple) cheers Fa

"running" code on client side with cherrypy?

2006-08-10 Thread Mr BigSmoke
Hi All, I'm developing a website to handle some code/application version control on a intranet. I'm using cherrypy and pysvn. Everything runs quite good but i want the user to be able to checkout some projects from the server. The user(on the client side) selects a folder in his machine (i.e.: C:\P

Re: "running" code on client side with cherrypy?

2006-08-10 Thread Mr BigSmoke
quot; users that can checkout our applications releases... I'll try some other solution... thanks very much! cheers Fabio jay graves wrote: > Mr BigSmoke wrote: > > Hi All, > > I'm developing a website to handle some code/application version > > control on a intranet. I&#x

Simple Char-I/O Dialogs for Win32 and DOS

2006-06-14 Thread Mr Roboto
n't need a dialog/forms designer, no database access, just a basic dialog box to get input from a couple of text boxes, check boxes, etc. Does such an animal exist and can someone offer a link to the kit ? TIAMR -- http://mail.python.org/mailman/listinfo/python-list

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Mr Roboto
al C++ 2K5 *Express* from microsoft itself. If you're interested, try: http://msdn.microsoft.com/vstudio/express/visualc/default.aspx It's legal, free (no registration, no BS.) HTHMR -- http://mail.python.org/mailman/listinfo/python-list

[Q] About an Installer Script for PyWin

2006-08-25 Thread Mr. Roboto
I need PyWin under the covers, that is, to install it as part of an application, but in such a way that it isn't visible to users. I'm concerned about a so-called "power-user", seeing the Python directory and/or the corresponding entry in the 'Add/Remove Programs' list, breaking my app by uninstal

calling python from C#...

2006-01-22 Thread Mr BigSmoke
Hi everybody, I need write an application in c#, but i wnat to use some functions that i have already written in python. Is there an "easy" way to call my python code from c#? I must use COM or there are other ways? And, if COM is the only way, where can i find some tutorials or examples? I've neve

Re: calling python from C#...

2006-01-22 Thread Mr BigSmoke
I use python for .NET in some applications... I've always used it for using c# code from python (but i had some problems using it with py2exe and win2000). I'll try using it the other way (c# calling python). I also thought about trying ironpython, but it's too young for my work projects... The CO

Re: Data Crunching and Charting....

2006-01-28 Thread Mr BigSmoke
Hi Tom. I had more or less the same problem about 1 year and a half ago... Since then i've tried either Matplotlib and chaco. I've started using matplotlib but for some features reason i've decided to use only chaco. Chaco is really cool but has some neg. points: - documentation is not really deta

Re: Data Crunching and Charting....

2006-01-29 Thread Mr BigSmoke
Great!! I kept looking enthought site everyday for 2/3 months about one year ago... but it always had old chaco versions, no news... Then i posted questions about it here at comp.lang.python and some people said the project had been abbandoned... Great to know that it's not true!! TNX VERY MUCH!!

Using CHACO and UNICODE

2006-02-21 Thread Mr BigSmoke
I'm using chaco in an application that draw some grafs and plot. I really NEED to write unicode strings as a title (PlotTitle) and labels(PlotLabels) i my axis. The problem is that chat (and it's traits) only allow ascii strings... In the old version of chaco i created a new myPlotLabel class, deri

including directories with py2exe

2006-02-26 Thread Mr BigSmoke
Hi All how do i include directories into my project when using py2exe? I have a module that has it's images directory and when it's searches it (into ../dist/library.zip/.../mymodule/) it generates an error because the directory wasn't imported... tnx Fabio -- http://mail.python.org/mailman/list

How to use TLS lite

2007-06-08 Thread Mr SZ
I'm using tls lite to send mail using gmail's smtp.This is what I've done: from tlslite.api import * import tlslite.integration.SMTP_TLS connection= tlslite.integration.SMTP_TLS.SMTP_TLS('smtp.gmail.com',587) connection.set_debuglevel(1) msg = "Subject:Testing \n Hello" connection.starttls('[EMAIL

  1   2   >