Re: Using paramiko rsa key

2009-02-10 Thread Martin P. Hellwig
loial wrote: Can anyone be a little more helpful than Tino? I'll do some freebie hints :-) What I would do is try first whether key authentication works at all, for example following a tutorial like http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter8.html And if that works translate

Re: Pythonic way to determine if one char of many in a string

2009-02-19 Thread Martin P. Hellwig
MRAB wrote: Dennis Lee Bieber wrote: On Wed, 18 Feb 2009 21:22:45 +0100, Peter Otten <__pete...@web.de> declaimed the following in comp.lang.python: Steve Holden wrote: Jervis Whitley wrote: What happens when you have hundreds of megabytes, I don't know. I hope I never have to test a wor

PyMei - Python Media Interface

2008-11-25 Thread Jørgen P. Tjernø
sible, but let me know if you want to do something that isn't currently possible! I find it useful myself, so I hope someone else will. Please give me any feedback you might have about the program itself or the webpage! The project is available at http://pymei.org/ and http://code.goog

Re: Project structure - Best practices

2008-11-30 Thread Martin P. Hellwig
Aaron Watters wrote: On Nov 30, 11:55 am, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: http://jcalderone.livejournal.com/39794.html That's exactly what I have read before posting here ;-) -- Filip Gruszczyński I too would like to see a meatier discussion of best practices for python packa

Re: "as" keyword woes

2008-12-03 Thread Martin P. Hellwig
Warren DeLano wrote: A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? Because it can be used at the import statement to let the imported thing be known under another name? Something like: >>> import xml.etree.ElementTree as E

Re: "as" keyword woes

2008-12-03 Thread Martin P. Hellwig
Martin P. Hellwig wrote: Warren DeLano wrote: A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? Because it can be used at the import statement to let the imported thing be known under another name? Some

Re: "as" keyword woes

2008-12-03 Thread Martin P. Hellwig
Steven D'Aprano wrote: On Wed, 03 Dec 2008 22:02:24 +, Martin P. Hellwig wrote: Warren DeLano wrote: A bottom line / pragmatic question... hopefully not a FAQ. Why was it necessary to make "as" a reserved keyword? Because it can be used at the import statement to let the

Re: Can't get exclusive file lock when safely renaming a file

2008-12-06 Thread Martin P. Hellwig
Steven D'Aprano wrote: import os, fcntl oldname = "ham.txt" newname = "spam.txt" def lock_destination(name): fileno = os.open(name, os.O_CREAT | os.O_EXCL) fcntl.flock(fileno, fcntl.LOCK_EX) # POSIX systems only return fileno # Create a test file to be renamed. f = open(oldname, '

Re: Learning Python now coming from Perl

2008-12-06 Thread Martin P. Hellwig
News123 wrote: What's more painful is to learn which functianilty is in which library and which library exists. Yes and one mistake I still often find myself doing is, when confronted with a particular problem, that I write some helper code to deal with it. Of course later on I discover tha

Re: Moving to subprocess from os.popen--pipe closes prematurely

2008-12-12 Thread Martin P. Hellwig
Kevin Walzer wrote: Hello, I'm trying to move from os.popen to using subprocess, and I'm having trouble with the pipe suddenly closing. My old code looked something like this: Hi Kevin, You could try something more like: >>> import subprocess >>> cmd = subprocess.Popen([executable_path,

[ANN] EuroPython 2009 – Call for Partic ipation!

2008-12-17 Thread Martin P. Hellwig
On behalf of the EuroPython 2009 organisation it is my privilege and honour to announce the 'Call for Participation' for EuroPython 2009! EuroPython is the conference for the communities around Python, including the Django, Zope and Plone communities. This year's conference will be held in Birmin

[ANN] EuroPython 2009 – Call for Partic ipation!

2008-12-17 Thread Martin P. Hellwig
On behalf of the EuroPython 2009 organisation it is my privilege and honour to announce the 'Call for Participation' for EuroPython 2009! EuroPython is the conference for the communities around Python, including the Django, Zope and Plone communities. This years conference will be held in Birming

Re: I always wonder ...

2008-12-22 Thread Martin P. Hellwig
s...@pobox.com wrote: Is there some online troll game running where the players earn points for generating responses to their posts? You just got 10 points ;-) -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Define a 2d Array?

2008-10-12 Thread thomas . p . krauss
On Oct 11, 9:19 pm, Jillian Calderon <[EMAIL PROTECTED]> wrote: > How do I define a 2d list? > > For instance, to define a 4 by 5 list, I wanted to do this: > n=4 > m=5 > world = [n][m] > However, it gives me an invalid syntax error saying the index is out > of range. Here are some examples of how

[ANN] EuroPython 2009 – Open for Regist ration and Reminder of Participation!

2009-03-02 Thread Martin P. Hellwig
On behalf of the EuroPython 2009 organisation it is my privilege and honour to announce that EuroPython 2009 is open for registration! EuroPython is the conference for the communities around Python, including the Django, Zope and Plone communities. This year's conference will be held in Birming

Re: Indentations and future evolution of languages

2009-03-05 Thread Martin P. Hellwig
bearophileh...@lycos.com wrote: Living on a small fitness plateau isn't good, even if it's very high, because it's evolutionary unstable :-( Actually I think, in biological sense speaking [citation needed], if one path has an advantage over the other path, even if the other path is in majori

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
odeits wrote: I am looking to clean up this code... any help is much appreciated. Note: It works just fine, I just think it could be done cleaner. The result is a stack of dictionaries. the query returns up to STACK_SIZE ads for a user. The check which i think is very ugly is putting another con

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
Martin P. Hellwig wrote: def query_parser(QUERY, USER, STACK_SIZE): indexes = ['ni','adid','rundateid','rundate','city','state','status'] empty = 'None' stack = [] query_result = self.con

Re: Help cleaning up some code

2009-03-07 Thread Martin P. Hellwig
Martin P. Hellwig wrote: while I am at it :-) if ignore == False: is probably cleaner when written if not ignore: -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: should i move on to python3

2009-03-07 Thread Martin P. Hellwig
Wensui Liu wrote: i started learning python with earlier version and am happy with it and all related packages, such as scipy, pywin, and so on. right now, i am wondering if i should move to python3. if i do, will all packages working on earlier version still work in python3? this is my major con

Re: should i move on to python3

2009-03-07 Thread Martin P. Hellwig
R. David Murray wrote: Comparing Python releases to Windows releases is...disturbing :) That was why I was very carefully in this example for choosing 2000 :-) -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: Guidance - Professional Python Development

2009-03-08 Thread Martin P. Hellwig
RT wrote: Can you recommend any books or articles that you have found offer useful advice on program structure, design and use of classes or any other features or best practices that you feel are important for professional Python development. In my opinion, 'professional development' has sur

Re: unbiased benchmark

2009-03-12 Thread Martin P. Hellwig
Philip Semanchuk wrote: On Mar 12, 2009, at 4:20 PM, Daniel Fetchinson wrote: Even more amazingly, it takes approximately 30% less time to say 'ruby' than to say 'python'!!! But "python" scores 55% more points than "ruby" in Scrabble, so that's understandable. It also explains why both la

Re: unbiased benchmark

2009-03-13 Thread Martin P. Hellwig
Lie Ryan wrote: But ruby don't bite... Neither does a python, it is a constrictor, meaning it has a firm grip on the modules imported :-) -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter: start window without window managers frame (linux,KDE)

2009-03-14 Thread Martin P. Hellwig
Ekkard Gerlach wrote: Hi, is tkinter able to start a windows without the frame of the according window manager? (only needed for Linux, KDE desktop) The window should only be closed by click on a button within the window! I should not be moved, it should not be close, ... and so on. The soluti

Re: What way is the best to check an empty list?

2009-03-25 Thread Martin P. Hellwig
Raymond Hettinger wrote: On Mar 25, 7:38 am, srinivasan srinivas wrote: For ex: to check list 'A' is empty or not.. if A == []: if A.count == 0: if len(A) == 0: if not A: PEP 8 recommends the latter. Raymond I can't seem to find where this recommendation is mentioned or implied. Personall

Re: What way is the best to check an empty list?

2009-03-25 Thread Martin P. Hellwig
Albert Hopkins wrote: On Wed, 2009-03-25 at 21:26 +, Martin P. Hellwig wrote: PEP 8 recommends the latter. Raymond I can't seem to find where this recommendation is mentioned or implied. Wow, you must not have looked very hard: 1. Point your browser to http://www.python.or

Re: Bullshit Generator

2009-03-29 Thread Martin P. Hellwig
Tim Chase wrote: Is it an upgrade from from urllib import urlopen bs = urlopen("http://xahlee.org";).read() Yes it is. Although both produce random quantities of text, only the name can be interpreted offensive, not the content. -- mph -- http://mail.python.org/mailman/listinfo/python-l

Re: Re. suid/sudo in python

2009-03-30 Thread Martin P. Hellwig
Rustom Mody wrote: I don't think this is necessary a python problem but a generic, SUID scripts considered dangerous, problem. The essence of your program is that you only want information, that is great! Since that makes it all a bit simpler. How about writing a cronjob that outputs the re

Re: A design problem I met again and again.

2009-04-01 Thread Martin P. Hellwig
一首诗 wrote: But I think the first step to resolve a problem is to describe it. In that way, I might find the answer myself That is an excellent approach, knowing you have a problem and describing it is actually the hardest part of a design, the rest is more like a puzzle. What I guess so fa

Re: A design problem I met again and again.

2009-04-02 Thread Martin P. Hellwig
Steven D'Aprano wrote: If you have too much code in one file, it will upset the balance of the spinning hard drive platter, and it will start to wobble and maybe even cause a head-crash. That is why proper designed operating systems, like windows 95,rarely write one continuous block but spre

Re: Testing dynamic languages

2009-04-04 Thread Martin P. Hellwig
grkunt...@gmail.com wrote: If I am writing in Python, since it is dynamically, but strongly typed, I really should check that each parameter is of the expected type, or at least can respond to the method I plan on calling ("duck" typing). Every call should be wrapped in a try/except statement to

Re: Python3: to add, remove and change

2009-04-05 Thread Joe P. Cool
ouce public-money- > funded vaporwere that has tried to do too much). How about moving these lines to a separate message with a matching header? Regards, Joe. P. Cool -- http://mail.python.org/mailman/listinfo/python-list

Re: cx_Oracle - DLL load failed

2009-04-13 Thread Martin P. Hellwig
cwurld wrote: Hi, I am having some trouble getting cx_Oracle to work. When I try to import cx_Oracle, I get the following error message: ImportError: DLL load failed: %1 is not a valid Win32 application. I am using Python 2.6 on WIndows. Oracle Client 10g. Any ideas? Thanks Hmm some time a

Re: [OT] large db question about no joins

2009-04-16 Thread Martin P. Hellwig
Daniel Fetchinson wrote: [off but interesting topic] What would be the corresponding database layout that would scale and I could get the total number of legs in the zoo or total number of animals in the zoo without join(s)? Cheers, Daniel [/off but interesting topic] That all comes down

Re: [OT] large db question about no joins

2009-04-17 Thread Martin P. Hellwig
Daniel Fetchinson wrote: Well, I gave the concrete example of zoo/cage/animal/leg because this *is* the business logic. I need to know for example the total number of animals, this is pretty understandable if you have a zoo. Or you mean that I should give another example? It might be the busin

Re: [OT] large db question about no joins

2009-04-17 Thread Martin P. Hellwig
Daniel Fetchinson wrote: In an relational database setting you would have a table for artists, a table for cd's and a table for songs and a table for comments where people can comment on songs. All of this with obvious foreign keys. Now you want to display on your website the total number of cd'

Re: Is there a programming language that is combination of Python and Basic?

2009-04-17 Thread Martin P. Hellwig
Michael Torrie wrote: Aahz wrote: Why do you want to do that? Before you answer, make sure to read this: http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html Somebody better tell the Linux kernel developers about that! They apparently haven't read that yet.

Re: [OT] large db question about no joins

2009-04-18 Thread Martin P. Hellwig
Daniel Fetchinson wrote: Thanks, this wikipedia entry was actually very useful as well as your other comments. Thanks again, Daniel Your welcome, I usually take quite a lot of effort into designing before I start coding. One tool I found very helpful was DIA, especially the UML section. Ha

Re: Can some1 review my code?

2009-04-19 Thread Martin P. Hellwig
zaheer.ag...@gmail.com wrote: hi I am from java background, I have written some code that actually works :) Need to some one to look at it and tell me if there are better ways of doing same things Will some one help? Thanks My crystal ball is a bit cloudy today so forgive me if my suggestion

Re: The Python standard library and PEP8

2009-04-19 Thread Martin P. Hellwig
Emmanuel Surleau wrote: What makes you think Python is "an OO language"? Python is a dynamic object-oriented programming language that can be used for many kinds of software development. First line on the Python official website. Was this a trick question? What kind of OO language allows y

Re: Learning Python the quick way

2009-04-25 Thread Martin P. Hellwig
mercur...@googlemail.com wrote: Hi guys, I have decided to learn Python a little more than I already do. Very good! But I found few problems, I am not sure what will happen if I do the programing in python the find the program doesn't deliver the desired performance due to lack of a good com

Re: DigitalSigner in Python

2009-04-25 Thread Martin P. Hellwig
Marco Bizzarri wrote: On Fri, Apr 24, 2009 at 7:57 AM, Good Z wrote: Hello All, I need to digitally sign a document in python. Is there any equivalent directory in Python like the DigitalSigner we have in Java. Best Regards, Mike Maybe you could take a look at M2Crypto? http://chandlerp

Re: Is there a maximum size to a Python program?

2009-04-27 Thread Martin P. Hellwig
Carbon Man wrote: I have a program that is generated from a generic process. It's job is to check to see whether records (replicated from another system) exist in a local table, and if it doesn't, to add them. To answer the topic question, it would be limited to the memory your platform can

Re: Silent install of Python software(2.5) for windows.

2009-04-29 Thread Martin P. Hellwig
kc.pyt...@gmail.com wrote: Hi All, Is it possible to "automate" the installation of python software(2.5) without the need of pressing "Next" so many times? Below is the platform in which it should be installed. OS : windows Thanks & Regards, Kalyan. Distribute the msi using Active Directories

Re: web access through vpn client

2009-05-01 Thread Martin P. Hellwig
mark.sea...@gmail.com wrote: Hi; I am trying to retrieve financial data off website for stock market analysis. Just hobby not for pay. I actually am impressed that urllib2 and BeautifulSoup work pretty well to do what I want, and the first little routine actually gets the data from the web pag

Re: web access through vpn client

2009-05-02 Thread Martin P. Hellwig
mark.sea...@gmail.com wrote: On May 1, 5:57 pm, "Martin P. Hellwig" wrote: mark.sea...@gmail.com wrote: Hi; I am trying to retrieve financial data off website for stock market analysis. Just hobby not for pay. I actually am impressed that urllib2 and BeautifulSoup work pretty

Re: Is it better to use threads or fork in the following case

2009-05-03 Thread Martin P. Hellwig
grocery_stocker wrote: Let's say there is a new zip file with updated information every 30 minutes on a remote website. Now, I wanna connect to this website every 30 minutes, download the file, extract the information, and then have the program search the file search for certain items. Would it

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-06 Thread Martin P. Hellwig
Jelle Smet wrote: Hi list, My goals is to have concurrent and separated client sessions using xmlrpc. Initially my though was that SimpleXMLRPCServer was able to create a new object instance for each incoming request. But this doesn't appear to be the case, unless I'm overlooking something, if s

Re: SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-10 Thread Martin P. Hellwig
Piet van Oostrum wrote: goo...@smetj.net (g) wrote: g> Well, I think Martin's example will suit my needs. g> Thanks for the explanation! His client code is unnecessarily complicated with 3 session variables. The following code does the same: SESSION = xmlrpclib.ServerProxy(URL_PORT)

Re: making a python program in windows

2009-05-21 Thread Martin P. Hellwig
Rustom Mody wrote: I know how to make a python script behave like a (standalone) program in unix -- 1. put a #! path/to/python as the first line 2. make the file executable The closest I know how to do this in windows is: r-click the file in win-explorer goto properties goto open with change pyt

Re: How to ask smart questions question

2009-05-26 Thread Martin P. Hellwig
Carl Banks wrote: On May 26, 7:48 am, Gary Herron wrote: John wrote: I'm okay with init, but it seems to me that enter is redundant since it appears that anything you want to execute in enter can be done in init. The proper response to a question like this has to be http://www.catb.org/~es

Re: How to ask smart questions question

2009-05-26 Thread Martin P. Hellwig
Martin P. Hellwig wrote: I can do a quick one albeit without citation: - Have you googled/searched? - No really, have you? - Are you really, really sure? - So what did you 'search for|tried before' which didn't returned a result you can work with? - What does that tell you

Re: subprocess and win32security.ImpersonateLoggedOnUser

2009-06-01 Thread Martin P. Hellwig
Emin.shopper Martinian.shopper wrote: The source for subprocess just uses CreateProcess. Which means that, short of monkey-patching it, you're going to have to roll your own subprocess-like code (I think). Basically, you'll need to run CreateProcessAsUser or CreateProcessAsLogonW. They're both a

Re: Python GUIs and custom controls

2008-05-11 Thread Joe P. Cool
On 9 Mai, 10:14, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > If you can work with the license (GPL), I suggest Qt4 Thanks for your helpful hints, guys. -- Joe P. Cool -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with that comment?

2008-05-20 Thread Joe P. Cool
Ludwig Miniatur wrote: > For example: > #!/usr/bin/env python > > from parser import suite, ast2list > fh = file(__file__) > s = fh.read() > fh.close() > ast = suite(s) > > while False: > print "hello world" > # comment > > Looks like a little bug in parser; but what I don't understand is that >

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Joe P. Cool
On 24 Mai, 15:58, Ben Finney <[EMAIL PROTECTED]> wrote: > Sh4wn <[EMAIL PROTECTED]> writes: > > first, python is one of my fav languages, and i'll definitely keep > > developing with it. But, there's 1 one thing what I -really- miss: > > data hiding. I know member vars are private when you prefix t

Re: Looking for lots of words in lots of files

2008-06-18 Thread Martin P. Hellwig
Kris Kennaway wrote: If you can't use an indexer, and performance matters, evaluate using grep and a shell script. Seriously. grep is a couple of orders of magnitude faster at pattern matching strings in files (and especially regexps) than python is. Even if you are invoking grep multipl

surprising behaviour of os.environ.clear

2008-06-27 Thread Joe P. Cool
If I call os.environ.clear in a python program child processes still see the deleted entries. But when I iterate over the keys like so names = os.environ.keys for k in names: del os.environ[k] then the entries are also deleted for the child processes. Where is the difference? Is this a bug?

Re: surprising behaviour of os.environ.clear

2008-06-28 Thread Joe P. Cool
On 28 Jun., 08:54, [EMAIL PROTECTED] wrote: > For one thing, the expression 'os.environ.keys' will yield a method > object (not a list, as you're probably expecting), but iterating over > a method as you did should produce an exception. If you want to get > the list of environment vars, you have to

Re: surprising behaviour of os.environ.clear

2008-06-28 Thread Joe P. Cool
On 28 Jun., 04:05, Benjamin <[EMAIL PROTECTED]> wrote: > On Jun 27, 4:05 pm, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > This is because of how os.environ is implement with a UserDict > subclass. You should report this at bugs.python.org. issue 3227: os.envir

Re: surprising behaviour of os.environ.clear

2008-06-28 Thread Joe P. Cool
On 28 Jun., 23:06, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > On 28 Jun., 04:05, Benjamin <[EMAIL PROTECTED]> wrote: > > > On Jun 27, 4:05 pm, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > > This is because of how os.environ is implement

multi-platform browser embedding

2008-07-05 Thread Joe P. Cool
I fiddled a little with pyGTK and was quite happy to discover gtkMozEmbed because I want to write an application for Linux and Windows with a powerful browser widget. Unfortunatly I couldnt find a way to make gtkMozEmbed work on Windows. Are there alternatives? I'm lazy so I prefer to download bina

Re: Python Written in C?

2008-07-21 Thread Martin P. Hellwig
Bruno Desthuilliers wrote: [EMAIL PROTECTED] a écrit : (snip clueless nonsense) Surely a troll... No one on earth can be *that* clueless. I disagree he has upper management written all over him. -- mph -- http://mail.python.org/mailman/listinfo/python-list

Pickle to Source - Gabriel Genellina?

2008-04-04 Thread $P!D3R DelSol
Hello I found this 3 year old message asking about doing the same exact thing I am trying to do. This is one wheel I REALLY don't want to re-invent. Can anyone point me to code that does this? Thanks Ivan ( sunsp1der at yahoo dot com) > I want to convert from pickle format to python source code

sys.path and importing modules from other directories

2008-04-05 Thread Martin P. Hellwig
Hello all, I had some troubles in the past how to arrange my packages and modules, because I usually don't develop my stuff in the Lib\site-packages directory I have some troubles when importing depending modules that are in 'sibling' directories. Like in the following scenario: pkg_root\ -__in

Gecko 1.9

2008-04-15 Thread Joe P. Cool
In 2005 I heard of plans to add Python as a second language to the Gecko engine. Is this still true? Or has this plan been abandoned? -- http://mail.python.org/mailman/listinfo/python-list

Re: How is GUI programming in Python?

2008-04-15 Thread Joe P. Cool
On 12 Apr., 03:34, baalbek <[EMAIL PROTECTED]> wrote: > Delphi/Object Pascal simply sucks big time! I disagree. Delphi/Object Pascal with the VCL (Visual Component Library) is one of the most sophisticated IDEs ever, even better than Qt IMO. The only drawback is that it is Windows only. > No rea

Re: I just killed GIL!!!

2008-04-17 Thread Martin P. Hellwig
sturlamolden wrote: You killed the GIL, you bastard! :-) > Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit

Re: get quote enclosed field in a line

2008-04-17 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

Re: Bigger projects, including files?

2008-04-19 Thread Martin P. Hellwig
globalrev wrote: > if i have a larger project and want to divide my program into several > files, how do i include these files in the mainprogram? > > using import someprojectfile doesnt work because import is for site- > packages right and i dont want to put all my files > in that folder. > > so

Re: How do I say "Is this a function"?

2008-04-26 Thread Martin P. Hellwig
John Henry wrote: How do I determine is something a function? For instance, I don't want to relying on exceptions below: def f1(): print "In f1" def f3(): print "In f3" def others(): print "In others" for i in xrange(1,3): fct = "f%d()"%(i+1) try: exec fct except:

Re: python newbie: some surprises

2008-05-08 Thread Martin P. Hellwig
v4vijayakumar wrote: When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. Even the standard editor Idle tries to guess the intendation, so this was never a probl

Python GUIs and custom controls

2008-05-08 Thread Joe P. Cool
So far I have a little experience with Tkinter and wxPython. I wonder which of the numerous Python GUI kits would be the best choice for a multi platform application that makes heavy use of custom controls, 3D views and the like? Thanks in advance for your hints and advice. Joe -- http://mail.pyth

PEP 8 example of 'Function and method arguments'

2006-03-13 Thread Martin P. Hellwig
While I was reading PEP 8 I came across this part: """ Function and method arguments Always use 'self' for the first argument to instance methods. Always use 'cls' for the first argument to class methods. """ Now I'm rather new to programming and unfamiliar to some basic concepts of OOP.

Re: PEP 8 example of 'Function and method arguments'

2006-03-14 Thread Martin P. Hellwig
Steven, Bruno, Terry & Duncon, thank you for your insights, it really helped me a great deal. -- mph -- http://mail.python.org/mailman/listinfo/python-list

Re: How to recgonize an USB device in FreeBSD?

2006-03-21 Thread Martin P. Hellwig
Geoffery wrote: > I want to add some applications to Freevo. > Let Freevo recgonize the USB device is the one. > Thank u for your answer. > Have a look at 'man 5 usbd.conf' -- mph -- http://mail.python.org/mailman/listinfo/python-list

don't understand popen2

2006-03-22 Thread Martin P. Hellwig
Hi all, I was doing some popen2 tests so that I'm more comfortable using it. I wrote a little python script to help me test that (testia.py): - someline = raw_input("something:") if someline == 'test': print("yup") else: print("nope") ---

Re: don't understand popen2

2006-03-22 Thread Martin P. Hellwig
gry@ll.mit.edu wrote: > > You gave it a single string, not a list(sequence) of strings. Try > something like: > std_in.writelines(["notgood"]) > I got this output then: >>> something: Traceback (most recent call last): File "F:\coding\pwSync\popen_test\popen_test.py", line 8, in ?

Re: don't understand popen2

2006-03-23 Thread Martin P. Hellwig
Donn Cave wrote: > > Anyway, it seems unlikely he would get that INVARG error for this > reason. That's an error from the host operating system, not the > interpreter, and it mostly likely refers to the file descriptor. > Since it works for me, I guess his problem is basically this: > > |> (pyt

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

2006-03-28 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > Hi Everyone > > I want to run a python script in all the machines that are connected > through local network and collect the information about that machine > such as HDD size, RAM capacity(with number of slots) ,processer speed > etc. > > But i want to run a script fro

Re: in-place string reversal

2006-03-28 Thread Martin P. Hellwig
Sathyaish wrote: > And that the "extra-memory" operation I've given above is expensive, I > believe. Is there an efficient way to do it? > If i recall correctly a string is an immutable list. I would do it this way: >>> strTXT = "foo" >>> strREV = strTXT[::-1] >>> strREV 'oof' -- mph -- http

Re: Python 2.5 licensing: stop this change

2006-04-01 Thread Martin P. Hellwig
Fuzzyman wrote: > From the site: "Advanced Program for Research In Licensing, whose First Object-Oriented License" string = "Advanced Program for Research In Licensing, whose First Object-Oriented License" for letter in string: if ord(letter) in range(65,91): print(letter), --

Re: XML-RPC server via xinetd

2006-04-16 Thread Martin P. Hellwig
Jos Vos wrote: > Hi, > > I'm trying to figure out how to implement a XML-RPC server that > is called by xinetd i.s.o. listening on a TCP socket itself. > > I already have implemented a stand-alone XML-RPC server using > SimpleXMLRPCServer, but I now want something similar, that is > started via x

Re: XML-RPC server via xinetd

2006-04-16 Thread Martin P. Hellwig
Jos Vos wrote: > > The problem is that the server initialization *requires* a server > address (host, port pair), but I don't see how to tell it to use > the stdin socket (and I'm afraid this is not possible, but I'm not > sure). > If I understood it correctly you want the python server bind be

Req. for comments section "Basic Data" in intro book

2009-11-28 Thread Alf P. Steinbach
I added a section on "basic data" to ch 2 of my writings, an introduction to programming (with Python as main language). The intended reader is someone who is intelligent and wants to learn programming but knows little or nothing about it. As before it would be nice with feedback on this.

Re: Creating a local variable scope.

2009-11-29 Thread Alf P. Steinbach
* markolopa: On 18 Sep, 10:36, "markol...@gmail.com" wrote: On Sep 11, 7:36 pm, Johan Grönqvist wrote: I find several places in my code where I would like tohavea variable scope that is smaller than the enclosing function/class/module definition. This is one of the single major frustrations

Re: semantics of ** (unexpected/inconsistent?)

2009-11-29 Thread Alf P. Steinbach
* Esmail: Ok, this is somewhat unexpected: Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> -3**2 -9 >>> x = -3 >>> x**2 9 >>> I would have expected the same result in both cases. Init

Re: Creating a local variable scope.

2009-11-30 Thread Alf P. Steinbach
* Jean-Michel Pichavant: Steven D'Aprano wrote: On Mon, 30 Nov 2009 02:11:12 +0100, Alf P. Steinbach wrote: I think if one could somehow declare names as const (final, readonly, whatever) then that would cover the above plus much more. Having real constants is one feature that I

Re: Req. for comments section "Basic Data" in intro book

2009-11-30 Thread Alf P. Steinbach
* Alf P. Steinbach: I added a section on "basic data" to ch 2 of my writings, an introduction to programming (with Python as main language). The intended reader is someone who is intelligent and wants to learn programming but knows little or nothing about it. As before it would be

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Alf P. Steinbach
* Edward Cherlin: On Sun, Nov 29, 2009 at 11:34, Brian Blais wrote: After a bit of playing, I realized that I couldn't think of many exaples which use turtle with conditional structures (if- and while- statements), Repeat is used much more often. but of course we can provide examples of any

Re: Moving from Python 2 to Python 3: A 4 page "cheat sheet"

2009-12-02 Thread Martin P. Hellwig
Mark Summerfield wrote: It is available as a free PDF download (no registration or anything) from InformIT's website. Here's the direct link: http://ptgmedia.pearsoncmg.com/imprint_downloads/informit/promotions/python/python2python3.pdf Very handy! Am I wrong in assuming that you forgot to inc

Formatting logically nested actions -- Pythonic way?

2009-12-03 Thread Alf P. Steinbach
Hi. I discovered with tkinter the registration of widgets with layout managers (tkinter "geometry" managers, e.g. calls to pack()) needs to be done very hierarchically. And this leads to hierarchical code, which would be nice to indicate by indenting, but oops, indenting in Python is syntact

Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 >>> _ Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Alf P. Steinbach
* Marco Mariani: Alf P. Steinbach wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass >>> foo.blah = 222 >>> foo.blah 222 >>> _ I don't see why it shouldn't work. For example, (42).blah = 666 The question is w

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Raymond Hettinger: On Dec 4, 2:03 am, "Alf P. Steinbach" wrote: Is this guaranteed to work in Python 3.x? >>> def foo(): pass ... >>> foo.blah = 222 >>> foo.blah 222 Yes, function attributes are guaranteed to be writable: http://www.python.o

Re: Can't print Chinese to HTTP

2009-12-05 Thread Alf P. Steinbach
* Lie Ryan: On 12/5/2009 2:57 PM, Gnarlodious wrote: On Dec 1, 3:06 pm, Terry Reedy wrote: def print(s): return sys.stdout.buffer.write(s.encode('utf-8')) Here is a better solution that lets me send any string to the function: def print(html): return sys.stdout.buffer.write(("Content-type:te

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 05 Dec 2009 11:26:34 +0100, Alf P. Steinbach wrote: Regarding my terminology, "routine" instead "function" that everybody except you remarked on, it is of course intentional. [...] I think you failed to realise that your use of the term

Re: When will Python 3 be fully deployed

2009-12-06 Thread Martin P. Hellwig
Edward A. Falk wrote: For development purposes, you should stick with the oldest version that will actually run your code. Every time you move to a more modern version, you're leaving potential users/customers out in the cold. If the fear of customers disatification prevents you from using a

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-06 Thread Alf P. Steinbach
* Dennis Lee Bieber: On Sat, 05 Dec 2009 11:26:34 +0100, "Alf P. Steinbach" declaimed the following in gmane.comp.python.general: The devolution of terminology has been so severe that now even the Wikipedia article on this subject confounds the general concept of "routine"

<    4   5   6   7   8   9   10   11   12   13   >