Re: [Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Peter Otten
Steven D'Aprano wrote: > On Thu, Sep 05, 2013 at 09:11:50AM +1000, Steven D'Aprano wrote: > >> I don't believe there is a way to make >> string literals unicode, you just have to get used to writing u"" and >> b"" strings by hand. > > Sorry, that is unclear. I meant to say, there is no way to fo

Re: [Tutor] myown.getfilesystemencoding()

2013-09-04 Thread Steven D'Aprano
On Wed, Sep 04, 2013 at 05:39:10AM -0700, Albert-Jan Roskam wrote: > Wow, thanks for looking all this up. Thanks also to other people who > replied. It's not really desirable that a IDE adds confusion to an > area that's already confusing to begin with. Well, naturally it isn't desirable to ad

Re: [Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Steven D'Aprano
On Thu, Sep 05, 2013 at 09:11:50AM +1000, Steven D'Aprano wrote: > I don't believe there is a way to make > string literals unicode, you just have to get used to writing u"" and > b"" strings by hand. Sorry, that is unclear. I meant to say, there is no way to force unprefixed strings "" to be

Re: [Tutor] resolution

2013-09-04 Thread Steven D'Aprano
On Wed, Sep 04, 2013 at 10:50:54AM +0200, musa ezeri wrote: > im building an image processing software, but the python image processing > modules are in 32 bit and require 32bit python 2.7 where can i find a 32 > bit python 2.7? http://www.python.org/download/ -- Steven __

Re: [Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Steven D'Aprano
On Wed, Sep 04, 2013 at 06:30:12AM -0700, Albert-Jan Roskam wrote: > Hi, > > I am trying to make my app work in Python 2.7 and Python 3.3 (one > codebase) and I might later also try to make it work on Python 2.6 and > Python 3.2 (if I am not too fed up with it ;-). I was very happy to > notice

Re: [Tutor] myown.getfilesystemencoding()

2013-09-04 Thread eryksun
On Wed, Sep 4, 2013 at 8:39 AM, Albert-Jan Roskam wrote: > But given that chcp returns cp850 on my windows system (commandline), > wouldn't it be more descriptive if sys.getfilesystemencoding() > returned 'cp850'? The common file systems (NTFS, FAT32, UDF, exFAT) support Unicode filenames. The co

Re: [Tutor] Map Element Automation

2013-09-04 Thread ALAN GAULD
Please use ReplyAll to include the list in your responses.   I'm using python to automate this process. The map elements can be automatically  >updated using python, I just can't figure out how to access an attribute in >the layer's  >attribute table. I don't think there is any other way to autom

Re: [Tutor] postgresql was: Re: Tutor Digest, Vol 115, Issue 6

2013-09-04 Thread Steve Willoughby
On 04-Sep-2013, at 14:28, Alan Gauld wrote: > On 03/09/13 08:25, Ismar Sehic wrote: >> help with postgres and csv: >> i solved my problem by playing with the sql line a little. >> it looked like this : sql = " UPDATE hotel SET path_picture = >> "+"';"+hotel_url+"' >> WHERE code LIKE '"+"%"+hotel

[Tutor] postgresql was: Re: Tutor Digest, Vol 115, Issue 6

2013-09-04 Thread Alan Gauld
On 03/09/13 08:25, Ismar Sehic wrote: help with postgres and csv: i solved my problem by playing with the sql line a little. it looked like this : sql = " UPDATE hotel SET path_picture = "+"';"+hotel_url+"' WHERE code LIKE '"+"%"+hotel_code+"'" now it's like this : " UPDATE hotel SET path_pi

Re: [Tutor] Map Element Automation

2013-09-04 Thread Alan Gauld
On 04/09/13 17:42, Abbott, Jennifer ENV wrote: I am trying to automate a map so that every time I make a new map with the same template the sub titles and other text changes according to the specific map properties. For instance, a field from the attribute table has the PROPERTY # and with each

Re: [Tutor] resolution

2013-09-04 Thread Alan Gauld
On 04/09/13 09:50, musa ezeri wrote: im building an image processing software, but the python image processing modules are in 32 bit and require 32bit python 2.7 where can i find a 32 bit python 2.7? On the Python.org download page I would say. Which OS? If it's Linux and you are on 64bit it

Re: [Tutor] Tutor Digest, Vol 115, Issue 6

2013-09-04 Thread Ismar Sehic
help with postgres and csv: i solved my problem by playing with the sql line a little. it looked like this : sql = " UPDATE hotel SET path_picture = "+"';"+hotel_url+"' WHERE code LIKE '"+"%"+hotel_code+"'" now it's like this : " UPDATE hotel SET path_picture = '" + hot_url + "' WHERE code LIKE

[Tutor] Map Element Automation

2013-09-04 Thread Abbott, Jennifer ENV
HI, I am trying to automate a map so that every time I make a new map with the same template the sub titles and other text changes according to the specific map properties. For instance, a field from the attribute table has the PROPERTY # and with each map I need that property number to be show

[Tutor] resolution

2013-09-04 Thread musa ezeri
im building an image processing software, but the python image processing modules are in 32 bit and require 32bit python 2.7 where can i find a 32 bit python 2.7? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

Re: [Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Don Jennings
On Sep 4, 2013, at 9:30 AM, Albert-Jan Roskam wrote: > Hi, > > I am trying to make my app work in Python 2.7 and Python 3.3 (one codebase) > and I might later also try to make it work on Python 2.6 and Python 3.2 (if I > am not too fed up with it ;-). You might like to read Armin Ronacher's (

[Tutor] Python 2 & 3 and unittest

2013-09-04 Thread Albert-Jan Roskam
Hi, I am trying to make my app work in Python 2.7 and Python 3.3 (one codebase) and I might later also try to make it work on Python 2.6 and Python 3.2 (if I am not too fed up with it ;-). I was very happy to notice that the 'b' prefix for bytes objects is also supported for byte strings in Pyt

Re: [Tutor] myown.getfilesystemencoding()

2013-09-04 Thread Albert-Jan Roskam
- Original Message - > From: eryksun > To: Oscar Benjamin ; Albert-Jan Roskam > > Cc: Python Mailing List > Sent: Sunday, September 1, 2013 7:30 AM > Subject: Re: [Tutor] myown.getfilesystemencoding() > > On Sat, Aug 31, 2013 at 9:16 AM, Oscar Benjamin > wrote: >>  Spyder has both

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread eryksun
On Wed, Sep 4, 2013 at 7:11 AM, Oscar Benjamin wrote: > On 4 September 2013 11:42, eryksun wrote: si = subprocess.STARTUPINFO() si.dwFlags |= subprocess.STARTF_USESHOWWINDOW si.wShowWindow = subprocess.SW_HIDE >>> >>> Do these statements modify module-level state? Or do

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread Oscar Benjamin
On 4 September 2013 11:42, eryksun wrote: >>> si = subprocess.STARTUPINFO() >>> si.dwFlags |= subprocess.STARTF_USESHOWWINDOW >>> si.wShowWindow = subprocess.SW_HIDE >> >> Do these statements modify module-level state? Or do you need to pass >> startupinfo=si when calling Popen? > > It

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread eryksun
On Wed, Sep 4, 2013 at 6:22 AM, Oscar Benjamin wrote: > On 4 September 2013 11:11, eryksun wrote: > >> Using shell=True also sets startupinfo to hide the window. If that's >> the only reason you're using the shell, you may as well cut out the >> middleman (and potential security hole). Set startu

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread Oscar Benjamin
On 4 September 2013 11:11, eryksun wrote: > On Wed, Sep 4, 2013 at 5:14 AM, learner404 wrote: >> >> Yes, this worked :) >> >> subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputName,"-f", >> "dshow","-i","audio="+audioinputName,"-q","5","%s"%videoFileOutput], >> shell=True) You shou

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread eryksun
On Wed, Sep 4, 2013 at 5:14 AM, learner404 wrote: > > Yes, this worked :) > > subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputName,"-f", > "dshow","-i","audio="+audioinputName,"-q","5","%s"%videoFileOutput], > shell=True) Using shell=True also sets startupinfo to hide the window.

Re: [Tutor] os.system vs subprocess.Popen args problems

2013-09-04 Thread learner404
Thanks a lot Oscar and Eryksun for all the explanations and answers, I really appreciate. "So the extra quotes used for the video and audio arguments do actually get passed through to ffmpeg causing confusion." Yes, this worked :) subprocess.Popen(["ffmpeg","-f","dshow","-i","video="+videoinputNa