Hi
I have written a very simple program to read and print data from the serial
port using pyserial:
#!/usr/bin/python3
import serial
ser=serial.Serial('COM1',115200)
while True:
out = ser.read()
print('Receiving...'+out)
When I run it and send data for it to read I get:
C:\SVNProj\Rag
Thanks for all your answers.
David
--
https://mail.python.org/mailman/listinfo/python-list
> Try this
> subprocess.check_call(["bash", "-O", "extglob", "-c", cmd])
That worked. Thanks very much!
David
--
https://mail.python.org/mailman/listinfo/python-list
Hi
I am working on Linux with Python 3.4.
I want to do a bash diff on two text files and show just the first 20 lines of
diff's output. So I tried:
>>> cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')'
>>> subprocess.check_call(cmd, shell=True)
The command contained in cmd works ok from th
Hi
I have setup Sphinx for my Python project. We keep all our code and
documentation in Subversion. So, following changes to the Python code, I need
to regenerate and commit the Sphinx generated documentation.
I just wondered how people manage this. I'm thinking of using Jenkins (a
continuous
> Not sure if this is the place to ask about kivy ...
Try the kivy users list here:
https://groups.google.com/forum/#!forum/kivy-users
Best regards
David
--
https://mail.python.org/mailman/listinfo/python-list
Hi
I am fairly new to Python. I am writing some code that uses a dictionary to
store definitions of hardware registers. Here is a small part of it:
import sys
register = {
'address' : 0x3001c,
'fields' : {
'FieldA' : {
'range' : (31,20),
},
'FieldB
; Sent: 03 June 2015 11:59
> To: python-list@python.org
> Subject: Re: What sort of data structure to use?
>
> David Aldrich wrote:
>
> > Hi
> >
> > I have written a Python utility that performs a certain activity on
> > some predefined sets of files. Here
Hi
I have written a Python utility that performs a certain activity on some
predefined sets of files. Here is the outline of what I have written:
# File Set A
pathA = 'pathA'
fileListA = ['fileA1.txt', 'fileA2.txt']
# File Set B
pathB = 'pathB'
fileListB = ['fileB1.txt', 'fileB2.txt', 'fileB3.
Hi
I wonder if someone could help me with this problem please?
On an Ubuntu 10.04 platform, I want to run the latest version of Meld, which is
a Python program.
Ubuntu 10.04 runs Python 2.6 as standard. Meld requires Python 2.7. So I have
installed Python 2.7 under /usr/local/bin and Python
> >> BUT do *not* run `make install` as that will overwrite your system
> >> Python and Bad Things will happen. Instead, run `make altinstall`.
Thanks for all the warnings. We did use `make altinstall`, so all is ok.
Recompiling, with readline installed, fixed the arrow keys.
--
https://mail.pyt
Thanks for your replies, I will give readline a try.
> PS: and you mention being on CentOS but running apt-get. I believe CentOS
> and other Red-Hat based distros use "yum" instead of "apt-get"
Yes, I think I need to use:
yum install readline-devel
Best regards
David
--
https://mail.python.o
Hi
I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh
session. Python is running on Centos 5.
Currently, the arrow keys do not work:
$ /usr/local/bin/python3.4
Python 3.4.2 (default, Feb 11 2015, 15:06:33)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux
Type "help", "copy
>It's also possible to do it the other around using shlex.split. I prefer that
>version because
>I can easily copy/paste the command from code to the shell, it's also more
>readable IMO:
> cmd = """python3 -O -c "import sys; print(sys.argv[1:])" foo bar "spam egg"
> """
> print(cmd)
> subproc
Hi Peter
Thanks very much for your reply. I have added one more question below.
> The straightforward approach is to pass a list or tuple:
>
> def build(build_options=()):
> subprocess_check_call(("make",) + build_options)
>
> build(("flagA=true", "flagB=true"))
This looks fine - I am tryi
Hi
I wonder if someone could help me with this problem please. I am writing a
Python script that builds and tests a C++ program on Linux. The build options
depend on the test, so I have encapsulated the 'make' call in a Python function:
def build(build_options=''):
if len(build_option
> Unindent the 'if' statement. Currently, it's indented inside the class
> definition, so MyApp isn't defined yet.
Thanks very much. That fixed it.
Best regards
David
--
https://mail.python.org/mailman/listinfo/python-list
Hi
I am just getting started with Python 3.3.3 and Kivy 1.8.
I am using the Kivy development environment on Windows (open a command prompt
and call kivy.bat).
With this minimal code:
import kivy
kivy.require('1.8.0')
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App)
Hi
I'm trying to install the path.py package under Python 2.7 on Windows.
I installed it using:
easy_install path.py
That worked but it didn't install path.py which is needed by my PTVS IDE for
code completion (Intellisense).
I then tried downloading path.py-7.0.zip. I unzipped it and ran:
p
> The only confusing bit here is that instead of "sys" and "argv", you have
> "path" and "path", the same name twice. But it's the same thing happening.
Thanks very much for all replies I received for my question. It's clearer now.
By the way, for Windows users, I do recommend Microsoft's PTVS (P
> The syntax:
>from import
> will import the name from the module , so:
> from path import path
> will import the name 'path' (a class) from the module 'path'.
Thanks. But I don't quite understand. If I use sys:
import sys
args = sys.argv[1:]
I don't need to use 'from'. What i
Hi
I am running Python 2.7 on Windows 8.1. Today I installed path.py using
easy_install:
easy_install path.py
The example code that I've seen imports path.py as follows:
from path import path
I am fairly new to Python and have a few questions about this:
1) Why is 'from path'
Hi
I am building a 32-bit C++ application using Visual C++ Express 2008 on 64-bit
Windows 7. The application links to Python, so I installed 32-bit Python 2.7.2
by running python-2.7.2.msi.
When I run my app, I get error:
... python27.dll is missing from your computer ...
and, indeed, it is
Hi
I am building a 32-bit C++ application using Visual C++ Express 2008 on 64-bit
Windows 7. The application links to Python, so I installed 32-bit Python 2.7.2
by running python-2.7.2.msi.
When I run my app, I get error:
... python27.dll is missing from your computer ...
and, indeed, it is
24 matches
Mail list logo