Re: 'open' is not defined

2015-07-30 Thread ltc.hotspot
Dieter, Thanks. What about using the append function to remove duplicate outputs entered on or thereafter line no. 9, i.e., LIST_APPEND(i) Calls list.append(TOS[-i], TOS). Used to implement list comprehensions. While the appended value is popped off, the list object remains on the stack

GvR Europython keynote described on lwn.net

2015-07-30 Thread Paul Rubin
https://lwn.net/Articles/651967/ Excerpts: He then moved on to Python 3.5, which is due in September. He would have trouble choosing a favorite feature from the release because there are "way too many cool things" in it Perhaps his favorite 3.5 feature should be type hints, since it is a PEP

Re: 'open' is not defined

2015-07-30 Thread dieter
writes: > ... > Why is open not defined in the following code:NameError: name 'open' is not > defined > > Code reads as follows: > > fname = raw_input("Enter file name: ") > if len(fname) < 1 : fname = "mbox-short.txt" > fh = open(fname) > count = 0 > for line in fh: > if not line.startswith(

Re: Improper Django Project error

2015-07-30 Thread dieter
Gary Roach writes: > Being new to Django and Python, I have two projects setup side by > side, each in it's own virtualenv wrapper. > The twr_project is running Django 1.7, python 2.7 and is set up to > duplicate the 'Tango With Rango' tutorial. > The archivedb project is running Django 1.8, pytho

Re: Logical Query JSON

2015-07-30 Thread dieter
subhabrata.bane...@gmail.com writes: > ... > I am trying to quote some of my exercises below, and my objective. A general remark. Python errror messages are quite good (unlike e.g. many Microsoft or Oracle error messages). You can almost always trust them. Thus, if you get a "SyntaxError", someth

Re: How to rearrange array using Python?

2015-07-30 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 30/07/2015 21:31, Martin Schöön wrote: >> I am just back from visiting my sisters and the younger of them >> was busy planning a youth orchestra summer camp. For some reason >> the kids are allowed to wish with whom they want to share rooms >> and my sister spent several

Re: using sched

2015-07-30 Thread Nkansah Rexford
Great. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: How to rearrange array using Python?

2015-07-30 Thread Robin Koch
Am 30.07.2015 um 22:31 schrieb Martin Schöön: Scores to the right show how many wishes are fulfilled in each room Is it possible the is a mistake in the sum column on the third row? Should the be a 1? The goal is to re-shuffle the array to maximize this score. How do I go about doing that?

'open' is not defined

2015-07-30 Thread ltc.hotspot
Hi Everyone: Why is open not defined in the following code:NameError: name 'open' is not defined Code reads as follows: fname = raw_input("Enter file name: ") if len(fname) < 1 : fname = "mbox-short.txt" fh = open(fname) count = 0 for line in fh: if not line.startswith('Fro

Re: How to rearrange array using Python?

2015-07-30 Thread Mark Lawrence
On 30/07/2015 23:31, ltc.hots...@gmail.com wrote: Hi Mark, I’m still confused because line 4 reads: fh=open(fname,'r') # Open a new file handle, not fn = open(fname) Can you write down line by line from error to correction? I'd think about it if you could find the correct thread :) -- My fe

Re: How to rearrange array using Python?

2015-07-30 Thread ltc.hotspot
Hi Mark, I’m still confused because line 4 reads: fh=open(fname,'r') # Open a new file handle, not fn = open(fname) Can you write down line by line from error to correction? Hal Sent from Surface From: Mark Lawrence Sent: ‎Thursday‎, ‎July‎ ‎30‎, ‎2015 ‎3‎:‎21‎ ‎PM To: python-l

Re: How to rearrange array using Python?

2015-07-30 Thread Mark Lawrence
On 30/07/2015 21:31, Martin Schöön wrote: Here is a problem I think I should be able to solve using Python but after having searched the internet for the better part of this evening my head spins and I would apreciate some guidance. Disclaimer My formal programming training happened 35+ years a

Re: [Tutor] Mailbox

2015-07-30 Thread ltc.hotspot
Hi Cameron, New revision code: count = 0 fn = raw_input("Enter file name: ") if len(fn) < 1 : fname = "mbox-short.txt" for line in fn: if 'From' in line.split()[0]: count += 1 print "There are %d lines starting with From" % count print len(line) fn = open(fname) print "There were", count, "lin

Re: [Tutor] Mailbox

2015-07-30 Thread Cameron Simpson
On 30Jul2015 19:00, ltc.hots...@gmail.com wrote: New revision code: count = 0 fn = raw_input("Enter file name: ") if len(fn) < 1 : fname = "mbox-short.txt" for line in fn: if 'From' in line.split()[0]: count += 1 print "There are %d lines starting with From" % count print len(line) fn = open(f

How to rearrange array using Python?

2015-07-30 Thread Martin Schöön
Here is a problem I think I should be able to solve using Python but after having searched the internet for the better part of this evening my head spins and I would apreciate some guidance. Disclaimer My formal programming training happened 35+ years ago and initially involved F77 and later Pasc

Re: How to re-write this bash script in Python?

2015-07-30 Thread random832
On Thu, Jul 30, 2015, at 14:31, sutanu@gmail.com wrote: > _year=$(date -d "-5 hour" +%Y) > _month=$(date -d "-5 hour" +%m) > _day=$(date -d "-5 hour" +%d) > _hour=$(date -d "-5 hour" +%H) What is the purpose of the -5 hour offset? Is it an attempt to compensate for timezones? -- https://mail.

New module (written in C) for using the high-precision QD library

2015-07-30 Thread baruchel
Hi, I wrote a module for wrapping the well-known high-precision QD library written by D.H. Bailey. You can find it here: https://github.com/baruchel/qd It is written in pure C with the CPython C-API in order to get the highest possible speed. The QD library provides floating number types for ~

Re: using sched

2015-07-30 Thread Irmen de Jong
On 30-7-2015 17:57, Nkansah Rexford wrote: > Using sched, how can I run a function, at for instance, exactly 00:00 GMT, > and only that time. > > If sched wouldn't be the best to do so a job, please can you recommend > something? > The sched module is by itself not really a task scheduler. It

Re: How to re-write this bash script in Python?

2015-07-30 Thread Mark Lawrence
On 30/07/2015 19:31, sutanu@gmail.com wrote: #!/bin/bash _maillist='pa...@email.com' _hname=`hostname` _logdir=/hadoop/logs _dirlog=${_logdir}/directory_check.log _year=$(date -d "-5 hour" +%Y) _month=$(date -d "-5 hour" +%m) _day=$(date -d "-5 hour" +%d) _hour=$(date -d "-5 hour" +%H) _hd

Improper Django Project error

2015-07-30 Thread Gary Roach
Hi all Being new to Django and Python, I have two projects setup side by side, each in it's own virtualenv wrapper. The twr_project is running Django 1.7, python 2.7 and is set up to duplicate the 'Tango With Rango' tutorial. The archivedb project is running Django 1.8, python 2.7 and is my act

How to re-write this bash script in Python?

2015-07-30 Thread sutanu . das
#!/bin/bash _maillist='pa...@email.com' _hname=`hostname` _logdir=/hadoop/logs _dirlog=${_logdir}/directory_check.log _year=$(date -d "-5 hour" +%Y) _month=$(date -d "-5 hour" +%m) _day=$(date -d "-5 hour" +%d) _hour=$(date -d "-5 hour" +%H) _hdfsdir=`hdfs dfs -ls -d /hadoop/flume_ingest_*/$_yea

Re: Logical Query in Python

2015-07-30 Thread subhabrata . banerji
On Thursday, July 30, 2015 at 8:35:08 PM UTC+5:30, Steven D'Aprano wrote: > On Thu, 30 Jul 2015 11:28 pm, wrote: > > > Dear Group, > > > > I am trying to query JSON with Logical operators. > > What does that mean? > > > I tried to experiment lot with it, but could not do much. > > I came many

Re: Logical Query JSON

2015-07-30 Thread subhabrata . banerji
On Thursday, July 30, 2015 at 9:20:35 PM UTC+5:30, Denis McMahon wrote: > On Thu, 30 Jul 2015 06:32:01 -0700, subhabrata.banerji wrote: > > > I am trying to query JSON with Logical operators. > > Your post was an excellent example of asking for help without explaining > what your problem was at

using sched

2015-07-30 Thread Nkansah Rexford
Using sched, how can I run a function, at for instance, exactly 00:00 GMT, and only that time. If sched wouldn't be the best to do so a job, please can you recommend something? -- https://mail.python.org/mailman/listinfo/python-list

Re: Logical Query JSON

2015-07-30 Thread Denis McMahon
On Thu, 30 Jul 2015 06:32:01 -0700, subhabrata.banerji wrote: > I am trying to query JSON with Logical operators. Your post was an excellent example of asking for help without explaining what your problem was at all. Please: - show an example of what you tried; - give the results you expected

EuroPython 2015: Thank you to all volunteers

2015-07-30 Thread M.-A. Lemburg
EuroPython is now over and was a great success thanks to everyone who helped make it happen. Unfortunately, we did not properly acknowledge all the volunteers who were working on the event during the closing session and we would like to apologize for this, so here’s the full list of all volunteers

[Ann] Package Repository Project

2015-07-30 Thread casa
Hi all, I have started a package repository project at http://github.com/c4s4/cheeseshop. This is useful if you want to share Python packages that you can't make public on pypi.python.org. It is aimed to be easy to install and efficient. Any comment welcome Enjoy! -- https://mail.python.org/

Re: Logical Query in Python

2015-07-30 Thread Steven D'Aprano
On Thu, 30 Jul 2015 11:28 pm, subhabrata.bane...@gmail.com wrote: > Dear Group, > > I am trying to query JSON with Logical operators. What does that mean? > I tried to experiment lot with it, but could not do much. > I came many times pretty close but missed it almost. Please: - show an examp

Re: How to Calculate NPV?

2015-07-30 Thread Dave Farrance
ryguy7272 wrote: >PERFECT!! SO SIMPLE!! >I don't know why the author didn't do that in the book. The book is evidently giving you code snippets to enter into Python's own interactive interpreter, i.e., you enter "python" at the command line, then you manually type each command which immediately

Re: Python launcher problem

2015-07-30 Thread Zachary Ware
On Jul 30, 2015 2:05 AM, "ElChino" wrote: > > If I in a cmd-shell (actually it is 4NT), do: > c:>py -3 -V & python3 -V > > I get: > Requested Python version (3) not installed << ! from py -3 -V > Python 3.5.0b2 << ! from the 2nd cmd. > > What nonsense is this? I DO HAVE Python3 in my %PAT

Logical Query JSON

2015-07-30 Thread subhabrata . banerji
Dear Group, I am trying to query JSON with Logical operators. I tried to experiment lot with it, but could not do much. I came many times pretty close but missed it almost. I tried to experiment with json, jsonquery, jsonschema, jsonpipe, objectpath, requests. I got a good example from h

Logical Query in Python

2015-07-30 Thread subhabrata . banerji
Dear Group, I am trying to query JSON with Logical operators. I tried to experiment lot with it, but could not do much. I came many times pretty close but missed it almost. I tried to experiment with json, jsonquery, jsonschema, jsonpipe, objectpath, requests. I got a good example from ht

Looking for Python developers with S&OP Simulation experience

2015-07-30 Thread regoricardo
Hi all, We're starting a new Python project where any extra help will be warmly welcomed. Please, contact us at: ricardo att r2software dott com dott br Cheers, Ricardo -- https://mail.python.org/mailman/listinfo/python-list

ANN: eGenix pyOpenSSL Distribution 0.13.11

2015-07-30 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.11 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface for OpenS

Re: Python launcher problem

2015-07-30 Thread Terry Reedy
On 7/30/2015 3:03 AM, ElChino wrote: If I in a cmd-shell (actually it is 4NT), do: c:>py -3 -V & python3 -V I get: Requested Python version (3) not installed << ! from py -3 -V Python 3.5.0b2 << ! from the 2nd cmd. What nonsense is this? I DO HAVE Python3 in my %PATH. A Registry set

Re: Python launcher problem

2015-07-30 Thread Mark Lawrence
On 30/07/2015 08:03, ElChino wrote: If I in a cmd-shell (actually it is 4NT), do: c:>py -3 -V & python3 -V I get: Requested Python version (3) not installed << ! from py -3 -V Python 3.5.0b2 << ! from the 2nd cmd. What nonsense is this? I DO HAVE Python3 in my %PATH. A Registry sett

Re: My code won't work if I double click the saved file

2015-07-30 Thread Mark Lawrence
On 30/07/2015 03:06, Cameron Simpson wrote: On 29Jul2015 00:20, john wrote: I have windows 8 running on my computer and I think I downloaded python 2 and 3 simultaneously or I think my computer has built in python 2 and I downloaded python 3. And now when I ran my code in IDLE, the code works f

Re: Python launcher problem

2015-07-30 Thread Thomas 'PointedEars' Lahn
ElChino wrote: > If I in a cmd-shell (actually it is 4NT), do: >c:>py -3 -V & python3 -V > > I get: >Requested Python version (3) not installed << ! from py -3 -V >Python 3.5.0b2 << ! from the 2nd cmd. > > What nonsense is this? I DO HAVE Python3 in my %PATH. > A Registry setting

Python launcher problem

2015-07-30 Thread ElChino
If I in a cmd-shell (actually it is 4NT), do: c:>py -3 -V & python3 -V I get: Requested Python version (3) not installed << ! from py -3 -V Python 3.5.0b2 << ! from the 2nd cmd. What nonsense is this? I DO HAVE Python3 in my %PATH. A Registry setting gone haywire? -- https://mail.python