= 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
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 database.
What is the best way to store arrays?
Petr
--
I would like to convert simple B/W graphic to the 432x64 pixel matrix.
It is intended to display this graphic on the one color LED matrix
sign/display (432 LEDs width, 64 LEDs height).
I am experimenting with the PIL, but I did not find solution there.
It will be really helpful If somebody here
What file format is the graphic in? How big is it?
What file format do you want it to be?
Now, I am able to create the png file with the resolution 432x64 using
PIL (using draw.text method for example).
I would like to get the 432x64 True/False (Black/White) lookup table
from this file, so
(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
()
traceback.print_exc()
Thanks for your replies.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
in MyTable.select(MyTable.q.album == Pinkk Floyd):
print row.album, row.filepath
HTH
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Finaly, after few experiments, I am using pygame.
It comunicates directly with the framebuffer and the performance is
excellent.
Thanks for your help.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
into a new
table.
John Nagle
I agree,
maybe following can help
http://tinyurl.com/32colp
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
not look very nice to me.
Is there some different/nicer/more pythonic way how to achieve above
mentioned?
regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
here for your opinions/experiences/advices.
Best regards
Petr Jakes
http://www.libsdl.org/
http://pyfltk.sourceforge.net/
http://www.pygame.org/news.html
http://pyui.sourceforge.net/
http://pyglet.org/
--
http://mail.python.org/mailman/listinfo/python-list
I agree that SDL is probably the best choice but for the sake of
completeness, Gtk can (at least in theory - I've never tried it) be
built against directfb and run without X.
from the Pygame Introduction: Pygame is a Python extension library
that wraps the SDL library and it's helpers. So you
is already solved).
what you are looking for is curse :)
http://docs.python.org/lib/module-curses.html
http://www.ibm.com/developerworks/linux/library/l-python6.html
renaud
Renaud, thanks for your reply.
I think I was not specific/clear enough in my first posting. I know
the curses
On Jan 4, 4:55 pm, [EMAIL PROTECTED] wrote:
Petr thanks so much for your input. I'll try to learnSQL, especially
if I'll do a lot of database work.
I tried to do it John's way as en exercise and I'm happy to say I
understand a lot more. Basically I didn't realize I could nest
dictionaries
using win32api, win32com
( http://tinyurl.com/2m3x3v )
HTH
Petr Jakes
#!/usr/bin/env python
# -*- coding: cp1250 -*-
import sqlite3
con = sqlite3.connect(:memory:)
cur = con.cursor()
normalizedInputData=[]
subCategories=[]
rawData = [['Italy', 'Horror', '70s', 'Suspiria','Dario Argento', 4
So the data comes in as a long list. I'm dealing with some
information on various countries with 6 pieces of information to
pivot. Just to make it simple it's like a video store database. The
data is like [Country, Category, Sub Category, Film Title, Director,
Number of Copies]. data =
function
calls upon access to defined attribute).
My question is: is it possible to set the property for any attribute
when I do not know what will be the name of the attribute in the
future?
Thanks for your reply
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
was:
Is it possible to define some general sort of set/get/del/doc rules
for the attributes which are defined in the code AFTER the
instantiation of an object.
I am sending this question even I feel such a on the fly creation of
the attribute is probably not a good trick.
Petr Jakes
--
http://mail.python.org
(self):
for no in range(10):
yield no
myNo=property(getInfo)
gen=GenExample()
print gen.myNo.next()
print gen.myNo.next()
.
.
print gen.myNo.next()
--
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Patrick,
in your first posting you are writing ... I'm trying to learn how to
make pivot tables from some excel sheets Can you be more specific
please? AFIK Excel offers very good support for pivot tables. So why
to read tabular data from the Excel sheet and than transform it to
pivot tabel
Yes, I realize Excel has excellent support for pivot tables. However,
I hate how Excel does it and, for my particular excel files, I need
them to be formated in an automated way because I will have a number
of them over time and I'd prefer just to have python do it in a flash
than to do it
What about to let SQL to work for you.
HTH
Petr Jakes
Tested on Python 2.5.1
8--
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
con = sqlite3.connect(:memory:)
cur = con.cursor()
inputData=(
('Bob', 'Morn', 240),
('Bob', 'Aft', 300),
('Joe', 'Morn', 70
web browser later
on.
I was just trying to find if somebody here can point me to the
existing tool, which is suitable for such a task.
Anyway thank you for trying me help.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
am really grateful for all
replies.
Thank you
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
.
Googling for a while I have found only this tool:
http://pasko.net/PyHtmlTable/
Your tips to some other tools or/and your suggestion how to solve
above mentioned will be very helpful.
Thanks and regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
displeje_pokus.py I am getting an error (see
below) which I am not able to eliminate.
thanks for your reply
Petr Jakes
==
displeje_pokus.py
==
from sqlobject import *
class TextyDispleje(SQLObject):
pass
if __name__ == __main__:
import doctest
On Dec 22, 7:05 pm, Peter Otten [EMAIL PROTECTED] wrote:
petr.jakes.tpc wrote:
While you could either alter the textfile to
import __main__ as displeje_pokus
or the module along the lines of
# not recommended!
from displeje_pokus import TextyDispleje
if __name__ == __main__:
#
Thanks, it works.
And thanks for your comments which are worth to think about :)
Petr
This has nothing to do with your previous problem. Use
from __main__ import myFunction, myOtherFunction, ...
or
from __main__ import *
if you prefer namespace pollution paradise*.
Again, it would be
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 or Windows tips
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/pleac_python/
datesandtimes.html
HTH
Petr Jakes
--
http://mail.python.org/mailman
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
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
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
Hi Dennis,
thanks for your reply.
Dennis Lee Bieber napsal:
def dataOnSerialPort():
data=s.readLine()
Unless you are using a custom serial port module, that should be
s.readline()
sorry for the typo
if data:
return data
else:
return 0
This
the 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.
Petr
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, str(dataName))
Thanks for your comments
Petr Jakes
--
http://mail.python.org/mailman
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_dat_TPC
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
will happen if the person will input character rather
than integer.
Again: good luck in your effort
Petr Jakes
Petr Jakes wrote:
It smells like many student are trying to do their homework last few
days here ... Can we now the name of your school? :)
AFAIK this group does not solve
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
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
can figure out what I was trying to accomplish.
Sam Schulenburg
+1
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
.
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
only!! polling
10x a second
minutes=min
print Eureca
time.sleep(0.1)
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your comment. It is mainly English issue (I am not native
English speaker).
OK, to be more specific, I would like to run the code, when the value
of seconds in the timestamp become say 00.
The whole code will run in the infinitive loop and other actions will
be executed as well, so it
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
off).
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
/kinterbasdb-3.2_pre_20060503.win32-FB-2.0-py2.4.exe
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
,
KInterbasDB 3.2b1
Thanks for your advices.
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
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
Eric3 is great IMHO.
http://www.die-offenbachs.de/detlev/eric3.html
--
http://mail.python.org/mailman/listinfo/python-list
Jarek, I am using it always like in the following example to connect to
the remote host and it works for me flawlessly.
Petr Jakes
import kinterbasdb as k
con = k.connect(
host='router.maren.cz',
database='/data/sysdat01.gdb',
user='SYSDBA', password='masterkey
before
posting questions (I am not saying it is a bad idea to ask here, I am
only trying to show an simple alternative how to get an answers to your
questions to you)
HTH
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
:Your credit= %3d % (credit)}
While I am trying to import my_dictionary in to the main code, I am
getting:
exception unhandled NameError
name credit is not defined
How can I organize my code so the credit variable will be visible
in the my_dictionary namespace?
Thanks
Petr Jakes
--
http
Thanks Steven,
credit is mentioned to be a calculated value changed at run-time and
your third hand suggestion is exactly what I was looking for.
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
?
Thanks
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
to you in above mentioned posting as well)
You can find plenty of examples on http://pyserial.sourceforge.net/ in
the Examples paragraph. Try to study and search before you ask.
HTH
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
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
options (I am trying to use spaces for indentation
strictly) are:
=
- Use tabs for indentation - unchecked
- Convert tabs upon open - checked
=
Because of that I am not getting to the troubles with indentation
anymore.
HTH
Petr
,
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
something?
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
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 Jakes
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
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://mail.python.org/mailman/listinfo
http://www.pspad.com/en/
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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 state/transition
table in the format:
{'start_state
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
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
if the 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
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 :)
Petr Jakes
PS:
I agree
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 stdin, line 1, in ?
error: (22, 'Invalid argument')
Thanks for your comments.
Petr Jakes
--
http
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
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 beautiful language to me
Regards
Petr Jakes
--
http://mail.python.org/mailman
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.
Thanks a lot.
Petr
--
before sending each
communication byte.
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
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 each byte transmission).
Any comment will be appreciated.
Petr Jakes
85 matches
Mail list logo