Re: Pythonic way to iterate through multidimensional space?

2014-10-06 Thread Gelonida N
On 8/6/2014 1:39 PM, Tim Chase wrote: On 2014-08-06 11:04, Gayathri J wrote: Below is the code I tried to check if itertools.product() was faster than normal nested loops... they arent! arent they supposed to be...or am i making a mistake? I believe something like this was discussed a while a

Re: Syntax Highlighting in a tkinter Text widget

2014-10-06 Thread Christian Gollwitzer
Am 07.10.14 07:35, schrieb Nicholas Cannon: Hey guys Im working on an open source text editor(https://github.com/nicodasiko/Text-Config-2) and I would like to add syntax highlighting(mainly for python code). I have built the editor in python and the text input is a Text tkinter widget. I know how

Syntax Highlighting in a tkinter Text widget

2014-10-06 Thread Nicholas Cannon
Hey guys Im working on an open source text editor(https://github.com/nicodasiko/Text-Config-2) and I would like to add syntax highlighting(mainly for python code). I have built the editor in python and the text input is a Text tkinter widget. I know how to add tags and highlight things but Im

Re: Practice question

2014-10-06 Thread Seymore4Head
On Tue, 7 Oct 2014 01:46:37 + (UTC), Denis McMahon wrote: >On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: > >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it wants a similar expression that is equivale

Re: Representing mathematical equations

2014-10-06 Thread Michael Torrie
On 10/06/2014 10:45 AM, Peter Pearson wrote: > I don't think the OP is interested in complex numbers. I think this > is a question about organizing loops. But I can't tell for sure. Poor choice of words on my part. I meant complicated. This is exactly the kind of thing that people use numpy and

Re: Practice question

2014-10-06 Thread Denis McMahon
On Sun, 05 Oct 2014 19:02:31 -0400, Seymore4Head wrote: > For the record, I don't want a hint. I want the answer. > I see a practice question is similar to this. > 15 <= x < 30 And it wants a similar expression that is equivalent. I think part of the problem here is that you don't understand th

Re: Practice question

2014-10-06 Thread Redge @ Versalytics.com
> On Oct 6, 2014, at 4:49 PM, Steven D'Aprano wrote: > >> On Mon, 06 Oct 2014 10:05:40 -0700, Rustom Mody wrote: >> >>> On Monday, October 6, 2014 10:22:27 PM UTC+5:30, Chris Angelico wrote: On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: Consider the sequence: 1. Drives on th

Re: Assignment Operators?

2014-10-06 Thread sohcahtoa82
On Thursday, October 2, 2014 6:24:37 AM UTC-7, Didymus wrote: > Hi All, > > > >I was wondering if someone could explain an assignment operator that I'm > seeing in some code. As an example: > > > > >>> errors = False > > >>> errors |= 3 > > >>> errors > > 3 > > >>> errors |= 4 > >

Re: Practice question

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

Re: ruby instance variable in python

2014-10-06 Thread Steven D'Aprano
roro codeath wrote: > in ruby: > > module M > def ins_var > @ins_var ||= nil > end > > def m > @ins_var = 'val' > end > > def m2 > m > ins_var # => 'val' > end > end I admit that my Ruby skills are admittedly pretty lousy. Still, I used to think that Ruby was pretty readable, but I find the a

Re: Representing mathematical equations

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

Re: Python 2.76

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 4:31 AM, Joel Goldstick wrote: > Assuming you have a relationship with microsoft, you might try asking > them if they support the version of python you want to use. I'm not sure there's any official Microsoft support for existing versions of Python. With Steve Dower of Micr

Re: Representing mathematical equations

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

Re: Python 2.76

2014-10-06 Thread Joel Goldstick
On Mon, Oct 6, 2014 at 11:38 AM, Chris “Kwpolska” Warrick wrote: > CC'ing the mailing list. > > On Mon, Oct 6, 2014 at 5:29 PM, Sas Parmar > wrote: >> Hi Chris >> >> I need to get in contact with the actual manufacturer of Python. >> >> Do you have an email address or phone number? > > This is a

Re: Recommended hosting

2014-10-06 Thread writeson
Hi all, OP here, thanks for all your reply's, all very useful. I'm going to check out a couple and see what works for the project I have in mind. Thanks again! Doug -- https://mail.python.org/mailman/listinfo/python-list

Re: Representing mathematical equations

2014-10-06 Thread Dave Angel
varun...@gmail.com Wrote in message: > On Monday, 6 October 2014 15:03:44 UTC+2, varu...@gmail.com wrote: > (Deleted all the 8-space quoting. Either use a better email client or remove the extra 7 lines between every line you quote.) >> >> Okay, I forgot to explain them. L is a set of links,

Re: "High water" Memory fragmentation still a thing?

2014-10-06 Thread bryanjugglercryptographer
dieter wrote: > As you see from the description, memory compaction presents a heavy burden > for all extension writers. Particularly because many CPython extensions are actually interfaces to pre-existing libraries. To leverage the system's facilities CPython has to follow the system's conventio

Re: Practice question

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

Re: Practice question

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

Re: Practice question

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 3:23 AM, Rustom Mody wrote: > Consider the sequence: > > 1. Drives on the wrong side of the road > 2. Has no clue that there's such a concept as 'wrong side of road' > 3. Teaches people to drive without conveying anything about 'wrong side of > road' > > Hopefully you will

Re: Representing mathematical equations

2014-10-06 Thread Peter Pearson
On Mon, 06 Oct 2014 08:42:01 -0600, Michael Torrie wrote: > On 10/06/2014 07:07 AM, varun...@gmail.com wrote: >>> Okay, I forgot to explain them. L is a set of links, dist is a >>> number (distance), bd is the bandwidth and hc is a number as well >>> (hopcount)...different bandwidths, hopcounts an

Re: "High water" Memory fragmentation still a thing?

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 3:21 AM, wrote: > Chris Angelico wrote: >> This is why a lot of long-duration processes are built to be restarted >> periodically. It's not strictly necessary, but it can be the most >> effective way of solving a problem. I tend to ignore that, though, and >> let my processe

Re: "High water" Memory fragmentation still a thing?

2014-10-06 Thread bryanjugglercryptographer
Chris Angelico wrote: > This is why a lot of long-duration processes are built to be restarted > periodically. It's not strictly necessary, but it can be the most > effective way of solving a problem. I tend to ignore that, though, and > let my processes just keep on running... for 88 wk 4d 23:56:2

Re: Practice question

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

Re: Python 2.76

2014-10-06 Thread Chris “Kwpolska” Warrick
CC'ing the mailing list. On Mon, Oct 6, 2014 at 5:29 PM, Sas Parmar wrote: > Hi Chris > > I need to get in contact with the actual manufacturer of Python. > > Do you have an email address or phone number? This is a very problematic question. Why do you need to contact “the manufacturer”? Pytho

Re: Representing mathematical equations

2014-10-06 Thread Michael Torrie
On 10/06/2014 07:07 AM, varun...@gmail.com wrote: >> Okay, I forgot to explain them. L is a set of links, dist is a >> number (distance), bd is the bandwidth and hc is a number as well >> (hopcount)...different bandwidths, hopcounts and distances for different >> links... b(i,x) is what i intend to

Re: Python 2.76

2014-10-06 Thread Chris “Kwpolska” Warrick
On Mon, Oct 6, 2014 at 4:30 PM, Joel Goldstick wrote: > […] > No, I just meant to point out that these people are using a version of > 2.7 with the OS the OP is using. > Maybe that is helpful to know. This would have assumed those people bothered keeping their Python version up-to-date. Now: Win

Re: Python 2.76

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 1:30 AM, Joel Goldstick wrote: > No, I just meant to point out that these people are using a version of > 2.7 with the OS the OP is using. > Maybe that is helpful to know. Sure. A little extra verbiage could have made that clearer :) Unfortunately it's not proof; they seem

Re: Python 2.76

2014-10-06 Thread Joel Goldstick
On Mon, Oct 6, 2014 at 10:27 AM, Chris Angelico wrote: > On Tue, Oct 7, 2014 at 1:18 AM, Joel Goldstick > wrote: >> Look Here: http://ampps.com/download > > Any particular reason for using this third-party build of Python? I > note that they distribute some slightly old builds (2.7.2 on Windows

Re: Python 2.76

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 12:52 AM, Sas Parmar wrote: > I am working on a project at Service Birmingham to migrate our applications > from Windows Server 2003 over to Windows Server 2008 R2 > > Can you confirm if Python 2.76 is compatible with Server 2008 R2? > > If not can you confirm if any changes

Re: Python 2.76

2014-10-06 Thread Chris Angelico
On Tue, Oct 7, 2014 at 1:18 AM, Joel Goldstick wrote: > Look Here: http://ampps.com/download Any particular reason for using this third-party build of Python? I note that they distribute some slightly old builds (2.7.2 on Windows, 2.7.6 on other platforms), so unless they have some strong justif

Re: Python 2.76

2014-10-06 Thread Joel Goldstick
On Mon, Oct 6, 2014 at 9:52 AM, Sas Parmar wrote: > Dear Sirs > > > > I am working on a project at Service Birmingham to migrate our applications > from Windows Server 2003 over to Windows Server 2008 R2 > > > > Can you confirm if Python 2.76 is compatible with Server 2008 R2? > > > > If not can y

Re: Representing mathematical equations

2014-10-06 Thread Mark Lawrence
On 06/10/2014 14:07, varun...@gmail.com wrote: [snip 69 lines] L = [(1,3), (5,7), .] bd = [23, 34,43.44.] dist = [3,7,5,7, ] hc = [2,3,4,1,2,2,...] for every l belonging to L, i could be either 1 or 3 for L[0], similarly for L[1] it could be 5 or 7 Would you please access this

Python 2.76

2014-10-06 Thread Sas Parmar
Dear Sirs I am working on a project at Service Birmingham to migrate our applications from Windows Server 2003 over to Windows Server 2008 R2 Can you confirm if Python 2.76 is compatible with Server 2008 R2? If not can you confirm if any changes can be made to make it work on Server 2008 R2 (i

Re: ruby instance variable in python

2014-10-06 Thread Mark Lawrence
On 06/10/2014 11:45, David Palao wrote: Hello, If you explain what the ruby code does, I think much more people will be able to help you. Don't forget, this is a Python list. Not everybody knows Ruby here. Best 2014-10-06 12:06 GMT+02:00 roro codeath : in ruby: Please don't top post here, t

Re: Representing mathematical equations

2014-10-06 Thread varun7rs
On Monday, 6 October 2014 15:03:44 UTC+2, varu...@gmail.com wrote: > On Monday, 6 October 2014 13:14:04 UTC+2, varu...@gmail.com wrote: > > > Hello, > > > > > > > > > > > > I am working on a mathematical equation which I'm finding really hard to > > express in python. Could any of you sp

Re: Representing mathematical equations

2014-10-06 Thread varun7rs
On Monday, 6 October 2014 13:14:04 UTC+2, varu...@gmail.com wrote: > Hello, > > > > I am working on a mathematical equation which I'm finding really hard to > express in python. Could any of you spare some time to help me out? > > > > The equation looks like this > > > > b(i,x) = [Σ(l∈L)

Re: Practice question

2014-10-06 Thread Skip Montanaro
On Sun, Oct 5, 2014 at 9:47 PM, Rustom Mody wrote: > Sorry Seymore if this sounds condescending -- its not a complaint > against you but against those who treat the print statement/expression as > kosher for newbies. So if you're not griping about Seymore's original post, are you griping about my

Re:Representing mathematical equations

2014-10-06 Thread Dave Angel
varun...@gmail.com Wrote in message: > Hello, > > I am working on a mathematical equation which I'm finding really hard to > express in python. Could any of you spare some time to help me out? > > The equation looks like this > > b(i,x) = [Σ(l∈L) [bd(l) * dist(l) * hc(l)]] / Σ(l∈L) l > > I ha

Representing mathematical equations

2014-10-06 Thread varun7rs
Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out? The equation looks like this b(i,x) = [Σ(l∈L) [bd(l) * dist(l) * hc(l)]] / Σ(l∈L) l I have a problem in representing the above equation. I don't

Re: ruby instance variable in python

2014-10-06 Thread David Palao
Hello, If you explain what the ruby code does, I think much more people will be able to help you. Don't forget, this is a Python list. Not everybody knows Ruby here. Best 2014-10-06 12:06 GMT+02:00 roro codeath : > in ruby: > > module M > def ins_var > @ins_var ||= nil > end > > def m > @ins_var

ruby instance variable in python

2014-10-06 Thread roro codeath
in ruby: module M def ins_var @ins_var ||= nil end def m @ins_var = 'val' end def m2 m ins_var # => 'val' end end in py: # m.py # how to def ins_var def m: # how to set ins_var def m2: m() # how to get ins var -- https://mail.python.org/mailman/listinfo/python-list

ruby instance variable in python

2014-10-06 Thread roro codeath
for instance in ruby i can write following code: module M def ins_var @ins_var ||= nil end def m @ins_var = "val" end def m2 ins_var # => "val" end end in py # m.py # how to def a ins_var? def m: # how to set a ins_var? def m2: # how to get a ins_var? -- https://mail.python.org/ma

Re: Clearing globals in CPython

2014-10-06 Thread Chris Angelico
On Mon, Oct 6, 2014 at 8:08 PM, Steven D'Aprano wrote: > On Mon, 06 Oct 2014 09:05:17 +, jakubo wrote: > >> After invoking autocompletion (.__ and hitting tab), session has been >> automagically healed. > > > That's ... um ... > > I have no words. > > > Can you confirm that autocompletion modi

Re: Clearing globals in CPython

2014-10-06 Thread Steven D'Aprano
On Mon, 06 Oct 2014 09:05:17 +, jakubo wrote: > After invoking autocompletion (.__ and hitting tab), session has been > automagically healed. That's ... um ... I have no words. Can you confirm that autocompletion modifies globals()? I don't have 3.4 installed here. -- Steven -- https

Re: Clearing globals in CPython

2014-10-06 Thread jakubo
On 2014-10-01, Peter Otten <__pete...@web.de> wrote: > Steven D'Aprano wrote: > >> Out of curiosity, I ran: >> >> globals().clear() >> >> Oops. >> >> So, with no built-ins available, import no longer works. That makes things >> rather tricky. >> >> Obviously the easiest way to recover is to exi

Re: Python 3.4.1 on W2K?

2014-10-06 Thread Chris Angelico
On Mon, Oct 6, 2014 at 11:04 AM, Pal Acreide wrote: > BTW, the reason I run VBox is that I belong to a group of diehard users of > the classic DOS word-processor XyWrite. I've devised a way to use Python as > an extension of XyWrite's built-in Programming Language (XPL): > http://users.datarealm.c

Re: Python 3.4.1 on W2K?

2014-10-06 Thread Tim Golden
On 06/10/2014 01:04, Pal Acreide wrote: > Hi, I'm a lurker here and enjoy the back-and-forth, especially among the > experts among you. > > My question is this: I have Python 3.4.1 installed on 64-bit Win 7 Home > Premium, and on 32-bit Win 7 Pro running on a virtual machine (Oracle > VirtualBox)

Re: "High water" Memory fragmentation still a thing?

2014-10-06 Thread Steven D'Aprano
On Sun, 05 Oct 2014 20:23:42 +0100, mm0fmf wrote: > On 04/10/2014 02:02, Steven D'Aprano wrote: >> Way back in the mid 1980s, Apple Macintoshes used a memory manager >> which could move memory around. > > But the memory manager didn't return a pointer to memory the way malloc > does. It returned

Python 3.4.1 on W2K?

2014-10-06 Thread Pal Acreide
Hi, I'm a lurker here and enjoy the back-and-forth, especially among the experts among you. My question is this: I have Python 3.4.1 installed on 64-bit Win 7 Home Premium, and on 32-bit Win 7 Pro running on a virtual machine (Oracle VirtualBox). Now I'm trying to install it on Windows 2000 P

Re: Practice question

2014-10-06 Thread C Smith
14 wrote: > On 10/5/14 7:02 PM, Seymore4Head wrote: >> >> For the record, I don't want a hint. I want the answer. >> I see a practice question is similar to this. >> 15 <= x < 30 And it wants a similar expression that is equivalent. >> So the right answer is 15<= x or x <30 > > > No, "15 <= x < 3

article posting

2014-10-06 Thread Maxim Lesnichenko
Dear Python community members, I would be very appreciate you if somebody could give me the contacts of responsible person for posting articles on python.org resource. It could be chief editor`s or administrator`s name and e-mail, Thank you very much advance, Best Regards Maxi