RE: Learning Python book, new edition?

2007-01-11 Thread Bjoern Schliessmann
Demel, Jeff wrote: > Björn replied: >>IIRC, differences to 2.4 are in it, too. > Interesting. The description I read said 2.3. That's good to > know. Whoops, I think it was Python Cookbook that has also remarks about 2.4. Learning Python is only about 2.3 as it seems. Regards, Björn -- B

Re: modules...n methods

2007-01-12 Thread Bjoern Schliessmann
lee wrote: > whats the way to read the sourcecode of methods Easy. Look up the .py file and open it in an editor of your choice. Those files are, for example, in "/usr/lib/python". > and built in functions? Get your python interpreter's source code and look up the functions there. Regards, B

Re: context managers and generators

2007-01-12 Thread Bjoern Schliessmann
Laszlo Nagy wrote: >> I'm still thinking there is a better way to do it, and would >> appreciate any ideas. > > Everything can be implemented with goto and arrays. But is that really better? Regards, Björn -- BOFH excuse #174: Backbone adjustment -- http://mail.python.org/mailman/list

Re: What about this?

2007-01-12 Thread Bjoern Schliessmann
Dr. Who wrote: > What's more amazing is that anyone would click on the link at all > given the increasing number of website that provide hidden content > that tries to deliver spyware or viruses just by getting visitors. How could active input reach *me* if I just fed the W3C validator with the U

Re: modules...n methods

2007-01-12 Thread Bjoern Schliessmann
belinda thom wrote: > This becomes a lot easier if you use IPython (which embellishes > the python shell in many useful ways). For instance, I did a "dir > (__builtins__)" to find out what some of the builtin functions > were. Sure. > HTH I'm sorry, it doesn't help me. And *please* don't send

Re: python and MOV or MPEG

2007-01-15 Thread Bjoern Schliessmann
siggi wrote: > Thanks, Diez. I forgot to mention that I am learning Python with > python 2.5 on WinXP. And both pymedia and pygame require somewhat > older versions of python, 1.3 and 2.4, respectively. 1.3? I've found both for 2.4, and in one site's forum some guy offers windows binaries for 2.

Re: compile your python programs with rpython

2007-01-15 Thread Bjoern Schliessmann
Simon Burton wrote: > The pypy'ers have written a brief description on > using rpython to create standalone executables: > > http://codespeak.net/pypy/dist/pypy/doc/standalone-howto.html > > This is definately worth playing around with, it's very nice > writing (r)python code that gets executed

Re: Looking for Job

2007-01-15 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Any one looking for job.. I need someone good at phyton Sorry, you'll only sporadically find people competent with plants here. Regards, Björn -- BOFH excuse #83: Support staff hung over, send aspirin and come back LATER. -- http://mail.python.org/mailman/listin

Re: Watch log

2007-01-15 Thread Bjoern Schliessmann
Salvatore Di Fazio wrote: > I would like wait until a new line will be write in the file. > > Something like the "watch cat Log" command on Linux os. Why not read the file continuously and only do something if a new line is complete (i. e. a newline char is detected)? > How can I check the eof

Re: Mounting shares with python

2007-01-26 Thread Bjoern Schliessmann
Marcpp wrote: > Hi, when i mount a share with python... > > os.system ("mount -t smbfs -o username=nobody ...") > > the problem is that I'll to be root. Consider modifying /etc/fstab. > Have a comand to send a root password...? > I've tried > > os.system ("su") > os.system ("the password") >

Re: Count nb call of a function, without global var or decorator

2007-02-05 Thread Bjoern Schliessmann
Méta-MCI wrote: > Example, with meta-data (attributs of function) : Apart from asking what counting "nb call" of a function means, I wonder why you didn't use an iterator? > @-salutations @-less Regards, Björn -- BOFH excuse #65: system needs to be rebooted -- http://mail.python.org/mail

Re: Calling J from Python

2007-02-05 Thread Bjoern Schliessmann
Gosi wrote: > J is in many ways similar to Python. The only one I see at the moment is that they're both some kind of programming languages. > J has very many advanced operations. Sure. Mh, just looking at some "advanced" J source taken from wikipedia.org makes me feel sick: | Here's a J prog

Re: Count nb call of a function, without global var or decorator

2007-02-05 Thread Bjoern Schliessmann
Méta-MCI wrote: > If the iterator is extern (to the function), it's like decorator, > or global var. Please excuse me, I don't understand your point. I'm not even sure if both of us speak of the same iterators. > If it is internal, it's huge, compare to this.count=this.count+1 > (or this.count

Re: Calling J from Python

2007-02-05 Thread Bjoern Schliessmann
Alexander Schmolck wrote: > Apart from being less to type Cool. Less to type. > and it is superior in that it's > generalizes much better, e.g: > > avg&.^. NB. geomtric mean > avg&.%NB. harmonic mean > avg M NB. column mean of matrix M > avg"1 M NB. row mean of matrix M Is there

Re: help on packet format for tcp/ip programming

2007-02-07 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I want a specific packet format for packet exchange between a > client server across the network. For example frame format > as a python class could be: > class Frame: > def __init__(self, buffer=None, count=0, offset=0): > self.buffer = buffer >

Re: multithreading concept

2007-02-07 Thread Bjoern Schliessmann
S.Mohideen wrote: > There is a dictionary on which I store/read data values. I want to > seperate the send and recv functionality on two different > processes so that the parallel execution becomes fast. What makes you think that'll be faster? Remember: - If you have one CPU, there is no paralle

Re: Newbie Question

2007-02-10 Thread Bjoern Schliessmann
John wrote: > Visual Basic is also good. For what -- headache? 8) Regards, Björn -- BOFH excuse #62: need to wrap system in aluminum foil to fix problem -- http://mail.python.org/mailman/listinfo/python-list

Re: multithreading concept

2007-02-10 Thread Bjoern Schliessmann
Carl J. Van Arsdall wrote: > Not necessarily, if he's on a full duplex ethernet connection, > then there is some parallelity he can take advantage of. He has > upstream and downstream. Partly agreed. There is one bus to the network device, and CPU should be very much faster than the network devi

Re: Newbie Question

2007-02-12 Thread Bjoern Schliessmann
Stef Mientki wrote: > - in Delphi the GUI design itself is done in a graphical > environment, making it much easier and faster RAD possible with Python, too. > - auto-scaling of components on a form is very easy (so if the > user changes form size ..) Just to name one library, wxPython can do

Re: swf format verification?

2007-02-14 Thread Bjoern Schliessmann
akonsu wrote: > hello, can someone recommend a good library to verify whether a > file is in swf format (and ideally flv as well)? i need it to > enable file uploading on to my web site. Look how GNU "file" does it: #--

Re: why I don't like range/xrange

2007-02-16 Thread Bjoern Schliessmann
stdazi wrote: > Many times I was suggested to use xrange and range instead of the > while constructs, and indeed, they are quite more elegant - but, > after calculating the overhead (and losen flexibility) when > working with range/xrange, and while loops, you get to the > conclusion that it isn't

Re: Any Idea about thread safe issue with python

2007-02-16 Thread Bjoern Schliessmann
mralokkp wrote: > I need help guys. I have a code running properly and execute again > after a certain time. > In Simple words [incomplete and useless code line] is not solving > my purpose. Would any body like to help. Please be so kind and read this paragraph: http://www.catb.org/~esr/faqs/sm

Re: Approaches of interprocess communication

2007-02-16 Thread Bjoern Schliessmann
exhuma.twn wrote: > * Sockets >Advantage: Supported per se in nearly every programming >language without even the need to install additional packages >Disadvantage: Lot's of code to write, Who's Lot? :) No, seriously. Why would you think that it's much to write? It can, especially us

Re: why I don't like range/xrange

2007-02-16 Thread Bjoern Schliessmann
Eduardo "EdCrypt" O. Padoan wrote: >> But this long int => int issue should not exist in a future >> python version any more, IIRC int and long int is scheduled to be >> merged somehow. (Or isn't it?) > > It is done. Thanks for the info. Please don't send mail copies! Regards, Björn -- BOF

Re: Help Required for Choosing Programming Language

2007-02-16 Thread Bjoern Schliessmann
Stef Mientki wrote: > Although the GUI of Python is not as good as VB, What is the GUI of a language? Regards, Björn -- BOFH excuse #334: 50% of the manual is in .pdf readme files -- http://mail.python.org/mailman/listinfo/python-list

Re: cmd all commands method?

2007-02-17 Thread Bjoern Schliessmann
placid wrote: > if i want to treat every cmdloop prompt entry as a potential > command then i need to overwrite the default() method ? Excuse me, what's a cmdloop prompt? What's the "default() method"? > What i want to achieve is to be able to support global variable > creation for example; >

Re: Help Required for Choosing Programming Language

2007-02-18 Thread Bjoern Schliessmann
Stef Mientki wrote: > Some examples: > - Creating a treeview (like in the M$ explorer), with full edit > capabilities and full drag & drop facilities: Delphi takes about > 40 lines of code (most of them even ^C ^V). - Creating a graphical > overview of relations between database tables, which can

Re: function & class

2007-02-18 Thread Bjoern Schliessmann
jupiter wrote: > My problem is I want to use threading You're right. Why do you think you want to use (multi-)threading? > and I might need to pass values between function and classes. I am > not sure how this can be done. I have read about classes and I > know they are like function however do

Re: Declare a variable global

2007-02-19 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I have the following code: > > colorIndex = 0; > > def test(): > print colorIndex; Don't use ";". It's redundant. > This won't work. But it works if i do this: > > colorIndex = 0; > > def test(): > global colorIndex; > print colorIndex; > > My qu

Re: function & class

2007-02-19 Thread Bjoern Schliessmann
jupiter wrote: > I am getting this error when I am using sql command within > class.function accessing from another class > > how can I create seperate instance for sqlite objects ??? Trying to help you gets boring. I suggest reading the material that's being offered. Regards, Björn --

Re: how can I create/set a 'file' reference in a attribute of a class

2007-02-26 Thread Bjoern Schliessmann
ken wrote: > Hi, > i have a class: > > class LogHandler(ContentHandler): > # a reference to a file open by some other function/class > outputFile; What do you intend to achieve with this last line, and what's the ';' for? > First, I get an error saying 'NameError: global name 'outputFil

Re: Lists: Converting Double to Single

2007-02-26 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I end up with a single list, but with two brackets on each end, > for example, [[3.5, 4.5, 5.5, 6.5, 7.5]]. > > Unfortunately, when I try to use that last list in a NumPy > function, I'm > told that it cannot be broadcast to the correct shape. So, what I > want to d

Re: book for a starter

2007-02-27 Thread Bjoern Schliessmann
Wensui Liu wrote: > I just start learning python and have a question regarding books > for a newbie like me. http://wiki.python.org/moin/IntroductoryBooks > If you are only allowed to buy 1 python book, which one will you > pick? ^_^. I'd pick a reference. YMMV. Regards, Björn (having been a

Re: import parent

2007-02-27 Thread Bjoern Schliessmann
Greg Hoover wrote: > How does one get access to the class that imported a module. For > example: foo imports bar -- how does bar access foo? Directly? Not at all in sane programs, IMHO. That's the job of clear interfaces. Regards, Björn -- BOFH excuse #407: Route flapping at the NAP. --

Re: threading a thread

2007-02-27 Thread Bjoern Schliessmann
tubby wrote: > Right now I'm just prototyping and the threaded hosts portion > works very well for my needs. I'd just like to add a threaded > ports check and wanted to know if anyone had done something > similar in Python. Taken the vast amount of threads you'll need, there will be a big overhead

Re: how to convert an integer to a float?

2007-02-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > def compareValue(n1, n2): > i1 = int(n1) > i2 = int(n2) > > dx = abs(i2 - i1)/min(i2, i1) > print dx > return dx < 0.05 You could also prepend from __future__ import division Regards, Björn -- BOFH excuse #237: Plate voltage too low on demod

Re: threading a thread

2007-02-27 Thread Bjoern Schliessmann
tubby wrote: > Have you tried it? Nmap is sequential. RTFM? | NMAP(1)Nmap Reference GuideNMAP(1) | [...] | TIMING AND PERFORMANCE | [...] While Nmap utilizes parallelism and many advanced | algorithms to accelerate these scans, the user has ultimate |

Re: using telnetlib

2007-02-28 Thread Bjoern Schliessmann
Phoe6 wrote: import telnetlib tn = telnetlib.Telnet("172.31.128.244") tn.read_until("Login: ") > '\r\nLogin: ' tn.write("root\n:") ^^^ With telnet, use "\r\n" for line breaks at *all* times to be on the safe side. Also, what's the ":" at the end for? Regards

Re: using telnetlib

2007-02-28 Thread Bjoern Schliessmann
Phoe6 wrote: > That did help and solved my problem. ":" after \n was just a typo. Thanks for feedback :) I've had a similar problem once, too. Regards, Björn -- BOFH excuse #166: /pub/lunch -- http://mail.python.org/mailman/listinfo/python-list

Re: class declaration shortcut

2007-02-28 Thread Bjoern Schliessmann
Luis M. González wrote: > I've come across a code snippet in www.rubyclr.com where they show > how easy it is to declare a class compared to equivalent code in > c#. I wonder if there is any way to emulate this in Python. > > The code is as follows: > > Person = struct.new( :name, :birthday, :ch

Re: text wrapping help

2007-02-28 Thread Bjoern Schliessmann
Ryan K wrote: > It doesn't even run but when I go through it interactively it > seems okay. Once again, any help is appreciated. I haven't tested yet, but why don't you make a list of words of the text (with split), and then accumulate words in a list until the next word would make the line too l

Re: Extract String From Enclosing Tuple

2007-02-28 Thread Bjoern Schliessmann
Ben Finney wrote: > A tuple implies a meaning associated with each position in the > sequence (like a record with a positional meaning for each field), > a list implies the opposite (a sequence with order but not meaning > associated with each position). Explain. I know tuples as immutable lists

Re: class declaration shortcut

2007-02-28 Thread Bjoern Schliessmann
Bruno Desthuilliers wrote: > class Toto(object): > pass > > print Toto.__name__ Okay, I revoke my statement and assert the opposite. But what's it (__name__) good for? Regards, Björn -- BOFH excuse #179: multicasts on broken packets -- http://mail.python.org/mailman/listinfo/python

Re: How to update DNS record

2007-03-01 Thread Bjoern Schliessmann
Andi Clemens wrote: > I want to change the A-Record for some IPs, this shouldn't be too > hard. I looked at dnspython and twisted, but I really don't have a > clue how to do this. > Has anyone done this before? Read RFC 2136 (Dynamic updates in the DNS) and see if your server can be configured to

Re: Tuples vs Lists: Semantic difference

2007-03-01 Thread Bjoern Schliessmann
Ben Finney wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> >> Explain. > > Well, since you ask so politely :-) I admit, sometimes I'm a little short-spoken ;) >> I know tuples as immutable lists ... > > That's a common misconception. > [...]

Re: class declaration shortcut

2007-03-01 Thread Bjoern Schliessmann
Michele Simionato wrote: > On Mar 1, 9:40 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> >> In <[EMAIL PROTECTED]>, Bjoern Schliessmann >>> But what's it (__name__) good for? >> >> As objects don't know to which name they are bound,

Re: How to update DNS record

2007-03-01 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > It worked before with a perl script, but now I'm using django for > all our web services so I want to implement this update function > in Python as well. > I don't know how to do this in Python, right now I'm trying it > with twisted, but I don't what to do exactly. It w

Re: How to update DNS record

2007-03-01 Thread Bjoern Schliessmann
Andi Clemens wrote: > It's working!!! > Yeah! > I don't know why I didn't get this the first time I tried > dnspython, but now its working! And it's so easy, 3 lines of code: Great, thanks for reporting back. Regards, Björn -- BOFH excuse #310: asynchronous inode failure -- http://mail.py

Re: python newbie

2007-11-02 Thread Bjoern Schliessmann
Duncan Booth wrote: > Why not try it out for yourself (both of you). Globals do not need > to be defined in the global scope so long as the first 'access' is > to bind a value to the variable: Well, I did. I (mis)understood the OP to mean "read" by "access". I didn't consider rebinding another obj

Re: python newbie

2007-11-02 Thread Bjoern Schliessmann
Bruno Desthuilliers wrote: > Bjoern Schliessmann a écrit : >> You can't just declare in Python, you always define objects (and >> bind a name to them). > > def toto(): >global p >p = 42 > > Here I declared 'x' as global without defining

Re: python newbie

2007-11-02 Thread Bjoern Schliessmann
Jim Hendricks wrote: > This sounds like an issue of terminology. I understand that I > don't declare variables like I would in C or Java, but that they > are implicitly declared via the first assignment. I think yes, it's an issue of terminology. As mentioned I used the terms I know from C/C++,

Re: Can local function access local variables in main program?

2007-11-03 Thread Bjoern Schliessmann
Sullivan WxPyQtKinter wrote: > UnboundLocalError: local variable 'x' referenced before assignment For your reference: http://groups.google.de/groups?q=group:comp.lang.python+UnboundLocalError Regards, Björn -- BOFH excuse #12: dry joints on cable plug -- http://mail.python.org/mailman/l

Re: __file__ vs __FILE__

2007-11-03 Thread Bjoern Schliessmann
Jeff McNeil wrote: > I've used the 'os.path.realpath(os.path.pardir)' construct in a > couple of scripts myself. In Windows? Using Linux, this gives me "..". I use os.path.dirname(os.path.abspath(__file__)) > That ought to work within the interactive interpreter. Why do you also enter that cod

Re: python newbie

2007-11-03 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: > So what's the difference ? Why can't bar be called a method > of foo, or is it merely a convention that classes have > methods and modules have functions? In depends on which terminology you use. As Steven told, Python methods are special functions. In contrast, the t

Re: py2exe (or other exe builder) on Vista system for Vista/XP install targets.

2007-11-03 Thread Bjoern Schliessmann
Michael wrote: > Björn, what library files end up being in your dist directory for > that project? Would you mind posting a copy of the output of dir? Okay, sorry for the delay. Here the output of py2exe is, for directory contents see below. | The following modules appear to be missing | ['FCNT

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-03 Thread Bjoern Schliessmann
Grant Edwards wrote: > Yes, it's "modern" enough to run Linux/X11 -- horsepower-wise > it's sort of in the PDA class of devices. wxWidgets has been > tried, but it's pretty sluggish. Hence the search for something > a littler lighter weight. Erm, wxWidgets is implemented in C++ and wxPython is j

Re: Can local function access local variables in main program?

2007-11-03 Thread Bjoern Schliessmann
Pawel wrote: > Is there any way to disable global for x? Something like that: x = 12345 def foo(): > ... global x > ... print x > ... noglobal(x) # ??? > ... x = 0# now this is local x Not really. Why don't you choose meaningful variable names? You practically sa

Re: __file__ vs __FILE__

2007-11-03 Thread Bjoern Schliessmann
klenwell wrote: > Bjoern Schliessmann wrote: >> I use os.path.dirname(os.path.abspath(__file__)) > > That makes sense, as it is almost a literal translation of what > I'm used to using in PHP. Thanks for pointing this out. You're welcome, happy coding :) Regards,

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-04 Thread Bjoern Schliessmann
Grant Edwards wrote: > On 2007-11-04, Bjoern Schliessmann >> Erm, wxWidgets is implemented in C++ > > Are you saying C++ software can't be large and slow? No, but wxWidgets is quite mature and my experience is that it's faster than Qt (partly, I think, because it alway

Re: how to figure out if python was used as a cgi script

2007-11-15 Thread Bjoern Schliessmann
ce wrote: > is there a way to figure out which scripting language was used in > a cgi. I used to watch extensions (i.e. py, pl, asp or php) I'd say that ASP and PHP are rather rarely used for CGI scripts. Also, extensions are essentially meaningless. > nowadays i hardly see any extensions and re

Re: Resolving declaring class of a method at runtime

2007-11-15 Thread Bjoern Schliessmann
Janne Härkönen wrote: class X: > ... def x(self): > ...pass > ... class Y(X): > ... def y(self): > ...pass > ... y = Y() y.x.im_class > y.y.im_class > > > What I would like to find out is the declaring class of method x, > ie. class X How to do this ? The g

Re: Interfaces.

2007-11-17 Thread Bjoern Schliessmann
Benjamin wrote: > Python is has duck typing. "If it quacks like a duke, it's duck." How do dukes quack, exactly? :) Regards, Björn -- BOFH excuse #290: The CPU has shifted, and become decentralized. -- http://mail.python.org/mailman/listinfo/python-list

Re: Interfaces.

2007-11-17 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I would argue that interfaces/(similar feature) are necessary in > any modern language I wouldn't, but have a look at the Zope interfaces module. It seems to work similar to Java's interfaces. Regards, Björn -- BOFH excuse #104: backup tape overwritten with copy of

Re: Web update library in python?

2007-11-20 Thread Bjoern Schliessmann
Jorgen Bodde wrote: > There are two roles: > > Repository maintainer: > - > - Developer of the 'repository' creates a snapshot > - This archive is uploaded on his private site > - A file that accompanies the archive containing the list of > updates is sent last > > Repository updater: > -

Re: Web update library in python?

2007-11-20 Thread Bjoern Schliessmann
Jorgen Bodde wrote: > As for subversion, this is not possible as I want to provide > people wihtout the ability to have a subversion server but only a > plain web site, What's a "plain web site"? Could mod_python be on it? > to download a file that can upgrade a local work copy. As others men

Re: png transparency with PIL

2007-11-23 Thread Bjoern Schliessmann
Robin Becker wrote: > I'm trying to determine the transparency information for a png > image. With gif images I can determine the colour that is used for > transparent areas using im.info['transparency']. For the png > images of interest there is no such entry in the info dict. I > assume that's b

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-24 Thread Bjoern Schliessmann
Licheng Fang wrote: > I mean, all the class instances that equal to each other should be > reduced into only one instance, which means for instances of this > class there's no difference between a is b and a==b. If you only want that if "a == b" is True also "a is b" is True, overload the is_ attr

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-24 Thread Bjoern Schliessmann
Licheng Fang wrote: > I find myself frequently in need of classes like this for two > reasons. First, it's efficient in memory. Are you using millions of objects, or MB size objects? Otherwise, this is no argument. BTW, what happens if you, by some operation, make a == b, and afterwards change b

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-24 Thread Bjoern Schliessmann
Licheng Fang wrote: > On Nov 24, 7:05 pm, Bjoern Schliessmann > BTW, what happens if you, by some operation, make a == b, and >> afterwards change b so another object instance must be created? >> This instance management is quite a runtime overhead. > > I probably need th

Re: How can I create customized classes that have similar properties as 'str'?

2007-11-24 Thread Bjoern Schliessmann
Steven D'Aprano wrote: > No advantage? That's for sure. There is no is_ attribute of > generic classes, and even if there was, it would have no special > meaning. Argl, I confused the operator module's attributes with objects ;) Regards, Björn -- BOFH excuse #378: Operators killed by year

Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Bjoern Schliessmann
Alexander Tuchacek wrote: > i try to adress an qt object > > self.statusbar.showMessage("rtt %s" % (n.rtt)) > > in an callback function, comming from a shared lib importet by > ctypes, on osx this works wonderfull > > when i run the same code on linux (ubuntu gutsy), i get this core > dump,

Re: How to Teach Python "Variables"

2007-11-25 Thread Bjoern Schliessmann
Aurélien Campéas wrote: > I mean : aren't C variables also bindings from names to objects ? No, C variables are aliases for memory addresses. Regards, Björn -- BOFH excuse #390: Increased sunspot activity. -- http://mail.python.org/mailman/listinfo/python-list

Re: read/write to java socket in python

2007-11-27 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I have a problem with reading from a Java server after I have > written to it - it just hangs. It works fine if I just write to > the server and not try to write. Excuse me? > I have read the HOWTO on sockets - and it states that there is a > problem (something about f

Re: Control mouse position and clicking

2007-11-28 Thread Bjoern Schliessmann
Glich wrote: > hi, how can I, control mouse position and clicking from python? > > I want to interact with a flash application inside firefox. > thanks. > > ps: I am not using windows. On Mac, IIRC, you can't. Regards, Björn -- BOFH excuse #394: Jupiter is aligned with Mars. -- http://ma

Re: Science list

2007-11-29 Thread Bjoern Schliessmann
Francesco Pietra wrote: > Nonetheless, this extremely useful list is so crowded that if > checking email is not carried out every few hours, it is difficult > to detect other messages in the plethora of pythons and spams > arrived. Why don't you use a newsreader to access comp.lang.python? It's s

Re: Control mouse position and clicking

2007-11-29 Thread Bjoern Schliessmann
Tony wrote: [place mouse programmatically] > well, you can do it from Java, Are you absolutely positive? IIRC the Mac UI guidelines forbid such things, and there's no API function for it; so Java wouldn't have any chance. Regards, Björn -- BOFH excuse #136: Daemons loose in system. -- htt

Re: Control mouse position and clicking

2007-11-29 Thread Bjoern Schliessmann
Glich wrote: > I am running ubuntu. :) I neither asserted differently nor am I competent in clairvoyance. Regards, Björn -- BOFH excuse #93: Feature not yet implemented -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Split a String

2007-11-29 Thread Bjoern Schliessmann
Siah wrote: > I need to convert the string: '(a, b, "c", d, "e")' into the > following list ['a', 'b', 'c', 'd', 'e']. Much like a csv reader > does. I usually use the split function, but this mini-monster > wouldn't properly get split up due to those random quotations > postgresql returns to me.

Re: Control mouse position and clicking

2007-11-29 Thread Bjoern Schliessmann
Robert Kern wrote: > There is an API for it. Not all programs have GUIs so the HIG > doesn't restrict the scope of the OS's APIs. Ah, okay. In (IIRC) wxPython docs, I read differently. Regards, Björn -- BOFH excuse #40: not enough memory, go get system upgrade -- http://mail.python.org/m

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > First, python also means snake, Monty Python. If we search > "python" in google, emule, many results are not programming > resource. If we search PHP, all results are programming resource. Who cares? No one looking for special Python programming tips will use only "pytho

Re: How to Split a String

2007-11-30 Thread Bjoern Schliessmann
Siah wrote: > The basic split/strip method wouldn't split '(a, b, "c,...", d)', > which is why I chose not to use it. Could you please explain which part of my example doesn't work? split takes arguments which enables it to split your string as desired. > The csv solution seems to work well, th

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Bjoern Schliessmann
Russ P. wrote: > I agree that Python is not a good name for a programming language, Why not? BTW, is "Windows" a great name for an operating system? > If I had invented Python, I would have called it Newton or Euler, > arguably the greatest scientist and mathematician ever, > respectively. The

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > New name "Pytn" may be better, do you think so ? No. How would you pronounce it? Pai-tn? Why don't you create a fork where the only difference is the name? Regards, Björn -- BOFH excuse #194: We only support a 1200 bps connection. -- http://mail.python.org/mailm

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Bjoern Schliessmann
Dotan Cohen wrote: > C was named after the B programming language, as it was inspired > and meant to replace it. C++ is obviously C+1 Strictly speaking, C++ evalutes to C, but C is incremented afterwards. Regards, Björn -- BOFH excuse #307: emissions from GSM-phones -- http://mail.python.o

Re: How to read strings cantaining escape character from a file and use it as escape sequences?

2007-12-01 Thread Bjoern Schliessmann
John Machin wrote: > Amazing what you can find in obscure corners of the obscure docs! > BTW, how many folks know what "bijective" means ? Everyone that can read and is smart enough to enter "bijective" into Wikipedia search. Regards, Björn -- BOFH excuse #25: Decreasing electron flux --

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Bjoern Schliessmann
Tóth Csaba wrote: > Lets evaluate from the Python3000: Newton3 (N3). > > +1 vote from me :) Nah. BTW, why exactly do you keep using an X-Face header completely identical to mine? Regards, Björn -- BOFH excuse #364: Sand fleas eating the Internet cables -- http://mail.python.org/mailman/

Re: "Python" is not a good name, should rename to "Athon"

2007-12-02 Thread Bjoern Schliessmann
Russ P. wrote: > Python is an "acceptable" name, but Newton1 (or Newton3) would be > a great name. Nah, I like Monty and Snakes. Newton already has his name as unit for kg*m/s^2. :) Regards, Björn -- BOFH excuse #74: You're out of memory -- http://mail.python.org/mailman/listinfo/python-l

Re: takes no arguments (1 given)

2007-12-03 Thread Bjoern Schliessmann
Tommy Grav wrote: > The class method needs a self argument so that > disp.fill_canvas() can parse the class instance disp > to the method. It's an instance method, no class method. Regards, Björn -- BOFH excuse #88: Boss' kid fucked up the machine -- http://mail.python.org/mailman/listinf

Re: "Python" is not a good name, should rename to "Athon"

2007-12-04 Thread Bjoern Schliessmann
Marc 'BlackJack' Rintsch wrote: > On Tue, 04 Dec 2007 08:31:55 +0100, Zara wrote: >> He meant quetzatcoatl. We could rename the language. > > That name is already taken in the programming language domain. > There's a Tiny C compiler for 6510 based targets: Uh, why don't take one of his aliases?

Re: "Python" is not a good name, should rename to "Athon"

2007-12-05 Thread Bjoern Schliessmann
Piet van Oostrum wrote: > "Adrian Cherry" <[EMAIL PROTECTED]> (AC) wrote: >> For that matter C# is no better, I thought that # was >> pronounced hash, I still refer to C# as C-hash. > > Are you musically illiterate? I wonder what Cb (C-flat) would be. Ada? :) Regards, Björn -- BOFH excuse #

Re: "Python" is not a good name, should rename to "Athon"

2007-12-05 Thread Bjoern Schliessmann
Dennis Lee Bieber wrote: > I wouldn't be that harsh... Though I've never heard # as "hash"... Python programmer and never heard of the hashbang? :) Also see: http://en.wikipedia.org/wiki/Number_sign Regards, Björn -- BOFH excuse #170: popper unable to process jumbo kernel -- http://mail.

Re: I'm missing something here with range vs. xrange

2007-12-06 Thread Bjoern Schliessmann
Joe Goldthwaite wrote: > I read that the range function builds a list and that xrange > returns an iterator and is therefore more efficient. This is generally not true. > In my testing, they both come out to almost exactly the same > performance wise. Did something get changed in Python 2.4 to

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: > I have a binary file containing 3 byte float values (big endian). > How can I read them into python? The struct module does not work, > since it expects 4 byte floats. Since the module crystalball is still in development, you'll have to analyze your three byte float forma

Re: how to convert 3 byte to float

2007-12-08 Thread Bjoern Schliessmann
Mario M. Mueller wrote: > It's output of a digitizer (but not that old). I was also > wondering about the reason for this limitation (maybe the design > is ~20 years old). Uh, that's weird. Since Python cannot guess its format, you'll have to try it out. Why don't you try to let the device output

Re: TCP reset caused by socket.py

2007-12-12 Thread Bjoern Schliessmann
Gabriel Genellina wrote: > A RST when you close a socket is OK. Says who? MS? ;) Regards, Björn -- BOFH excuse #328: Fiber optics caused gas main leak -- http://mail.python.org/mailman/listinfo/python-list

Re: TCP reset caused by socket.py

2007-12-12 Thread Bjoern Schliessmann
Object01 wrote: > The server is multithreaded, handling each request on its own > thread. Ugh. > But is a RST really a part of a valid close operation? Depends on the state of the parties :) The proper way to close non-defunct connections is using FIN segments. > It was my understanding that

Re: Tuples !?!?

2007-12-12 Thread Bjoern Schliessmann
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : >> The problem is '2' != 2 > > It would indeed be a problem if this expression eval'd to True. > That's the case in some, hem, 'languages', and believe me it's > *not* the RightThing. What kind of "hem" language is this? :) >>> '2' != 2 T

Re: TCP reset caused by socket.py

2007-12-12 Thread Bjoern Schliessmann
Object01 wrote: > Is there something I can look for in the packet traffic that would > indicate one party is misbehaving? The sequence numbers seem ok. > *shrug* I'd expect to see data sent from server to client and > then see a sequence of packets that close the connection > gracefully. Instead

Re: problem in reading indices

2007-12-13 Thread Bjoern Schliessmann
Xavier Barthelemy wrote: > so when I call another array with these indices > ArrayWithData[i,int(choice[i].current[0])] You don't "call" "arrays" "with indices". You are indexing the list ArrayWithData using the index "i,int(blah)" which is invalid. Indices must be integers, not comma seperated v

Re: Python import search path!

2007-12-14 Thread Bjoern Schliessmann
SMALLp wrote: > remember worked file when i wrote eg. import myFile but now in > Ubuntu it says Module not found. (I'm using Ubuntu and I've > installed python 2.5 and wxPython 2.8.4, and I'm using GedIt as my > favorite text editor). The question is how to make this work > (files are in the same

<    1   2   3   4   5   6   >