Re: degrees and radians.

2016-08-23 Thread Steven D'Aprano
On Wednesday 24 August 2016 14:26, Gary Herron wrote: > Do you really need anything more complex than this? > > >>> toRadians = math.pi/180.0 > > >>> math.sin(90*toRadians) > 1.0 > > Perhaps I'm not understanding what you mean by "clunky", but this seems > pretty clean and simple to me. The

Re: Python 3: Launch multiple commands(subprocesses) in parallel (but upto 4 any time at same time) AND store each of their outputs into a variable

2016-08-23 Thread Paul Rubin
Dale Marvin writes: > The best way is a matter of opinion, I have had success using Celery > with Redis. I generally use GNU Parallel for stuff like that. Celery looks interesting though much fancier. -- https://mail.python.org/mailman/listinfo/python-list

Re: degrees and radians.

2016-08-23 Thread Random832
On Wed, Aug 24, 2016, at 00:26, Gary Herron wrote: > Perhaps I'm not understanding what you mean by "clunky", but this seems > pretty clean and simple to me. The original post is from 2002, I don't know why it got a reply just now. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3: Launch multiple commands(subprocesses) in parallel (but upto 4 any time at same time) AND store each of their outputs into a variable

2016-08-23 Thread Dale Marvin via Python-list
On 8/23/16 8:15 PM, lax.cla...@gmail.com wrote: > I am trying to: > > 1) Use Python 3+ (specifically 3.4 if it matters) > 2) Launch N commands in background (e.g., like subprocess.call would for individual commands) > 3) But only limit P commands to run at same time > 4) Wait until all N comman

Re: degrees and radians.

2016-08-23 Thread Gary Herron
On 08/23/2016 09:08 PM, murdocksgra...@gmail.com wrote: On Saturday, May 4, 2002 at 3:37:07 AM UTC-4, Jim Richardson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am trying to get the math module to deal with degrees rather than radians. (that it deals with radians for the angular fun

Re: degrees and radians.

2016-08-23 Thread murdocksgranpa
On Saturday, May 4, 2002 at 3:37:07 AM UTC-4, Jim Richardson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I am trying to get the math module to deal with degrees rather than > radians. (that it deals with radians for the angular functions like > sin() isn't mentioned in the docs

Python 3: Launch multiple commands(subprocesses) in parallel (but upto 4 any time at same time) AND store each of their outputs into a variable

2016-08-23 Thread lax . clarke
Hi, I've been reading various forums and python documentation on subprocess, multithreading, PIPEs, etc. But I cannot seem to mash together several of my requirements into working code. I am trying to: 1) Use Python 3+ (specifically 3.4 if it matters) 2) Launch N commands in background (e.g.,

Re: Python non blocking multi-client service

2016-08-23 Thread INADA Naoki
> > I did that only for the debug reasons :-) That's bad for debugging too. Real Exception and Stacktrace are far better than print('Error') on all time. Never do it even for debugging. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread Zentrader
I don't know anything about asyncio, but multiprocessing would be my tool of choice. The first example should be enough for what you want to do at https://pymotw.com/2/multiprocessing/basics.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code ta

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code ta

Re: Python non blocking multi-client service

2016-08-23 Thread Chris Angelico
On Tue, Aug 23, 2016 at 11:39 PM, wrote: > except: > print ('Error') > Don't do this. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code ta

libdivecomputer

2016-08-23 Thread alister
Does anyone know if there is a python module avaialbe to interact with this library (it is for downloading data down various Decompression computers so a bit of a specialist market) I already have an application that works fine (sub-surface) so this is more of a curiosity, delving into ctypes

Re: Python non blocking multi-client service

2016-08-23 Thread Chris Angelico
On Tue, Aug 23, 2016 at 11:08 PM, dimao wrote: > My current code takes almost 99% CPU usage. Here is the main part of my code : > > > PORT= 33123 > HOST= '127.0.0.1' > > > import asyncio > import os > > @asyncio.coroutine > def tcp_echo_client(offset): > > def send(offset): > MSG =

Python non blocking multi-client service

2016-08-23 Thread dimao
I am trying to implement multi-client service. The service must be able to: connect to the server; send/receive messages; wait until a new message will be received *** Per each client and non blocking My current code takes almost 99% CPU usage. Here is the main part of my code : PORT= 3312

Re: Dynamically import specific names from a module vs importing full module

2016-08-23 Thread Malcolm Greene
Ned and Random832, Ned: Thank you - your example answered my question. Random832: Thank you for the reminder about "from import " still importing the module. Yes, I had forgotten that behavior. Best, Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Raw Data from Website

2016-08-23 Thread Chris Angelico
On Tue, Aug 23, 2016 at 5:14 PM, Steven D'Aprano wrote: > There are many tutorials and examples of "screen scraping" or "web scraping" > on > the internet -- try reading them. It's not something I personally have any > experience with, but I expect that the process goes something like this: > > -

Re: Raw Data from Website

2016-08-23 Thread Steven D'Aprano
On Tuesday 23 August 2016 10:28, adam.j.k...@gmail.com wrote: > Hi, > > I am hoping someone is able to help me. > > Is there a way to pull as much raw data from a website as possible. The > webpage that I am looking for is as follows: > http://www.homepriceguide.com.au/Research/ResearchSeeFullL