Re: Python 3.5 amd64 and win32service

2016-10-06 Thread Nagy László Zsolt
>> "C:\Users\Laci\AppData\Local\Programs\Python\Python35\lib\site-packages\win32\PythonService.exe" > I wanted you to run the above executable, not python.exe. If it fails > you'll get more information about why it's failing when run directly > then when the service controller runs it. Since you'r

Re: segfault using shutil.make_archive

2016-10-06 Thread dieter
Tim writes: > I need to zip up a directory that's about 400mb. > I'm using shutil.make_archive and I'm getting this response: > > Segmentation fault: 11 (core dumped) > > The code is straightforward (and works on other, smaller dirs): > > shutil.make_archive(os.path.join(zip_dir, zname), '

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 3:06 PM, Loren Wilton wrote: > If the thread has a current instruction pointer, then it must also know what > function it is currently in, and therfore have a pointer (or some such) to > the current function locals: > > def func1(): >ham = 0.0; >ham += 1;// threa

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread ast
"Gregory Ewing" a écrit dans le message de news:e5mgi9fp1b...@mid.individual.net... Lawrence D’Oliveiro wrote: Every function is already a descriptor. Which you can see with a simple experiment: >>> def f(self): ... print("self =", self) ... I thought yesterday that every thing was cle

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Loren Wilton
Honestly, the best implementation strategy I can think of is to first implement a Python interpreter for the actual mainframe environment. Then invent an RPC layer that can semi-transparently bridge the two for when you want to call a module that only exists in the Windows environment (or call _fr

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Let me rephrase my question in other way. class myClass: def __init__(self, var): self.var = var myObj = myClass(abc) # I am calling instance with function name and arguments myObj func1 arg1 arg2 Can i associate any function like __init__ with instance ? Means if I just use in

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
I still don't understand why this has to be in the same process space as the VM. Wouldn't it be a lot simpler to create a simple RPC layer (all localhost of course) to interface between the VM and a Python server that spins up multiple processes or sessions? Kind of like how Python for a web ser

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
To be fair, the sharing of data between threads is no different from other concerns about global state. The only thing threads change is that you can have multiple functions doing stuff at once. state = [1,2,3] def func(): state[1] += 5 # do work state[1] -= 5 It occurs to me that thr

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Random832
On Thu, Oct 6, 2016, at 19:27, Loren Wilton wrote: > So I don't want to WRITE a Python interpreter for the actual mainframe > environment. I want to use an interpreter for an existing environment > (Windows) where there are already a lot of existing libraries. But > since a lot of the data to be an

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
From: "Paul Rubin" I don't think Python threads are the answer. You want a separate interpreter per user, which is annoying to do with CPython. Do you have concrete performance expectations about the sharing of data between interpreter sessions? Those old mainframes were very slow compared to

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Well I jump from TCL to Python. And found that it was very convenient to use Procs there. So I was looking for that luxury in Python. I am not trying to reinvent the wheel. I was just curious to know if there is any possibility to create a caller function in my way (TCL) where I can call pyth

Re: Question on multiple Python users in one application

2016-10-06 Thread Michael Torrie
On 10/06/2016 07:48 PM, Chris Angelico wrote: > If that had been your original plan, it's dead simple to enhance it to > use per-user module names. Just do this same work, but substitute a > different module name right at the beginning! Other > extremely-high-level interface functions are similar.

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 12:52 PM, Paul Rubin wrote: > "Loren Wilton" writes: >> I've read that Python supports 'threads', and I'd assumed (maybe >> incorrectly) that these were somewhat separate environments that could >> be operating concurrently (modulo the GC lock). I assume that data can >> be

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > strength of Python is that there are many existing 3rd party libraries > that do lots of useful things. Since a lot of them are distributed as > binaries, they would not work in this mainframe environment. Python libraries are usually available as source, either in Python

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > I've read that Python supports 'threads', and I'd assumed (maybe > incorrectly) that these were somewhat separate environments that could > be operating concurrently (modulo the GC lock). I assume that data can > be shared between the threads, Threads all run in the same

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 12:21 PM, Loren Wilton wrote: > The VM is a program running on Windows. The mainframe object code is just > byte code. The VM has routines to handle every operator and each kind of > Descriptor that they might validly use. One form of Descriptor is only used > by the CALL in

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 11:22 AM, Loren Wilton wrote: >> Ah, that probably means you want separate interpreters, then. > > > I hope not, unless I can get separate simultaneous interpreters out of one > CPython.dll in one Windows process space. I'm guessing that I can't, but > since I really don't k

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
No idea as it's still not clear what you want to accomplish exactly. You are providing a lot of details, just not concrete ones that show how things are currently done and how you want to change that by adding Python to the mix. Hum, this could take a lot of pages of text to describe how the exi

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 11:03 AM, Loren Wilton wrote: > I've read that Python supports 'threads', and I'd assumed (maybe > incorrectly) that these were somewhat separate environments that could be > operating concurrently (modulo the GC lock). I assume that data can be > shared between the threads,

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Loren Wilton
Oops, apologies for replying to the wrong thread! Loren -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
Ah, that probably means you want separate interpreters, then. I hope not, unless I can get separate simultaneous interpreters out of one CPython.dll in one Windows process space. I'm guessing that I can't, but since I really don't know what I'm doing with Python yet, maybe I'm wrong there.

Re: Question on multiple Python users in one application

2016-10-06 Thread Michael Torrie
On 10/06/2016 06:03 PM, Loren Wilton wrote: >> So I take it that currently users access the software running in the >> virtual mainframe over telnet or some form of serial link and that they >> interact with it in a text terminal? This point is fairly important, >> because if it's true, then you r

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
So I take it that currently users access the software running in the virtual mainframe over telnet or some form of serial link and that they interact with it in a text terminal? This point is fairly important, because if it's true, then you really don't have any in-band way of clients talking to

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread BartC
On 06/10/2016 18:06, mr.puneet.go...@gmail.com wrote: Hi I just started learning python. Is there any way to call functions in different way ? Rather calling obj.function(arg1, arg2) I would like to call like below "obj function arg1 arg2" As has been pointed out, it's difficult to tell whe

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Loren Wilton
[Cue the decades-old story about the elaborate set of C macros that I once saw somebody using so he could write a C program that looked like some flavor of structured BASIC.] I once wrote a set pf C defines so that I could compile Pascal with a C compiler without having to change the Pascal sou

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 9:47 AM, Loren Wilton wrote: > I don't think my main concern here is being able to call the CPython > interpreter routines, but instead it is to be able to provide separate > sandboxes for the various programs ("stacks", in B6500 terminology) that > might have their own Pyth

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Grant Edwards
On 2016-10-06, Steve D'Aprano wrote: > The only way to do this will be to write your own pre-processor, which will > parse your source code, and translate it from your language to valid > Python. That's a lot of work for very little value -- I recommend you just > learn the Python syntax rather t

Re: Question on multiple Python users in one application

2016-10-06 Thread Michael Torrie
On 10/06/2016 04:47 PM, Loren Wilton wrote: > The Python code is running as (I hope) a native Windows DLL, so should be > able to access any existing Python libraries that exist on the WIndows > machine. Obviously this Python code will be using Windows-shaped data > objects like integers, floats

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 9:09 AM, Loren Wilton wrote: >> Okay. Before you go one micron further, answer this critical question: >> >> *Do you trust your users?* > > > The basic answer is yes. This program amounts to a virtual machine > implementation of a multi-processor and multi-user mainframe com

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
"Loren Wilton" writes: I don't think my main concern here is being able to call the CPython interpreter routines, but instead it is to be able to provide separate sandboxes for the various programs ("stacks", in B6500 terminology) that might have their own Python sessions or programs. This is

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > I don't think my main concern here is being able to call the CPython > interpreter routines, but instead it is to be able to provide separate > sandboxes for the various programs ("stacks", in B6500 terminology) > that might have their own Python sessions or programs. Thi

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
the multi-user program is a virtual machine implementation and the programs running on the machine have resources like variables, arrays, files, and databases Python variables? Python arrays (lists? tuples?)? Or some other sort of "variables" and "arrays" that exist outside of Python? You _re

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
We need to understand first what the process/threading/per-user model of the existing application is. The program is a virtual machine for an old mainframe architecture. You could think of a VM running a Linux implementaiton as a kind of crude mental reference model. The emulated mainframe i

Re: Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
Okay. Before you go one micron further, answer this critical question: *Do you trust your users?* The basic answer is yes. This program amounts to a virtual machine implementation of a multi-processor and multi-user mainframe computer. It runs on a Windows box of its own. It has an IO subsyst

Re: Question on multiple Python users in one application

2016-10-06 Thread Erik
On 06/10/16 22:40, Loren Wilton wrote: the multi-user program is a virtual machine implementation That's not relevant (unless you mean each user is running in their own VM, in which case you _really_ need to describe your execution environment). BTW, you _really_ need to describe your execut

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Loren Wilton" writes: > While it is certianly possible to marshall every variable access > through IPC, it isn't real efficient. I would much perfer to avoid > this if I possibly can. Maybe you could use Python proxy objects accessing a shared memory segment. Though as Chris Angelico mentions,

Question on multiple Python users in one application

2016-10-06 Thread Loren Wilton
(Apologies for the broken threading on this reply, I'm just getting the list access set up.) Put each Python in a separate process and communicate by IPC. I thought of that, but the multi-user program is a virtual machine implementation, and the programs running on the machine have resources

Re: Question on multiple Python users in one application

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 7:59 AM, Jolly Good Spam wrote: > I have a Windows multi-user program that can be used by an arbitrary number > of users at once. They can work independently, or they can share data at the > file or even variable level if they want. I want to give them the ability to > write

Re: Question on multiple Python users in one application

2016-10-06 Thread Erik
On 06/10/16 22:11, Paul Rubin wrote: "Jolly Good Spam" writes: Can someone please suggest what I should be looking at and doing to be able to effectively run multiple independent Pythons in a single program? Put each Python in a separate process and communicate by IPC. Loren says that this

Re: Question on multiple Python users in one application

2016-10-06 Thread Paul Rubin
"Jolly Good Spam" writes: > Can someone please suggest what I should be looking at and doing to be > able to effectively run multiple independent Pythons in a single > program? Put each Python in a separate process and communicate by IPC. -- https://mail.python.org/mailman/listinfo/python-list

Question on multiple Python users in one application

2016-10-06 Thread Jolly Good Spam
Hello. Please pardon a newbie question. I have a Windows multi-user program that can be used by an arbitrary number of users at once. They can work independently, or they can share data at the file or even variable level if they want. I want to give them the ability to write Python programs wi

Re: segfault using shutil.make_archive

2016-10-06 Thread Tim
On Thursday, October 6, 2016 at 2:04:20 PM UTC-4, Random832 wrote: > On Thu, Oct 6, 2016, at 13:45, Random832 wrote: > > On Thu, Oct 6, 2016, at 12:46, Tim wrote: > > > I need to zip up a directory that's about 400mb. > > > I'm using shutil.make_archive and I'm getting this response: > > > > > >

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread mbg1708
On Wednesday, 5 October 2016 14:10:21 UTC+1, Beverly Howard wrote: > I'm new to Python, but have three decades of experience with FoxPro and VFP > plus I started programming in Basic and still comfortable with that. > > I have spent some time with Python and am now fairly familiar with the synta

Re: BeautifulSoup help !!

2016-10-06 Thread Michael Torrie
On 10/06/2016 11:34 AM, Navneet Siddhant wrote: > I guess I will have to extract data from multiple divs as only > extracting data from the parent div which has other divs in it with > the different data is coming up all messed up. Will play around and > see if I could get through it. Let me clarif

Re: segfault using shutil.make_archive

2016-10-06 Thread Random832
On Thu, Oct 6, 2016, at 13:45, Random832 wrote: > On Thu, Oct 6, 2016, at 12:46, Tim wrote: > > I need to zip up a directory that's about 400mb. > > I'm using shutil.make_archive and I'm getting this response: > > > > Segmentation fault: 11 (core dumped) > > > > The code is straightforward (a

Re: segfault using shutil.make_archive

2016-10-06 Thread Random832
On Thu, Oct 6, 2016, at 12:46, Tim wrote: > I need to zip up a directory that's about 400mb. > I'm using shutil.make_archive and I'm getting this response: > > Segmentation fault: 11 (core dumped) > > The code is straightforward (and works on other, smaller dirs): Are you able to make a test

Re: BeautifulSoup help !!

2016-10-06 Thread Navneet Siddhant
I guess I will have to extract data from multiple divs as only extracting data from the parent div which has other divs in it with the different data is coming up all messed up. Will play around and see if I could get through it. Let me clarify once again I dont need complete code , a resource w

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Steve D'Aprano
On Fri, 7 Oct 2016 04:06 am, mr.puneet.go...@gmail.com wrote: > Hi > > I just started learning python. Is there any way to call functions in > different way ? > > Rather calling obj.function(arg1, arg2) I would like to call like below > > "obj function arg1 arg2" No. This will be a syntax erro

Re: A newbie doubt on methods/functions calling

2016-10-06 Thread Peter Otten
mr.puneet.go...@gmail.com wrote: > Hi > > I just started learning python. Is there any way to call functions in > different way ? > > Rather calling obj.function(arg1, arg2) I would like to call like below > > "obj function arg1 arg2" How would the machine reading the above know that you didn'

Re: BeautifulSoup help !!

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 4:00 AM, Navneet Siddhant wrote: > I guess I shouldnt have mentioned as this was a recruitment task. If needed I > can post a screenshot of the mail I got which says I can take help from > anywhere possible as long as the assignment is done. Wont be simply copying > pasti

Re: BeautifulSoup help !!

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 3:38 AM, Steve D'Aprano wrote: > On Fri, 7 Oct 2016 03:00 am, Chris Angelico wrote: > >> You are asking >> for assistance with something that was assigned to you *as a >> recruitment task*. Were you told that asking for help was a legitimate >> solution? > > Why should he ne

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Grant Edwards
On 2016-10-06, Steve D'Aprano wrote: > On Thu, 6 Oct 2016 10:03 pm, BartC wrote: > >> I'd quite like to know too. However I've just tried a test sequence >> ("[P1d" to move the cursor to row 1) and it didn't work. If there's >> reason why something so basic won't work (hence the need for curses et

Re: BeautifulSoup help !!

2016-10-06 Thread Navneet Siddhant
On Thursday, October 6, 2016 at 8:52:18 PM UTC+5:30, Navneet Siddhant wrote: > So I've just started up with python and an assignment was given to me by a > company as an recruitment task. > > I need to web scrap the coupons of all the websites available on > http://www.couponraja.in and export i

A newbie doubt on methods/functions calling

2016-10-06 Thread mr . puneet . goyal
Hi I just started learning python. Is there any way to call functions in different way ? Rather calling obj.function(arg1, arg2) I would like to call like below "obj function arg1 arg2" this function is part of a class. class myClass: def function(arg1, arg2): # do something

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Grant Edwards
On 2016-10-06, BartC wrote: > All this advice seems to be getting out of hand, with suggestions of > 'curses' and 'blessings' and using GUI. I've tried 'ncurses' elsewhere > and it was over the top for what I wanted to do. > > The OP wants to runs on Pi which I think runs Linux. It can run Lin

segfault using shutil.make_archive

2016-10-06 Thread Tim
I need to zip up a directory that's about 400mb. I'm using shutil.make_archive and I'm getting this response: Segmentation fault: 11 (core dumped) The code is straightforward (and works on other, smaller dirs): shutil.make_archive(os.path.join(zip_dir, zname), 'zip', tgt_dir) I guess I

Re: BeautifulSoup help !!

2016-10-06 Thread Steve D'Aprano
On Fri, 7 Oct 2016 03:00 am, Chris Angelico wrote: > You are asking > for assistance with something that was assigned to you *as a > recruitment task*. Were you told that asking for help was a legitimate > solution? Why should he need to be told that? Asking for help *is* a legitimate solution, j

Re: Is it possible to use 'groupby' asynchronously?

2016-10-06 Thread Ian Kelly
On Thu, Oct 6, 2016 at 9:57 AM, Chris Angelico wrote: > On Thu, Oct 6, 2016 at 11:09 PM, Frank Millman wrote: >> Hi all >> >> I have used itertools.groupby before, and I love it. I used it to process a >> csv file and 'break' on change of a particular field. It worked very well. >> >> Now I want

Re: Python and ssh for remote login

2016-10-06 Thread Noah
On 6 Oct 2016 04:56, "Michael Torrie" wrote: > > On 10/05/2016 11:46 AM, Noah wrote: > > Hello folk, > > > > I would like to use a python script to ssh into a server using a username > > and password and perhaps ass port. > > > > Any ideas on how to script that. > > If paramiko doesn't fit your ne

Re: BeautifulSoup help !!

2016-10-06 Thread Navneet Siddhant
On Thursday, October 6, 2016 at 9:57:46 PM UTC+5:30, Navneet Siddhant wrote: > On Thursday, October 6, 2016 at 9:42:47 PM UTC+5:30, Steve D'Aprano wrote: > > On Fri, 7 Oct 2016 02:30 am, alister wrote: > > > > > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > > > > > >> So I've just

Re: BeautifulSoup help !!

2016-10-06 Thread Navneet Siddhant
On Thursday, October 6, 2016 at 9:42:47 PM UTC+5:30, Steve D'Aprano wrote: > On Fri, 7 Oct 2016 02:30 am, alister wrote: > > > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > > > >> So I've just started up with python and an assignment was given to me by > >> a company as an recruit

Re: BeautifulSoup help !!

2016-10-06 Thread Noah
+1 at Steve On 6 Oct 2016 19:17, "Steve D'Aprano" wrote: > On Fri, 7 Oct 2016 02:30 am, alister wrote: > > > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > > > >> So I've just started up with python and an assignment was given to me by > >> a company as an recruitment task. >

Re: BeautifulSoup help !!

2016-10-06 Thread Steve D'Aprano
On Fri, 7 Oct 2016 02:30 am, alister wrote: > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > >> So I've just started up with python and an assignment was given to me by >> a company as an recruitment task. >> > so by your own admission you have just started with python yet you > co

Re: Copying a compiled Python from one system to another

2016-10-06 Thread Ned Deily
On 2016-10-06 11:04, Steve D'Aprano wrote: > On Fri, 7 Oct 2016 01:36 am, Ned Deily wrote: >> On 2016-10-02 00:25, Steve D'Aprano wrote: >>> On Sun, 2 Oct 2016 01:58 pm, Chris Angelico wrote: Hmm, I've possibly missed something here, which may indicate a problem. Why can't your existing

Re: BeautifulSoup help !!

2016-10-06 Thread alister
On Thu, 06 Oct 2016 08:50:25 -0700, Navneet Siddhant wrote: > On Thursday, October 6, 2016 at 9:00:21 PM UTC+5:30, alister wrote: >> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: >> >> > So I've just started up with python and an assignment was given to me >> > by a company as an re

Re: BeautifulSoup help !!

2016-10-06 Thread Chris Angelico
On Fri, Oct 7, 2016 at 2:50 AM, Navneet Siddhant wrote: > On Thursday, October 6, 2016 at 9:00:21 PM UTC+5:30, alister wrote: >> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: >> >> > So I've just started up with python and an assignment was given to me by >> > a company as an recruit

Re: Is it possible to use 'groupby' asynchronously?

2016-10-06 Thread Chris Angelico
On Thu, Oct 6, 2016 at 11:09 PM, Frank Millman wrote: > Hi all > > I have used itertools.groupby before, and I love it. I used it to process a > csv file and 'break' on change of a particular field. It worked very well. > > Now I want to use it to process a database table. I can select the rows in

Re: BeautifulSoup help !!

2016-10-06 Thread Navneet Siddhant
On Thursday, October 6, 2016 at 9:00:21 PM UTC+5:30, alister wrote: > On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > > > So I've just started up with python and an assignment was given to me by > > a company as an recruitment task. > > > so by your own admission you have just starte

Re: BeautifulSoup help !!

2016-10-06 Thread alister
On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > So I've just started up with python and an assignment was given to me by > a company as an recruitment task. > so by your own admission you have just started with python yet you consider your self suitable for employment? -- "Unibus

BeautifulSoup help !!

2016-10-06 Thread desolate . soul . me
So I've just started up with python and an assignment was given to me by a company as an recruitment task. I need to web scrap the coupons of all the websites available on http://www.couponraja.in and export it to csv format. The details which I need to be present in the csv are the coupon titl

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread ast
"Steve D'Aprano" a écrit dans le message de news:57f6673a$0$1598$c3e8da3$54964...@news.astraweb.com... On Thu, 6 Oct 2016 08:03 pm, ast wrote: Consider this function: def add(a, b): return a+b You say that a function is always stored as a descriptor object, so when I execute sum = f(4

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Steve D'Aprano
On Thu, 6 Oct 2016 10:03 pm, BartC wrote: > I'd quite like to know too. However I've just tried a test sequence > ("[P1d" to move the cursor to row 1) and it didn't work. If there's > reason why something so basic won't work (hence the need for curses etc) > then that would be useful to know too.

Re: Copying a compiled Python from one system to another

2016-10-06 Thread Steve D'Aprano
On Fri, 7 Oct 2016 01:36 am, Ned Deily wrote: > On 2016-10-02 00:25, Steve D'Aprano wrote: >> On Sun, 2 Oct 2016 01:58 pm, Chris Angelico wrote: >>> Hmm, I've possibly missed something here, which may indicate a >>> problem. Why can't your existing machines build? Is it because they >>> have too-o

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread Steve D'Aprano
On Thu, 6 Oct 2016 08:03 pm, ast wrote: > Consider this function: > > def add(a, b): > return a+b > > You say that a function is always stored as > a descriptor object, so when I execute > > sum = f(4, 6) > > from which class it is supposed to come from ? It doesn't. The descriptor proto

Re: Copying a compiled Python from one system to another

2016-10-06 Thread Ned Deily
On 2016-10-02 00:25, Steve D'Aprano wrote: > On Sun, 2 Oct 2016 01:58 pm, Chris Angelico wrote: >> Hmm, I've possibly missed something here, which may indicate a >> problem. Why can't your existing machines build? Is it because they >> have too-old versions of tools, and if so, which? > Yes, this.

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread BartC
On 06/10/2016 13:38, Peter Otten wrote: BartC wrote: All this advice seems to be getting out of hand, with suggestions of 'curses' and 'blessings' and using GUI. I've tried 'ncurses' elsewhere and it was over the top for what I wanted to do. The OP wants to runs on Pi which I think runs Linux

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread jmp
On 10/05/2016 11:33 PM, Chris Angelico wrote: On Thu, Oct 6, 2016 at 8:19 AM, Beverly Howard wrote: Thanks for the responses... appreciated. print("value value data data data", end="\r") << That makes sense, but it also seems to suggest that there is no other way to position the cursor pri

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Tim Golden
On 06/10/2016 13:38, Peter Otten wrote: > BartC wrote: >> All this advice seems to be getting out of hand, with suggestions of >> 'curses' and 'blessings' and using GUI. I've tried 'ncurses' elsewhere >> and it was over the top for what I wanted to do. >> >> The OP wants to runs on Pi which I think

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Peter Otten
BartC wrote: > On 05/10/2016 23:12, Akira Li wrote: >> Beverly Howard writes: >> >>> ...snip... >>> A primary question would be, "What are options for building a display >>> that would update displayed values without scrolling?" >> >> To rewrite only the last character, you could use '\b': >> >>

Is it possible to use 'groupby' asynchronously?

2016-10-06 Thread Frank Millman
Hi all I have used itertools.groupby before, and I love it. I used it to process a csv file and 'break' on change of a particular field. It worked very well. Now I want to use it to process a database table. I can select the rows in the desired sequence with no problem. However, I am using as

Re: Assignment versus binding

2016-10-06 Thread BartC
On 06/10/2016 00:27, Chris Angelico wrote: On Thu, Oct 6, 2016 at 9:45 AM, BartC wrote: Small languages are perfectly viable: the JIT version of Lua, for example, is only about 225KB, and is very fast. If I wanted to send you program.lua, and you didn't have Lua, I only need to add luajit.ex

Re: static, class and instance methods

2016-10-06 Thread Steve D'Aprano
On Thu, 6 Oct 2016 05:53 pm, ast wrote: [...] > * For instance methods, there is no decorator: > > def funct2(self, a, b): > ... > > self is automatically filled with the instance when we call > funct2 from an instance and not filled if funct2 is called from > a class. > But there is no decorato

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread BartC
On 05/10/2016 23:12, Akira Li wrote: Beverly Howard writes: ...snip... A primary question would be, "What are options for building a display that would update displayed values without scrolling?" To rewrite only the last character, you could use '\b': import os import itertools import

Re: Python 3.5 amd64 and win32service

2016-10-06 Thread eryk sun
On Thu, Oct 6, 2016 at 5:23 AM, Nagy László Zsolt wrote: > "C:\Users\Laci\AppData\Local\Programs\Python\Python35\lib\site-packages\win32\PythonService.exe" I wanted you to run the above executable, not python.exe. If it fails you'll get more information about why it's failing when run directly th

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread alister
On Wed, 05 Oct 2016 14:33:43 -0700, Beverly Howard wrote: >>> if it is a pi controlling the system I would tend towards controlling >>> it > from a web page via the network. to keep it updating would require AJAX > style programming of the web page. << > > Thanks. I am interested in eventually d

Re: Assignment versus binding

2016-10-06 Thread Anuradha Laxminarayan
On Thursday, 6 October 2016 14:17:06 UTC+5:30, Gregory Ewing wrote: > Paul Rubin wrote: > > It's useful to write some Python things in monadic style, but monads > > make the most sense as type operators, which don't map onto Python that > > well. > > There probably isn't much point in using the

Re: I am comfused about the name behavior of Python in recursion

2016-10-06 Thread alister
On Wed, 05 Oct 2016 17:30:22 -0700, 380162267qq wrote: > Google told me Python name is a label attaching to the object. > But in this recursive function,the name 'a' will point to different > number object. > > def rec(a): > a+=1 if a<10: > rec(a) > print(a) > > rec(0)

Re: working with ctypes and complex data structures

2016-10-06 Thread Michael Felt
On 04-Oct-16 04:48, eryk sun wrote: On Mon, Oct 3, 2016 at 9:27 PM, Michael Felt wrote: int perfstat_subsystem_total( perfstat_id_t *name, perfstat_subsystem_total_t *userbuff, int sizeof_struct, int desired_number); ... +79 class cpu_total: +80 def __init__(self

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread Peter Otten
ast wrote: > > "Lawrence D’Oliveiro" a écrit dans le message de > news:f5314bdd-a98f-4a16-b546-bd8efe4dd...@googlegroups.com... >> On Thursday, October 6, 2016 at 7:54:08 PM UTC+13, ast wrote: >>> But there is no decorator, why ? Is python doing the conversion >>> of funct2 to a descriptor itsel

Re: any json data validation library recommendation? (Reposting on Python-Lists Prohitibited)

2016-10-06 Thread Maciej Dziardziel
On Thursday, October 6, 2016 at 7:20:58 AM UTC+1, Lawrence D’Oliveiro wrote: > What action are users supposed to take on such errors, other than include > them in a bug report? By users I mean API users (developers). Most common action would be to add a missing field, correct typo or change valu

Re: Assignment versus binding

2016-10-06 Thread Gregory Ewing
Ben Bacarisse wrote: import Control.Concurrent spam io = do x <- io; print x; print (x+1) main = spam (do threadDelay (2*10^6); return 1) It matches the Python in that the delay happens once. To get the behaviour being hinted at (two delays) you need to re-bind the I

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread ast
"Lawrence D’Oliveiro" a écrit dans le message de news:f5314bdd-a98f-4a16-b546-bd8efe4dd...@googlegroups.com... On Thursday, October 6, 2016 at 7:54:08 PM UTC+13, ast wrote: But there is no decorator, why ? Is python doing the conversion of funct2 to a descriptor itself, behind the scene ? E

Re: Assignment versus binding

2016-10-06 Thread Gregory Ewing
Paul Rubin wrote: It's useful to write some Python things in monadic style, but monads make the most sense as type operators, which don't map onto Python that well. There probably isn't much point in using the monadic style in Python, since the main reason for it is to express stateful proces

Re: static, class and instance methods (Reposting On Python-List Prohibited)

2016-10-06 Thread Gregory Ewing
Lawrence D’Oliveiro wrote: Every function is already a descriptor. Which you can see with a simple experiment: >>> def f(self): ... print("self =", self) ... >>> g = f.__get__(17, None) >>> g >>> g() self = 17 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment versus binding

2016-10-06 Thread Gregory Ewing
Rustom Mody wrote: It is fair to say that Haskell's variadic function support is poorer than C's [Collecting into a list fails for different types If you want an arbitrary number of args of unrelated types, you would need to define a wrapper type that can encapsulate all the ones you're interes

Re: Assignment versus binding

2016-10-06 Thread Gregory Ewing
Chris Angelico wrote: There's one other consideration. With Python functions, you often want to run a function for its side effects and ignore its return value. You can't just ignore a return value in Haskell. The return value is always going *somewhere*. If you leave off an argument, the resul

Re: 'str' object has no attribute 'intersection' and unhashable set

2016-10-06 Thread dieter
meInvent bbird writes: > ... > is there any algorithm tutorials or books or external library that > can have a better result for finding repeated lines as group in grouping > application I do not yet understand your problem (and still am not ready to look at your code). When I need grouping for