Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 3:35 PM, Νικόλαος Κούρας wrote: > Can you please tell me HOW TO GET RID OF ALL PYTHON SETUPS except 2.6 that is > needed for system core and then just install 3.3.2? Nuke the hard drive from orbit. It's the only way to be sure. > also why cant i install 3.3.2 using yum.

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Σάββατο, 1 Ιουνίου 2013 3:15:22 π.μ. UTC+3, ο χρήστης Dennis Lee Bieber έγραψε: > On Fri, 31 May 2013 08:20:54 -0700 (PDT), �������� > ������ > > declaimed the following in > > gmane.comp.python.general: > > > > > I'am using CentOS v6.4 on my VPS and hence 'yu

Re: Apache and suexec issue that wont let me run my python script

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 3:30 PM, Νικόλαος Κούρας wrote: > I have asked this in alt.apache.configuration but received no response at all You posted it FIFTEEN HOURS AGO on a low-traffic forum. Sheesh! Learn a little patience. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Apache and suexec issue that wont let me run my python script

2013-05-31 Thread Νικόλαος Κούρας
I have asked this in alt.apache.configuration but received no response at all, so i was thinking of you guys as a last resort to this. Sorry about that but koukos.py need to set a cookies that other scripts depend upon for identification. 'python3 koukos.py' runs properly. chown nikos:nikos kouk

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread rusi
On May 31, 7:42 pm, Chris Angelico wrote: > On Sat, Jun 1, 2013 at 12:02 AM, Alister wrote: > > /etc is used to store configuration files for the operating system & if > > you inadvertently corrupt the wrong one then you could kill the system. > > Expanding on this: > > http://en.wikipedia.org/wi

netcdF4 variables

2013-05-31 Thread Sudheer Joseph
Dear members, I have been using python NetcdF for some time. I understand that we can get variables from a netcdf one by one by using temp=ncf.variable['temp'][:] but is there a way to get a list of variables with out the rest of the stuff as seen below? some hing like a list

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Michael Torrie
On 05/31/2013 12:02 PM, Νικόλαος Κούρας wrote: > please tell me how to unistall python 2.6 and just keep 2.7 > and install 3.3.2 please uisng yum. Python 2.6 is required for CentOS to function. You simply cannot remove it. You can't replace it with 2.7 either. You can install 2.7 alongside it i

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Tim Chase
On 2013-06-01 01:20, Nobody wrote: > On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote: > > Any Idea how to create a file in /etc as non-root user? > > This should not be possible. The language used is irrelevant. It's theoretically possible to pre-create the file (or a subdirectory) in /etc as

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Mark Lawrence
On 01/06/2013 01:18, David wrote: I knew I didn't have all the answers, but felt that I'd try some pig wrestling anyway. To carry on with the animal analogy, the OP appears to me a very dangerous combination of headless chicken and bull in a china shop. -- "Steve is going for the pink ball

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Nobody
On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote: > I am a python novice;request all to kindly bear with me. > > fd = open('/etc/file','w') > fd.write('jpdas') > fd.close() > > > The above snippet fails with: > IOError: [Errno 13] Permission denied: '/etc/file' As it should. > Any Idea ho

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 10:18 AM, David wrote: > On 01/06/2013, Chris Angelico wrote: >> On Sat, Jun 1, 2013 at 8:50 AM, David wrote: >>> >>> Apart from the bizarre trailing '*' characters which for which I have >>> no sane explanation... >> >> I believe that indicates that his 'ls' is aliased to

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread David
On 01/06/2013, Chris Angelico wrote: > On Sat, Jun 1, 2013 at 8:50 AM, David wrote: >> >> Apart from the bizarre trailing '*' characters which for which I have >> no sane explanation... > > I believe that indicates that his 'ls' is aliased to 'ls --classify', > which puts * after executables (and

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 10:08 AM, Νικόλαος Κούρας wrote: > Τη Σάββατο, 1 Ιουνίου 2013 2:55:38 π.μ. UTC+3, ο χρήστης Ian έγραψε: > > [ snip lots of double-spaced quoted text ] > > Do you think that i should have my VPS copmany to install ubuntu for me and > use apt-get install python3 ? > > I think

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Σάββατο, 1 Ιουνίου 2013 2:55:38 π.μ. UTC+3, ο χρήστης Ian έγραψε: > On Fri, May 31, 2013 at 5:30 PM, Νικόλαος Κούρας > wrote: > > > Indeed i have comiled python 2.7 and 3.3 form source after wget and > > > ./configure an make install > > > > > > but i belive somehting is mixed up althouh

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 5:30 PM, Νικόλαος Κούρας wrote: > Indeed i have comiled python 2.7 and 3.3 form source after wget and > ./configure an make install > > but i belive somehting is mixed up althouh python works ok. > > root@nikos [/opt/python3/bin]# ls -al > ... > root@nikos [/opt/python3/bi

Re: Is this code correct?

2013-05-31 Thread Cameron Simpson
On 30May2013 06:45, Nikos as SuperHost Support wrote: | Τη Πέμπτη, 30 Μαΐου 2013 4:36:11 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: | > Lemme guess, he's next going to ask on the PostgreSQL mailing list. I | > mean, that's unrelated to Python, right? | | Well Chris, i'am not that stupid :) | |

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 8:50 AM, David wrote: > On 01/06/2013, Νικόλαος Κούρας wrote: >> >> root@nikos [/]# ls -l /usr/bin/python* >> -rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python* >> lrwxrwxrwx 1 root root6 Apr 5 20:34 /usr/bin/python2 -> python* >> -rwxr-xr-x 3 root root 4864 Feb

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 9:30 AM, Νικόλαος Κούρας wrote: > Still i feel my system is a bit messed p and i just want to leave the > 2.6 installed and remove all the rest python and then yum install > the_latest_one. It's not half as messed up as... uhh, scratch that. It's not half as messed up as th

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Indeed i have comiled python 2.7 and 3.3 form source after wget and ./configure an make install but i belive somehting is mixed up althouh python works ok. root@nikos [/opt/python3/bin]# ls -al total 15180 drwxr-xr-x 2 root root4096 Apr 7 22:09 ./ drwxr-xr-x 6 root root4096 Apr 7 22:09

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread David
On 01/06/2013, Νικόλαος Κούρας wrote: > > Why so many pythons in my system. Explained below, underneath each pertinent info you provided. First, let's discuss Python 2.6: On 01/06/2013, Νικόλαος Κούρας wrote: > I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just > tried

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Fábio Santos
On 31 May 2013 19:09, "Νικόλαος Κούρας" wrote: > > On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας wrote: > > > > > OMG i gave by mistake > > > root@nikos [/]# rm -rf /root/.local/ > > > did i screwed up my remote VPS which i host 10 peoples webpages? Couldn't you check ten websites which are

Re: How to Begin Web Development with Python ?

2013-05-31 Thread Modulok
> I have learnt python and used it for various purposes for scietific > computing using sage and GUI development using Tkinter and lots more. I > want to start web development using python My goal is to learn the web > development in python from the basic level and understand the big web > developm

Re: Cutting a deck of cards

2013-05-31 Thread Modulok
> Why on Earth would you want to? "Cutting" a deck makes no sense in > software. Randomize the deck properly (Google "Fisher-Yates") and start > dealing. Cutting the deck will not make it any more random, and in fact > will probably make it worse depending on how you choose the cutpoint. > > The pu

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 1:43 AM, Ian Kelly wrote: > On Thu, May 30, 2013 at 1:38 PM, MRAB wrote: >> And additional argument (pun not intended) for putting sep second is >> that you can give it a default value: >> >>def join(iterable, sep=""): return sep.join(iterable) > > One argument against

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 8:55:51 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας > wrote: > > > OMG i gave by mistake > > > > > > root@nikos [/]# rm -rf /root/.local/ > > > > > > did i screwed up my remote VPS which i host 10 peoples webpages? > > >

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:42 AM, Νικόλαος Κούρας wrote: > OMG i gave by mistake > > root@nikos [/]# rm -rf /root/.local/ > > did i screwed up my remote VPS which i host 10 peoples webpages? I don't know, is that where you were keeping the data? The website still appears to be working, as best I

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
OMG i gave by mistake root@nikos [/]# rm -rf /root/.local/ did i screwed up my remote VPS which i host 10 peoples webpages? -- http://mail.python.org/mailman/listinfo/python-list

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 8:24:26 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > On the other hand, there's really not much harm in leaving it. Python > 2.6 is already your default Python. > Is this the same system where you recently spent a lot of time > upgrading your web scripts to Python 3? Yes, it

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:16 AM, Νικόλαος Κούρας wrote: > root@nikos [~]# which python > /usr/bin/python > root@nikos [~]# which python2 > /usr/bin/python2 > root@nikos [~]# which python3 > /root/.local/lib/python2.7/bin/python3 > root@nikos [~]# which python3.3 > /root/.local/lib/python2.7/bin/p

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 11:10 AM, Νικόλαος Κούρας wrote: > root@nikos [~]# ls -al /usr/bin/python* > -rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python* > lrwxrwxrwx 1 root root6 Apr 5 20:34 /usr/bin/python2 -> python* > -rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6* > -rw

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Alister
On Fri, 31 May 2013 08:20:54 -0700, Νικόλαος Κούρας wrote: > I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i > just tried: > > Code: > root@nikos [~]# which python /usr/bin/python root@nikos [~]# which > python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which >

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python2 /usr/bin/python2 root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which python3.3 /root/.local/lib/python2.7/bin/python3.3 root@nikos [~]# So i have 2.6 2.7 3 3.3 4 installations? --

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
root@nikos [~]# yum remove python3 Loaded plugins: fastestmirror Setting up Remove Process No Match for argument: python3 Loading mirror speeds from cached hostfile * base: ftp.plusline.de * extras: ftp.plusline.de * updates: ftp.plusline.de base

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 6:55:03 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε: > On 05/31/2013 09:20 AM, Νικόλαος Κούρας wrote: > > > Why so many pythons in my system. Now in the case of my Python3 > > > installation, it looks like i have two parallel installations of > > > Python3, but i don'

Re: sendmail smtplib.SMTP('localhost') Where is the email?

2013-05-31 Thread inq1ltd
Your responses helped. The mailg for linux gave me information I didn't expect. regards, jol On Friday, May 31, 2013 08:55:12 AM Cameron Simpson wrote: > On 30May2013 15:48, inq1ltd wrote: > | python help, > > Please do not make new discussions by replying to an old discussion. > > It

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 9:41 AM, Νικόλαος Κούρας wrote: > Τη Παρασκευή, 31 Μαΐου 2013 6:37:06 μ.μ. UTC+3, ο χρήστης Fábio Santos έγραψε: > >> Check if python3 and python3.3 aren't the same. Run them and look at the >> "intro" > lines. > > root@nikos [~]# python -V > Python 2.6.6 > root@nikos [~]#

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Michael Torrie
On 05/31/2013 09:20 AM, Νικόλαος Κούρας wrote: > Why so many pythons in my system. Now in the case of my Python3 > installation, it looks like i have two parallel installations of > Python3, but i don't. One is almost certainly a symlink to the other > and not an actual installation. Well is it a

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
Τη Παρασκευή, 31 Μαΐου 2013 6:37:06 μ.μ. UTC+3, ο χρήστης Fábio Santos έγραψε: > Check if python3 and python3.3 aren't the same. Run them and look at the > "intro" > lines. root@nikos [~]# python -V Python 2.6.6 root@nikos [~]# python3 -V Python 3.3.0 root@nikos [~]# python3.3 -V Python 3.3.0 ro

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Ian Kelly
On Fri, May 31, 2013 at 4:16 AM, Fábio Santos wrote: > On Fri, May 31, 2013 at 10:08 AM, Alister wrote: >> I think that is the winning argument. >> Next question is what should be the default ("", " " or',')? > > join, comma_join, whitejoin, linejoin variants, with different defaults? The more s

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Ian Kelly
On Thu, May 30, 2013 at 1:38 PM, MRAB wrote: > And additional argument (pun not intended) for putting sep second is > that you can give it a default value: > >def join(iterable, sep=""): return sep.join(iterable) One argument against the default is that it is specific to the str type. If you

Re: Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Fábio Santos
On 31 May 2013 16:28, "Νικόλαος Κούρας" wrote: > > I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: > > Code: > root@nikos [~]# which python > /usr/bin/python > root@nikos [~]# which python3 > /root/.local/lib/python2.7/bin/python3 > root@nikos [~]# which python3.

Re: Short-circuit Logic

2013-05-31 Thread Stefan Drees
On 2013-05-30 08:29:41 +, Steven D'Aprano said: On Thu, 30 May 2013 10:22:02 +0300, Jussi Piitulainen wrote: I wonder why floating-point errors are not routinely discussed in terms of ulps (units in last position). ... That is an excellent question! ... I have a module that works with ULPs.

Too many python installations. Should i remove them all and install the latest?

2013-05-31 Thread Νικόλαος Κούρας
I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried: Code: root@nikos [~]# which python /usr/bin/python root@nikos [~]# which python3 /root/.local/lib/python2.7/bin/python3 root@nikos [~]# which python3.3 /root/.local/lib/python2.7/bin/python3.3 root@nikos [~]# Why

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-31 Thread Νικόλαος Κούρας
Τη Πέμπτη, 30 Μαΐου 2013 8:28:56 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε: > Wonder how much less exciting this mailing list would be if he > switched to decaf... decaf is like tasting coffee without coffee! Caffeine gives the coffee a nice taste and make me sweaty and panik too if when i str

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Chris Angelico
On Sat, Jun 1, 2013 at 12:02 AM, Alister wrote: > /etc is used to store configuration files for the operating system & if > you inadvertently corrupt the wrong one then you could kill the system. Expanding on this: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard The FHS applies to Li

Re: Fatal Python error

2013-05-31 Thread nn
On May 29, 10:05 am, Joshua Landau wrote: > On 29 May 2013 14:02, Dave Angel wrote: > > > On 05/29/2013 08:45 AM, Oscar Benjamin wrote: > > Joshua:  Avoid doing anything complex inside an exception handler. > > Unfortunately, Ranger (the file manager in question) wraps a lot of stuff > in one big

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Alister
On Fri, 31 May 2013 07:11:58 -0400, Dave Angel wrote: > On 05/31/2013 05:27 AM, Luca Cerone wrote: >>> fd = open('/etc/file','w') >>> >>> fd.write('jpdas') >>> >>> fd.close() >>> >>> >> Hi Bibhu, that is not a Python problem, but a permission one. >> You should configure the permissions so that yo

Re: Short-circuit Logic

2013-05-31 Thread Roy Smith
In article <51a86319$0$29966$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > In an early talk Ken was explaining the advantages of tolerant > comparison. A member of the audience asked incredulously, > “Surely you don’t mean that when A=B and B=C, A may not equal C

Re: Cutting a deck of cards

2013-05-31 Thread Lee Crocker
Why on Earth would you want to? "Cutting" a deck makes no sense in software. Randomize the deck properly (Google "Fisher-Yates") and start dealing. Cutting the deck will not make it any more random, and in fact will probably make it worse depending on how you choose the cutpoint. The purpose of

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Fri, 31 May 2013 03:27:52 -0700, rusi wrote: > On May 31, 2:08 pm, Alister wrote: >> On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: >> > And additional argument (pun not intended) for putting sep second is >> > that you can give it a default value: >> >> >     def join(iterable, sep=""): retu

Re: serialize a class to XML and back

2013-05-31 Thread Schneider
On 25.05.2013 07:54, dieter wrote: Schneider writes: how can I serialize a python class to XML? Plus a way to get the class back from the XML? My aim is to store instances of this class in a database. In case you want to describe the XML data via an XML-schema (e.g. to exchange it with other

Re: serialize a class to XML and back

2013-05-31 Thread Schneider
On 26.05.2013 22:48, Roy Smith wrote: In article , Chris Rebert wrote: On May 23, 2013 3:42 AM, "Schneider" wrote: Hi list, how can I serialize a python class to XML? Plus a way to get the class back from the XML? There's pyxser: http://pythonhosted.org/pyxser/ My aim is to store inst

Re: Python Magazine

2013-05-31 Thread DRJ Reddy
Hello all, Was busy with work. Finally finished the job of registering the domain name. Will be live soon. The url is http://pythonmagazine.org. Hope we will be live soon. Regards, DRJ. -- http://mail.python.org/mailman/listinfo/python-list

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Dave Angel
On 05/31/2013 05:27 AM, Luca Cerone wrote: fd = open('/etc/file','w') fd.write('jpdas') fd.close() Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to the folder. However unless you know what you are doing it is

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Serhiy Storchaka
31.05.13 12:55, Peter Otten написав(ла): Serhiy Storchaka wrote: 30.05.13 23:46, Skip Montanaro написав(ла): Am I missing something about how io.StringIO works? I thought it was a more-or-less drop-in replacement for StringIO.StringIO. io.StringIO was backported from Python 3. It is a text

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread rusi
On May 31, 2:08 pm, Alister wrote: > On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: > > And additional argument (pun not intended) for putting sep second is > > that you can give it a default value: > > >     def join(iterable, sep=""): return sep.join(iterable) > > I think that is the winning ar

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Fábio Santos
On Fri, May 31, 2013 at 10:08 AM, Alister wrote: > I think that is the winning argument. > Next question is what should be the default ("", " " or',')? join, comma_join, whitejoin, linejoin variants, with different defaults? -- Fábio Santos -- http://mail.python.org/mailman/listinfo/python-list

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Peter Otten
Serhiy Storchaka wrote: > 30.05.13 23:46, Skip Montanaro написав(ла): >> Am I missing something about how io.StringIO works? I thought it was >> a more-or-less drop-in replacement for StringIO.StringIO. > > io.StringIO was backported from Python 3. It is a text (unicode) stream. > cStringIO.Stri

Re: Finding Relative Maxima in Python3

2013-05-31 Thread Chris Rebert
On May 31, 2013 2:46 AM, "Lourens-Jan Ugen" wrote: > > Hi all, > > The last few days I've been working on a script to manipulate some scientific data. One thing I would like to be able to do is find relative maxima in a data set. > I'm using numpy in python3 (which I think I can't do without becau

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-31 Thread Peter Otten
Luca Cerone wrote: >> >> That's because stdin/stdout/stderr take file descriptors or file >> >> objects, not path strings. >> > > Thanks Chris, how do I set the file descriptor to /dev/null then? For example: with open(os.devnull, "wb") as stderr: p = subprocess.Popen(..., stderr=stderr)

Finding Relative Maxima in Python3

2013-05-31 Thread Lourens-Jan Ugen
Hi all, The last few days I've been working on a script to manipulate some scientific data. One thing I would like to be able to do is find relative maxima in a data set. I'm using numpy in python3 (which I think I can't do without because of utf16 encoding of my data source) and a series of n

Re: Surprising difference between StringIO.StringIO and io.StringIO

2013-05-31 Thread Serhiy Storchaka
30.05.13 23:46, Skip Montanaro написав(ла): Am I missing something about how io.StringIO works? I thought it was a more-or-less drop-in replacement for StringIO.StringIO. io.StringIO was backported from Python 3. It is a text (unicode) stream. cStringIO.StringIO is a binary stream and StringI

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-31 Thread Luca Cerone
> > That's because stdin/stdout/stderr take file descriptors or file > > objects, not path strings. > Thanks Chris, how do I set the file descriptor to /dev/null then? -- http://mail.python.org/mailman/listinfo/python-list

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread Luca Cerone
> fd = open('/etc/file','w') > > fd.write('jpdas') > > fd.close() > > Hi Bibhu, that is not a Python problem, but a permission one. You should configure the permissions so that you have write access to the folder. However unless you know what you are doing it is discouraged to save your file i

Create a file in /etc/ as a non-root user

2013-05-31 Thread BIBHU DAS
I am a python novice;request all to kindly bear with me. fd = open('/etc/file','w') fd.write('jpdas') fd.close() The above snippet fails with: Jagannath-MacBook-Pro:~ jpdas$ python testUmask.py Traceback (most recent call last): File "testUmask.py", line 3, in fd = open('/etc/file','w')

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread Alister
On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: > On 30/05/2013 19:44, Chris Angelico wrote: >> On Fri, May 31, 2013 at 4:36 AM, Ian Kelly >> wrote: >>> On Wed, May 29, 2013 at 8:49 PM, rusi wrote: On May 30, 6:14 am, Ma Xiaojun wrote: > What interest me is a one liner: > print '\n

Re: Short-circuit Logic

2013-05-31 Thread Steven D'Aprano
On Fri, 31 May 2013 17:09:01 +1000, Chris Angelico wrote: > On Fri, May 31, 2013 at 3:13 PM, Steven D'Aprano > wrote: >> What makes you think that the commutative law is relevant here? >> >> > Equality should be commutative. If a == b, then b == a. Also, it's > generally understood that if a == c

Re: Short-circuit Logic

2013-05-31 Thread Steven D'Aprano
On Fri, 31 May 2013 09:42:38 +0300, Carlos Nepomuceno wrote: >> From: steve+comp.lang.pyt...@pearwood.info Subject: Re: Short-circuit >> Logic >> Date: Fri, 31 May 2013 05:13:51 + To: python-list@python.org >> >> On Fri, 31 May 2013 00:03:13 +0300, Carlos Nepomuceno wrote: From: steve+com

Re: python b'...' notation

2013-05-31 Thread jmfauth
On 31 mai, 00:19, alcyon wrote: > On Wednesday, May 29, 2013 3:19:42 PM UTC-7, Cameron Simpson wrote: > > On 29May2013 13:14, Ian Kelly wrote: > > > | On Wed, May 29, 2013 at 12:33 PM, alcyon wrote: > > > | > This notation displays hex values except when they are 'printable', in > > which case

Re: Can anyone please help me in understanding the following python code

2013-05-31 Thread Chris Angelico
On Fri, May 31, 2013 at 3:43 PM, Cameron Simpson wrote: > On 30May2013 21:54, bhk...@gmail.com wrote: > | One final question, Is there a way to edit the message once it has been > posted? > > Essentially, no. If there's some error in a post, reply to it > yourself with a correction. Transparency

Re: Short-circuit Logic

2013-05-31 Thread Chris Angelico
On Fri, May 31, 2013 at 3:13 PM, Steven D'Aprano wrote: > What makes you think that the commutative law is relevant here? > Equality should be commutative. If a == b, then b == a. Also, it's generally understood that if a == c and b == c, then a == b, though there are more exceptions to that (esp