Re: [Tutor] where is the wsgi server root?

2015-04-15 Thread Jim Mooney
I'm guessing; but I'd expect it to be the current directory > when you started the server. try adding a > > print( os,getcwd() ) > > And see if the result is your root. > Or you could try reading the documents...they might tell you! > > -- > Alan G Read the docs? Where's the fun in that ;') Act

Re: [Tutor] Regular expression on python

2015-04-15 Thread Alan Gauld
On 15/04/15 02:02, Steven D'Aprano wrote: New one on me. Where does one find out about verbose mode? I don't see it in the re docs? or embed the flag in the pattern. The flags that I know of are: (?x) re.X re.VERBOSE The flag can appear anywhere in the pattern and applies to the whole patte

Re: [Tutor] Regular expression on python

2015-04-15 Thread Peter Otten
Alan Gauld wrote: > On 15/04/15 02:02, Steven D'Aprano wrote: >>> New one on me. Where does one find out about verbose mode? >>> I don't see it in the re docs? >>> > >> or embed the flag in the pattern. The flags that I know of are: >> >> (?x) re.X re.VERBOSE >> >> The flag can appear anywhere in

Re: [Tutor] Regular expression on python

2015-04-15 Thread Albert-Jan Roskam
On Tue, 4/14/15, Peter Otten <__pete...@web.de> wrote: Subject: Re: [Tutor] Regular expression on python To: tutor@python.org Date: Tuesday, April 14, 2015, 4:37 PM Steven D'Aprano wrote: > On Tue, Apr 14, 2015 at 10:00:47AM +0200, Peter Otten

Re: [Tutor] Regular expression on python

2015-04-15 Thread Peter Otten
Albert-Jan Roskam wrote: > On Tue, 4/14/15, Peter Otten <__pete...@web.de> wrote: >>> >>> pprint.pprint( >>> ... [(k, int(v)) for k, v in >>> ... >re.compile(r"(.+?):\s+(\d+)(?:\s+\(.*?\))?\s*").findall(line)]) >>> [('Input Read Pairs', 2127436), >>>('Both Surviving', 1795091), >>>('Forward Only

[Tutor] Changing a string number to another number

2015-04-15 Thread Ken G.
When running the following code, I get the following error code: 201504110102030405061 Traceback (most recent call last): File "Mega_Millions_Tickets_Change.py", line 11, in datecode[20:21] = "0" TypeError: 'str' object does not support item assignment datecode = "201504110102030405061"

Re: [Tutor] Changing a string number to another number

2015-04-15 Thread Dave Angel
On 04/15/2015 08:21 AM, Ken G. wrote: When running the following code, I get the following error code: 201504110102030405061 Traceback (most recent call last): File "Mega_Millions_Tickets_Change.py", line 11, in datecode[20:21] = "0" TypeError: 'str' object does not support item assignm

Re: [Tutor] Changing a string number to another number

2015-04-15 Thread Peter Otten
Ken G. wrote: > When running the following code, I get the following > error code: > > 201504110102030405061 > Traceback (most recent call last): >File "Mega_Millions_Tickets_Change.py", line 11, in > datecode[20:21] = "0" > TypeError: 'str' object does not support item assignment > >

Re: [Tutor] Changing a string number to another number [RESOLVED]

2015-04-15 Thread Ken G.
On 04/15/2015 08:36 AM, Dave Angel wrote: On 04/15/2015 08:21 AM, Ken G. wrote: When running the following code, I get the following error code: 201504110102030405061 Traceback (most recent call last): File "Mega_Millions_Tickets_Change.py", line 11, in datecode[20:21] = "0" TypeErro

[Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
Solaris 10, Python 2.4.4 I have very little experience with issuing print commands using a Unix environment. Despite this, I wish to design a Tkinter window with a "Print" button, which, when clicked, would create a copy of the contents of the window as a .pdf file. GhostScript is available on my

Re: [Tutor] Changing a string number to another number

2015-04-15 Thread Steven D'Aprano
On Wed, Apr 15, 2015 at 08:21:33AM -0400, Ken G. wrote: > When running the following code, I get the following > error code: > > 201504110102030405061 > Traceback (most recent call last): > File "Mega_Millions_Tickets_Change.py", line 11, in > datecode[20:21] = "0" > TypeError: 'str' object

Re: [Tutor] Changing a string number to another number [RESOLVED]

2015-04-15 Thread Ken G.
On 04/15/2015 08:50 AM, Peter Otten wrote: Ken G. wrote: When running the following code, I get the following error code: 201504110102030405061 Traceback (most recent call last): File "Mega_Millions_Tickets_Change.py", line 11, in datecode[20:21] = "0" TypeError: 'str' object does

Re: [Tutor] Changing a string number to another number [RESOLVED]

2015-04-15 Thread Ken G.
On 04/15/2015 09:09 AM, Steven D'Aprano wrote: On Wed, Apr 15, 2015 at 08:21:33AM -0400, Ken G. wrote: When running the following code, I get the following error code: 201504110102030405061 Traceback (most recent call last): File "Mega_Millions_Tickets_Change.py", line 11, in datecod

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Steven D'Aprano
On Wed, Apr 15, 2015 at 07:55:28AM -0500, boB Stepp wrote: > Solaris 10, Python 2.4.4 > > I have very little experience with issuing print commands using a Unix > environment. Despite this, I wish to design a Tkinter window with a > "Print" button, which, when clicked, would create a copy of the >

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 8:29 AM, Steven D'Aprano wrote: > On Wed, Apr 15, 2015 at 07:55:28AM -0500, boB Stepp wrote: >> Solaris 10, Python 2.4.4 >> >> I have very little experience with issuing print commands using a Unix >> environment. Despite this, I wish to design a Tkinter window with a >> "P

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Zachary Ware
On Apr 15, 2015 9:38 AM, "boB Stepp" wrote: > Perhaps I am being foolish! But I do have my reasons, which, in this > case, is I wanted to take advantage of the pack and grid geometry > managers. These two tools seem to make the positioning of the widgets > much easier. Unless I am missing somethin

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 8:50 AM, Zachary Ware wrote: > > On Apr 15, 2015 9:38 AM, "boB Stepp" wrote: >> Perhaps I am being foolish! But I do have my reasons, which, in this >> case, is I wanted to take advantage of the pack and grid geometry >> managers. These two tools seem to make the positioni

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Peter Otten
boB Stepp wrote: > Solaris 10, Python 2.4.4 > > I have very little experience with issuing print commands using a Unix > environment. Despite this, I wish to design a Tkinter window with a > "Print" button, which, when clicked, would create a copy of the > contents of the window as a .pdf file. G

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Zachary Ware
On Apr 15, 2015 9:59 AM, "boB Stepp" wrote: > > On Wed, Apr 15, 2015 at 8:50 AM, Zachary Ware > wrote: > > > > On Apr 15, 2015 9:38 AM, "boB Stepp" wrote: > >> Perhaps I am being foolish! But I do have my reasons, which, in this > >> case, is I wanted to take advantage of the pack and grid geome

Re: [Tutor] Regular expression on python

2015-04-15 Thread Alan Gauld
On 15/04/15 09:24, Peter Otten wrote: function call. I've never seen (or noticed?) the embedded form, and don't see it described in the docs anywhere Quoting : """ (?aiLmsux) (One or more letters from the set 'a', 'i', 'L', 'm', 's', 'u', 'x'.) The

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Alan Gauld
On 15/04/15 13:55, boB Stepp wrote: Solaris 10, Python 2.4.4 I have very little experience with issuing print commands using a Unix environment. Despite this, I wish to design a Tkinter window with a "Print" button, which, when clicked, would create a copy of the contents of the window as a .pdf

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 10:39 AM, Peter Otten <__pete...@web.de> wrote: > boB Stepp wrote: > >> Solaris 10, Python 2.4.4 [...] > > I'm on linux and surprisingly > > subprocess.call(["import", "-window", window_title, postscript_file]) > > worked. I admit it's a roundabout way... I did not find t

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread boB Stepp
On Wed, Apr 15, 2015 at 11:13 AM, Alan Gauld wrote: [...] > Your problem is that Tkinter does not really support the concept > of printing to hard copy. Other GUI frameworks (like WxPython) > do this much better. So anything you do will be a bit of a kluge. > There are some valid reasons for thi

Re: [Tutor] How to get a Tkinter window to print a color copy of itself as a .pdf file?

2015-04-15 Thread Alan Gauld
On 15/04/15 18:00, boB Stepp wrote: import Tkinter as tk Question: I have been using "from Tkinter import *" as suggested in "Programming Python" by Lutz. He remarks that unlike other situations, this is generally safe with Tkinter. Is there a benefit to doing the import as you have? Biggest

[Tutor] Reference last email message...

2015-04-15 Thread Ken G.
I just emailed that I was unable to correct a message in ModTools so I went to Yahoo and made the change and then approved it. Noticing it did not appear on the list, I checked the Activity Log in Yahoo and it was marked Bounced! Several days ago, we had another message correction and that too,

Re: [Tutor] Reference last email message...

2015-04-15 Thread Alan Gauld
On 16/04/15 00:47, Ken G. wrote: I just emailed that I was unable to correct a message in ModTools so I went to Yahoo and made the change and then approved it. What is ModTools? What kind of message? Where does Yahoo fit in? What does any of it have to do with this list? I'm confused. -- Ala

Re: [Tutor] Reference last email message...

2015-04-15 Thread Dave Angel
On 04/15/2015 07:47 PM, Ken G. wrote: I just emailed that I was unable to correct a message in ModTools so I went to Yahoo and made the change and then approved it. Noticing it did not appear on the list, I checked the Activity Log in Yahoo and it was marked Bounced! Several days ago, we had an