Re: how to get python version ?

2016-01-27 Thread Rustom Mody
On Thursday, January 28, 2016 at 10:51:17 AM UTC+5:30, namenob...@gmail.com wrote: > hi > > is there something analogous to sys.platform that lets you get the version of > python you're using? sorry if the question is too see-spot-run. thanks if you > can help > > peace > stm You want this??

Re: how to get python version ?

2016-01-27 Thread Ben Finney
namenobodywa...@gmail.com writes: > is there something analogous to sys.platform that lets you get the > version of python you're using? sorry if the question is too > see-spot-run. thanks if you can help The same ‘sys’ module provides many other ways to interrogate the running Python system http

how to get python version ?

2016-01-27 Thread namenobodywants
hi is there something analogous to sys.platform that lets you get the version of python you're using? sorry if the question is too see-spot-run. thanks if you can help peace stm -- https://mail.python.org/mailman/listinfo/python-list

Re: how to get python version ?

2016-01-27 Thread Chris Angelico
On Thu, Jan 28, 2016 at 4:21 PM, wrote: > is there something analogous to sys.platform that lets you get the version of > python you're using? sorry if the question is too see-spot-run. thanks if you > can help Check out sys.version and sys.version_info - are they what you're after? ChrisA --

Re: Question about asyncio and blocking operations

2016-01-27 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidk-RBkB-vi6CgcEeoFHQrsoTFvqX9MqzDD=rny5boc...@mail.gmail.com... On Tue, Jan 26, 2016 at 7:15 AM, Frank Millman wrote: > > If I return the cursor, I can iterate over it, but isn't this a blocking > operation? As far as I know, the DB adaptor will only ac

Re: Question about asyncio and blocking operations

2016-01-27 Thread Frank Millman
"Ian Kelly" wrote in message news:calwzidn6tvn9w-2qnn2jyvju8nhzn499nptfjn9ohjddceb...@mail.gmail.com... On Wed, Jan 27, 2016 at 7:40 AM, Frank Millman wrote: > > Assume a slow function - > > async def slow_function(arg1, arg2): >[do stuff] > > It now looks like this - > > async def slow_f

Re: show instant data on webpage

2016-01-27 Thread Grant Edwards
On 2016-01-27, mustang wrote: > >> mod_python exists for apache. If your only goal is just a simple website for >> your temperature sensor you could do it completely with python. If the >> webserver should serve other pages as well I'd prefer apache with mod_python. > > my goal is only to collect

Re: Question about asyncio and blocking operations

2016-01-27 Thread Ian Kelly
On Wed, Jan 27, 2016 at 10:14 AM, Ian Kelly wrote: > Unfortunately this doesn't actually work at present. > EventLoop.run_in_executor swallows the StopIteration exception and > just returns None, which I assume is a bug. http://bugs.python.org/issue26221 -- https://mail.python.org/mailman/listin

Re: show instant data on webpage

2016-01-27 Thread mustang
mod_python exists for apache. If your only goal is just a simple website for your temperature sensor you could do it completely with python. If the webserver should serve other pages as well I'd prefer apache with mod_python. my goal is only to collect data and show them or plotting in a graph

Re: show instant data on webpage

2016-01-27 Thread mustang
Php, vbscript, perl, and perhaps other languages allow the interspersal of code and html in the same file. You can't do that with python. So, if you begin to wade into making websites with python you may be a little lost until you grasp the concept of separating code from templates (the html p

Re: Question about asyncio and blocking operations

2016-01-27 Thread Ian Kelly
On Wed, Jan 27, 2016 at 9:15 AM, Ian Kelly wrote: > class CursorWrapper: > > def __init__(self, cursor): > self._cursor = cursor > > async def __aiter__(self): > return self > > async def __anext__(self): > loop = asyncio.get_event_loop() > return await

Re: show instant data on webpage

2016-01-27 Thread Peter Heitzer
mustang wrote: >> You even could use python for the webserver. Read the docs for the module >> "SimpleHTTPServer". >now I'm using apache. Is it possible to do the same with python+apache >or it's better to use SimpleHTTPServer? mod_python exists for apache. If your only goal is just a simple web

Re: Question about asyncio and blocking operations

2016-01-27 Thread Ian Kelly
On Wed, Jan 27, 2016 at 7:40 AM, Frank Millman wrote: > "Ian Kelly" wrote in message > news:CALwzidk-RBkB-vi6CgcEeoFHQrsoTFvqX9MqzDD=rny5boc...@mail.gmail.com... > >> You probably want an asynchronous iterator here. If the cursor doesn't >> provide that, then you can wrap it in one. In fact, this

Re: show instant data on webpage

2016-01-27 Thread Joel Goldstick
On Wed, Jan 27, 2016 at 10:36 AM, mustang wrote: > > I'm not sure to understand how you are using php, but indeed you can >> use python to plot data (have a look at matplotlib, for instance) and >> also to make dynamic web pages (Flask, django). >> > > Because I don't know how to do it in python.

Re: show instant data on webpage

2016-01-27 Thread mustang
You even could use python for the webserver. Read the docs for the module "SimpleHTTPServer". now I'm using apache. Is it possible to do the same with python+apache or it's better to use SimpleHTTPServer? -- https://mail.python.org/mailman/listinfo/python-list

Re: show instant data on webpage

2016-01-27 Thread mustang
I'm not sure to understand how you are using php, but indeed you can use python to plot data (have a look at matplotlib, for instance) and also to make dynamic web pages (Flask, django). Because I don't know how to do it in python. So I've used php. But I prefer working in python. Best. -

Re: Question about asyncio and blocking operations

2016-01-27 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidk-RBkB-vi6CgcEeoFHQrsoTFvqX9MqzDD=rny5boc...@mail.gmail.com... On Tue, Jan 26, 2016 at 7:15 AM, Frank Millman wrote: > > If I return the cursor, I can iterate over it, but isn't this a blocking > operation? As far as I know, the DB adaptor will only ac

Re: not run in my laptop

2016-01-27 Thread Joel Goldstick
On Wed, Jan 27, 2016 at 9:35 AM, Grant Edwards wrote: > On 2016-01-27, anubha agrawal wrote: > > > How I Install python for 64 bit > > Standard info required: OS, version, version of python. What have you tried? what went wrong? Be specific. -- Joel Goldstick http://joelgoldstick.com/stats

Re: not run in my laptop

2016-01-27 Thread Grant Edwards
On 2016-01-27, anubha agrawal wrote: > How I Install python for 64 bit $ sudo emerge python -- Grant Edwards grant.b.edwardsYow! I wonder if I could at ever get started in the gmail.com

PyVmMonitor 1.0.1 released

2016-01-27 Thread Fabio Zadrozny
PyVmMonitor 1.0.1 is now available for download *Release Highlights:* - Pstats files may be passed in the command line to be opened in pyvmmonitor-ui. - Fixed issue opening PyVmMonitor in Mac OS (El Capitan). - Opening PStats file may fail because it's linked to a Python version, s

Re: show instant data on webpage

2016-01-27 Thread Peter Heitzer
mustang wrote: >> open("myData.dat", "w").close() >> >> while True: >> temp = sensor.readTempC() >> riga = "%f\n" % temp >> with open("myData.dat", "a") as f: >> f.write(riga) >> time.sleep(1) >yes great it works!thanks a lot! >Anyway to refresh temperature I've to re

not run in my laptop

2016-01-27 Thread anubha agrawal
How I Install python for 64 bit -- https://mail.python.org/mailman/listinfo/python-list

Windows - Embedded Python in C++: ImportError: DLL load failed. Python expert advice needed.

2016-01-27 Thread ftpronk
I've been busy porting a Linux code to Windows, and originally decided to go for the mingw-w64 toolchain set, with gcc-4.8 and win32 threading model. I'm embedding Python in C++ code, and I need to be able to import specific modules, like PySide, to eventually embed an IPython qtconsole in a C++

Re: show instant data on webpage

2016-01-27 Thread David Palao
2016-01-26 18:26 GMT+01:00 mustang : > >> open("myData.dat", "w").close() >> >> while True: >> temp = sensor.readTempC() >> riga = "%f\n" % temp >> with open("myData.dat", "a") as f: >> f.write(riga) >> time.sleep(1) > > yes great it works!thanks a lot! > Anyway to refr

Re: Duplicate Output

2016-01-27 Thread Peter Otten
Peter Otten wrote: > or use next(): > > filenames = next(walk("."))[2] > print(filenames) Be warned though that if you try this with a non-existent or otherwise inaccessible directory you will get an exception: $ sudo mkdir forbidden $ sudo chmod a-r forbidden $ python3 -c 'import os; next(os

Re: Duplicate Output

2016-01-27 Thread Peter Otten
Gary Roach wrote: > Hi > > Debian stretch OS > KDE Desktop > Code written with Kate > Run in command line with $python getFileNames.py > > Code: > > from os import walk > import subprocess > > f = [] > x = "" > for (dirpath, dirnames, filenames) in walk('.'): > print(filenames) > > This

Duplicate Output

2016-01-27 Thread Gary Roach
Hi Debian stretch OS KDE Desktop Code written with Kate Run in command line with $python getFileNames.py Code: from os import walk import subprocess f = [] x = "" for (dirpath, dirnames, filenames) in walk('.'): print(filenames) This prints [][] What am I doing wrong or how do I remove t