Re: Python / Apache / MySQL

2006-02-14 Thread Sybren Stuvel
Dennis Lee Bieber enlightened us with: I believe that since 4.1, the default table format is InnoDB, and that DOES have some support foreign keys and transactions. Finally they are starting to make more sense. I'd still rather use a database that has had those features for a longer time,

Re: pop line from file

2006-02-15 Thread Sybren Stuvel
Sinan Nalkaya enlightened us with: i searched and google long long time but couldnt find any result, i want pop the first line from file, i dont want to read all file contents because file is being updated from another proccess. So basically, what you want is some sort of on-disk FIFO queue,

Re: xml.dom.ext documentation

2006-02-17 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I figure I must just be missing something, but I can't seem to find good documentation for xml.dom.ext. What I'm hoping for is just a simple list of what actually is available in that package (what other packages get included if you import xml.dom.ext

Re: Simple question about freeze

2006-02-17 Thread Sybren Stuvel
Martin v. Löwis enlightened us with: No. You also need to provide static versions of all system libraries. You can also ship the required .so files along with the program, and set LD_LIBRARY_PATH to include the directory in which you stored those files. This can be easily done by a shell script

Re: How many web framework for python ?

2006-02-19 Thread Sybren Stuvel
Bruno Desthuilliers enlightened us with: I want to write a web framework for python based on mod_python as my course homework , could you give some advise ? Yes : forget it. Why forget it? I've written my own web framework (http://www.unrealtower.org/) and it works great! It was a good

Re: How many web framework for python ?

2006-02-19 Thread Sybren Stuvel
Ville Vainio enlightened us with: When you write your own framework, you are helping yourself. True. And if that doesn't have a negative effect on others (which I think it doesn't) there is nothing wrong with that. If you use an existing framework and possibly contribute patches to it, you

Re: editor for Python on Linux

2006-02-19 Thread Sybren Stuvel
Mladen Adamovic enlightened us with: I wonder which editor or IDE you can recommend me for writing Python programs. I tried with jEdit but it isn't perfect. I use gvim (if I have X) and vim (if I don't). The only negative thing about it, is its learning curve ;-) Sybren -- The problem with

Re: Is inifinite loop not a good practice?

2006-02-20 Thread Sybren Stuvel
Alvin A. Delagon enlightened us with: I have to write a python script that would continously monitor and process a queue database. [...] I've been planning to do an infinite loop within the script to do this but I've been hearing comments that infinite loop is a bad programming practice. I

Re: Canvas clicking stuff

2006-02-20 Thread Sybren Stuvel
Tuvas enlightened us with: I have a picture that is being displayed on a canvas interface, that I want to do the following. [...] There are loads of GUI toolkits you could be using. Please read How To Ask Questions The Smart Way: http://catb.org/~esr/faqs/smart-questions.html It's a very good

Re: deriving from float or int

2006-02-20 Thread Sybren Stuvel
Russ enlightened us with: Does it ever make sense to derive a class from a basic type such as float or int? Suppose, for example, that I want to create a class for physical scalars with units. That makes sense. I thought about deriving from float, then adding the units. I played around with

Re: Video.

2006-02-21 Thread Sybren Stuvel
Dr. Pastor enlightened us with: What environment,library,product should I import or study to manipulate cameras, video, fire-wire, avi files? That depends on what you want with it. Without more information I'd say transcode Sybren -- The problem with the world is stupidity. Not saying there

Re: deriving from float or int

2006-02-21 Thread Sybren Stuvel
Russ enlightened us with: The problem is that when I derive a new class from float, the darn thing won't let me create a constructor that accepts more than one argument. Use __new__, not __init__. It's the function that's called when a new immutable object is created. Sybren -- The problem

Re: a little more help with python server-side scripting

2006-02-22 Thread Sybren Stuvel
John Salerno enlightened us with: What I had asked was if I could just embed Python code within my HTML files, like you do with PHP, but they didn't address that yet. Check out PSP. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: a little more help with python server-side scripting

2006-02-23 Thread Sybren Stuvel
John Salerno enlightened us with: That sounds like just what I want, except do I have to write my code in Jython? Can't I just use regular Python? I wouldn't know, never used Python ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Using repr() with escape sequences

2006-02-23 Thread Sybren Stuvel
nummertolv enlightened us with: myString = bar\foo\12foobar Are the interpretations of the escape characters on purpose? How do I print this string so that the output is as below? bar\foo\12foobar Why do you want to? typing 'print myString' prints the following: bar oo foobar Which is

Re: need help regarding compilation

2006-02-23 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: i am new to learning jython... And to python, obviously i just tried compiling a small piece of code that is given below: def fac(x) if x=1:return 1 return x*fac(x-1) You need to write 'def fac(x):'. Sybren -- The problem with the world is

Re: How to send an email with non-ascii characters in Python

2006-02-24 Thread Sybren Stuvel
Lad enlightened us with: and can give me an example of Python code that can send such email?? Not really, but I'm sure this will help you. In fact, my last name has an umlaut on the 'u'. This is the From header in my emails, encoded in Latin-1: From: Sybren =?iso-8859-1?Q?St=FCvel?= [EMAIL

Re: How to send an email with non-ascii characters in Python

2006-02-25 Thread Sybren Stuvel
Lad enlightened us with: Body='Rídících Márinka a Školák Kája Marík'.decode('utf8').encode('windows-1250')# I use the text written in my editor with utf-8 coding, so first I decode and then encode to windows-1250 Why would you do that? What's the advantage of windows-1250? Sybren -- The

Re: Python and Flash

2006-02-28 Thread Sybren Stuvel
SamFeltus enlightened us with: PS. Here is an example... http://sonomasunshine.com/sonomasunshine/FrontPage.html The HTML version of that site is crap, by the way. Check out http://sonomasunshine.com/cgi-bin/old_school.py?pagename=FrontPage The HTML is sent as text/plain, and if interpreted

Re: HTML/DOM parser

2006-02-28 Thread Sybren Stuvel
Xah Lee enlightened us with: is there a module that lets me parse validated html files and store it as a tree? http://docs.python.org/lib/module-xml.dom.html Assuming you're using XHTML. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Python and Flash

2006-02-28 Thread Sybren Stuvel
SamFeltus enlightened us with: By the way Sybren, if you don't mind, what kinda computer and browser were you using, trying to figure out which browsers get redirected to html and which get the Flash Site. Mozilla Firefox 1.5, on Ubuntu Linux Breezy. If you have Flash plugin, what version

PIL and PSDraw

2006-03-01 Thread Sybren Stuvel
Hi there, I'm experimenting with PIL to create a PostScript file. The end result should be an EPS file with a couple of bar graphs. At this moment, I have a very simple piece of code: ps = PIL.PSDraw.PSDraw(file('demo.ps', 'w')) ps.begin_document() ps.rectangle((0, 0, 650, 150))

Re: PIL and PSDraw

2006-03-01 Thread Sybren Stuvel
Kjell Magne Fauske enlightened us with: PIL is, as far as i know,primarily a tool for creating and manipulating raster graphics. I was afraid of that. If you want to create eps vector graphics with Python I recommend PyX: That looks exactly what I was looking for. Thanks a lot! Sybren --

Re: white space in expressions and argument lists

2006-03-02 Thread Sybren Stuvel
John Salerno enlightened us with: To me, the space makes it nicer and more readable, but I was surprised to read in Guido's blog that he thinks 1+2 should be the normal way to write it. What does everyone else think? I usually write 1 + 2 and func(a, b). Sometimes I even use more spaces to

Re: white space in expressions and argument lists

2006-03-02 Thread Sybren Stuvel
John Salerno enlightened us with: Guido listed a few rules that he'd like to see implemented in 2.5, and one of them was no more than one consecutive white space. I don't know how realistic some of those suggestions are, but they seem to be getting a little to restrictive. I just read the PEP

Re: white space in expressions and argument lists

2006-03-03 Thread Sybren Stuvel
Scott David Daniels enlightened us with: One reason is such code changes too much on code edits, which makes code differences hard to read. Good point. I'll keep it in mind :) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but

Re: white space in expressions and argument lists

2006-03-03 Thread Sybren Stuvel
rtilley enlightened us with: I took it literally when I first read it b/c it made sense to me and I did not notice the date. I don't think it will ever be _required_ of all Python hackers, but I may be wrong. Well, part of it is a serious PEP. It being _required_ was the joke. Sybren -- The

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Sybren Stuvel
Laszlo Zsolt Nagy enlightened us with: How can I convert a dictionary into a HTTP POST string? I have an example below, but this is not working correctly for special characters. ( ' and others). URL-quote it. In other words, if I use Bessy's cat instead of Bessy then the http server will

Re: help in converting perl re to python re

2006-03-03 Thread Sybren Stuvel
Joel Hedlund enlightened us with: regexp = re.compile(r(tag1)(.*)/\1) I'd go for regexp = re.compile(r(tag1)(.*?)/\1) Otherwise this: line = tag1sometext/tag1tag1othertext/tag1 match = regexp.search(line) will result in 'sometext/tag1tag1othertext' Sybren -- The problem with the world is

Re: object's list index

2006-03-03 Thread Sybren Stuvel
Iain King enlightened us with: i = 0 for object in list: objectIndex = i print objectIndex i += 1 Why not: for index, object in enumerate(list): print index Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity,

Re: Convert dictionary to HTTP POST

2006-03-03 Thread Sybren Stuvel
Laszlo Zsolt Nagy enlightened us with: The values of some inputs are encoded using html entities. How can I decode a string like Bessy#39;s cat in Bessy's cat? This should help: http://docs.python.org/lib/module-htmlentitydefs.html Sybren -- The problem with the world is stupidity. Not

Re: white space in expressions and argument lists

2006-03-03 Thread Sybren Stuvel
Magnus Lycka enlightened us with: Think particularly about using version management systems and applying patches coming from different sources etc. I was :) Finally, if you end up with something like... a= 1 b=

Re: Python as an extension language

2006-03-06 Thread Sybren Stuvel
Torsten Bronger enlightened us with: I already know how to do that in principle. My only concern is distributing the thing, especially for the Windows platform. Check out distutils and py2exe. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment

Re: copying a tuple to a list..

2006-03-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: i have a result tuple from a MySQLdb call that would like to change in place.. i would like to copy it to a list, so i can modify it in place, but i cannot figure out how to do it. dataResults = (1, 2, 12) dataList = list(dataResults) Sybren -- The

Re: About IDLE?

2006-03-09 Thread Sybren Stuvel
Dr. Pastor enlightened us with: When I select Run Module in the Edit window, I got only two after the RESTART line. I expected to see the output of several commands! You never gave it any commands that print output. I suggest reading the Python tutorial. Sybren -- The problem with the

Re: File Permissions

2006-03-10 Thread Sybren Stuvel
VJ enlightened us with: Basically i want to write into a file .If the permissions are not there then print a error message. How do i achive this ??? f = file('somefile', 'w') then catch the exception that's thrown when it can't be done. Sybren -- The problem with the world is stupidity. Not

Re: File Permissions

2006-03-10 Thread Sybren Stuvel
Sebastjan Trepca enlightened us with: Those constants are in stat module so add import stat before the program. Yeah, but just opening the file is more Pythonic than first checking if it can be opened in the first place. Sybren -- The problem with the world is stupidity. Not saying there

Re: why use special config formats?

2006-03-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: i came to this conclusion a long time ago: YOU DON'T NEED CONFIG FILES FOR PYTHON. why re-invent stuff and parse text by yourself, why the interpreter can do it for you? Because you generally don't want to give the configuration file writer full control

Re: Which GUI toolkit is THE best?

2006-03-10 Thread Sybren Stuvel
Thomas Guettler enlightened us with: The licence for QT is GPL, this means you cannot use it in commercial application. That is why I never looked at it. Ehmm... from their website: The Qt Commercial License is the correct license to use for the construction of proprietary, commercial

Re: why use special config formats?

2006-03-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: i dont know about your experience with config files, but there thousands of formats. All the config files I needed were either very easy to learn, or well documented in comments. on the python side -- just in this conversation, we mentioned ConfigObj,

Re: Cheese Shop: some history for the new-comers

2006-03-10 Thread Sybren Stuvel
richard enlightened us with: Rejoice! No more confusing conversations with PyPy developers! Thanks for sharing that. I always wondered where the name came from :) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we

Re: why use special config formats?

2006-03-11 Thread Sybren Stuvel
gangesmaster enlightened us with: YES THATS THE POINT. PYTHON CAN BE USED JUST LIKE A CONFIG FILE. AND CAN ALSO BE MISUSED AND HARDER TO USE THAN A SIMPLE CONFIG FILE. Get it into your thick head that you're plain wrong here. Sybren -- The problem with the world is stupidity. Not saying there

Re: Help Create Good Data Model

2006-03-11 Thread Sybren Stuvel
mwt enlightened us with: I'm reworking a little app I wrote, in order to separate the data from the UI. Good idea. As a start, I wanted to create a iron-clad data recepticle that will hold all the important values, and stand up to being queried by various sources, perhaps concurrently. Why

Re: Cheese Shop: some history for the new-comers

2006-03-13 Thread Sybren Stuvel
A.M. Kuchling enlightened us with: Given the endless whiny complaints about the name, though, I think we should just give up and go back to PyPI (pronounced 'Pippy'). I love The Python Cheese Shop. It's original and distinctive. Besides that, it gives you more information that PyPI since Python

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Sybren Stuvel
Frank Millman enlightened us with: while 1: conn,addr = s.accept() c = TLSConnection(conn) c.handshakeServer(certChain=certChain,privateKey=privateKey) data = c.recv(1024) It's nice that you set up a TLS connection, but you never check the certificate of the other

Re: Cheese Shop: some history for the new-comers

2006-03-13 Thread Sybren Stuvel
Michael enlightened us with: Microsoft is the largest software company on the planet, but no way that you can guess that from the name. MICRO computer SOFTware. Seems pretty obvious to me Where is the size of the company in that story? The fact that they make software is rather obvious

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Sybren Stuvel
Frank Millman enlightened us with: The point of the exercise for me is encryption. I am not too worried about authentication. Encryption can't function fully without authenication. The next step in my app is for the client to enter a user id and password, and the server will not proceed

Re: Please, I Have A Question before I get started

2006-03-13 Thread Sybren Stuvel
Skipper enlightened us with: I can not believe that there isn't a GUI programing tool that will allow me to build GUI apps There are plenty of them. just like I use Dreamweaver to build a web page Which produces horrible HTML. Sybren -- The problem with the world is stupidity. Not saying

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Sybren Stuvel
Frank Millman enlightened us with: If I understand correctly, a 'man-in-the-middle' attack would involve someone setting up a 'pseudo server', which gives the correct responses to the client's attempt to log in That's right. Usually it's done by proxying the data between the client and the

Re: SSL/TLS - am I doing it right?

2006-03-13 Thread Sybren Stuvel
Paul Rubin enlightened us with: for example, OpenSSL (www.openssl.org) comes with a simple Perl script that acts as a rudimentary CA. I never understood those CA scripts. I mean, creating a new CA certificate only has to be done once, and is: openssl req -new -x509 -key $KEY -out $OUT -days

Re: Which GUI toolkit is THE best?

2006-03-13 Thread Sybren Stuvel
Thomas Guettler enlightened us with: There is a GPL version for Linux. But the GPL does not allow linking with closed source software. The availability of a GPL license does not negate the availability of a commercial license. You can write commercial, closed source software on Linux using Qt

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Sybren Stuvel
Paul Rubin enlightened us with: If you're paranoid, you can scrounge some $20 obsolete laptop from ebay and dedicate it to use as a CA, never letting it touch the internet (transfer files to and from it on floppy disc). caCert use a special box for this too. It has no network connection, and

Re: SSL/TLS - am I doing it right?

2006-03-14 Thread Sybren Stuvel
Frank Millman enlightened us with: I don't know how to check the certificates. None of the documentation I have read spells out in detail how to do this. Read the readme that comes with TLS Lite. You can require certificate checks, call certchain.validate(CAlist), and with my extension you can

Re: SSL/TLS - am I doing it right?

2006-03-15 Thread Sybren Stuvel
Michael Ekstrand enlightened us with: clients aren't expected to have their own certificates. I think that the only time you really need the clients to have certificates is when the certificate *is* your authentication (e.g., in OpenVPN). Fact remains that a strong certificate is much more

Re: SSL/TLS - am I doing it right?

2006-03-15 Thread Sybren Stuvel
Paul Rubin enlightened us with: The client cert approach isn't strictly necessary but it means that the SSL stack takes care of stuff that your application would otherwise have to take care of at both the client and the server side. Indeed. I always try to take the route of the least wheels I

Re: MS word document generator

2006-03-15 Thread Sybren Stuvel
Raja Raman Sundararajan enlightened us with: Well, Office 12 will have very many features. Thats true. But my document needs to work in all versions of Office. I hope that pyRtf generated file is fully rtf compatible. :-) Oh come on. Even Word files don't work in all versions of Office.

Re: datetime iso8601 string input

2006-03-20 Thread Sybren Stuvel
aurora enlightened us with: I agree. I just keep rewriting the parse method again and again. I just use the parser from mx.DateTime. Works like a charm, and can even guess the used format. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Some info

2006-03-22 Thread Sybren Stuvel
Fulvio enlightened us with: Now, I'd like to go some step farther and make a disk cataloger. What kind of disk? Harddisks? DVDs? Audio CDs? I'm, actually, a bit stuck on how to collect informations regarding disk names (CDroms or USB HDs). Depends on what names you want. Filenames? Track

Re: Default/editable string to raw_input

2006-03-22 Thread Sybren Stuvel
Paraic Gallagher enlightened us with: What I am trying to do is provide a simple method for a user to change a config file, for a test suite. My opinion: let the user edit the configuration file using his/her favourite text editor. Someone configuring a test suite should certainly be able to

Re: Some info

2006-03-22 Thread Sybren Stuvel
Fulvio enlightened us with: Alle 21:22, mercoledì 22 marzo 2006, Sybren Stuvel ha scritto: disk names (CDroms or USB HDs). Depends on what names you want. It seems clear that was _disk_ names. What's a disk name? The filesystem label works as a disk name for ISO-9660 CDROMs, but entire

Re: Default/editable string to raw_input

2006-03-22 Thread Sybren Stuvel
Paraic Gallagher enlightened us with: While I agree in principal to your opinion, the idea is that an absolute moron would be able to configure a testcell with smallest amount of effort possible. Then explain to me why learning how to use your program to edit the file is easier than using an

Re: Need help with restricting number of new objects a user script can create

2006-03-22 Thread Sybren Stuvel
vj enlightened us with: how do I restrict the user from (inadvertently or maliciously) creating a large number of objects which will bring down the entire 100 nodes. Use ulimit to give them a limited amount of CPU time, memory etc. The kernel will then kill runaway processes. Sybren -- The

Re: Need help with restricting number of new objects a user script can create

2006-03-22 Thread Sybren Stuvel
vj enlightened us with: Run using lua generates: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /home/groups/d/do/doris/htdocs/lua/weblua.php on line 109 Ehm... this can also be done with Python ulimit. Sybren -- The problem with the world is

Re: Default/editable string to raw_input

2006-03-23 Thread Sybren Stuvel
Sion Arrowsmith enlightened us with: You're assuming that the tester is already familiar with a text editor. Indeed. Someone working on a test suite sounded like someone who knows how to work with a text editor. And then they would have to learn the syntax of the configuration file, and the

Re: Extending Methods Vs Delegates

2006-03-26 Thread Sybren Stuvel
vbgunz enlightened us with: I hope I've made some sense with this question. I ultimately wish to know just one real thing. Regardless of the name of the second example above, what is the purpose of calling a sub class method from a super class instance? What is the application to such a

Re: SSH, remote login, and command output

2006-03-26 Thread Sybren Stuvel
Spire 01 enlightened us with: So what I'd like to do is, from any given computer, log on to every other computer, run a certain command (which normally outputs text to the terminal), and store the output so I can use the aggregate statistics later in the program. I'd go for SSH indeed. I

Re: CGI redirection: let us discuss it further

2006-03-27 Thread Sybren Stuvel
Sullivan WxPyQtKinter enlightened us with: 1. Are there any method (in python of course) to redirect to a web page without causing a Back button trap(ie, when user click the back button on their web browser, they are redirect to their current page, while their hope is probably to go back to

Re: CGI redirection: let us discuss it further

2006-03-27 Thread Sybren Stuvel
Dennis Lee Bieber enlightened us with: I suspect the desired function may be browser specific, since it sounds like one would need to pop a history record to remove the redirect page from the list... That's only if you think from the browser's point of view. An internal redirect goes unnoticed

Re: Converting Time question

2006-03-28 Thread Sybren Stuvel
Math enlightened us with: How do I convert a time of day from milliseconds? Milliseconds since what? 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 the

Re: To run a python script in all the machines from one server

2006-03-28 Thread Sybren Stuvel
Nick Craig-Wood enlightened us with: If these are unix machines then I would use ssh/scp. Use scp to copy the script to /tmp then run it and collect the output with ssh (and os.popen/subprocess) I'd use ssh only. Just give a 'cat /tmp/myscript.sh' command, then output the contents of the

Re: Converting Time question

2006-03-28 Thread Sybren Stuvel
Math enlightened us with: I measure a time at racing events.this tracktime is measures in the format hh:mm:ssDDD where DDD = thousands of a second...like 17:14:11.769 This format is being saved as a number of micro seconds since 1970.. like 1,090516451769E+15 How do I convert from the

Re: in-place string reversal

2006-03-28 Thread Sybren Stuvel
Sathyaish enlightened us with: How would you reverse a string in place in python? You wouldn't, since strings are immutable. Forget it! I got the answer to my own question. Strings are immutable, *even* in python. Indeed :) Why not! The python compiler is written in C, right? Yup. But

Re: CGI redirection: let us discuss it further

2006-03-28 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: What's wrong with the redirection page? If there's really a necessary reason for not using an HTTP redirect (for example, needing to set a cookie, which doesn't work cross-browser on redirects), the best bet is a page containing a plain link and

Re: CGI redirection: let us discuss it further

2006-03-28 Thread Sybren Stuvel
Sullivan WxPyQtKinter enlightened us with: Sorry I do not quite understand what is the difference between an internal redirection and an external one? External: - Browser requests URL A - Server responds Go to URL B - Browser requests URL B - Server responds with contents of B

Re: any() and all() on empty list?

2006-03-28 Thread Sybren Stuvel
Paul McGuire enlightened us with: That goes against the usual meaning of all in, say, mathematical logic. Usually, for all X in S, PRED(x) is true means: there does not exist X in S so that PRED(x) is false. How do you get this usually stuff? From its mathematical definition. I would

Re: difference between .cgi and .py

2006-03-29 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I am new to python.. I have uploaded few scripts in my cgi-bin folder, some with extension .cgi and some with .py. What is the difference between the two extensions.. None at all, except the way you write them. which one is more prefered That depends.

Re: Can I export my datas in pickle format safely ?

2006-03-31 Thread Sybren Stuvel
DurumDara enlightened us with: I want to create a database from datas. Just nitpicking: 'data' is already plural, a single is called 'datum'. I thinking about that I can use the pickle to serialize/load my datas from the file. Sure you can. Be very, very careful though, since unpickling data

Re: Oserror: [Errno 20]

2006-04-03 Thread Sybren Stuvel
k r fry enlightened us with: I did think maybe it was meant to be listdir instead of istdir, but that doesn't work either. And again you don't tell us in what way it doesn't work. Think about what you post from our point of view. Then re-read it, and think about it again. Only if you're sure

Re: Oserror: [Errno 20]

2006-04-03 Thread Sybren Stuvel
k r fry enlightened us with: Traceback (most recent call last): File katiescint.py, line 153, in ? for subdir in os.path.listdir(DATADIR): #loop through list of strings AttributeError: 'module' object has no attribute 'listdir' But why do you use that function then?

Re: Registration Code

2006-04-03 Thread Sybren Stuvel
Math enlightened us with: But now I want the end-user to register this software with a registration code or perhaps something like an evaluation demo version which expires after some period of time... Fair enough. What do you want to know from us? Is this the right place to ask or does

Re: CD Burning

2006-04-04 Thread Sybren Stuvel
Albert Leibbrandt enlightened us with: Can anybody tell me which windows API or python module they are using for writing cd's / dvd's with python? I'd install cygwin and use cdrecord. That seems the easiest way to go about burning disks to me. Sybren -- The problem with the world is

Re: Difference in Python and Ruby interactive shells

2006-04-04 Thread Sybren Stuvel
dmh2000 enlightened us with: When you want to change something, you can edit those same source files outside the environment and reload them from within the interactive environment. But, here is the difference: with Python, when you reload the source file (module in Python terms), it seems

Re: Difference in Python and Ruby interactive shells

2006-04-05 Thread Sybren Stuvel
Lou Pecora enlightened us with: Impressive, but YIKES, there ought to be a simpler way to do this. I think during the development phase editing and reloading would be very common and you'd want everything updated. I hardly ever reload stuff manually during development. I write a script, and

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Can someone help me by suggesting how to capture python's STDOUT. I doesn't want the python's output to get displayed on the screen. python somescript.py /dev/null Sybren -- The problem with the world is stupidity. Not saying there should be a capital

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I have python script in which i have some print statements. I dont want the outputs of print to be displayed on the console since it is used my fellow-workers But i need those prints for debugging purpose So some how i want to capture those prints can u

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
Fredrik Lundh enlightened us with: or you can use the logging module: http://docs.python.org/lib/module-logging.html I'd definitely do that. 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: Partially unpacking a sequence

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: y[1,3] Traceback (most recent call last): File interactive input, line 1, in ? TypeError: list indices must be integers The error message gave me no clue as to what I was doing wrong (in my mind, I was just writing out the elements of a range), and I

Re: calculating system clock resolution

2006-04-08 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Is it mentioned somewhere that print truncates floats ? 'print' prints str(time()). On the interactive prompt, you see repr(time()). float.__str__ truncates. I don't know where it's documented, but this is the reason why you see the truncation. Sybren --

Re: how relevant is C today?

2006-04-08 Thread Sybren Stuvel
John Salerno enlightened us with: Because of my 'novice-ness' in programming, I had always thought that C was replaced by C++ and wasn't really used anymore today. C is used in many, many programs. The Linux kernel is perhaps one of the best known. IIRC Apache is written inC too. The default

Re: wiki engine (just engine) available?

2006-04-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Ideal feature set is ReStructureText, some easy way to add custom commands (to keep my pages integrated in way Trac is doing) and (ideally) docbook export (althrough I'm ready to write one). What is Trac doing? What kind of commands are you talking about?

Re: can't pass command-line arguments

2006-04-10 Thread Sybren Stuvel
Lawrence D'Oliveiro enlightened us with: The MS-DOS foundation on which Windows is built only supports a small number of extensions for executable files (.COM, .EXE and .BAT), with no provision for any extensions to these. Common misconception: screensavers are simply executable files with a

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Sybren Stuvel
Ben Sizer enlightened us with: Every day I come across people or programs that use tab stops every 2 or 8 columns. I am another fan of tabs every 4 columns, but unfortunately this isn't standard, so spaces in Python it is. I don't care about how people see my tabs. I use one tab for every

Re: An algorithm problem

2006-05-31 Thread Sybren Stuvel
Bo Yang enlightened us with: I have writen a python program to slove a problem described as below: Please post again, but then leaving indentation intact, since this is unreadable. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Best Python Editor

2006-05-31 Thread Sybren Stuvel
Manoj Kumar P enlightened us with: Can anyone tell me a good python editor/IDE? It would be great if you can provide the download link also. VIM 7 is great, http://www.vim.org/ Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity,

Re: shuffling elements of a list

2006-05-31 Thread Sybren Stuvel
David C Ullrich enlightened us with: I thought that the fact that you could use the same trick for _shuffling_ a list was my idea, gonna make me rich and famous. I guess I'm not the only one who thought of it. Anyway, you can use DSU to _shuffle_ a list by decorating the list with random

Re: Best way to do data source abstraction

2006-06-01 Thread Sybren Stuvel
Arthur Pemberton enlightened us with: What is the best way to do data source abtraction? That depends on your data source. For files, file-like objects are an abstraction. For databases there is PEP 249. I was thinking of almost having classA as my main class, and have classA dynamically

Re: Max function question: How do I return the index of the maximum value of a list?

2006-06-04 Thread Sybren Stuvel
jj_frap enlightened us with: When I try to print the winner (I've not coded for kicker strength and ties yet) via the max function, it returns the maximum value in the list rather than the index associated with that value. How do I return the index? You can't even be sure it exists - there

Re: C# equivalent to range()

2006-06-06 Thread Sybren Stuvel
Erik Max Francis enlightened us with: The other zilion persons who were not interested (other than the four I mentioned above) silently and peacefully ignored the question on went on with their happy lifes. That's because many of them have killfiled you. I can say that I didn't killfile him.

Re: FYI: getting data from an OpenOffice.org spreadsheet

2006-09-03 Thread Sybren Stuvel
Hi folks, I just noticed I still had the no archive header on, which is rather stupid. If I want to make life easier for people, the information I posted in this thread should be archived! Here is a small summary: Get data from an OpenOffice.org spreadsheet with a Python script. It works on the

Re: FYI: getting data from an OpenOffice.org spreadsheet

2006-09-03 Thread Sybren Stuvel
John Machin enlightened us with: Suppose one has over a hundred spreadsheets (real-life example: budgets from an organisation's reporting centres) ... manually opening each in OOo Calc is less than appealing, and not very robust. True. There are functions that can load files as well. Combined

<    1   2   3   4   5   >