Re[2]: termios.tcgetattr(fd) error: (22, 'Invalid argument')

2005-11-21 Thread Petr
>>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

How to convert simple B/W graphic to the dot matrix for the LED display/sign

2012-03-04 Thread Petr Jakes
can show me the direction to go? Regards Petr -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign

2012-03-04 Thread Petr Jakes
om this file, so I can switch LEDs ON/OFF accordingly. -- Petr -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert simple B/W graphic to the dot matrix for the LED display/sign

2012-03-05 Thread Petr Jakes
> >>> 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

mmap and bit wise twiddling - Raspberry Pi

2012-05-02 Thread Petr Jakes
= 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

What encoding is used when initializing sys.argv?

2005-09-30 Thread Petr Prikryl
. 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

Re: What encoding is used when initializing sys.argv?

2005-10-05 Thread Petr Prikryl
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

Any 3state Check Tree Ctrl for wxPython available?

2005-10-17 Thread Petr Prikryl
, 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

UART parity setting as "mark" or "space" (using Pyserial???)

2005-11-03 Thread Petr Jakes
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

convert string to the "escaped string"

2005-11-12 Thread Petr Jakes
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

Re: convert string to the "escaped string"

2005-11-12 Thread Petr Jakes
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

Re: convert string to the "escaped string"

2005-11-12 Thread Petr Jakes
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

Re: UART parity setting as "mark" or "space" (using Pyserial???)

2005-11-12 Thread Petr Jakes
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

termios.tcgetattr(fd) error: (22, 'Invalid argument')

2005-11-19 Thread Petr Jakes
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')

Re: termios.tcgetattr(fd) error: (22, 'Invalid argument')

2005-11-19 Thread Petr Jakes
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

Bug in Python 2.4 raw_input(u'xyz') Win/command line?

2005-01-10 Thread Petr Prikryl
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

Re: list item's position

2005-01-20 Thread Petr Prikryl
.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

Re: [OT] Good C++ book for a Python programmer

2005-01-20 Thread Petr Prikryl
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

Simpler transition to PEP 3000 "Unicode only strings"?

2005-09-20 Thread Petr Prikryl
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

Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Petr Prikryl
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

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Petr Prikryl
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

Replacing lambda() examples... (Re: Lambda going out of fashion)

2004-12-23 Thread Petr Prikryl
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

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-12 Thread Petr Viktorin
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

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-16 Thread Petr Viktorin
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

Re: Linux users: please run gui tests

2015-08-27 Thread Petr Viktorin
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

Python code written in 1998, how to improve/change it?

2006-01-19 Thread Petr Jakes
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

Re: Python code written in 1998, how to improve/change it?

2006-01-19 Thread Petr Jakes
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 :)

Re: Python for Embedded Systems?

2006-07-17 Thread Petr Jakeš
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

technique to enter text using a mobile phone keypad (T9 dictionary-based disambiguation)

2006-08-08 Thread Petr Jakeš
comments Regards Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: technique to enter text using a mobile phone keypad (T9 dictionary-based disambiguation)

2006-08-09 Thread Petr Jakes
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

what is the reasonable (best?) Exception handling strategy?

2006-06-01 Thread Petr Jakes
specific answers to the above mentioned code example. Regards Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: what are you using python language for?

2006-06-07 Thread Petr Jakes
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

Re: Most elegant way to generate 3-char sequence

2006-06-11 Thread Petr Jakes
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

Re: Simple Char-I/O Dialogs for Win32 and DOS

2006-06-14 Thread Petr Jakes
o the > kit ? TIAMR You can try: Dialog http://invisible-island.net/dialog/ HTH Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: break the loop in one object and then return

2006-06-26 Thread Petr Jakes
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

Re: break the loop in one object and then return

2006-06-27 Thread Petr Jakes
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

small inaccuracy in the logging module documentation (Python Library Reference)

2006-06-29 Thread Petr Jakeš
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

finding the last file created in a directory

2006-06-30 Thread Petr Man
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

Re[2]: delete first line in a file

2006-06-30 Thread Petr Jakeš
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

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-02 Thread Petr Jakeš
in.com/ You can manage cluster of servers at once. Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re[2]: Can I do it using python?? about xterm and telnet

2006-07-03 Thread Petr Jakeš
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

Re: a question about "return"

2006-07-04 Thread Petr Prikryl
"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

Re: [noob question] References and copying

2006-07-04 Thread Petr Prikryl
"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] > >>

import gtk RuntimeError: could not open display

2006-09-11 Thread Petr Jakes
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

unicode mystery/problem

2006-09-20 Thread Petr Jakes
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,

Re[2]: unicode mystery/problem

2006-09-22 Thread Petr Jakeš
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

Python language extension mechanism for Python 3000... Worth for PEP?

2006-11-30 Thread Petr Prikryl
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

writing serial port data to the gzip file

2006-12-17 Thread Petr Jakes
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.

Re: writing serial port data to the gzip file

2006-12-18 Thread Petr Jakes
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

Re: writing serial port data to the gzip file

2006-12-18 Thread Petr Jakes
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

Re: Python code written in 1998, how to improve/change it?

2006-01-22 Thread Petr Jakes
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

Re: Python code written in 1998, how to improve/change it?

2006-01-22 Thread Petr Jakes
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

Re: Python code written in 1998, how to improve/change it?

2006-01-28 Thread Petr Jakes
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

how to parse structured text file?

2006-01-31 Thread Petr Jakes
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

Re: how to parse structured text file?

2006-01-31 Thread Petr Jakes
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

Re: tricky regular expressions

2006-02-07 Thread Petr Jakes
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

Re: What editor shall I use?

2006-02-08 Thread Petr Jakes
http://www.pspad.com/en/ Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

how to get function names from the file

2006-02-15 Thread Petr Jakes
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

Re: editor for Python on Linux

2006-02-20 Thread Petr Jakes
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

Re: how to break a for loop?

2006-02-20 Thread 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

Re: Pyserial never read

2006-02-22 Thread Petr Jakes
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

Re: pyserial

2006-02-23 Thread Petr Jakes
put()) Does it print out something? Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: pyserial

2006-02-24 Thread Petr Jakes
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

Re: Python Indentation Problems

2006-03-01 Thread Petr Jakes
the troubles with indentation anymore. HTH Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: spliting on ":"

2006-03-04 Thread Petr Jakes
> 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

Re: Pyserial again

2006-03-06 Thread Petr Jakes
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

Re: Python Graphing Utilities.

2005-05-12 Thread Petr Mikulik
> 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_

Re: Python and GUI

2007-05-21 Thread Petr Muller
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

Re: Help with PySMS

2007-05-27 Thread Petr Jakes
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

Re: Catching a key press

2007-07-23 Thread Petr Jakes
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

how to analyse music stream

2007-07-24 Thread Petr Jakes
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

Re: datetime.time() class - How to pass it a time string?

2007-07-24 Thread Petr Jakes
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

Re: From D

2007-07-26 Thread Leo Petr
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

Q: Cteni unicode retezcu ze souboru UTF-8 s BOM?

2007-03-14 Thread Petr Prikryl
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 (was Re: Cteni unicode retezcu ze souboru UTF-8 s BOM?)

2007-03-15 Thread Petr Prikryl
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

Re: problem with str()

2007-03-15 Thread Petr Prikryl
"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

Re: difference between class and static methods?

2006-04-18 Thread Petr Prikryl
"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

Re: BIOCHIP --->>> NO GOOD !!

2006-04-19 Thread Petr Prikryl
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

Re: Confused by Python and nested scoping (2.4.3)

2006-04-20 Thread Petr Prikryl
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

Re: how to append to a list twice?

2006-04-24 Thread Petr Prikryl
"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

Re: Coming from delphi - looking for an IDE - willing to spend money

2006-04-26 Thread Petr Jakes
Eric3 is great IMHO. http://www.die-offenbachs.de/detlev/eric3.html -- http://mail.python.org/mailman/listinfo/python-list

Using Databases in Python

2006-04-28 Thread Petr Jakes
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

Re: Using Databases in Python

2006-04-28 Thread Petr Jakes
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

Re: Using Databases in Python

2006-04-29 Thread Petr Jakes
Thank you very much, Steve. Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

milliseconds are not stored in the timestamp KInterbasDB + Firebird

2006-05-02 Thread Petr Jakes
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

Re: Polling from keyboard

2006-05-02 Thread Petr Jakes
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

Re: milliseconds are not stored in the timestamp KInterbasDB + Firebird

2006-05-03 Thread Petr Jakes
/kinterbasdb-3.2_pre_20060503.win32-FB-2.0-py2.4.exe Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I use python for this .. ??

2006-05-04 Thread Petr Jakes
off). Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: eric3 3.9.0 released

2006-05-06 Thread Petr Jakes
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

do "some action" once a minute

2006-05-08 Thread Petr Jakes
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

Re: do "some action" once a minute

2006-05-09 Thread Petr Jakes
s well, so it can not "sleep" for 60 seconds :). Regards Petr -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Petr Prikryl
"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

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Petr Prikryl
"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

Re: A critic of Guido's blog on Python's lambda

2006-05-11 Thread Petr Prikryl
"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

do something in time interval

2008-10-06 Thread Petr Jakes
(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

Re: do something in time interval

2008-10-06 Thread Petr Jakeš
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

fputs in tp_print crashes under Win32

2008-11-12 Thread Petr Gotthard
ux everything works fine. Do you have any idea what could be wrong? Thanks, Petr -- http://mail.python.org/mailman/listinfo/python-list

xml input sanitizing method in standard lib?

2009-03-09 Thread Petr Muller
I've just overlooked something in the docs to this (imo) important task... Petr -- http://mail.python.org/mailman/listinfo/python-list

Re: xml input sanitizing method in standard lib?

2009-03-09 Thread Petr Muller
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

Socket and cycle problem

2008-05-12 Thread petr . poupa
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   2   >