>>To provide some feedback:
>>As Grant Edwards posted in this list, I was running my code inside of
>>IDE that replaces sys.stdin with some other. While running the program
>>from a shell prompt, everything goes fine.
>>Petr Jakes
>>
>>
>>
SN&g
can show me the direction
to go?
Regards
Petr
--
http://mail.python.org/mailman/listinfo/python-list
om this file, so I can switch LEDs ON/OFF accordingly.
--
Petr
--
http://mail.python.org/mailman/listinfo/python-list
> >>> import Image
> >>> im=Image.new('L', (100,100))
> >>> im=im.convert('1')
> >>> px=im.load()
> >>> px[0,0]
Thanks, load() method works great.
One more question.
Finally, I would like to store array in the datab
= GPIO()
LED01 = gpio.pin04
LED01 = 1 # led diode is shining (or gpio pin 4 is set)
LED01 = 0 # led diode is off
General suggestions, how to organise this work are more then welcome.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
. Still, how the sys.argv is filled? What
encoding is used when parsing the cmd line internally?
To what encoding is it converted when non ASCII
characters appear?
Thanks for your time and experience,
pepr
--
Petr Prikryl (prikrylp at skil dot cz)
--
http://mail.python.org/mailman/listinfo
Thanks, Martin v. Löwis, Neil Hodgson, and Tim Roberts.
I really appreciate your valuable comments. It simply
works.
Thanks again,
Petr
"Neil Hodgson" wrote...
> Petr Prikryl:
>
> > I do not understand what encoding should be used
> > to convert the sys.ar
, is there something similar with 3 states
available around?
Thanks for your time and experience,
pepr
--
Petr Prikryl (prikrylp at skil dot cz)
--
http://mail.python.org/mailman/listinfo/python-list
a one-bit. For space parity
it's always a zero-bit.
Does anybody here knows some "tricks" how to set up the mark and space
parity on the UART (using pyserial???), so I can simulate 9bit
communication? (I know it sounds silly, but I would like to try to
re-configure the UART parity before
Hi,
I am trying to convert string to the "escaped string".
example: from "0xf" I need "\0xf"
I am able to do it like:
a="0xf"
escaped_a=("\%s" % a ).decode("string_escape")
But it looks a little bit complicated in this
small mistake in my previous posting, sorry
from "0xf" I need "\xf" of course
and mentioned code gives me "\0xf" of course.
Thanks for your postings
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik, thanks for your posting. I really appretiate your reply and
your way how you kindly answer even stupid newbie's questions on this
mailing list.
I was trying: int("0xf") but I did not have idea about the optional
"base" parameter for the int function.
Tha
ifics. It is
necessary to control parity bit setting before sending each
communication byte.
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
On my box (Fedora Core4, Python 2.4.1) I am getting following error:
>>> import termios, sys
>>> fd = sys.stdin.fileno()
>>> oldSettings = termios.tcgetattr(fd)
Traceback (innermost last):
File "", line 1, in ?
error: (22, 'Invalid argument')
To provide some feedback:
As Grant Edwards posted in this list, I was running my code inside of
IDE that replaces sys.stdin with some other. While running the program
from a shell prompt, everything goes fine.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
es.
Could you confirm the bug? Is it known?
Should this be posted into some bug-report list?
Petr
python test.py
I have observed t
--
Petr Prikryl (prikrylp at skil dot cz)
test.py
Description: test.py
<>--
http://mail.python.org/mailman/listinfo/python-list
.pop(0) # get and remove the first
element
if 'bar' in bar and 'baz' in bar:
bars.insert(0, bar) # insert the tested back
break # and finish
print bars
The result is ['barbaz', 'foobar'] in both cases.
Petr
--
Petr Prikryl (prikrylp at skil dot cz)
--
http://mail.python.org/mailman/listinfo/python-list
y C with
strange OO things on the top".
Petr
"Paul Rubin" wrote in message
news:<[EMAIL PROTECTED]>...
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > I was wondering whether anyone could recommend a good C++ book, with
> > "good" b
in UTF-8 (or
other recognised Unicode file format), then the
encoding declaration must reflect the format or
can be omitted entirely. In such case, all
simple string literals will be treated as
unicode string literals.
Would this break any existing code?
Thanks for your time and experience
i problem invisibility
in Python. But I had to learn by mistake. The ++i
behaviour is not intuitive for me.
Your opinion?
--
Petr Prikryl (prikrylp at skil dot cz)
--
http://mail.python.org/mailman/listinfo/python-list
yntax error".
The suggestion is to do the same with the prefix
version of the operators that are not used in Python.
Petr
"Christian Ergh" wrote...
> Hmm, i never liked the i++ syntax, because there is a value asignment
> behind it and it does not show - except the case
rary functions are anonymous
> or not).
> [...]
I believe that GvR has a lot of experience and he proved
to be very pragmatic. If he thinks that lambdas bring more
problems than they solve, it may be some truth in it.
I also believe that lamda-trained programmers think
a bit differently
Also keep in mind that not all Python libraries are on PyPI.
For non-Python projects with Python bindings (think video players,
OpenCV, systemd, Samba), distribution via PyPI doesn't make much
sense. And since the Python bindings are usually second-class
citizens, the porting doesn't have a high pr
On Sun, Dec 14, 2014 at 1:14 AM, Nick Coghlan wrote:
[...]
> Barry, Petr, any of the other folks working on distro level C extension
> ports, perhaps one of you would be willing to consider an update to the C
> extension porting guide to be more in line with Brett's latest version o
On Fri, Aug 7, 2015 at 4:07 AM, Terry Reedy wrote:
> Python has an extensive test suite run after each 'batch' of commits on a
> variety of buildbots. However, the Linux buildbots all (AFAIK) run
> 'headless', with gui's disabled. Hence the following
> test_tk test_ttk_guionly test_idle
> (and o
principles used in this code are still valid in the "modern"
Python and if/how it can be improved (revrited) using futures of
current version of Python.
Thanks for your comments for a "newbie" and for your patience.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
st
lost with subclass and mapping attributes etc. while trying to study
the code in the example (http://tinyurl.com/a4zkn).
All I wanted to know, if, thanks to the improvements in the Python
functionality over the years, it is possible to simplify somhow the old
code.
Otherwise I have to dig through :)
J> Is there a Python packaging that is specifically for
J> embedded systems? ie, very small and configurable so the
J> user gets to select what modules to install?
J> For Linux-based embedded systems in particular?
J> I'm thinking of running it on the Linksys's Linux-based open
J> source router W
comments
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a lot. It works flawlessly and I have learned few new Python
"tricks" as well.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
specific answers to the above
mentioned code example.
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
hacker1017 wrote:
> im just asking out of curiosity.
a vending machine controlled from the PC (peripherals connected using
I2C bus (SMBus) and the MDB coin change-giver and the bill acceptor
connected to the serial port).
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
o my less elegant
> co-workers can figure out what I was trying to accomplish.
>
> Sam Schulenburg
+1
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
o the
> kit ? TIAMR
You can try:
Dialog
http://invisible-island.net/dialog/
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
urnum < 101"
you should test if the input is an integer as well..
http://tinyurl.com/j468c
Other suggested here which way to go.
Good luck :)
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
t;debugging" purposes. Finally you
will remove it.
For example you can put:
print "starting the strt function", "mynum = ", mynum, "yournum =",
yournum
on the first row of your strt function, so you will see the code is
going through there.
Finally:
Try to thi
extension is (depending on the "when" value): "timestamp" or
"date+hour+minutes" or "date+hours" or "date".
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
for i in range(len(listing)):
item = listing[i]
numbers.append(item[len(dir) + len(new_file_name) + 1:])
return new_file_name + '.' + max(numbers)
cheers
Petr
--
http://mail.python.org/mailman/listinfo/python-list
to solve some "problems"
Petr Jakes
JH>> that documentation i have already read, but it wouldn`t help me for my
JH>> problem!
JH>> i know, how i can read the first line an print them on the screen!
JH>> but...how can i say python, delete the first line?!
JH>> t
in.com/
You can manage cluster of servers at once.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
v> Thanks,
v> But I need to to do complicated job in the xterm consoles for servers.
what does it mean, complicated job? Can you be more specific, please?
v> So I need
v> to open many xterm consoles and I just want to save my time from
v> telneting...usr/pwd...
v> Network Ninja wrote:
>> valpa wr
"yaru22" wrote in message
news:[EMAIL PROTECTED]
> In one of the examples in the book I'm reading, it says:
>
> def __init__(self):
> ...
> return
>
> It has nothing after "return". I expected it to have some number like 0
> or 1. What does it mean to have nothing after return?
Yes, it ha
"zefciu" wrote in message news:[EMAIL PROTECTED]
> Where can I find a good explanation when does an interpreter copy the
> value, and when does it create the reference. I thought I understand
> it, but I have just typed in following commands:
>
> >>> a=[[1,2],[3,4]]
> >>> b=a[1]
> >>> b=[5,6]
> >>
Hi
my script is working well when I am running it from the terminal
window. While I am trying to start it as a Cron job, I am getting an
Error described bellow:
My configuration: Pentium III, Python 2.4.1, Fedora Core4
Thanks for your comments.
Petr Jakes
File "/root/eric/analyza_da
looks strange, I have to use str(a) syntax even I know the "a"
variable is a string.
I am trying to use ChartDirector for Python (charts for Python) and the
method "layer.addDataSet()" needs above mentioned syntax otherwise it
returns an Error.
layer.addDataSet(data, colour,
unicode object.
>> I am trying to use ChartDirector for Python (charts for Python) and the
>> method "layer.addDataSet()" needs above mentioned syntax otherwise it
>> returns an Error.
JM> Care to tell us which error???
you can see the Error description and author com
Do you think that the following could became PEP (pre PEP).
Please, read it, comment it, reformulate it,...
Abstract
Introduction of the mechanism for language extensions via
modules written using other languages. Extensions of
Python could be done via special interpreter extensions.
F
serial port. It looks like g.close() does not close the gz
file.
I was reading in the doc:
Calling a GzipFile object's close() method does not close fileobj,
since you might wish to append more material after the compressed
data...
so I am completely lost now...
thanks for your comments.
Maybe I am missing something. Expect data is comming continually to the
serial port for the period say 10min. (say form the GPS), than it stops
for 1 minute and so on over and over. I would like to log such a data
to the different gzip files.
My example was written just for the simplicity (I was tr
ds to some of your looping...
>
> s = ... #somewhere you had to open the serial port
>
> g = gzip.GzipFile("/root/foofile.gz", "w")
> while True:
> data = s.readline()
> if not data: break
> g.write(data)
> g.close()
what I am trying to say is g.close() does not close the g file (try to
add the line "print g" after g.close())
Petr
--
http://mail.python.org/mailman/listinfo/python-list
Sorry, I can't get in. Can you please show me, how to use your approach
on the simple push/push ON/OFF button for example please?
PS: seriously it is not a homework :) and I feel it like a shame I am
asking such a simple questions :(
States: ON, OFF
Transition event: "push", "lift"
transition di
Sorry for the typo in my previous posting. Of course it has to be:
simple liftt/push ON/OFF button
--
http://mail.python.org/mailman/listinfo/python-list
store state/transition dependencies).
Tanks to all for your previous postings.
Petr Jakes
State machine example, for the pull/push button mentioned earlier in
this discussion thread
class FSM:
'''the "states" dictionary contains user defined "st
I have a file which contains data in the format shown in the sample
bellow.
How can I parse it to get following:
(14,trigger,guard,do_action,15)
Thanks a lot for your postings
Petr Jakes
type:
4
bgrColor:
255 255 255
fgrColor:
0 0 0
objId:
16
Num.Pts:
2
177 104
350 134
objStartId:
14
objEndId
Sorry I was not precise enough in my description.
In the file, there is of course more sections starting with the keyword
type:
I would like to only analyze sections which start with the sequence:
type:
4
Petr jakes
--
http://mail.python.org/mailman/listinfo/python-list
ot;]
for title in range(len(titles)):
if titles[title][:6] =="Title:":
x=1
try:
while titles[title+x]!="Request : Play" and
titles[title+x]!="Request : next":
x+=1
pass
print titles[title], titles[title+x]
except IndexError: pass
HTH
Petr Jakes
PS: just wonder why are you asking the same question in two different
topics
--
http://mail.python.org/mailman/listinfo/python-list
http://www.pspad.com/en/
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
like to read the file with the function names sequences
# and to create tuple which will contain the function names.
# After that I would like to call functions from the tuple:
functions=(printFoo, printFOO)
for function in functions:
function()
Thanks for your postings
Petr Jakes
--
http://ma
Endless stories about IDEs (try to browse through this discussion group
first). Of course it depends about users personal needs and taste. So
install them and try them (I know, it's really time consuming). I thing
there is not the other way to decide which one is the best for YOU.
Petr
zero_list=[0,0,0,0,0,1,2,3,4]
for x in range(len(zero_list)):
if zero_list[x]!=0: break
nonzero_list=zero_list[x:]
print nonzero_list
but some more "pythonic" solutions will be posted from other users I
guess :)
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Well, I think it is better to start with some simple code first.
Try to read serial port and print it out.
something like this could work:
import serial
s = serial.Serial(port=2,baudrate=38400, timeout=20)
while 1:
print s.readline()
Petr Jakes
--
http://mail.python.org/mailman/listinfo
put()) Does it print
out something?
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
imple and short code first,
so you will be able to understand how to communicate with the serial
port.
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
the troubles with indentation
anymore.
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
> I think you're getting caught by the classic and/or trap in Python,
> trying to avoid using a simple if statement.
What do you mean by "the classic and/or trap"? Can you give an example
please?
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Grant and Steve,
I am wowed and amazed how supportive and helpful you (and other people
in this group as well of course) are.
Thanks.
(sorry for OT)
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
> A pslatex backend certainly would be interesting. A Gnuplot backend
> would probably not be feasible. Does it expose its raw drawing operations?
There is a patch
[ 1027032 ] Connect gnuplot_x11 to exterior application window
http://sourceforge.net/tracker/index.php?func=detail&aid=1027032&group_
en't used Tkinter a lot, only looked at it. And I didn't like it much.
I would really suggest PyQt. (with a big IMHO :)
Petr
--
http://mail.python.org/mailman/listinfo/python-list
Maybe you can try python binding for gammu, which works great for me.
HTH
Petr Jakes
http://cihar.com/gammu/python/
--
http://mail.python.org/mailman/listinfo/python-list
On 23 ec, 14:23, westymatt <[EMAIL PROTECTED]> wrote:
> linux primarily still a little lost in how to implementent this,
> however I understand what you are saying.
maybe you can use this:
http://tinyurl.com/2zyfmw
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
lyse music stream form
the PC radio card to get the signal: "first tones of Frozen were
played after Sacrifice, call to the studio" :-)
Of course, the calling can be made by PC as well, but this is the
easiest part of the task :)
Thanks for your tips and comments
Petr Jakes
PS: both, Linux
ever, the __init__()
> method only takes integers (which means I'd be forced to parse the
> string myself). Does anyone know of a way I can make it use the
> string? Thanks.
http://pleac.sourceforge.net/pleac_python/datesandtimes.html
the part "http://pleac.sourceforge.net
On Jul 24, 10:10 am, Stargaming <[EMAIL PROTECTED]> wrote:
> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote:
> > There are various things I like about the D language that I think Python
> > too may enjoy. Here are few bits (mostly syntactical ones):
>
> > 1) (we have discussed part of thi
Ahoj všeci,
Tak nějak prakticky poprvé se dostávám k tomu,
jak přečíst unicode řetězce ze souboru, který
je uložen ve formátu UTF-8 se signaturou
na začátku (BOM). Nějak se mi nedaří.
Mám takovýto soubor.txt v UTF-8 s BOM
=
První řádek.
Druhý řádek.
Třetí řáde
Sorry for the mess,
The message should have been sent to the Czech
Python mailing list. My fault.
pepr
"Petr Prikryl" wrote...
> Ahoj všeci,
> Tak nějak prakticky poprvé se dostávám k tomu,
> jak přečíst unicode řetězce ze souboru, který
> je uložen ve formátu UTF-8 se s
"Alex Martelli" wrote
> Steve Holden wrote:
>...
> > >> Get yourself a stuffed bear, and next time you have this kind of
problem
> > >> spend a few minutes explaining to the bear exactly how your
program
> > >> can't possibly be wrong. Works like a charm.
> > >
> > > A rubber ducky works muc
"John Salerno" wrote...
[...]
> So a class method is specifically for using the class name itself as an
> object in the method? If that's the case, then it makes some sense now.
> I guess the reason I didn't get it before is that this is a feature of
> dynamic languages, right? And something that
rainbow.cougar wrote in message
> okay wrote:
> > To Archbishop Christodoulos Paraskevaides of the Greek Orthodox Church
> > in Athens and Greece Archbishop,
> > I talked with a Greek Orthodox believer in Australia and he told me two
>
> I'm thinking a list comprehension...
Possibly some filter(m
I have added some spaces guessing how the original was formatted.
See the simplified example and the explanation below...
"Sean Givan" wrote...
> Hi. I'm new to Python [...] something strange.
> This code:
>
> def outer():
> val = 10
> def inner():
> print val
> inner()
> outer()
>
> ..pr
"Fredrik Lundh" wrote:
> Alex Martelli wrote:
>
> > > But of course that only does it once, and I don't want to have to copy
> > > and paste the append line. Perhaps there's a better way than this.
> >
> > def makeseries(N):
> > series = [N]
> > append = series.append
> > for tailer in xrang
Eric3 is great IMHO.
http://www.die-offenbachs.de/detlev/eric3.html
--
http://mail.python.org/mailman/listinfo/python-list
I would like to know if anybody can point me to the site, where it is
possible to find the tutorial "Using Databases in Python" which is
mentioned by Steve Holden here: http://tinyurl.com/ectj8
Thanks
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
I have got Steven's book of course (it is excellent IMHO). I was just
thinking some new approaches can be found in the tutorial.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Thank you very much, Steve.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Firebird CS 1.5, Python 2.4.1,
KInterbasDB 3.2b1
Thanks for your advices.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
I am using following code which I have found on
http://www.ibiblio.org/obp/py4fun/ few months ago. It works well for my
purposes. Another way is to use Curses library.
HTH
Petr Jakes
#!/usr/local/bin/python
#
# t t y L i n u x . p y
#
# getLookAhead reads lookahead chars from the keyboard
/kinterbasdb-3.2_pre_20060503.win32-FB-2.0-py2.4.exe
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
off).
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
I think you can get the answer on
http://www.die-offenbachs.de/detlev/eric3-mailinglist.html
rather then here.
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
irst occur of sec==0 only!! polling
10x a second
minutes=min
print "Eureca"
time.sleep(0.1)
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
s well, so it can not "sleep" for 60 seconds :).
Regards
Petr
--
http://mail.python.org/mailman/listinfo/python-list
"Alex Martelli" wrote...
> Joe Marshall wrote:
>...
> > If you language allows unnamed integers, unnamed strings, unnamed
> > characters, unnamed arrays or aggregates, unnamed floats, unnamed
> > expressions, unnamed statements, unnamed argument lists, etc. why
> > *require* a name for trivia
"Chris Uppal" wrote...
> Alex Martelli wrote:
>
> > I think it's reasonable to make a name a part of functions, classes and
> > modules because they may often be involved in tracebacks (in case of
> > uncaught errors): to me, it makes sense to let an error-diagnosing
> > tracebacks display package
"Chris Uppal" wrote:
> Petr Prikryl wrote:
>
> > for element in aCollection:
> > if element > 0:
> > return True
> > return False
>
> [I'm not sure whether this is supposed to be an example of
(0.01)
seconds = time.time()
if not int(seconds % (5)):
if eventFlag:
print "5 seconds, hurray"
eventFlag = False
else:
eventFlag = True
Best regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
oop and once in 5s period it has to trigger some
other stuff(function, method, action) to do.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
ux everything works
fine.
Do you have any idea what could be wrong?
Thanks,
Petr
--
http://mail.python.org/mailman/listinfo/python-list
I've
just overlooked something in the docs to this (imo) important task...
Petr
--
http://mail.python.org/mailman/listinfo/python-list
id characters may occur -
form feed (\x0c) character is one example.
I don't know what else is illegal in xml, so I've searched if there's
some method how to prepare strings for insertion to a xml doc before I
start research on a xml spec and write such function on my own.
Petr
--
http://mail.python.org/mailman/listinfo/python-list
mmy
raise error(EBADF, 'Bad file descriptor')
error: (9, 'Bad file descriptor')
Where is the mistake? I dont know.
thaks for help
Petr
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 144 matches
Mail list logo