Re: \t not working

2006-05-17 Thread Sybren Stuvel
Alex Pavluck enlightened us with: Q: As an exercise, write a single string that: Procuces this output. A? print produces,'\n',\t,this,\n,\t,output. Just nitpicking, since you already got your answer, but that's not a single string ;-)

Re: Tabs versus Spaces in Source Code ('semantic' vs. arbitrary indentation)

2006-05-17 Thread Sybren Stuvel
Dave Hansen enlightened us with: Assume the code was written by someone using 4-space tabs. To them, the code is: def sqlcall(): ---cursor.execute('select id, item, amount, field4, etc ...'from table1 where amount100') (where --- represents an 4-space tab and .

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Sybren Stuvel
Duncan Booth enlightened us with: That is true so far as it goes, but equally if your editor inserts a tab character when you press the tab key it is as broken as though it inserted a backspace character when you press the backspace key. In both of these cases you have an operation (move to

Re: Tabs versus Spaces in Source Code

2006-05-16 Thread Sybren Stuvel
Duncan Booth enlightened us with: It could be, and for some keys (q, w, e, r, t, y, etc. spring to mind) that is quite a reasonable implementation. For others 'tab', 'backspace', 'enter', 'delete', etc. it is less reasonable, but it is a quality of implementation issue. If I had an editor

Re: Web framework to recommend

2006-05-15 Thread Sybren Stuvel
Jacky enlightened us with: I just started learning Python and would like to starting writing some web-based applications with Python. You could check out my web framework, the UnrealTower Engine. It uses Cheetah as template engine, it's fast and small - it doesn't get in your way.

Re: Converting hex to char help

2006-05-14 Thread Sybren Stuvel
Ognjen Bezanov enlightened us with: Hi all, I am trying to convert a hexdecimal value to a char using this code: print ' %c ' % int(0x62) This is an integer this works fine, but if I want to do this: number = 62 print ' %c ' % int(0x + number) This is a string ^

Re: Multi-line lambda proposal.

2006-05-12 Thread Sybren Stuvel
Kaz Kylheku enlightened us with: Which proposed lambda syntax is closest in this sense? I was talking about different ways (your multi-line lambda vs. the currently implemented one) of doing function decorators. Is it unusual to have a tougher time explaining X than Y to people who are

Re: Decorator

2006-05-12 Thread Sybren Stuvel
Lad enlightened us with: I use Python 2.3. I have heard about decorators in Python 2.4. What is the decorator useful for? A whole lot of stuff. I've used them for: - Logging all calls to a function, including its arguments. - Ensuring there is a database connection before the function

Re: Threads

2006-05-12 Thread Sybren Stuvel
placid enlightened us with: Did you read the documentation for Queue methods? there is no need to be patronizing about this dude, im just learning Python in my spare time, as im a Intern Software Engineer There is nothing patronizing about the question, it's merely an enquiry to a

Re: Threads

2006-05-12 Thread Sybren Stuvel
placid enlightened us with: its always said that (in programming) that the easiest solution to a problem is hard to find Yeah, that's true allright! 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: Decorator

2006-05-12 Thread Sybren Stuvel
Martin Blume enlightened us with: Another question: Isn't decorating / wrapping usually done at runtime, so that the @deco notation is pretty useless (because you'd have to change the original code)? Please explain why that would make the @deco notation pretty useless. Sybren -- The problem

Re: Memory leak in Python

2006-05-11 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Sure, are there any available simulators...since i am modifying some stuff i thought of creating one of my own. But if you know some exisiting simlators , those can be of great help to me. Don't know any by name, but I'm sure you can find some on Google.

Re: Multi-line lambda proposal.

2006-05-11 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: this is how I think it should be done with multi-line lambdas: def arg_range(inf, sup, f): return lambda(arg): if inf = arg = sup: return f(arg) else: raise ValueError This is going to be fun to debug if anything goes wrong.

Re: redirecting print to a a file

2006-05-11 Thread Sybren Stuvel
AndyL enlightened us with: Can I redirect print output, so it is send to a file, not stdout. Change sys.stdout to a file object. I have a large program and would like to avoid touching hundreds of print's. I can suggest using the logging module instead of print. It's much more flexible than

Re: redirecting print to a a file

2006-05-11 Thread Sybren Stuvel
AndyL enlightened us with: And what if I want to still send the output to stdout and just a log it in the file as well? $ python some_program.py | tee output.log Or write a class that has a write() function and outputs to a file and to the original value of sys.stdout (IIRC that's in

Re: Memory leak in Python

2006-05-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: My program is a simulation program with four classes and it mimics bittorrent file sharing systems on 2000 nodes. Wouldn't it be better to use an existing simulator? That way, you won't have to do the stuff you don't want to think about, and focus on the

Re: Multi-line lambda proposal.

2006-05-10 Thread Sybren Stuvel
Kaz Kylheku enlightened us with: In the case of if/elif/else, they have to be placed behind the closest suite that follows the expression in the syntax of the statement: if lambda(x)(4) 0: print a lambda: return x + 1 elif y = 4: print b else: print foo

Re: Multi-line lambda proposal.

2006-05-10 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: multi-line lambdas, had it been added to python a long time ago, would had reduced a lot of complexity in the language. for example - with multi-line lambdas - decorators are unneccesary. I love decorators. just give the multi-line lambda as an

Re: do some action once a minute

2006-05-09 Thread Sybren Stuvel
Petr Jakes enlightened us with: I would like to do some action once a minute. My code (below) works, I just wonder if there is some more pythonic approach or some trick how to do it differently. I'd use the Threading module, and the Timer object from that module to be more precise. There you

Re: Memory leak in Python

2006-05-09 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I have a python code which is running on a huge data set. After starting the program the computer becomes unstable and gets very diffucult to even open konsole to kill that process. What I am assuming is that I am running out of memory. Before acting on

Re: Multi-line lambda proposal.

2006-05-09 Thread Sybren Stuvel
Kaz Kylheku enlightened us with: I've been reading the recent cross-posted flamewar, and read Guido's article where he posits that embedding multi-line lambdas in expressions is an unsolvable puzzle. [...] a = lambda(x, y), lambda(s, t), lambda(u, w): u + w statement1 statement2

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: However, I wonder why L.sort() don't return the reference L, the performance of return L and None may be the same. It's probably because it would become confusing. Many people don't read the documentation. If L.sort() returns a sorted version of L, they

Re: get Windows file type

2006-05-08 Thread Sybren Stuvel
BartlebyScrivener enlightened us with: Using Python on Windows XP, I am able to get almost all file and path info using os.path or stat, but I don't see a way to retrieve the file type? E.g. Microsoft Word file, HTML file, etc, the equivalent of what is listed in the Type column in the Windows

Re: Logging vs printing

2006-05-08 Thread Sybren Stuvel
Leo Breebaart enlightened us with: I think the main reason why I am not using it by default is because, when all is said and done, it still comes easier to me to resort to guarded print statements then to set up and use the logging machinery. The logging machinery isn't that huge nor is it

Re: Logging vs printing

2006-05-08 Thread Sybren Stuvel
Leo Breebaart enlightened us with: Okay, you say, that's still easy. It's just: logging.basicConfig(level=logging.DEBUG, format='%(message)s') I always use a separate logger, as per my example. That would then just require an additional line: log.setLeveL(logging.DEBUG)

Re: Web framework comparison video

2006-05-08 Thread Sybren Stuvel
Iain King enlightened us with: http://compoundthinking.com/blog/index.php/2006/03/10/framework-comparison-video/ Thought this might be interesting to y'all. (I can't watch it 'cos I'm at work, so any comments about it would be appreciated :) It's a nice video, I really enjoyed it. Even

Re: Web framework comparison video

2006-05-08 Thread Sybren Stuvel
Sybren Stuvel enlightened us with: Perhaps I'll look into Plone for my site in the future ;-) I take that back. The Plone webserver is hosted by XS4ALL, the best ISP in The Netherlands, which resides in Amsterdam. I happen to live in Amsterdam too, so you'd expect the site to be fast. Well

Re: Python SSL

2006-05-04 Thread Sybren Stuvel
Edward Elliott enlightened us with: Encryption has multiple meanings. In the general sense, it encompasses all of cryptography and the information security properties crypto provides. And if you already know who'll get the message, it's secure. I get it :) Thanks for the nice read ;-) Of

Re: Gettings subdirectories

2006-05-03 Thread Sybren Stuvel
Florian Lindner enlightened us with: how can I get all subdirectories of a given directories? os.listdir() gives me all entries and I've found no way to tell if an object is a file or a directory. Why, doesn't your os.path.isdir() function work? Sybren -- The problem with the world is

Re: Python SSL

2006-05-03 Thread Sybren Stuvel
John J. Lee enlightened us with: Of course, remembering that the first thing to ask in response to is it secure? is against what?, for lots of purposes it just doesn't matter that it ignores certificates. I'm curious. Can you give me an example? AFAIK you need to know who you're talking to

Re: Non-web-based templating system

2006-05-02 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I'm creating a small application in Python that uses lists and dictionaries to create a rudimentary database. I'd like to create some fill-in-the-blanks reports from this data, ideally by taking an RTF or plaintext file as a template and replacing

Re: begging for a tree implementation

2006-04-27 Thread Sybren Stuvel
Micah enlightened us with: I'm looking for a simple abstract-data-type tree. I would have thought there would be a built-in type, but I can't find one. I just need to be able to start from a root node and attach children from there. I could jury-rig one using a dict or some tuples, but I'd

Re: Python UPnP on Linux?

2006-04-26 Thread Sybren Stuvel
Paul Sijben enlightened us with: Googling on this I have found win32 implementations and Twisted implementations yet I am looking for a way to do it on Linux WITHOUT Twisted. Twisted is Open Source, so you could browse the source and see how they do it. Sybren -- The problem with the world

Re: Query regarding support for IPv6 in python

2006-04-26 Thread Sybren Stuvel
Pramod TK enlightened us with: 1. Does python support IPv6? [128 bit IP addresses?] Yes. 2. Does it support setting of QoS flags? No idea. 3. Does it support tunneling of IPv6 on a IPv4 network? IIRC that's the OS's job, not Python's. 4. If an IPv4 address is given, does it support this

Re: Python UPnP on Linux?

2006-04-26 Thread Sybren Stuvel
Paul Sijben enlightened us with: You are right of course but I was hoping to avoid that. Twisted is very large and has all kinds of internal dependencies. Yeah, but I wouldn't know any other way, sorry... :-/ Sybren -- The problem with the world is stupidity. Not saying there should be a

Re: begging for a tree implementation

2006-04-26 Thread Sybren Stuvel
Micah enlightened us with: I'm looking for a simple tree implementation: 0-n children, 1 root. All the nice methods would be appreciated (getLeaves, isLeaf, isRoot, depthfirst, breadthfirst,...) That's really all I need. I could code one up, but it would take time to debug, and i'm really

Re: The whitespaceless frontend

2006-04-25 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Some people like and use them often (like those ones coming from Pascal-like languages, etc), some other people (like those coming from C-like languages like Java) use them rarely and like classes more. Python can choose to have just one way to solve

Re: 有關於 Mining google web services : Building applications with the Google API這本書的範例

2006-04-22 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: ?z?n?A ?O?o?A?e???b???s Mining Google Web Services : Building Applications with the Google API[EMAIL PROTECTED] 6??Using SQL Server as a Database?? ?M?B?A???q???w?g?w??SQL Server 2000 sp4?A?b?d???{?A.net?X?{?F

Re: how to append to a list twice?

2006-04-21 Thread Sybren Stuvel
John Salerno enlightened us with: Interesting. I tried the *2 method twice, but I kept getting weird results, I guess because I was using append and not extend. I thought extend added lists to lists, but obviously that's not the case here. [100].extend([90]) - [100, 90] [100].append([90]) -

Re: PYTHONPATH

2006-04-20 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I am using Linux env.I set the PYTHONPATH using import sys sys.path.append() But we i close python and start again i is not showing my new entry in PYTHONPATH. Can anyone help me to make my path persistant? Add the following to /etc/profile:

Re: Missing interfaces in Python...

2006-04-17 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I see that Python is missing interfaces. No it isn't. It just hasn't got them. The concept of an interface is a key to good programming design in Java, but I've read that they aren't really necessary in Python. In Java I would accomplish this by

Re: HELP PLEASE: What is wrong with this?

2006-04-15 Thread Sybren Stuvel
Ralph H. Stoos Jr. enlightened us with: File autotp.py, line 21 ready = raw_input(Ready to proceed ? TYPE (y)es or (n)o: ) ^ Please post the entire traceback, so we can see the actual error message. Posting the context of the bad line also wouldn't hurt. Sybren -- The problem

Re: help me ( import cx_Oracle ) 失�

2006-04-15 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: ???d???b cx_Oracle (Oracle 9i, Python 2.4) ???b??windows xp ??python???a??C:\Python24\cx_Oracle-doc?? import cx_Oracle ???F Traceback (most recent call last): File interactive input, line 1, in ? ImportError: DLL load failed:

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

<    1   2   3   4   5   >