Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Cameron Laird wrote: In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: This meets your requirements as stated: def temp(): foo.var = 1 bind('a', temp) def temp(): foo.var = 2 bind('b', temp) del temp Ewww! *When* is lambda going bye-bye? I apparently haven't been paying

Re: To whoever hacked into my Database

2013-11-13 Thread Oscar Benjamin
On Nov 13, 2013 6:31 PM, "superchromix" wrote: > > I've been thinking about learning Python for scientific programming.. but all of these flame war type posts make the user community look pretty lame. How did all of these nice packages get written when most of the user interaction is this??

Re: writing fortran equivalent binary file using python

2013-11-14 Thread Oscar Benjamin
On 14 November 2013 00:53, Sudheer Joseph wrote: > My trial code with Python (data is read from file here) > > from netCDF4 import Dataset as nc > import numpy as np > XFIN=0.0,YFIN=-90.0,NREC=1461,DXIN=0.5;DYIN=0.5 > TITLE="NCMRWF 6HOURLY FORCING MKS" > nf=nc('ncmrwf_uv.nc') > ncv=nf.variables.ke

Re: Trying tcompile an use the Python 3.4a

2013-11-14 Thread Benjamin Kaplan
On Nov 14, 2013 5:55 AM, "Nick the Gr33k" wrote: > > Will someone please tell me how to install 'pip' > > My website is not working because modules are missing and the only way i can install them is by installing python's module manager 'pip' > > but 'yum install python-pip' fails. > > How would i

Re: When to use assert

2013-11-18 Thread Oscar Benjamin
On 17 November 2013 13:33, Roy Smith wrote: > > So, I stick "assert 0" in the code an re-run the program to see if I get > an AssertionError. If I do, then I know the code is being run. If I > don't then I know it's not. Either way, I know more about what's going > on than I did before. Once I

Re: Setting longer default decimal precision

2013-11-20 Thread Oscar Benjamin
On 20 November 2013 14:02, Steven D'Aprano wrote: > > but alas, all the functions in the math module convert their arguments to > float first, so even though your Decimal(1) could perform calculations to > 75 decimal places, the math.atan function downgrades it to a regular > float. > > Unfortunat

Re: Recursive generator for combinations of a multiset?

2013-11-21 Thread Oscar Benjamin
On 21 November 2013 06:46, John O'Hagan wrote: > > I found a verbal description of such an algorithm and came up with > this: > > def multicombs(it, r): > result = it[:r] > yield result > while 1: > for i in range(-1, -r - 1, -1): > rep = result[i] > if

Re: Recursive generator for combinations of a multiset?

2013-11-25 Thread Oscar Benjamin
On 21 November 2013 13:01, John O'Hagan wrote: > In my use-case the first argument to multicombs is a tuple of words > which may contain duplicates, and it produces all unique combinations > of a certain length of those words, eg: > > list(multicombs(('cat', 'hat', 'in', 'the', 'the'), 3)) > > [('

Re: Recursive generator for combinations of a multiset?

2013-11-26 Thread Oscar Benjamin
On 26 November 2013 06:18, John O'Hagan wrote: > > Thanks, that is exactly the type of thing I was after. Although it is > actually slower as is than a hack like > > def imulticombs(it, n): > last = () > for i in itertools.combinations(it,n): > if i > last: > yield i >

Re: Recursive generator for combinations of a multiset?

2013-11-27 Thread Oscar Benjamin
On 27 November 2013 10:25, John O'Hagan wrote: > On Tue, 26 Nov 2013 10:33:06 + > Oscar Benjamin wrote: > > I simplified it a bit more to this: > > def word_sequences(prepend, target, subwords): > """subwords is a list of lists of subwords groupe

Re: Does Python optimize low-power functions?

2013-12-06 Thread Oscar Benjamin
On 6 December 2013 18:16, John Ladasky wrote: > The following two functions return the same result: > > x**2 > x*x > > But they may be computed in different ways. The first choice can accommodate > non-integer powers and so it would logically proceed by taking a logarithm, > multiplying

Re: python programming help

2013-12-08 Thread Benjamin Kaplan
On Sun, Dec 8, 2013 at 10:32 AM, wrote: > > On Sunday, December 8, 2013 6:27:34 PM UTC, bob gailer wrote: > > On 12/8/2013 12:59 PM, rafaella...@gmail.com wrote: > > > > > i have a dictionary with names and ages for each name. I want to write a > > > function that takes in an age and returns the

Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Oscar Benjamin
Hi all, I work in a University Engineering faculty teaching, among other things, programming. In our last meeting about improving our teaching syllabus and delivery we've identified the first year programming courses as an area where there is room for improvement and we're considering (mainly on m

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-10 Thread Oscar Benjamin
On 9 December 2013 19:57, Terry Reedy wrote: > On 12/9/2013 7:23 AM, Oscar Benjamin wrote: >> >> Hi all, >> >> I work in a University Engineering faculty teaching, among other >> things, programming. In our last meeting about improving our teaching >> syl

Re: python import error

2013-12-10 Thread Benjamin Kaplan
On Tue, Dec 10, 2013 at 9:45 PM, wrote: > On Wednesday, December 11, 2013 10:23:34 AM UTC+5:30, John Gordon wrote: >> In <93405ea9-6faf-4a09-9fd9-ed264e313...@googlegroups.com> >> smilesonisa...@gmail.com writes: >> >> >> >> > File "aaa.py", line 5, in >> >> > from ccc.ddd import sss >> >

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Oscar Benjamin
On 11 December 2013 08:43, Chris Angelico wrote: > On Wed, Dec 11, 2013 at 7:34 PM, Devin Jeanpierre > wrote: > > When you tell a story, it's important to engage the reader from the > start. Sometimes that means starting the story in the middle of the > action, and filling in the important-but-le

Re: Packaging a private project

2013-12-16 Thread Oscar Benjamin
On Dec 16, 2013 11:20 AM, "Nicholas Cole" wrote: > > Dear List, > > What is the best way to distribute a private, pure python, Python 3 > project that needs several modules (some available on pypi but some > private and used by several separate projects) in order to run? > > I'd like to include ev

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Oscar Benjamin
On 17 December 2013 00:39, rusi wrote: > On Tuesday, December 17, 2013 5:58:12 AM UTC+5:30, Ned Batchelder wrote: >> On 12/16/13 3:32 PM, Wolfgang Keller wrote: >> >>> And ever after that experience, I avoided all languages that were >> >>> even remotely similar to C, such as C++, Java, C#, Javasc

Re: [newbie] Saving binaries in a specific way

2013-12-17 Thread Oscar Benjamin
On 16 December 2013 22:19, Djoser wrote: > Hi all, Hi Djoser, > I am new to this forum and also to Python, but I'm trying hard to understand > it better. > I need to create a binary file, but the first 4 lines must be in > signed-Integer16 and all the others in signed-Integer32. I have a prog

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Oscar Benjamin
On 17 December 2013 15:51, Wolfgang Keller wrote: >> >> I was also taught C as an undergrad but having already learned Java, C >> and C++ before arriving at University I found the C course very easy >> so my own experience is not representative. Many of the other students >> at that time found the

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Oscar Benjamin
On 18 December 2013 09:18, rusi wrote: >> (BTW is there any reason that the document is repeated twice in the same >> pdf?) > > Thanks for the heads-up -- some pdf generation issues I guess > > Is it ok now? Yes. Also it definitely reads better without the twocolumn format. Oscar -- https://m

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Oscar Benjamin
On 18 December 2013 22:33, Terry Reedy wrote: > On 12/18/2013 3:18 AM, Steven D'Aprano wrote: > >> We don't know what locals()['spam'] = 42 will do inside a function, > > I am mystified that you would write this. Locals() will "Update and return a > dictionary representing the current local symbol

Re: Trying to wrap my head around futures and coroutines

2014-01-15 Thread Oscar Benjamin
On Mon, Jan 06, 2014 at 09:15:56PM -0600, Skip Montanaro wrote: > From the couple responses I've seen, I must have not made myself > clear. Let's skip specific hypothetical tasks. Using coroutines, > futures, or other programming paradigms that have been introduced in > recent versions of Python 3.

Re: [newbie] advice and comment wanted on first tkinter program

2014-01-18 Thread Oscar Benjamin
On 18 January 2014 14:52, Jean Dupont wrote: > > Thanks Peter and Terry Jan for the useful suggestions. One thing which I find > a bit weird: when asking for Python-help concerning raspberry pi code or > problems, a lot of people don't seem to be interested in helping out, that's > of course th

Re: Need help vectorizing code

2014-01-19 Thread Oscar Benjamin
On 18 January 2014 20:51, Kevin K wrote: > I have some code that I need help vectorizing. > I want to convert the following to vector form, how can I? I want to get rid > of the inner loop - apparently, it's possible to do so. > X is an NxD matrix. y is a 1xD vector. > > def foo(X, y, mylambda, N

Re: Can post a code but afraid of plagiarism

2014-01-21 Thread Oscar Benjamin
On Tue, Jan 21, 2014 at 12:47:41AM +, Steven D'Aprano wrote: > On Mon, 20 Jan 2014 09:08:28 -0500, Roy Smith wrote: > > > In article , > > Chris Angelico wrote: > > > >> On Mon, Jan 20, 2014 at 4:21 PM, Dan Stromberg > >> wrote: > >> > I did a short time of teaching while I was in school.

Re: which data structure to use?

2014-01-21 Thread Oscar Benjamin
On Tue, Jan 21, 2014 at 03:17:43AM -0800, Robert Voigtländer wrote: > Hi, > > which would be the best data structure to use for the following case? > > I have objects like this: > > class Node(object): > def __init__(self, pos, parent, g , h): > self.pos = pos > self.paren

Re: which data structure to use?

2014-01-21 Thread Oscar Benjamin
On Tue, Jan 21, 2014 at 05:38:34AM -0800, Robert Voigtländer wrote: > > > On Tue, Jan 21, 2014 at 03:17:43AM -0800, Robert Voigtl�nder wrote: > > > > > > I have objects like this: > > > > > > > > > > class Node(object): > > > > > def __init__(self, pos, parent, g , h): > > > > >

Re: any wheel experts here?

2014-01-22 Thread Oscar Benjamin
On Wed, Jan 22, 2014 at 10:49:29AM +, Robin Becker wrote: > I'm trying to use --plat-name in > > python33 setup.py bdist_wheel --plat-name=win-amd64 > > I have a patched distutils package on my path that does allow me to > do cross platform builds with normal distutils setup.py. > > However,

Re: any wheel experts here?

2014-01-23 Thread Oscar Benjamin
On Wed, Jan 22, 2014 at 06:17:33AM -0800, Rustom Mody wrote: > On Wednesday, January 22, 2014 4:31:32 PM UTC+5:30, Oscar Benjamin wrote: > > Sounds reasonable. I don't know the answer or whether anyone else on this > > list > > will but you can definitely find the r

Re: Case insensitive exists()?

2014-01-23 Thread Oscar Benjamin
On Wed, Jan 22, 2014 at 09:24:54PM -0700, Larry Martell wrote: > > I am writing something that is part of a django app, that based on > some web entry from the user, I run a query, get back a list of files > and have to go receive them and serve them up back to the browser. My > script is all done

Re: Trying to understand this moji-bake

2014-01-25 Thread Oscar Benjamin
On 25 January 2014 04:37, Steven D'Aprano wrote: > > But using Python 2.7, I get a really bad case of moji-bake: > > [steve@ando ~]$ python2.7 -c "print u'ñøλπйж'" > ñøλÏйж > > However, interactively it works fine: > > [steve@ando ~]$ python2.7 -E > Python 2.7.2 (default, May 18 2012, 18:25:1

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-09 Thread Oscar Benjamin
On 9 February 2014 12:13, Wesley wrote: > Hi guys, >Here is one question related to algorithm. > Details here: > > here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always > exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with > time complexity as O(

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-09 Thread Oscar Benjamin
Please reply to the list rather than directly to me so that other people can see the answer to my question and offer you help. On 9 February 2014 14:04, Ni Wesley wrote: > 2014年2月9日 下午9:41于 "Oscar Benjamin" 写道: > >> On 9 February 2014 12:13, Wesley wrote: >> &g

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-09 Thread Oscar Benjamin
Please don't top-post. On Feb 9, 2014 2:40 PM, "Ni Wesley" wrote: > > Yes, with no new list, otherwise, space won't to be O(1) Did you read the link I posted: >> http://en.wikipedia.org/wiki/In-place_matrix_transposition Oscar -- https://mail.python.org/mailman/listinfo/python-list

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-10 Thread Oscar Benjamin
On 10 February 2014 15:03, Sturla Molden wrote: > Chris Angelico wrote: > >> That's assuming it really is a sort operation. The problem description >> isn't entirely clear on this point, but if it's actually a zip, then >> it can definitely be done in O(n). > > Ah, I didn't read it carefully enou

Re: Sort one sequence by O(n) in time and O(1) in space

2014-02-10 Thread Oscar Benjamin
On 10 February 2014 15:52, Chris Angelico wrote: > On Tue, Feb 11, 2014 at 2:45 AM, Oscar Benjamin > wrote: >> Something like >> >> mylist[:] = reorder_generator(mylist) >> >> won't work because the generator would need to access the data >> n

Re: What is a function parameter =[] for?

2015-11-24 Thread Oscar Benjamin
On 24 November 2015 at 15:27, Ned Batchelder wrote: > On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote: >> Op 24-11-15 om 15:18 schreef Ned Batchelder: >> >> > 2) In Python, "value" means, what object does a name refer to, or what >> > object did an evaluation produce. >> >>

Re: getting fileinput to do errors='ignore' or 'replace'?

2015-12-03 Thread Oscar Benjamin
On 3 Dec 2015 16:50, "Terry Reedy" wrote: > > On 12/3/2015 10:18 AM, Adam Funk wrote: >> >> On 2015-12-03, Adam Funk wrote: >> >>> I'm having trouble with some input files that are almost all proper >>> UTF-8 but with a couple of troublesome characters mixed in, which I'd >>> like to ignore instea

Re: getting fileinput to do errors='ignore' or 'replace'?

2015-12-04 Thread Oscar Benjamin
On 4 Dec 2015 08:36, "Serhiy Storchaka" wrote: > > On 04.12.15 00:26, Oscar Benjamin wrote: >> >> On 3 Dec 2015 16:50, "Terry Reedy" wrote: >>> >>> fileinput is an ancient module that predates iterators (and generators) >> >

Re: Unicode failure

2015-12-04 Thread Oscar Benjamin
On 4 Dec 2015 22:34, "D'Arcy J.M. Cain" wrote: > > I thought that going to Python 3.4 would solve my Unicode issues but it > seems I still don't understand this stuff. Here is my script. > > #! /usr/bin/python3 > # -*- coding: UTF-8 -*- > import sys > print(sys.getdefaultencoding()) > print(u"\N{

Re: Unicode failure

2015-12-05 Thread Oscar Benjamin
On 5 Dec 2015 06:10, "D'Arcy J.M. Cain" wrote: > > On Fri, 4 Dec 2015 18:28:22 -0500 > Terry Reedy wrote: > > On 12/4/2015 1:07 PM, D'Arcy J.M. Cain wrote: > > > I thought that going to Python 3.4 would solve my Unicode issues > > > > Within Python itself, that should be mostly true. As soon as

[RELEASED] Python 2.7.11

2015-12-05 Thread Benjamin Peterson
Python 2.7.11, the latest bugfix release of the Python 2.7 series, is now available for download at https://www.python.org/downloads/release/python-2711/ Thank you as always to Steve Dower and Ned Deily, who build our binaries. Enjoy the rest of the year, Benjamin -- https://mail.python.org

Re: Unicode failure

2015-12-07 Thread Oscar Benjamin
On Sun, 6 Dec 2015 at 23:11 Quivis wrote: > On Fri, 04 Dec 2015 13:07:38 -0500, D'Arcy J.M. Cain wrote: > > > I thought that going to Python 3.4 would solve my Unicode issues but it > > seems I still don't understand this stuff. Here is my script. > > > > #! /usr/bin/python3 # -*- coding: UTF-8

Re: 3D numpy array subset

2015-12-09 Thread Oscar Benjamin
On 9 Dec 2015 14:26, "Heli" wrote: > > Dear all, > > I am reading a dataset from a HDF5 file using h5py. my datasets are 3D. > > Then I will need to check if another 3d numpy array is a subset of this 3D array i am reading from the file. > > In general, is there any way to check if two 3d numpy ar

Re: np.searchSorted over 2D array

2015-12-10 Thread Oscar Benjamin
On 10 Dec 2015 14:46, "Heli" wrote: > > Thanks Peter, > > I will try to explain what I really need. > > I have a 3D numpy array of 100*100*100 (1M elements). Then I have another numpy array of for example 10*2*10 (200 elements). I want to know if in the bigger dataset of 100*100*100, there is anyw

wrapper api / proxying third party exception?

2015-12-15 Thread Benjamin Risher
Ok, here's my issue. I have a plugin framework I wrote that relies on a third party library that I can't change. As a part of that framework, I wrote a small stub library to proxy calls to the third party library, so that if their api ever changes, plugins written against the stub won't have t

Re: How does one distribute Tkinter or Qt GUI apps Developed in Python

2015-12-17 Thread Oscar Benjamin
On 17 December 2015 at 00:03, Bruce Whealton wrote: > I watched one training video that discussed Python and Tkinter. Like many > similar tutorials from online training sites, I was left scratching my head. > > What seems to be blatantly missing is how this would be distributed. In the > first m

Re: need some basic help

2015-12-23 Thread Benjamin Kulas
On Wednesday, December 23, 2015 at 7:53:43 PM UTC-6, Qurrat ul Ainy wrote: > Hello, > > Can someone please explain this code below. I am new at Python . > Thanks > > > def receive_messages(self, msgs, time): > for msg in msgs: > msg.set_recv_time(time) > self.msgs_received.

Re: using __getitem()__ correctly

2015-12-31 Thread Oscar Benjamin
On 31 December 2015 at 11:30, Charles T. Smith wrote: >>> Obviously there is a syntax difference between x.attr and x['key'] >> >> Not merely syntax; the attributes of an object are not generally >> available as items of the container. > > > What are the set of ways that an attribute is accessible

Re: raise None

2015-12-31 Thread Oscar Benjamin
On 31 December 2015 at 04:07, Steven D'Aprano wrote: > On Thu, 31 Dec 2015 12:44 pm, Ben Finney wrote: > >> Steven D'Aprano writes: >> >>> Traceback (most recent call last): >>> File "spam", line 19, in this >>> File "spam", line 29, in that >>> File "spam", line 39, in other >>> File "sp

Re: raise None

2015-12-31 Thread Oscar Benjamin
On 31 Dec 2015 15:54, "Chris Angelico" wrote: > > On Fri, Jan 1, 2016 at 2:35 AM, Steven D'Aprano wrote: > >> If the user > >> can see the stack trace and work back to the point where they passed > >> something in to your function then how does the extra level hurt? > > > > It hurts precisely bec

Re: How to union nested Sets / A single set from nested sets?

2016-01-06 Thread Oscar Benjamin
On 4 January 2016 at 02:40, mviljamaa wrote: > I'm forming sets by set.adding to sets and this leads to sets such as: > > Set([ImmutableSet(['a', ImmutableSet(['a'])]), ImmutableSet(['b', 'c'])]) > > Is there way union these to a single set, i.e. get > > Set(['a', 'b', 'c']) Where are you getting

Re: How to union nested Sets / A single set from nested sets?

2016-01-07 Thread Oscar Benjamin
On 7 January 2016 at 08:37, Steven D'Aprano wrote: > On Thu, 7 Jan 2016 01:45 am, Oscar Benjamin wrote: > >> On 4 January 2016 at 02:40, mviljamaa wrote: >>> I'm forming sets by set.adding to sets and this leads to sets such as: >>> >>> Set([Immut

Re: graphs

2016-01-08 Thread Oscar Benjamin
On 7 January 2016 at 15:36, Saini, Sakshi wrote: > I have a complex dataset and I wish to write a code to create different > graphs from it. I was wondering if it is possible for Python/ matplotlib/ > seaborn to return a cumulative or mean distribution bar graph based on values > in your datas

Re: extract script from executable made by pyinstaller?

2016-01-08 Thread Oscar Benjamin
On 8 January 2016 at 07:44, Ulli Horlacher wrote: > Is it possible to extract (and view) the Python script from the Windows > executable which was made by pyinstller? I may be misremembering but I though that pyinstaller actually stores the main script uncompressed so that it's just in the raw .e

Re: Python installation in windows

2016-01-12 Thread Oscar Benjamin
On 11 January 2016 at 20:16, Cameron Simpson wrote: > On 11Jan2016 07:19, rusi wrote: >> >> On Monday, January 11, 2016 at 6:32:14 PM UTC+5:30, navneet bhatele wrote: >>> >>> I have been trying to install the "python-3.5.1-amd64-webinstall " many >>> times and the Set up failed is shown up with

Re: [Tutor] me, my arm, my availability ...

2016-01-14 Thread Oscar Benjamin
On 13 January 2016 at 20:47, Laura Creighton wrote: > > Seems like surgery is needed to fix this. > > So I wanted you all to know, no, I haven't forgotten you and no haven't > stopped caring. I have just stopped being as __capable__ if you know > what I mean. > > Please take care of yourselves an

Re: How to remove item from heap efficiently?

2016-01-14 Thread Oscar Benjamin
On 7 January 2016 at 22:52, Sven R. Kunze wrote: > > suppose, I need items sorted by two criteria (say timestamp and priority). > For that purpose, I use two heaps (heapq module): > > heapA # items sorted by timestamp > heapB # items sorted by priority > > Now my actual problem. When popping an it

Re: Why generators take long time?

2016-01-19 Thread Oscar Benjamin
On 19 Jan 2016 10:16, "Steven D'Aprano" wrote: > > [steve@ando ~]$ python -m timeit -s "from collections import deque" > -s "it = iter([i for i in xrange(1000)])" "deque(it, maxlen=0)" > 100 loops, best of 3: 0.913 usec per loop > > > [steve@ando ~]$ python -m timeit -s "from collections i

Re: Single format descriptor for list

2016-01-20 Thread Oscar Benjamin
On 20 January 2016 at 09:35, Paul Appleby wrote: > In BASH, I can have a single format descriptor for a list: > > $ a='4 5 6 7' > $ printf "%sth\n" $a > 4th > 5th > 6th > 7th > > Is this not possible in Python? Using "join" rather than "format" still > doesn't quite do the job: > a = range(4,

Re: How to simulate C style integer division?

2016-01-21 Thread Oscar Benjamin
On 21 January 2016 at 08:39, Shiyao Ma wrote: > > I wanna simulate C style integer division in Python3. > > So far what I've got is: > # a, b = 3, 4 > > import math > result = float(a) / b > if result > 0: > result = math.floor(result) > else: > result = math.ceil(result) > > > I found it's to

Re: installation error

2016-01-28 Thread Oscar Benjamin
On 27 January 2016 at 15:56, JAMES SCALF wrote: > > I am having an issue installing Python 3.51, > > I get an error message stating that there is a dll that is > missing: > > API-MS-WIN-CRT-RUNTIME-l1-1-0.DLL You need to get this file in a Windows update from Microsoft. I think you can download i

Re: Pyhon Icon

2016-01-29 Thread Oscar Benjamin
On 29 January 2016 at 11:00, Walter Nakatana wrote: > Every time I install python , I don't see the icon on my desktop neither in > my C: drive Hi Walter, I guess you're using Windows. There are many different ways to run Python. One way that beginners often use is to run IDLE. You can find some

Re: Error message

2016-01-29 Thread Oscar Benjamin
On 28 January 2016 at 18:51, Emeka Ikele wrote: > Please I downloaded Python 3.5 (32 bit) for Windows software. I installed > it but it keeps giving me an error message that a file was not found and I > should please re-install to fix the problem. I've tried that severally but > to no avail. Plea

Re: Cannot step through asynchronous iterator manually

2016-01-30 Thread Oscar Benjamin
On 30 January 2016 at 08:22, Frank Millman wrote: > There are times when I want to execute a SELECT statement, and test for > three possibilities - >- if no rows are returned, the object does not exist >- if one row is returned, the object does exist >- if more that one row is returned

Re: Cannot step through asynchronous iterator manually

2016-01-30 Thread Oscar Benjamin
On 30 January 2016 at 13:45, Frank Millman wrote: > "Oscar Benjamin" wrote in message > news:cahvvxxsa0yq4voyy6qycgxxvpl5zzgm8muui+1vmezd8crg...@mail.gmail.com... >> >> >> The simplest thing would just be to call list(cur) but I realise that > > you don

Re: Cannot step through asynchronous iterator manually

2016-01-30 Thread Oscar Benjamin
On 30 January 2016 at 16:42, Ian Kelly wrote: >> AFAICT there's no generator-function-style syntax for writing an async >> iterator so you'd have to make a class with the appropriate methods if >> you wanted to be able to loop over aslice with async for. > > Before you go any further with this, be

Re: Error : 0x80070570 file or directory is corrupted or unavailable

2016-02-01 Thread Oscar Benjamin
On 31 January 2016 at 07:26, archi dsouza wrote: > I was trying to install Python.exe in windows 8.1. But got error mention in > subject line. find attached log file. This particular error message has been reported here before: https://mail.python.org/pipermail/python-list/2015-September/697456.

Re: Heap Implementation

2016-02-02 Thread Oscar Benjamin
On 2 February 2016 at 05:38, Steven D'Aprano wrote: > > In effect, each measurement you take is made up of two components: > > * the actual time that the code would take if it had exclusive > access to the machine with no other programs running, call it t; > > * and the noise added by the system

Re: Error

2016-02-03 Thread Oscar Benjamin
On 3 February 2016 at 08:49, Mark Lawrence wrote: > On 03/02/2016 02:49, Russell McCune via Python-list wrote: >> >> Hi >> >> So I have installed python 3.5.1 (32-bit) for my windows 10 PC. I have >> also installed the IDE pycharm 5 to go along with it. Now my problem is when >> I run pycharm the

Re: problem in installing python

2016-02-03 Thread Oscar Benjamin
On 3 February 2016 at 06:57, Salony Permanand wrote: > sir, > I downloaded different version of python but no one is installed on my pc > because of same installation error each time having error code 2203. > Please solve it... > Thanking you Hi Salony, I think this is a problem with Windows. Mi

Re: Install Error

2016-02-04 Thread Oscar Benjamin
On 3 February 2016 at 21:55, Barrie Taylor wrote: > > I am attempting to install and run Python3.5.1 on my Windows machine. > > After installation on launching I am presented the attached error message. > It reads: > 'The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing >

Re: please help

2016-02-04 Thread Oscar Benjamin
On 3 February 2016 at 23:03, Syavosh Malek wrote: > hi i install python 3.5.1 and found run time error > see attach file and help me please I'm afraid your attachment didn't arrive as this is a text-only mailing list. Can you include more information about the error? If it's that you're missing

Re: A sets algorithm

2016-02-07 Thread Oscar Benjamin
On 7 Feb 2016 21:51, "Paulo da Silva" wrote: > > Hello! > > This may not be a strict python question, but ... > > Suppose I have already a class MyFile that has an efficient method (or > operator) to compare two MyFile s for equality. > > What is the most efficient way to obtain all sets of equal

Re: trouble installing python

2016-02-08 Thread Oscar Benjamin
On 7 Feb 2016 09:50, "donald alsept via Python-list" wrote: > > Hello, > I'm trying to install the 3.5.1 of Python and am running windows 7. I keep getting an error about api-ms-win-crt-runtime-|1-1-0.dll not being installed. Any advice on what is wrong? Hi Donald, you're seeing this problem beca

Re: Python's import situation has driven me to the brink of imsanity

2016-02-09 Thread Oscar Benjamin
On 8 February 2016 at 00:38, wrote: > Running python setup.py develop doesn't work, it gives me this error: error: > invalid command 'develop' This is presumably because your setup.py script uses distutils rather than setuptools: distutils doesn't have the develop command. > Running pip instal

Re: There has to be a better way to split this string!

2016-02-09 Thread Oscar Benjamin
On 10 February 2016 at 01:26, Anthony Papillion wrote: > I am using datetime.now() to create a unique version of a filename. > When the final file is named, it will look something like: > > myfile-2015-02-09-19-08-45-4223 > > Notice I'm replacing all of the "."'s, " "'s, and ":"'s returned by > da

Re: I cannot open IDLE

2016-02-12 Thread Oscar Benjamin
On 11 February 2016 at 18:02, anthony averett wrote: > I have downloaded python but I cannot open up idle. I really need this > issue resolved for I have work do for one of my computer science class. What operating system are you using? Windows? Which version? Have you installed Python and if so

Re: (unknown)

2016-02-13 Thread Oscar Benjamin
On 12 February 2016 at 21:39, Mark Lawrence wrote: > On 12/02/2016 20:16, Manas Soni wrote: >> >> >> I have downloaded python and when I click on it, it asks me to repair >> which I do, it then says successful however when I click on it again it >> won’t let me on it >> Sent from Mail for Windows

Re: Make a unique filesystem path, without creating the file

2016-02-16 Thread Oscar Benjamin
On 16 Feb 2016 05:57, "Ben Finney" wrote: > > Cameron Simpson writes: > > > I've been watching this for a few days, and am struggling to > > understand your use case. > > Yes, you're not alone. This surprises me, which is why I'm persisting. > > > Can you elaborate with a concrete example and its

Re: Make a unique filesystem path, without creating the file

2016-02-17 Thread Oscar Benjamin
On 16 February 2016 at 19:40, Ben Finney wrote: > Oscar Benjamin writes: > >> If you're going to patch open to return a fake file when asked to open >> fake_file_path why do you care whether there is a real file of that >> name? > > I don't, and have b

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Oscar Benjamin
On 18 February 2016 at 08:17, wrote: > Is it easy to create vector graphics files of plots in Python? Yes > In VB6, I wrote my own code to generate EPS files. Then people who demand jpg > and gif files could be given those by converting the EPS with the desired > resolution. That sounds a lo

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Oscar Benjamin
On 18 February 2016 at 11:32, Chris Angelico wrote: > On Thu, Feb 18, 2016 at 10:11 PM, wrote: >> Almost everything points positively for Python. Thanks to all of you who >> have responded. But please also tell me the disadvantages of Python. If I >> start using Python, I should be aware of th

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Oscar Benjamin
On 18 February 2016 at 15:33, wrote: >> It sounds to me as if all of your needs can be solved in pure Python >> code possibly using some of the popular extension modules from PyPI. >> In this case it's actually very easy to package/install. You can >> package your code simply by zipping it up wit

Re: I can't install python on my pc

2016-02-20 Thread Oscar Benjamin
On 20 Feb 2016 14:05, "Giriprasadh Raghavan" wrote: > > > I can’t install python on my pc because it encounters an error every time I try to install it. Please help as soon as possible. You need to give more information than that to get clear help. What error do you see? If there is an error mess

Re: Make a unique filesystem path, without creating the file

2016-02-22 Thread Oscar Benjamin
On 22 Feb 2016 22:50, "Ben Finney" wrote: > > Ethan Furman writes: > > > On 02/14/2016 04:08 PM, Ben Finney wrote: > > > > > I am unconcerned with whether there is a real filesystem entry of that > > > name; the goal entails having no filesystem activity for this. I want a > > > valid unique file

Re: Computational Chemistry Analysis

2016-02-25 Thread Oscar Benjamin
On 25 February 2016 at 01:01, Feagans, Mandy wrote: > Hi! I am a student interested in conducting computational analysis of > protein-ligand binding for drug development analysis. Recently, I read of an > individual using a python program for their studies of protein-ligand > binding. As I have

Re: Sorry, here are the details.

2016-02-26 Thread Oscar Benjamin
Please reply to the list rather than directly to me (and then you will get a quicker response from someone else). On 25 February 2016 at 17:13, Giriprasadh Raghavan wrote: > I open the setup file of python 3.5.1 and click then install button. Then I > am displayed an error that says: > > One or m

Re: subprocess startup error

2016-02-26 Thread Oscar Benjamin
On 26 February 2016 at 13:30, Peter Otten <__pete...@web.de> wrote: > Shweta Dinnimani wrote: >>> >>> hello, I'm begineer to python programming.. I had installed python 3.5.1 >>> version on my windows 7 system. I was fine earlier and now when i was >>> trying the programs on string i'm facing the s

Re: list index out of range Error , need to fix it or ignore it

2016-02-28 Thread Oscar Benjamin
On 27 February 2016 at 16:50, Ganesh Pal wrote: > Iam on python 2.6 and Linux , I need input on the below program , > here is the spinet of my program It would be much better if you presented a complete program here. Otherwise the missing parts will confuse people. See: http://sscce.org/ > file

Re: How to read from a file to an arbitrary delimiter efficiently?

2016-02-28 Thread Oscar Benjamin
On 25 February 2016 at 06:50, Steven D'Aprano wrote: > > I have a need to read to an arbitrary delimiter, which might be any of a > (small) set of characters. For the sake of the exercise, lets say it is > either ! or ? (for example). > > I want to read from files reasonably efficiently. I don't m

Re: yield in try/finally case

2016-03-03 Thread Oscar Benjamin
On 3 March 2016 at 11:52, 刘琦帆 wrote: > > "A yield statement is not allowed in the try clause of a try/finally > construct. The difficulty is that there's no guarantee the generator will > ever be resumed, hence no guarantee that the finally block will ever get > executed; that's too much a vio

Re: yield in try/finally case

2016-03-03 Thread Oscar Benjamin
On 3 March 2016 at 15:12, Random832 wrote: > On Thu, Mar 3, 2016, at 08:47, Peter Otten wrote: >> This is because the last generator uf = upperfile(...) is not garbage- >> collected and wasn't explicitly closed either. > > But the program hasn't ended yet when you run your assertion. > > import sy

Re: A mistake which almost went me mad

2016-03-03 Thread Oscar Benjamin
On 3 March 2016 at 11:48, Tim Chase wrote: > On 2016-03-03 10:43, Nick Sarbicki wrote: >> The number of times I've had to correct a student for naming their >> script "turtle.py". >> >> And the number of times I've caught myself doing it... > > I'm surprised at the number of times I find myself cr

Re: [Still off-top] Physics [was Requests author discusses MentalHealthError exception]

2016-03-04 Thread Oscar Benjamin
On 4 March 2016 at 00:04, Steven D'Aprano wrote: > On Fri, 4 Mar 2016 07:20 am, alister wrote: > >> On Thu, 03 Mar 2016 11:03:55 -0700, Ian Kelly wrote: > >>> Antimatter has positive mass. >> >> Are you sure? >> mix 1 atom of hydrogen + 1 of anti hydrogen & you end up with 0 mass (+ >> LOTTS of e

Re: [Still off-top] Physics [was Requests author discusses MentalHealthError exception]

2016-03-04 Thread Oscar Benjamin
On 4 March 2016 at 10:38, Marko Rauhamaa wrote: > Oscar Benjamin : > >> The mass is carried by the new particles. The new particles may have a >> total *rest mass* which differs from the total rest mass of the >> previous particles. However the total mass is the re

Re: [Still off-top] Physics [was Requests author discusses MentalHealthError exception]

2016-03-05 Thread Oscar Benjamin
On 5 March 2016 at 02:51, Gregory Ewing wrote: > The masslessness of photons comes from an extrapolation >> >> that leads to a divide by infinity: strictly speaking it's just >> undefined. > > No, it's not. The total energy of a particle is given by > >E**2 == c**2 * p**2 + m**2 * c**4 > > wh

Re: issue w/ python 3.5.7

2016-03-13 Thread Oscar Benjamin
On 13 Mar 2016 18:01, "Steven D'Aprano" wrote: > > On Mon, 14 Mar 2016 03:56 am, lucile.m...@free.fr wrote: > > > Hello, > > We would like to get the procedure to launch the software "python.exe". > > The only options we have acsess are: modify, repair and uninstall. Thanks > > for your help, Rgds

Re: Loading error message

2016-03-13 Thread Oscar Benjamin
On 13 Mar 2016 17:06, "BobFtz--- via Python-list" wrote: > > Hello > > I have just downloaded and installed a copy of the 3.5.1 programme but when > I come to run the programme I get an error message that says that > .api-ms-win-crt-runtime-l 1-1-0.dll is missing. > > I have un-installed and

<    4   5   6   7   8   9   10   11   12   13   >