Re: Set an environment variable

2005-10-21 Thread Sybren Stuvel
Mike Meyer enlightened us with: It's simpler to use eval and command substitution: eval $(python myScript.py) This looks like the best solution to me. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take

Re: p2exe using wine/cxoffice

2005-10-26 Thread Sybren Stuvel
Jon Perez enlightened us with: Actually, I think it's many unix/linux users who are ignorant of just how nice, stable and productive Windows can be as a desktop environment. I thought the same thing after spending two hours removing some adware I found. Ever since Win2K got rid of the

Re: p2exe using wine/cxoffice

2005-10-26 Thread Sybren Stuvel
Tim Golden enlightened us with: Well, I'm with you. I'm sure a lot of people will chime in to point out just how flexible and useful and productive Linux is as a workstation, but every time I try to use it -- and I make an honest effort -- I end up back in Windows I'm curious, what do you

Re: assignment to reference

2005-10-26 Thread Sybren Stuvel
Loris Caren enlightened us with: If a = 'apple' b = 'banana' c = 'cabbage' How can I get something like:- for i in 'abc': r = eval(i) if r == 'cabbage': r = 'coconut' actually change the object referenced by r rather than creating a new object temporarily referenced by

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Sybren Stuvel
Tim Golden enlightened us with: Not quite fair. Not only would I avoid saying something with a redundant apostrophe ;) but the Windows user interface, at least for my purposes, didn't change such a huge amount between Win9x and Win2K, Hence my reference to windows 3.1. It's obvious that

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Sybren Stuvel
Tim Golden enlightened us with: But as far as I can tell from my experience and from the docs -- and I'm not near a Linux box at the mo -- having used ctrl-r to recall line x in the history, you can't just down-arrow to recall x+1, x+2 etc. Or can you? With bash as well as the Python

Re: How do I access the property info in this example ?

2005-10-26 Thread Sybren Stuvel
David Poundall enlightened us with: class C(object): def getx(self): return self.__x def setx(self, value): self.__x = value def delx(self): del self.__x x = property(getx, setx, delx, I'm the 'x' property.) I would like to get at ... I'm the 'x' property. As usual:

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Sybren Stuvel
Tim Golden enlightened us with: Well yes. I think the (only slightly) wider point I was making was that -- despite goodwill and several attempts on my part -- Linux still has not overpowered me with its usefulness. I have yet to see any OS that overpowers me with its usefulness. Extending

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Sybren Stuvel
Tim Golden enlightened us with: Well, fair enough. Although I don't think that on its own this constitutes rubbish. True - it's just one of the reasons that shift its status toward rubishness ;-) Not quite sure what this means. As in ANSI support? (Perfectly true - definitely lacking there).

Re: Windows vs Linux

2005-10-26 Thread Sybren Stuvel
Tim G enlightened us with: Sadly, this seems not to be the case on my Ubuntu Breezy: bash 3.00.16, libreadline 4.3/5.0 (not sure which one bash is using). ctrl-r is fine; but you can't down-arrow from there; it just beeps at you. Is there some setting I'm missing? See my other post in this

Re: assignment to reference

2005-10-27 Thread Sybren Stuvel
Bruno Desthuilliers enlightened us with: for obj in (a, b, c): if obj == 'cabbage': obj = 'coconut' Doesn't work on my Python: Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type help, copyright, credits or license for

Re: OpenSSL in Python

2005-10-28 Thread Sybren Stuvel
dcrespo enlightened us with: I've been looking for OpenSSL for python. I found pyOpenSSL, but it requires the OpenSSL library, which I only found on http://www.openssl.org/, but don't know how to install. Ehm... wouldn't your question then not be more appropriate on the OpenSSL

Re: Why the nonsense number appears?

2005-10-31 Thread Sybren Stuvel
Johnny Lee enlightened us with: Why are there so many nonsense tails? thanks for your help. Because if the same reason you can't write 1/3 in decimal: http://docs.python.org/tut/node16.html Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Why the nonsense number appears?

2005-10-31 Thread Sybren Stuvel
Ben O'Steen enlightened us with: I think that the previous poster was asking something different. It all boils down to floating point inprecision. If t1 = 0.500 t2 = 0.461 print t1-t2 0.039 Then why: t1 += 12345678910 t2 += 12345678910 # Note, both t1 and t2 have been incremented by

Re: Windows - Need to process quotes in string...

2005-10-31 Thread Sybren Stuvel
Ernesto enlightened us with: I'm trying to use a $ delimeter Why? I want to send the string parameter: enable @USB\VID_0403PID_6010MI_00\715E4F681 launchWithoutConsole(devcon.exe 'enable @USB\VID_0403PID_6010MI_00\715E4F681') Or, if you should also be able to send single

Re: Expanding Python as a macro language

2005-10-31 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I know, but nowadays almost any relevant application has a GUI. I can't think of any relevant server application running on Linux that has a GUI. My text processor, email client, Usenet client, IRC client, address book and agenda are all without GUI too.

Re: OpenSSL in Python

2005-11-01 Thread Sybren Stuvel
dcrespo enlightened us with: First, is the PYTHON OpenSSL C wrapper what I need to get running. I think that first you have to get OpenSSL running. Only then can you think about wrapping it. Second, if you don't know how to answer, then limit your opinion to yourself. We all enjoy the

Re: OpenSSL in Python

2005-11-01 Thread Sybren Stuvel
dcrespo enlightened us with: Excuse me all of you for the way I answered. Sybren, and all of you, accept my apology. I saw the Sybren's message yersterday late night in a bad moment. Next time, don't visit Usenet in a bad moment. Sybren -- The problem with the world is stupidity. Not saying

python.org offline

2005-11-01 Thread Sybren Stuvel
Hi all, In the past weeks, I often got this message from the python.org webserver: -- Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please

Re: python.org offline

2005-11-01 Thread Sybren Stuvel
dcrespo enlightened us with: The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Yes, I can read. My question is: does anyone know why this happens so often lately? Sybren -- The problem with the world is stupidity. Not saying there

Re: python.org offline

2005-11-01 Thread Sybren Stuvel
Steve Holden enlightened us with: Possibly real maintenance occasioned by a recent move to a new server, in preparation for the new-look web site. Makes sense. Thanks for the info! Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: python.org offline

2005-11-01 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Works fine for me, and I check it pretty frequently. Perhaps it's a problem with your ISP's communication with the Python.org ISP? I doubt it, since they are one and the same ;-) Sybren -- The problem with the world is stupidity. Not saying there should

Re: Python's website does a great disservice to the language

2005-11-01 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I strongly agree with you, the web is full of web sites that are nice looking but have microscopic fixed fonts (against the very spirit of Html), are full of useless flash, have lots of html structures nested inside other ones (PHP sites are often like

Re: python.org offline

2005-11-01 Thread Sybren Stuvel
A.M. Kuchling enlightened us with: I suspect this is teething problems related to the move to a new server. I've bumped up the number of Apache processes, so we'll see if that alleviates the problem. Thanks! I hope it helps! Sybren -- The problem with the world is stupidity. Not saying

Re: how to write a blog system with Python

2005-11-03 Thread Sybren Stuvel
ice enlightened us with: I am a fresh here , and I have no idea of it. Do you have any comments? Look up turbogears and watch the 20 minute Wiki video tutorial. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we

Re: Class Variable Access and Assignment

2005-11-03 Thread Sybren Stuvel
Antoon Pardon enlightened us with: I would expect a result consistent with the fact that both times b.a would refer to the same object. b.a is just a name, not a pointer to a spot in memory. Getting the value associated with that name is something different from assigning a new value to that

Re: Cheapest pocket device to code python on

2005-11-04 Thread Sybren Stuvel
Devan L enlightened us with: I would not recommend trying to code on a handheld device. Small screen size and [usually] small keyboards make it less-than-practical. Stick with a laptop, or write it in a notebook, if you must. Although it isn't the pinnacle of usability, I can program just

Re: I Need Motivation Part 2

2005-11-04 Thread Sybren Stuvel
blahman ([EMAIL PROTECTED]) enlightened us with: i m losing my motivation with python because there are sooo many modules, that i cant just learn them all, this deters from c or c++ in which there are only a limited number of header files. There are over 2800 header files on my system in

Re: help converting some perl code to python

2005-11-04 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: the problem is the '..' operator in perl. Is there any equivalent in python? any suggestions ? I have a suggestion: stop assuming we know perl, and explain what this '..' operator does. Sybren -- The problem with the world is stupidity. Not saying there

Re: I Need Motivation Part 2

2005-11-05 Thread Sybren Stuvel
Dennis Lee Bieber enlightened us with: I show 185 .py files in the top level Python library. That's a close match for the base VC include directory -- and I be willing to bet that site-packages and other add-ins don't add up to another 700 .py files Sorry, bet lost. I have 1891 .py files in

Re: starting an X11 session from Python

2005-11-05 Thread Sybren Stuvel
Philippe C. Martin enlightened us with: Have there been any attempt to do so, and is there any source out there that could help me get started ? What's stopping you from using system(), exec() or the likes to start startx, xinit or simply X? Sybren -- The problem with the world is stupidity.

Re: Python gui

2005-11-06 Thread Sybren Stuvel
Gian Mario Tagliaretti enlightened us with: No, and *I hope* that if another toolkit has to replace Tkinter (will never happen?) will be PyGTK... :) Why do you hope for PyGTK? I think one of the strengths of wxWidgets is that it uses the native platform's look. GTK looks very nice on my Gnome

Re: How to use generators?

2005-11-09 Thread Sybren Stuvel
Ian Vincent enlightened us with: I have never used generators before but I might have now found a use for them. I have written a recursive function to solve a 640x640 maze but it crashes, due to exceeding the stack. The only way around this I can think of is to use Generator but I have no

Re: creating single-instance executables using python/py2exe

2005-11-11 Thread Sybren Stuvel
Satchidanand Haridas enlightened us with: a new instance is created when I double click on two different files. Is there a way in which I can make sure only one instance is created? You could open a listening socket to listen for open file commands. If opening that socket fails (address

Re: about try statement

2005-11-12 Thread Sybren Stuvel
Shi Mu enlightened us with: very hard for me to understand the difference between try...except and try...finally Within a 'try' block, if an exception is called and a matching 'except' block is found, that block will be used to handle the expression. From the documentation of the return

Re: help make it faster please

2005-11-12 Thread Sybren Stuvel
Bengt Richter enlightened us with: I suspect it's not possible to get '' in the list from somestring.split() Time to adjust your suspicions: ';abc;'.split(';') ['', 'abc', ''] countDict[w] += 1 else: countDict[w] = 1 does that beat

Re: help make it faster please

2005-11-13 Thread Sybren Stuvel
Bengt Richter enlightened us with: I meant somestring.split() just like that -- without a splitter argument. My suspicion remains ;-) Mine too ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the

Re: Python on linux

2005-11-18 Thread Sybren Stuvel
John Abel enlightened us with: Here's one I used a while back. Returns a dict containing details per partition This only gives information about actually mounted partitions. It could be improved by checking /proc/partitions as well. Sybren -- The problem with the world is stupidity. Not

Re: about try and exception

2005-11-19 Thread Sybren Stuvel
Bruno Desthuilliers enlightened us with: (Carl's top-post corrrected. Carl, please do not top-post) If you correct people and ask them to alter their posting style, at least make sure you post in a proper way. Snip what you're not directly referring to, so people don't have to scroll in order to

Re: Underscores in Python numbers

2005-11-19 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Of course, also support the locale variant where the meaning of , and . is swapped in most European countries. This is exactly why I wouldn't use that notation. What happens if it is hardcoded into the source? I mean, that's what we're talking about. Then

Re: How to get started in GUI Programming?

2005-11-25 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Googling around it seems the best GUI is either Tkinter or PyGtk. I'd go for wxPython ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of

Re: Persist a class (not an instance)

2005-11-25 Thread Sybren Stuvel
Kent Johnson enlightened us with: Is there a way to persist a class definition (not a class instance, the actual class) so it can be restored later? From the docs: Similarly, classes are pickled by named reference, so the same restrictions in the unpickling environment apply. Note that none of

Re: Persist a class (not an instance)

2005-11-25 Thread Sybren Stuvel
Kent Johnson enlightened us with: OK that confirms that pickle won't work. Is there another approach that will? Well, since the classes are created at runtime as well, you could compile them using the appropriate API and call exec() on them. Sybren -- The problem with the world is stupidity.

Re: Death to tuples!

2005-11-28 Thread Sybren Stuvel
Mike Meyer enlightened us with: Is there any place in the language that still requires tuples instead of sequences, except for use as dictionary keys? Anything that's an immutable sequence of numbers. For instance, a pair of coordinates. Or a value and a weight for that value. If not, then

Re: return in loop for ?

2005-11-28 Thread Sybren Stuvel
Duncan Booth enlightened us with: I would have thought that no matter how elaborate the checking it is guaranteed there exist programs which are correct but your verifier cannot prove that they are. Yep, that's correct. I thought the argument was similar to the proof that no program (read:

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-03 Thread Sybren Stuvel
D H enlightened us with: How is that a problem that some editors use 8 columns for tabs and others use less? So what? I don't care either. I always use tabs, and my code is always readable. Some people suggest one indents with four spaces, and replaces eight spaces of indenting with a tab. Now

Re: Tabs bad (Was: ANN: Dao Language v.0.9.6-beta is release!)

2005-12-04 Thread Sybren Stuvel
Björn Lindström enlightened us with: This article should explain it: http://www.jwz.org/doc/tabs-vs-spaces.html To me it doesn't. I use a single tab character for a single indent levell. That is unambiguous, and also ensures the file is indented as the reader likes it. People who have their

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-04 Thread Sybren Stuvel
Ed Leafe enlightened us with: See, I can make up bizarre scenarios where spaces cause problems, too. You make me glad I'm always using tabs :) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the

Re: Tabs bad (Was: ANN: Dao Language v.0.9.6-beta is release!)

2005-12-05 Thread Sybren Stuvel
Steven D'Aprano enlightened us with: It seems to me that one tab per indent level is far more logical than some arbitrary number, N, of spaces, often a multiple of eight, or four, or two, per indent level, and hope that the number of spaces is a multiple of that arbitrary N. But maybe that's

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread Sybren Stuvel
Richard Brodie enlightened us with: I'm sure some folk can remember local coding styles that suggested using BEGIN and END as macros for curly brackets in C because { and } aren't intuitive. I think that if you sink that low, you shouldn't be programming anyway. Come on, if someone can't even

Re: what's wrong with lambda x : print x/60,x%60

2005-12-05 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: No, it is not merely a shortcut. It often allows one to avoid polluting the namespace with a completely superfluous function name, thus reducing code smell. Which can also be done by using inner functions. It can also avoid a multi-line function

Re: what's wrong with lambda x : print x/60,x%60

2005-12-06 Thread Sybren Stuvel
Fredrik Lundh enlightened us with: def somefunc(x): return x*5 How is that a multi-line function definition? but that's namespace pollution! if you do this, nobody will never ever be able to use the name somefunc again! won't somebody please think about the children! If you use that as an

Re: what's wrong with lambda x : print x/60,x%60

2005-12-06 Thread Sybren Stuvel
Steve Holden enlightened us with: I think you need to turn your irony detector up a little - it looks like hte gain is currently way too low :o) Consider my detector tweaked ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity,

Re: what's wrong with lambda x : print x/60,x%60

2005-12-07 Thread Sybren Stuvel
Steven D'Aprano enlightened us with: All joking aside, when I have names (temporary variables or scaffolding functions) that I need to initialise a module or data structure, but then outlive their usefulness, I del the name afterwards. Am I the only one? I don't do that. I tend to split up my

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-07 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Some people (a lot of the ones that don't give Python a chance) want one more choice, braces. Is that so much to ask for? I say: use #{ and #} instead. If you want to have braces, what's wrong with if condition: #{ some statement other statement

Re: How to ping in Python?

2005-12-07 Thread Sybren Stuvel
Nico Grubert enlightened us with: I just need to ping a machine to see if its answering. What's the best way to do it? To do a real ICMP ping, you need raw sockets, which are turned off on Windows and reserved for root on other systems. You could try to connect to an unused port, and see how

Re: what's wrong with lambda x : print x/60,x%60

2005-12-07 Thread Sybren Stuvel
Steven D'Aprano enlightened us with: Once the lookup table is created, you shouldn't use that function again -- at best it is just sitting around like a third wheel, at worst it might have side-effects you don't want. So I del the function. I'd prefer to check the lookup table, and raise a

Re: unittest and non-.py files

2005-12-07 Thread Sybren Stuvel
Michael Hoffman enlightened us with: Hi. I am trying to use unittest to run a test suite on some scripts that do not have a .py extension. I'd move the functionality of the script into a separate file that does end in .py, and only put the invocation into the .py-less script. Sybren -- The

Re: Dectecting dir changes

2005-12-09 Thread Sybren Stuvel
chuck enlightened us with: The doco indicates to read the source for fcntl.py to lookup the constants representing the different types of events/signals that are avaiable. However fcntl on some platforms seems to be implemented as a binary leaving no way to look up the contants for the

Re: heartbeats

2005-12-09 Thread Sybren Stuvel
Yves Glodt enlightened us with: In detail I need a daemon on my central server which e.g. which in a loop pings (not really ping but you know what I mean) each 20 seconds one of the clients. You probably mean really a ping, just not an ICMP echo request. The only thing the client has to do

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-10 Thread Sybren Stuvel
Zeljko Vrba enlightened us with: Find me an editor which has folds like in VIM, regexp search/replace within two keystrokes (ESC,:), marks to easily navigate text in 2 keystrokes (mx, 'x), can handle indentation-level matching as well as VIM can handle {}()[], etc. And, unlike emacs, respects

Re: Invoking Unix commands from a Python app

2005-12-16 Thread Sybren Stuvel
Rob Cowie enlightened us with: Ok, I know see that os.spawnl() will suffice. However, how do I retrieve the output of the command. Apparently, os.spawnl() didn't suffice. Check out the popen2 module and Popen* classes. Sybren -- The problem with the world is stupidity. Not saying there should

Re: Wingide is a beautiful application

2005-12-17 Thread Sybren Stuvel
vinjvinj enlightened us with: I haven't used an IDE in a long time but gave wing ide a try because I wanted the same development platform on Linux and Windows. I use gvim for that :) - Ability to double click on the project plan and it hides and you double click on it and it becomes visable

Re: Wingide is a beautiful application

2005-12-18 Thread Sybren Stuvel
Claudio Grondi enlightened us with: With [Strg]-[End] I went to the end of the file where I wanted to continue editing, but the syntax highlighting told me there is no code but only a comment. I checked it and found out, that Vim is apparently not able to do proper highlighting when jumping to

Re: Wingide is a beautiful application

2005-12-18 Thread Sybren Stuvel
Claudio Grondi enlightened us with: The file I was editing was just 22 KByte large having 450 lines, so you try here to explain to me, that for speed reasons Vim has to cut it into pieces? Yep. Stani SPE based on Scintilla does it right, UltraEdit does it right, Wing does it right, so what,

Re: Wingide is a beautiful application

2005-12-18 Thread Sybren Stuvel
Sybren Stuvel enlightened us with: SPE is already annoying because of all the new windows it opens... Not a good start. I remember using it before, to check out the Blender integration. Unfortunately, that didn't work. I'll give it another go. I downloaded it, tried to run it, then it stopped

Re: Add to python path in Linux

2005-12-20 Thread Sybren Stuvel
ninhenzo64 enlightened us with: The variable PYTHONPATH doesn't seem to exist. Yet it is the one you should use. It's got the same syntax as the regular PATH variable. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why

Re: Help with python_fold.vim

2005-12-20 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Found an earlier thread that answered my question: Good for you. I often want only one or two levels of indentation at maximum. This ensures not all if/while/for etc. blocks are indented. Most of my python files either contain classes (max indent 2) or

Re: PyHtmlGUI Project is looking for developers

2005-12-26 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: The aim of the project is to create a web application framework. The API of PyHtmlGUI wants to be close to Trolltechs famous Qt API but incooperates the idea of a text based renderengine instead of the pixel based one. The obviouse target is html/css but

Re: PyHtmlGUI Project is looking for developers

2005-12-27 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: the idea of pyhtmlgui is that you can develop a web application the same way like a standard gui application. So what you get is a widget tree (buttons, forms, title bars, etc.) on the server side and a gui on the client side. Ah, okay - it's the other

Re: Spelling mistakes!

2006-01-08 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I'm one of those people who, for better or worse, is a good speller. Words just look right or wrong to me and it bothers me when they look wrong. Same here. I have to use code that has childs instead of children... I also can't stand then vs than

Re: Spelling mistakes!

2006-01-09 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Terry But not faster than use a dict server! Why not just use (e.g.) Terry kdict? Maybe because not everybody has it? Lame excuse. If you don't have something but you do want to use it, you get it. If everybody just used what they had at one point in

Re: Spelling mistakes!

2006-01-09 Thread Sybren Stuvel
Walter S. Leipold enlightened us with: [Gee, I hope their were no spelling misteaks inn that paragraph...] It should be where Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why

Re: string to datetime parser?

2006-01-09 Thread Sybren Stuvel
beza1e1 enlightened us with: Is there a library which can parse strings and output a datetime object? If you're happy with a mx.DateTime object, take a look at its parser. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why

Re: Spelling mistakes!

2006-01-09 Thread Sybren Stuvel
Xavier Morel enlightened us with: 1- The unit test will obviously fail in this case, telling you in which code unit the issue is Given the assumption the same mistake hasn't been made in the test as well. Sybren -- The problem with the world is stupidity. Not saying there should be a capital

Re: how to test for a dependency

2006-01-09 Thread Sybren Stuvel
Darren Dale enlightened us with: I would like to test that latex is installed on a windows, mac or linux machine. What is the best way to do this? This should work: if os.system('latex -v'): print 'please install latex' The downside is that you can only use this to test by executing.

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Sybren Stuvel
Mike Meyer enlightened us with: I think type 'object' has only one value, so that's it. In that case, they should all be equal, right? object() == object() False You compare instances of the type 'object'. They both have one value: object() object object at 0xb7ddb438 object() object

Re: ssl question

2006-01-13 Thread Sybren Stuvel
DarkBlue enlightened us with: I want connect to another linux machine via ssl , after password entry execute : It seems like you've already got something running. Do you really mean SSL? Or do you mean SSH? Sybren -- The problem with the world is stupidity. Not saying there should be a

Re: New Python.org website ?

2006-01-13 Thread Sybren Stuvel
Tim Chase enlightened us with: In both Mozilla-suite (1.7) and FireFox (1.5), the links on the left (the grey-backgrounded all-caps with the at the right) all intrude into the body text. Looks fine here on Firefox 1.5 and Konqueror 3.4.3. The site looks really nice! I think this is going to

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
talin at acm dot org enlightened us with: I'd be sad to see the notion of anonymous functions go Same here. I think it's a beautyful concept, and very powerful. It also allows for dynamic function creation in cases where a name would not be available. What about passing an anonymous function

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
Leif K-Brooks enlightened us with: It also allows for dynamic function creation in cases where a name would not be available. What cases are those? An example: def generate_randomizer(n, m): randomizer = def(x): return x ** n % m return randomizer Sybren -- The problem

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
Paul Rubin enlightened us with: You're a little bit confused; name doesn't necessarily mean persistent name. Wonderful. Another feature added to Python (that is: the Python version in my mind ;-) without the need to add any features to Python (that is: the real Python) Thanks! Sybren -- The

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread Sybren Stuvel
Terry Reedy enlightened us with: Are you claiming that including a reference to the more humanly readable representation of a function (its source code) somehow detracts from the beauty of the function concept? Nope. Or are you claiming that binding a function to a name rather than some

Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
Hi people, I'm creating a program that can solve and create Sudoku puzzles. My creation function needs to make a lot of copies of a puzzle. Until now, I used copy.deepcopy(), but that's too slow. I want to implement such a copying function in C and use that instead. My idea about this is: - Get

Re: Create new instance of Python class in C

2005-09-09 Thread Sybren Stuvel
djw enlightened us with: Personally, I would try Psyco first, and consider Pyrex next. Ok, I'll take a look at those. Are you sure your algorithm can't be optimized first, before you start trying to write this in C? I'm sure there will be optimizations, but profiling showed that the copying

Re: Create new instance of Python class in C

2005-09-10 Thread Sybren Stuvel
phil hunt enlightened us with: Why do you need to maske lots of copies? The puzzles are stored in a NxN list of strings. The strings contain all the numerals that that block can contain. So a 9x9 puzzle contains 81 strings 123456789 when it's empty. My creation function picks a block that isn't

Re: Python for ARM7?

2005-09-13 Thread Sybren Stuvel
Ken Seehart enlightened us with: Hello. Where might I find python binaries for ARM7 (Linux 2.4)? Check http://www.vanille.de/projects/python.spy If I absolutely have to build my own python, I would probably use a cygwin (or maybe linux) cross-compiler for ARM7, but that seems like a

Re: Python for ARM7?

2005-09-13 Thread Sybren Stuvel
Ken Seehart enlightened us with: 1. How do I know whether to use sharprom or modern? If it works, use it. 2. What do I do with ipk files? I surfed around and found that in one example, the command is ipkg install foo.ipk, but ipkg doesn't seem to exist on my hardware. ipkg doesn't have

Re: Python for ARM7?

2005-09-14 Thread Sybren Stuvel
Ken Seehart enlightened us with: I could try to unpack them on another (non-ARM7) linux box and then move the files over to the ARM7 device. Yep, that should work. Better yet, can I unpack them on windows XP somehow? Don't know. If for some reason that is not possible, i suppose my next

Re: network parameters

2005-09-14 Thread Sybren Stuvel
le dahut enlightened us with: Is there a way to get network parameters (number of network interfaces, ip address(es), DNS, gateway) on a linux station using python 2.3 ? Sure. - number of network interfaces, ip address(es), gateway: read from /proc - DNS: read /etc/resolv.conf Sybren -- The

Re: No newline using printf

2005-09-16 Thread Sybren Stuvel
Johnny Lee enlightened us with: Why the prompt followed after the output? Maybe it's not as expected. Because it did what you ask of it: write 012 to stdout, and nothing else. Hence, no newline at the end, hence the prompt is on the same line. Sybren -- The problem with the world is

Re: Software bugs aren't inevitable

2005-09-16 Thread Sybren Stuvel
Terry Hancock enlightened us with: This is ludicrous sophistry. The technical reason for having ANY high level languages is psychological. Computers are happier with binary code, over ANY language that must be interpreted. Computers aren't happy. They couldn't care less about the programming

Wrapping float

2005-09-17 Thread Sybren Stuvel
Hi all, I'm trying to make a float-like class (preferably a subclass of 'float') that wraps around. The background: I'm modeling a multi-dimensional space, and some of those dimensions are circular. Here is my code so far: class WrapFloat(float): def __init__(self, value, wrap = None):

Re: Software bugs aren't inevitable

2005-09-17 Thread Sybren Stuvel
phil hunt enlightened us with: If a program is too slow to respond isn't that about system time? Not by definition. Could be anything. If it's slow to respond due to a slow harddisk, then you're right. If it's slow to respond due to not putting the I/O and the GUI main loop in different threads,

Re: Do thread die?

2005-09-17 Thread Sybren Stuvel
Maurice LING enlightened us with: So, at the end of run(), what happens to the thread? Just die? Yep. While I am on it, can threading.Thread.run() accept any parameters? Nope. Pass them to the constructor and remember them. class myThread(threading.Thread): def __init__(self, func):

Re: Brute force sudoku cracker

2005-09-17 Thread Sybren Stuvel
Bas enlightened us with: I came across some of these online sudoku games and thought after playing a game or two that I'd better waste my time writing a solver than play the game itself any longer. I managed to write a pretty dumb brute force solver that can at least solve the easy cases

Re: Wrapping float

2005-09-17 Thread Sybren Stuvel
Bengt Richter enlightened us with: Float is an immutable, so you need to override __new__ Thanks, that works! Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let

Re: What am I doing wrong?

2005-09-21 Thread Sybren Stuvel
keithlackey enlightened us with: def __init__(self, folders = []): self.folders = folders Read all about this very common mistake at http://docs.python.org/tut/node6.html#SECTION00671 def add_folder(self, folder):

Re: Newbie Question on ctypes

2005-09-21 Thread Sybren Stuvel
Efrat Regev enlightened us with: My question is, therefore, if I can build ctypes locally. I tried rpm -i python-ctypes-0.9.1-1.rf.src.rpm That _installs_ the source package, not build it as you intended. Read the RPM manual: rpm --rebuild python-ctypes-0.9.1-1.rf.src.rpm Sybren -- The

Re: How to use a timer in Python?

2005-09-23 Thread Sybren Stuvel
Nico Grubert enlightened us with: How can I use a timer that waits e.g. 10 seconds if 'transfer.lock' is present and then checks again if 'transfer.lock' is still there? Make a while loop in which you sleep. Or use the threading module if you want to go multi-threading. Sybren -- The problem

  1   2   3   4   5   >