Re: No tab completion if sys.stdout is redirected

2007-12-18 Thread Bjoern Schliessmann
Dirk Loss wrote: > I want to have tab completion in my program for interactive input. > Using readline and rlcompleter this works nicely. But I also have > to catch and modify all "print" output, so I redirect sys.stdout > to a custom file-like object. The problem is: After the > redirection, readl

Re: No tab completion if sys.stdout is redirected

2007-12-19 Thread Bjoern Schliessmann
Dirk Loss wrote: > Bjoern Schliessmann wrote: >> readline module applies its autocompletion functions to (and only >> to) sys.stdout. > > I see. Then I guess I'll have to avoid redirecting sys.stdout and > come up with some kind of workaround instead. Just use a &q

Re: Inter-process communication, how? Part 2

2007-12-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > What I don't like about FIFO, is that on Unix they are persistent > files. So whatever happens to Manager they would stay there... Nope. /tmp exists. Many distributions delete /tmp contents on reboot. > I was just wondering if there's another way of doing the above and

Re: Inter-process communication, how? Part 2

2007-12-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Ok, but how to redirect "print" statement into a socket? Create an object that has the socket's send-or-what-it's-called method as a member called "write" and bind this object to sys.stdout. Alternatively, you can use the "print "text" >> object" syntax (see language ref

Re: Inter-process communication, how? Part 2

2007-12-24 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > <[EMAIL PROTECTED]> wrote: >> What I don't like about FIFO, is that on Unix they are persistent >> files. So whatever happens to Manager they would stay there... >> I was just wondering if there's another way of doing the above >> and if not, I would probably go with F

Re: fiber(cooperative multi-threading)

2007-12-24 Thread Bjoern Schliessmann
Michael Sparks wrote: > All that said, my personal primary aim for kamaelia is to try and > make it into a general toolkit for making concurrency easy & > natural (as well as efficient) to work with. If full blown > coroutines turn out to be part of that c'est le vie :-) I must admit I mostly did

Re: standalone python web server

2007-12-27 Thread Bjoern Schliessmann
eric wrote: > I want to setup simple python web server and I want it to just > unzip and run, without any installation steps (have no right to do > it). Which OS? You might run into authorisation problems if you want it to listen on port 80 TCP. Regards, Björn -- BOFH excuse #303: fractal ra

Re: OOP: How to implement listing al 'Employees'.

2007-12-28 Thread Bjoern Schliessmann
Petar wrote: > What is the better way of doing this? And should a class always > reference only on 'item'? It fully depends on what you want to do in your program. If you just want to have a list of employees, a list or dict will suffice. If you need a full-fledged employee database, an "Employees

Re: fiber(cooperative multi-threading)

2007-12-28 Thread Bjoern Schliessmann
Michael Sparks wrote: > Also, I'd be interested in hearing how your project gets on - it > sounds like the sort of thing that Kamaelia should be able to help > with. (If it doesn't/can't, then it's a bug IMO :) That was also my impression. :) My last tries had similarities to Axon, but I never was

Re: dont loose packages

2007-12-31 Thread Bjoern Schliessmann
Oguz Yarimtepe wrote: > I am trying to write a program that will work on a machine which > is between a client and a server. What i want is to simulate the > bridging process. So the program should take the packages and able > to send them to the other interface. I dont want to loose package > and

Re: wxpython application ( problem ? )

2008-01-02 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > yes, so what's the problem? http://wxwidgets.org/manuals/stable/wx_wxthreadoverview.html | If you do decide to use threads in your application, it is | strongly recommended that no more than one thread calls GUI | functions. The thread sample shows that it is possible f

Re: Basic inheritance question

2008-01-05 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Jeroen Ruigrok van der Werven wrote: >> self.startLoc = start >> self.stopLoc = stop > > Thanks! Of course it should. Old Java habits die slowly. That's not really a Java habit. In Java and C++, personally I like to write this.startLoc = start this.stopLoc = stop It

Re: Delete lines containing a specific word

2008-01-06 Thread Bjoern Schliessmann
Steven D'Aprano wrote: > grep doesn't delete lines. grep matches lines. If you want to > delete them, you still have to do the rest of the job yourself. In which way does "grep -v mypattern myfile > myfile" not delete the lines matching mypattern? Regards, Björn -- BOFH excuse #184: loop fo

Re: Help needed

2008-01-11 Thread Bjoern Schliessmann
Devraj wrote: > Sorry to diverge from the topic, but is there a reason you need to > develop something like again? It's obvious, isn't it? > On Jan 11, 1:15 pm, tijo <[EMAIL PROTECTED]> wrote: >> I dont know how to check the rest like how many bytes send or how >> much time taken since this is

[Kamaelia] TCPClient: How to sense connection failure?

2008-01-11 Thread Bjoern Schliessmann
Hello, I'm currently trying to implement a simulation program with Kamaelia and need a reliable TCP connection to a data server. >From Twisted, I know that a method is called if the connection fails by whatever reason. I tried to get the same results with Kamaelia's TCPClient component. If I star

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-12 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > Not sure about Kamelia, but I have found that when a FIN comes > along, a socket.recv() gives back an empty string, just like EOF > on a file. That Python socket interface can detect it I'm absolutely sure -- Twisted handles it. I even pdb'ed Kamaelia and control flow

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-13 Thread Bjoern Schliessmann
Michael Sparks wrote: > The behaviour you're seeing sounds odd (which is hopefully > encouraging :-), but it's not clear from the description whether > its a bug in your code or Kamaelia. One question I really have as > a result is what version are you using? Oh sorry, it's the versions from MegaP

Re: [Kamaelia] TCPClient: How to sense connection failure?

2008-01-14 Thread Bjoern Schliessmann
Michael Sparks wrote: > It is sufficient, and running with Kamaelia from /trunk, your > listener does indeed shutdown correctly Great, thanks for validating. :) > My suggestion for the moment would be to use the code on /trunk > since this is stable at present (development happens on branches >

Re: "env" parameter to "popen" won't accept Unicode on Windows - minor Unicode bug

2008-01-14 Thread Bjoern Schliessmann
John Nagle wrote: > It turns out that the strings in the "env" parameter have to be > ASCII, not Unicode, even though Windows fully supports Unicode in > CreateProcess. Are you sure it supports Unicode, not UTF8 or UTF16? Probably using something like u"thestring".encode("utf16") will help. Rega

RE: "env" parameter to "popen" won't accept Unicode on Windows -minor Unicode bug

2008-01-15 Thread Bjoern Schliessmann
Brian Smith wrote: > popen() knows that it is running on Windows, and it knows what > encoding Windows needs for its environment (it's either UCS2 or > UTF-16 for most Windows APIs). At least when it receives a unicode > string, it has enough information to apply the conversion > automatically, and

Re: "env" parameter to "popen" won't accept Unicode on Windows -minor Unicode bug

2008-01-15 Thread Bjoern Schliessmann
John Nagle wrote: > The problem is that only the NT-derived Microsoft systems > talk Unicode. The DOS/Win16/Win9x family did not. But they did > have CreateProcess. So the current code will handle Win9x, but not > Unicode. Please explain, I don't understand. If you try using Windows system functio

Re: Interesting Thread Gotcha

2008-01-16 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > Absolutely! - well spotted! This is no threading problem at all; not even a syntax problem. If you don't know exactly what start_new_thread and kbd_driver functions do it's impossible to tell if your code does what is intended. > It would have been nice, however, to ha

Re: Basic inheritance question

2008-01-16 Thread Bjoern Schliessmann
Lie wrote: > [EMAIL PROTECTED]> wrote: >> I used to systematically use it - like I've always systematically >> used 'this' in C++  and Java. > > And that is what reduces readability. IMHO not, IOPHO not. This is the nth time (n >> 1) this discussion comes up here. If I have learned one thing fr

Re: Basic inheritance question

2008-01-20 Thread Bjoern Schliessmann
(messed up references?) Lie wrote: > Please again, stop taking letters to the words Please don't mix up followups. Regards, Björn -- BOFH excuse #11: magnetic interference from money/credit cards -- http://mail.python.org/mailman/listinfo/python-list

Re: Max Long

2008-01-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > How can I figure out the largest long available? Why would you? AFAIK, longs are only limited by available memory. > I was hoping for something like sys.maxint, but I didn't see it. > Also, can someone point me to where I can (concisely) read about > size of such types

Re: translating Python to Assembler

2008-01-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > My expertise, if any, is in assembler. I'm trying to understand > Python scripts and modules by examining them after they have been > disassembled in a Windows environment. IMHO, that approach doesn't make sense to understand scripts or modules (except if you have some

Re: translating Python to Assembler

2008-01-23 Thread Bjoern Schliessmann
Grant Edwards wrote: > Trying to find assembly language stuff to look at is futile. > Python doesn't get compiled into assembly language. So, how do processors execute Python scripts? :) > If you want to learn Python, then read a book on Python. ACK. Regards, Björn -- BOFH excuse #198:

Re: Max Long

2008-01-23 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Indeed, as the docs pointed out. I guess I was confused by > > "If pylong is greater than ULONG_MAX, an OverflowError is raised." > > at http://docs.python.org/api/longObjects.html. Take care -- this is about "unsigned long" data type of C, not a Python "long" instan

Re: translating Python to Assembler

2008-01-24 Thread Bjoern Schliessmann
Tim Roberts wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> >> So, how do processors execute Python scripts? :) > > Is that a rhetorical question? A little bit. > Grant is quite correct; Python scripts (in the canonical CPython) > are NOT compiled into asse

Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > print x.ends,y.ends,z.ends > # > Running the following code outputs: [(0, 2)] [(0, 2)] [(0, 2)] > > Can anyone explain this? Yes. You bound a single list to the name "ends" inside the class. This name is shared by all instances. If you want the instanc

Re: translating Python to Assembler

2008-01-26 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Intel processors can only process machine language[...] There's no > way for a processor to understand any higher level language, even > assembler, since it is written with hexadecimal codes and basic > instructions like MOV, JMP, etc. The assembler compiler can > conver

Re: translating Python to Assembler

2008-01-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > hehe...which part am I kidding about? The explanation was for > someone who thought python scripts were translated directly by the > processor. Who might this have been? Surely not Tim. > I have already disassembled a pyc file as a binary file. Have you? How's it lo

Re: translating Python to Assembler

2008-01-28 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > On Sat, 26 Jan 2008 14:47:50 +0100, Bjoern Schliessmann >> This may be true, but I think it's not bad to assume that machine >> language and assembler are "almost the same" in this context, >> since the translation between them is n

Re: optional static typing for Python

2008-01-28 Thread Bjoern Schliessmann
Russ P. wrote: > On Jan 28, 1:51 am, Bruno Desthuilliers > Lord have mercy(tm). > > What is that supposed to mean? I suppose he wants to communicate that this is the nth time this topic is brought up (n=>infinite). Try searching the archives next time. Regards, Björn P.S.: IMHO, your flame i

Re: translating Python to Assembler

2008-01-28 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Bjoern Schliessmann wrote: >> [EMAIL PROTECTED] wrote: >>> That's not the point, however. I'm trying to say that a >>> processor cannot read a Python script, and since the Python >>> interpreter as stored on disk is essentia

Re: translating Python to Assembler

2008-01-28 Thread Bjoern Schliessmann
Grant Edwards wrote: > No, it doesn't output corresponding machine code (that's what > some Java JIT implementations do, but I'm not aware of any > Python implementations that do that). The virtual machine > interpreter just does the action specified by the bytecode. By "outputs corresponding mac

Re: Events in Python

2008-01-30 Thread Bjoern Schliessmann
Ivan Illarionov wrote: > Note that all those signals/events are very slow in Python. Compared to what, did you measure something? Regards, Björn -- BOFH excuse #38: secretary plugged hairdryer into UPS -- http://mail.python.org/mailman/listinfo/python-list

Re: Naive idiom questions

2008-01-31 Thread Bjoern Schliessmann
Terran Melconian wrote: > * Why are there no real mutable strings available? > > I found MutableString in UserString, but further research > indicates that it is horribly inefficient and actually just > wraps immutable strings for the implementation. Did you measure such impact on you

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Bjoern Schliessmann
Stefan Behnel wrote: > How do you know people in hell aren't doing any programming in > Python? Common sense. In hell, everything is hacked together using Perl. Regards, Björn (running for cover :) ) -- BOFH excuse #324: Your packets were eaten by the terminator -- http://mail.python.org

Re: Is it explicitly specified?

2008-02-03 Thread Bjoern Schliessmann
mario ruggier wrote: > It may sometimes be useful to make use of the conceptual > difference between these two cases, that is that in one case the > user did not specify any key and in the other the user explicitly > specified the key to be None. Do you have an example where this might be useful?

Re: Why not a Python compiler?

2008-02-07 Thread Bjoern Schliessmann
Ryszard Szopa wrote: > Of course, when writing Python extensions in C is fairly easy and > when rewriting just the critical part of the code is enough to get > acceptable performance, I really doubt I will see anybody willing > to invest serious amounts of money and time into writing a native > co

Re: socket script from perl -> python

2008-02-07 Thread Bjoern Schliessmann
kettle wrote: > Hi I have a socket script, written in perl, which I use to send > audio data from one server to another. I would like to rewrite > this in python so as to replicate exactly the functionality of the > perl script, so as to incorporate this into a larger python > program. Unfortunat

Re: OT: Star Wars and parsecs

2008-02-09 Thread Bjoern Schliessmann
Lou Pecora wrote: [parsecs] > Which is the Earth's orbit. So, long, long ago in a galaxy far, > far away did they know about the Earth and decide to use it as the > basis for length in the universe? Even before people on earth > defined it? No, even simpler: In the Star Wars galaxy, parsec is a

Re: Displaying Unicode Chars

2008-02-10 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > However how can I change it so it works with a string variable? > > print unicode("\u221E") doesn't seem to do it. Sure, that's because \u only works in unicode strings. You'd need to "encode" your \u-containing string to a unicode string. Perhaps this'll help: >>> def

Re: Displaying Unicode Chars

2008-02-11 Thread Bjoern Schliessmann
"Martin v. Löwis" wrote: > On Linux, try gucharmap or kcharselect. Or gnome-character-map if using Gnome. Regards, Björn -- BOFH excuse #25: Decreasing electron flux -- http://mail.python.org/mailman/listinfo/python-list

Re: dream hardware

2008-02-12 Thread Bjoern Schliessmann
Jeff Schwab wrote: > The only "dream hardware" I know of is the human brain. Nah. Too few storage capacity, and too slow and error-prone at simple calculations. The few special but very advanced features are all hard-wired to custom hardware, it's a real nightmare interfacing with it. Regards,

Re: OT: Speed of light

2008-02-13 Thread Bjoern Schliessmann
Dotan Cohen wrote: > Don't cry, I just want to say that I've hated the kilogram-force > almost as much as I've hated the electron-volt. Who is the lazy > who comes up with these things? eV has a advantages some "kilogram force" hasn't: It's on completely different order of magnitude. People aren'

Re: Floating point bug?

2008-02-13 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I've never had any call to use floating point numbers and now that > I want to, I can't! Ever considered phrasing your actual problem so one can help, let alone looking at the archive for many, many postings about this topic? Regards, Björn -- BOFH excuse #66: bit

Re: OT: Speed of light

2008-02-14 Thread Bjoern Schliessmann
Erik Max Francis wrote: > A couple of problems here. 1 eV = 1.602 x 10^-19 J. Also, the > atto-prefix is 10^-18, not 10^-15. So 511 keV = 81.9 fJ > (femtojoules). Miscount on my side; thanks for pointing that out. Regards, Björn -- BOFH excuse #330: quantum decoherence -- http://mail

Re: Encrypting a short string?

2008-02-16 Thread Bjoern Schliessmann
Lie wrote: > There is a simple encryption, called ROT13 (Rotate 13). This is > very unsecure for any cryptographical purpose, For enhanced security use TROT13 (triple ROT13). > but enough to make uninformed user to think it's just a random > piece of letters. Security by obscurity doesn't wor

Re: Linux/Python Issues

2008-02-19 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > CNR, which is now free, is absolutely marvelous when it's got what > you need. If Python2.5 were in the warehouse, I'd have clicked, > gone to make a cup of coffee and the appropriate icon would be on > my desktop when I came back. Why don't you switch to a distributio

Re: Linux/Python Issues

2008-02-19 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Both GNOME and KDE put Windows to shame. An old Windows guy, like > me, can just start using either one without needing 'common *n*x > knowledge.' Sure, go and compile them from the sources. The X server too, please (I got half insane from that once). > Too bad the *n

Re: Linux/Python Issues

2008-02-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > As a "solution" to the problem of wanting a program on my > computer, it sucks. On Windows I'll DL an install package, > "accept" a license agreement, click Next a few times (no, I can't > make a cup of coffee because the minute I step away the "Wizard" > will ask a ques

Re: Why this ref leak?

2008-02-27 Thread Bjoern Schliessmann
Gerhard Häring wrote: > Both Python 2.4 and 2.5 don't clean up properly here. Why is this? > Aren't classes supposed to be garbage-collected? Yes, but not neccessarily immediately. BTW, where is your method sys.gettotalrefcount supposed to come from? My CPython doesn't have it. Regards, Björn

Re: Why this ref leak?

2008-02-27 Thread Bjoern Schliessmann
Peter Otten wrote: > Bjoern Schliessmann wrote: >> BTW, where is your method sys.gettotalrefcount supposed to come >> from? My CPython doesn't have it. > > It's in the debug build only. Makes sense; thank you. Regards, Björn -- BOFH excuse #292: We ran

Re: Print to end of line in a terminal

2008-02-27 Thread Bjoern Schliessmann
ndlarsen wrote: > This might seem as a arbitrary question to some. Anyway, I'm > wondering how I go about printing text to the end of a line in a > terminal/console. I've been googling it for a few days without any > success. Any suggestions will be greatly appreciated. Well, just print ${COLUMNS

Re: Run wxPython app remotely under XWindows

2008-02-28 Thread Bjoern Schliessmann
Sean DiZazzo wrote: > Is there something special you have to do to get a wxPython app to > run remotely under xwindows? My Tkinter apps always automatically > work that way, so I was surprised to even be confronted with this > problem. Could you please provide more detail? My wxPython apps run p

Re: Run wxPython app remotely under XWindows

2008-02-29 Thread Bjoern Schliessmann
Sean DiZazzo wrote: > On Feb 28, 3:50 pm, Bjoern Schliessmann > $ ssh some-other-machine >> $ DISPLAY=:0 ./my_app.py > > Should wxPython apps work this way? I think so; at least it works for me. > Do you think it's something with the server? I have no idea. Regards

Re: Python Telnet formatting?

2008-03-02 Thread Bjoern Schliessmann
Gabriel Genellina wrote: > They are part of the telnet protocol; 0xFF (IAC=Interpret as > Command) starts a two or three byte command sequence. > Weren't you using telnetlib? It's supposed to handle this > transparently. With Twisted you don't need Telnetlib, twisted.conch.telnet does the job. I

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread Bjoern Schliessmann
blaine wrote: > So my question is this - what is the easiest way to interface to > this "serial" device? > > I don't imagine a straight read() and write() command to > /dev/ttyusb0 is the most efficient (if it even works) It doesn't only work, it's the preferred way (if you don't use advanced w

Re: Checking if a variable is a dictionary

2008-03-06 Thread Bjoern Schliessmann
Guillermo wrote: > I'm just designing the algorithm, but I think Python dictionaries > can hold any kind of sequence? (Watch out, dicts are no sequence types.) I recommend relying duck typing as long as it's feasible. I. e. if it can be subscripted like a dict, it is a dict. If this makes proble

Re: Change user on UNIX

2008-03-20 Thread Bjoern Schliessmann
Giampaolo Rodola' wrote: > Is there any way to su or login as a different user within a > python script? I mainly need to temporarily impersonate another > user to execute a command and then come back to the original user. > I tried to google a little bit about it but I still didn't find a > solut

Re: Files, directories and imports - relative to the current directory only

2008-03-25 Thread Bjoern Schliessmann
ptn wrote: > Traceback (most recent call last): > File "path.py", line 4, in > f = open('~/read/foo.txt') > IOError: [Errno 2] No such file or > directory: '~/read/foo.txt' > [...] > So, what's wrong here? Maybe there's something I haven't set up

Re: Simple question

2008-05-11 Thread Bjoern Schliessmann
Gandalf wrote: > On May 10, 2:36 pm, Bjoern Schliessmann > It depends on your web server configuration. To get your web >> server execute Python code, there are several alternatives like >> >> * CGI >> * FastCGI >> * mod_python > > my server is my computer

Re: Thread output with ncurses

2008-05-19 Thread Bjoern Schliessmann
blaine wrote: > The idea would be that the application simply has three 'windows' > or 'pads' and each thread would output to their respective one. I don't know much about ncurses, but I suggest you better use multiple processes (subprocess module). Regards, Björn -- BOFH excuse #434: Plea

Re: Compress a string

2008-05-19 Thread Bjoern Schliessmann
inhahe wrote: > i see lots of neat one-liner solutions but just for the sake of > argument: > > def compress_str(str): > new_str = "" > lc = "" > for c in str: > if c != lc: new_str.append(c) > return new_str Please test before posting. >>> compress_str("

Re: Keep a script running in the background

2008-06-03 Thread Bjoern Schliessmann
Guillermo wrote: > I need a script to keep running in the background after it's > loaded some data. It will make this data available to the main > program in the form of a dictionary, but I don't want to reload > the calculated data every time the user needs it via the main > program. > > I won't

Re: Python and Harry Potter?

2008-06-05 Thread Bjoern Schliessmann
Casey wrote: > Python fan??? Harry speaks Python fluently. We should all be so > lucky! > > I'm told Harry is looking forward to Py3K and getting rid of all > the old (hog)warts Well, how about another Python renaming flame thread then? Let's call Python 3.0 "Parselmouth" instead ... Regar

Re: Serial port error statistics - any comparable data?

2008-03-30 Thread Bjoern Schliessmann
Diez B. Roggisch wrote: > if you have the chance, try & attach a machine with legacy rs232 > port, and see if the errors still remain. Additionally, what kind of buffers does your device have? I'm using pyserial to control a very "sensitive" device with nuttily implemented buffering strategy. It

Re: Why prefer != over <> for Python 3.0?

2008-03-30 Thread Bjoern Schliessmann
Lie wrote: > Ah yes, that is also used (I completely forgot about that one, my > math's aren't that sharp anymore) and I think it's used more > frequently than ><. Where did you read that (I mean, which country)? I've never seen this sign in any german or english book on mathematics/physics/engi

Re: python ODF library?

2008-03-30 Thread Bjoern Schliessmann
Matias Surdi wrote: > Do yo know any good OpenDocumentFormat library for python? > > I'm starting a project on wich I'll have to programatically modify > ODF text documments, so, after reinventing the wheel, I'd like to > know if already something exists. Probably this will help: http://wiki.se

Re: Why prefer != over <> for Python 3.0?

2008-03-30 Thread Bjoern Schliessmann
hdante wrote: > BTW, my opinion is that it's already time that programmer editors > have input methods advanced enough for generating this: Could you please list some that do, and are also convenient? Regards, Björn -- BOFH excuse #288: Hard drive sleeping. Let it wake up on it's own... -

Re: Why prefer != over <> for Python 3.0?

2008-03-30 Thread Bjoern Schliessmann
Torsten Bronger wrote: > Maybe he means "?". Haven't seen this either, nor do I think it's the same than "<>". >From afar, it looks more like "><". But this does more look like South Park style shut eyes than an operator. :) Regards, Björn -- BOFH excuse #407: Route flapping at the NAP. -

Re: socket error when loading the shell?

2008-03-30 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > using python and wpython. What's wpython? > when using run module or python shell on the run menu in the GUI i > get "socket error, connection refused". > > it worked before, what si wrong now? There's no process listening for the port you try to connect to, so the t

Re: License of Python

2008-03-30 Thread Bjoern Schliessmann
iu2 wrote: > Due to Competitors... I don't want to expost the language I use A serious competitor that wants to find out _will_ find out, no matter what you try. Regards, Björn -- BOFH excuse #341: HTTPD Error 666 : BOFH was here -- http://mail.python.org/mailman/listinfo/python-list

Re: Why prefer != over <> for Python 3.0?

2008-03-30 Thread Bjoern Schliessmann
Torsten Bronger wrote: > Emacs is generally not regarded as being convenient, however, it > has very strong input methods. I type "\gtrless" and get "?", > or "\forall" and get "?". I wonder where the point of this is. :) Why use fancy unicode chars if they're not better to read (apart from not

Re: python ODF library?

2008-03-30 Thread Bjoern Schliessmann
Matias Surdi wrote: > Found it: > http://opendocumentfellowship.com/development/projects/odfpy While we're at it: This module seems to be centered around creating documents. Where could I possibly find information/examples on how to read an ODF spreadsheet using Python? Regards, Björn -- BO

Re: Why prefer != over <> for Python 3.0?

2008-03-31 Thread Bjoern Schliessmann
Torsten Bronger wrote: > Doesn't KNode support UTF-8? Well, it should, but automatic encoding detection doesn't always seem to work (or does it even have one?). I'm looking for a different (faster) newsreader anyway. > Who wants to minimize the number of keypresses? We're not Perl > after all.

Re: How is GUI programming in Python?

2008-04-10 Thread Bjoern Schliessmann
Chris Stewart wrote: > I've always had an interest in Python and would like to dabble in > it further. I've worked on a few very small command line programs > but nothing of any complexity. I'd like to build a really simple > GUI app that will work across Mac, Windows, and Linux. How > painful

Re: problem with unicode

2008-04-25 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > # media is a binary string (mysql escaped zipped file) > print media > x???[?... > (works) Which encoding, perhaps UTF-8 or ISO8859-1? print unicode(media) > UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in > position 1: ordinal not in range(128

Re: Remove multiple inheritance in Python 3000

2008-04-25 Thread Bjoern Schliessmann
sturlamolden wrote: > On Apr 22, 1:07 pm, GD <[EMAIL PROTECTED]> wrote: >> Multiple inheritance is bad for design, rarely used and contains >> many problems for usual users. >> >> Every program can be designed only with single inheritance. > > That's how the Java designers were thinking as well:

Re: problem with unicode

2008-04-25 Thread Bjoern Schliessmann
John Machin wrote: > On Apr 25, 10:01 pm, Bjoern Schliessmann > >>> media="x???[?" >> >>> print repr(media.decode("utf-8")) >> >> u'x\u30ef\u30e6\u30ed[\u30e8' (dang, KNode doesn't autodetect encodings ...) > But t

Re: display monochromatic images wxPython

2008-04-26 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I want to write a GUI program with wxPython displaying an image. Then be sure to check out the wxPython demo application. It displays lots of images. Regards, Björn -- BOFH excuse #217: The MGs ran out of gas. -- http://mail.python.org/mailman/listinfo/python-lis

Re: Pyserial - send and receive characters through linux serial port

2008-04-26 Thread Bjoern Schliessmann
terry wrote: > I am trying to send a character to '/dev/ttyS0' and expect the > same character and upon receipt I want to send another character. > I tired with Pyserial but in vain. Pyserial works very well for me (despite the device I connect to has quite a screwed protocol and implementation).

Re: design choice: multi-threaded / asynchronous wxpython client?

2008-04-27 Thread Bjoern Schliessmann
bullockbefriending bard wrote: > 1) The data for the race about to start updates every (say) 15 > seconds, and the data for earlier and later races updates only > every > (say) 5 minutes. There is no point for me to be hammering the > server with requests every 15 seconds for data for races after

Re: print some text

2008-04-27 Thread Bjoern Schliessmann
barronmo wrote: > I haven't found a way from within python to print f. I'm sure > there it is something simple but I've been searching for a couple > weeks now with no luck. Tried some searching? http://wiki.wxpython.org/Printing HTH&Regards, Björn -- BOFH excuse #374: It's the InterNIC's

Re: Simple unicode-safe version of str(exception)?

2008-04-28 Thread Bjoern Schliessmann
Russell E. Owen wrote: > I have code like this: > except Exception, e: >self.setState(self.Failed, str(e)) > which fails if the exception contains a unicode argument. Fails how? > I did, of course, try unicode(e) but that fails. Converting unicode to unicode doesn't help. Instead of just e

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Bjoern Schliessmann
"Martin v. Löwis" wrote: > e is an exception object, not a Unicode object. Er, sure, thanks for pointing that out. At first sight he should substitute "e" with "e.message" then since he tries to convert to string (for display?). Regards, Björn -- BOFH excuse #366: ATM cell has no roaming fe

Re: I messed up my wxPython install (Eclipse Configuration Issue)

2008-04-30 Thread Bjoern Schliessmann
blaine wrote: > I didn't mean anything by it, I promise. This group is just > amazing - there are always very active topics and I get responses > in no time. The wxPython group I noticed only has had recent > discussions a few times in the past month, and their subscribers > aren't as high as the

Re: is +=1 thread safe

2008-05-04 Thread Bjoern Schliessmann
Gary Herron wrote: > No NO NO! The only way to increment a variable in memory is > through a three step process: > > Load a register from a memory location > Increment the register > Store the value back into memory. I suggest you read "Intel 64 and IA-32 Architectures Software Developer

Re: Am I missing something with Python not having interfaces?

2008-05-07 Thread Bjoern Schliessmann
jmDesktop wrote: > Studying OOP and noticed that Python does not have Interfaces. By "OOP", you mean "Java", right? 8) > Is that correct? Is my schooling for nought on these OOP concepts > if I use Python. Am I losing something if I don't use > the "typical" oop constructs found in other lang

Re: simple question about Python list

2008-05-09 Thread Bjoern Schliessmann
dmitrey wrote: > Hmm... I thought this issue is available from Python2.5 only. I > have no other interpreters in my recently installed KUBUNTU 8.04. "aptitude install python2.4" helps. Regards, Björn -- BOFH excuse #10: hardware stress fractures -- http://mail.python.org/mailman/listinfo/p

Re: Simple question

2008-05-10 Thread Bjoern Schliessmann
Gandalf wrote: > how can i ran script with python It depends on your web server configuration. To get your web server execute Python code, there are several alternatives like * CGI * FastCGI * mod_python Regards, Björn -- BOFH excuse #93: Feature not yet implemented -- http://mail.python.

<    1   2   3   4   5   6