Re: reddit = porn fodder

2010-09-13 Thread Marc Mientki
Am 13.09.2010 05:14, schrieb Xah Lee: note that reddit was originally somewhat a site for programers, written in common lisp. It is still for Lisp programmers: http://www.reddit.com/r/lisp/ regards Marc -- http://mail.python.org/mailman/listinfo/python-list

Re: Minimal-D

2010-09-13 Thread Lawrence D'Oliveiro
In message <798a0db8-0ef0-4f35-9427- b713fec45...@g10g2000vbc.googlegroups.com>, Kruptein wrote: > On Sep 13, 3:23 am, Lawrence D'Oliveiro > wrote: > >> In message >> <383a7e4b-819f-4bdf-9b0c-e22baa9b6...@n7g2000vbo.googlegroups.com>, >> Kruptein wrote: >> >> > Hey I'm creating a program called m

Re: Refactoring similar subclasses

2010-09-13 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : I have some code that currently takes four different classes, A, B, C and D, and subclasses each of them in the same way: class MyA(A): def method(self, x): result = super(MyA, self).method(x) if result == "spam": return "spam spam spam"

Re: Static typing, Python, D, DbC

2010-09-13 Thread Bearophile
John Nagle: > All signed Windows 7 drivers must pass Microsoft's static checker, > which checks that they don't have bad pointers and call all the > driver APIs correctly. I didn't know this, thank you. I'll read more about this topic. Eric S. Johansson: > If you are careless,

Re: Hide DOS console for .pyc file

2010-09-13 Thread Jonathan Hartley
On Sep 11, 11:32 am, Lawrence D'Oliveiro wrote: > In message , Peter Otten wrote: > > > Lawrence D'Oliveiro wrote: > > >> In message > >> <3a2d194c-9b34-4b84-8680-28bdfb53b...@y3g2000vbm.googlegroups.com>, Muddy > >> Coder wrote: > > >>> For a quick testing purpose, I deliver .pyc files to my cust

WMI in Python

2010-09-13 Thread KING LABS
Hi All, I am new to programming and python, Being a system administrator I have chose Inventory (Software & Hardware ) as my first project. I would like to know experts advice on the best way to build the same using python. I would like to this tool to evolve into full fledge application. I woul

ANN: Dabo 0.9.3 released

2010-09-13 Thread Ed Leafe
It's been a while, but we've finally released version 0.9.3 of the Dabo framework! Since Dabo has a Web Update feature that lets developers receive regular updates between releases, the changes won't be too big for most current users of the framework, but compared to the 0.9.2 release, l

Re: WMI in Python

2010-09-13 Thread Rodrick Brown
The easiest way to do this is to use the native OS tools readily available to do the collection and log to a central location or if possible shared location accessible by all systems, once you have all the data you want to feed into your RDBMS you could easily parse these logs using python and t

Re: WMI in Python

2010-09-13 Thread KING LABS
On Sep 13, 6:42 pm, Rodrick Brown wrote: > The easiest way to do this is to use the native OS tools readily available to > do the collection and log to a central location or if possible shared > location accessible by all systems, once you have all the data you want to > feed into your RDBMS yo

Re: WMI in Python

2010-09-13 Thread Ed Leafe
On Sep 13, 2010, at 9:51 AM, KING LABS wrote: > I am trying to learn Python programming. Since I need a custom > inventory management tool for my work place. I am considering it as a > project in the process of learning Python. > > I am not looking for easiest way of doing things. > I am consider

Re: Static typing, Python, D, DbC

2010-09-13 Thread Paul Rubin
Bearophile writes: > But in some situations you want a faster final program. Running the > run-time contracts only when you test the code and removing them when > you run the program for real sounds silly or dangerous. But life is > made of trade-offs, and running those contracts during testing is

Re: Looking for Python and Python/Django workplaces in Chicago

2010-09-13 Thread Aahz
In article <894aa094-70c8-4c0e-b2c6-f2b783f68...@l20g2000yqe.googlegroups.com>, Erik Reppen wrote: > >I'm a really strong front end web dev with an interest in becoming >more of a generalist web and app dev through Python. Anybody aware of >studios/agencies that actually prefer Python in Chicago

Re: WMI in Python

2010-09-13 Thread Aahz
In article , KING LABS wrote: > >I would like to collect the complete information of system hardware & >and also software installed from registry and add/remove program and >feed this data into database. You should subscribe to the win32 mailing list: http://mail.python.org/mailman/listinfo/py

Re: [Tutor] Arguments from the command line

2010-09-13 Thread Giacomo Boffi
Dennis Lee Bieber writes: > On Fri, 10 Sep 2010 12:25:17 +0200, Giacomo Boffi > declaimed the following in > gmane.comp.python.general: > >> Lawrence D'Oliveiro writes: >> >> > In message <8662yfklzu@aiuole.stru.polimi.it>, Giacomo Boffi wrote: >> > >> >> Dennis Lee Bieber writes: >> >>

Re: WMI in Python

2010-09-13 Thread Jerry Hill
On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > Hi All, > > I am new to programming and python, Being a system administrator I > have chose Inventory (Software & Hardware ) as my first project. You'll probably want to look at the python WMI module: http://timgolden.me.uk/python/wmi/index.html

Re: Python script for MySQL Passwords Unreliable on first boot (rc.local)

2010-09-13 Thread Thomas Jollans
On Monday 13 September 2010, it occurred to cloudcontrol to exclaim: > The script below works great when logged in as root and run from the > command line, but when run at first boot using /etc/rc.local in Ubuntu > 10.04, it fails about 25% of the time- the system root, mysql root and > some mysql

Re: palindrome iteration

2010-09-13 Thread Cousin Stanley
> To deal with "real" palindromes such as, "Madam, I'm Adam," > you should probably strip all spaces and punctuation: > > # untested > pat = re.compile(r'[a-z]') > def is_palindrome(s): > letters = pat.findall(s.lower()) > return letters == reversed(letters) Using python 2.5 the above

From IDL to Python

2010-09-13 Thread Chris
Hi, I'm an IDL user since years and try now to learn Python since a few days. I'm blogging the various steps of this transition to: http://idl2python.blogspot.com/ I hope that other IDL switchers can help me by commenting on the blog and helping (me and others) to learn quickly the basics of Pyth

smtplib with Google

2010-09-13 Thread narke
Hi, Can anyone please show me a workable example that can let me use google's smtp server to send out a message? Thanks. -- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer narke -- http://mail.python.org/mailman/listinfo/python-list

Re: reddit = porn fodder

2010-09-13 Thread namekuseijin
Xah Lee escreveu: reddit = porn fodder Didn't realize, but Reddit is now a porn fodder. http://www.reddit.com/r/LegalTeens/ http://www.reddit.com/r/highheels http://www.reddit.com/r/gonewild/ Its traffic also seems to incleased 10 times since 2008. See: Computer Language Websites Popularity.

business date and calendar libraries?

2010-09-13 Thread Chris Withers
Hi All, I'm wondering what libraries people would use to answer the following questions relating to business days: - on a naive level; "what's give me the last business day" (ie: skipping weekends) - on a less-naive level; same question but taking into account public holidays - on a horr

Frustrating segfaults with Shelf

2010-09-13 Thread Edward Grefenstette
Dear Pythonistas, Below is a simple script that reads relations from a generator (they're just tuples of strings) and attempts to write them to a database. It's simple as hell, and if I simply ignore the database and have it print to stdout by replacing the line "depsDB[str(index)] = rels" with "p

Re: smtplib with Google

2010-09-13 Thread member thudfoo
On Mon, Sep 13, 2010 at 9:20 AM, narke wrote: > > Hi, > > Can anyone please show me a workable example that can let me use > google's smtp server to send out a message?  Thanks. > Go here: http://code.activestate.com/recipes/langs/python/ and search for this gmail -- http://mail.py

Expected bahaviour of os.chroot and os.getcwd

2010-09-13 Thread r0g
Hi CLP! Not been here for ages, I hope everyone is doing well :) I just want to check if this is the intended behaviour (2.2 to 2.7)... import os print os.getcwd() os.chroot("/home/r0g/whatever/") print os.getcwd() os.chdir("/") print os.getcwd() /home/r0g/AAA_BACKED_UP/Code/py /home/r0g/AA

Re: Frustrating segfaults with Shelf

2010-09-13 Thread Emile van Sebille
On 9/13/2010 10:05 AM Edward Grefenstette said... Dear Pythonistas, Below is a simple script that reads relations from a generator (they're just tuples of strings) and attempts to write them to a database. It's simple as hell, Ecept of course that no one else can test it due to the dependencie

Re: How Python works: What do you know about support for negative indices?

2010-09-13 Thread Raymond Hettinger
[Ben Finney] > I encourage anyone whose messages are munged like that to seek > correction from their mail service provider, and switch to a different > one until it's fixed. The post was typed on a mobile device into the text window on Google Groups. It's too bad that inane concerns with newline

Re: Expected bahaviour of os.chroot and os.getcwd

2010-09-13 Thread Ian Kelly
On Mon, Sep 13, 2010 at 12:04 PM, r0g wrote: > i.e. So do I always have to change directory after changing into a chroot? > Yes, as documented in the man page for the chroot system call: This call changes an ingredient in the pathname resolution process and does > nothing else. > > This call do

PIL : "The _imaging C module is not installed"

2010-09-13 Thread Michel Claveau - MVP
Hello! (*** sorry for my bad english***) I have the message (title), but only with PIL 1.1.7 (Windows XP, Vista or 7 (32 bits or 64 bits)). I tried: _imaging.pyd exist in C:\Python26\Lib\site-packages\PIL OK python -v >>> import Image OK sys.path contain C:\Python26\Lib\site-packages\P

Re: From IDL to Python

2010-09-13 Thread kBob
On Sep 13, 9:58 am, Chris wrote: > Hi, > > I'm an IDL user since years and try now to learn Python since a few > days. > I'm blogging the various steps of this transition > to:http://idl2python.blogspot.com/ > I hope that other IDL switchers can help me by commenting on the blog > and helping (me

Re: is there a way to get the encoding of python file

2010-09-13 Thread Stef Mientki
On 12-09-2010 19:28, Robert Kern wrote: > On 9/12/10 4:14 AM, Stef Mientki wrote: >> hello, >> >> Is it possible to get the encoding of a python file from the first source >> line, >> (if there's any), >> after importing it ( with '__import__' ) >> >> # -*- coding: windows-1252 -*- > > The regu

Re: business date and calendar libraries?

2010-09-13 Thread David Robinow
On Mon, Sep 13, 2010 at 1:06 PM, Chris Withers wrote: > I'm wondering what libraries people would use to answer the following > questions relating to business days: > > - on a naive level; "what's give me the last business day" (ie: skipping > weekends) import datetime def is_weekend(year, month,

Re: SendKeys and Python 2.7

2010-09-13 Thread Michel Claveau - MVP
Re! Sorry for time, but I am very busy... With Python + Pywin32, you can force the activation of a window (before send some keys...) See: win32gui.SetForegroundWindow(w_handle) or win32gui.SetActiveWindow(w_handle) For to find a windows (and his handle), see: win32gui.EnumWindows()

Re: How Python works: What do you know about support for negative indices?

2010-09-13 Thread Raymond Hettinger
On Sep 10, 2:13 pm, Terry Reedy wrote: > Reading the third paragraph out of context, one can miss the restriction > to built-in objects. I had assumed that the conversion using len(), when > available, happened prior to the __getitem__ call. Yes, that's a common misconception. It is probably ba

Re: is there a way to get the encoding of python file

2010-09-13 Thread Robert Kern
On 9/13/10 2:00 PM, Stef Mientki wrote: On 12-09-2010 19:28, Robert Kern wrote: On 9/12/10 4:14 AM, Stef Mientki wrote: hello, Is it possible to get the encoding of a python file from the first source line, (if there's any), after importing it ( with '__import__' ) # -*- coding: windows-

Re: is there a way to get the encoding of python file

2010-09-13 Thread Thomas Jollans
On Monday 13 September 2010, it occurred to Robert Kern to exclaim: > On 9/13/10 2:00 PM, Stef Mientki wrote: > > On 12-09-2010 19:28, Robert Kern wrote: > >> On 9/12/10 4:14 AM, Stef Mientki wrote: > >>>hello, > >>> > >>> Is it possible to get the encoding of a python file from the first >

Newbie question about Python + CouchDB

2010-09-13 Thread C3
Total newbie here - have a quick question I have a script that takes data in a flat text file, breaks it up and builds a CouchDB with all my data - however during the loop in which the data is loaded into couchdb - I sometimes get crashes becuase of a duplicate Document ID (which in my case is

Converting an ugly path to a shell path

2010-09-13 Thread AmFreak
Hi, im using a QFileDialog to let the user select a path that is used later in a command send to the shell like this: retcode = Popen(command + " " + path, shell=True, stdout = PIPE, stderr = PIPE) The problem that occurs now is when the user selects an "ugly" path like this /home/user/

Re: Newbie question about Python + CouchDB

2010-09-13 Thread James Mills
On Tue, Sep 14, 2010 at 8:59 AM, C3 wrote: > i was wondering if it is possible to; > > 1. capture the HTTP status code for each post > 2. write logic around that code (such as "skip post if error code was a > 409") An appropriate exception should by thrown when it "crashes". Use an appropriate

Re: WMI in Python

2010-09-13 Thread prakash jp
Very true most systems admins requirement range from : knoowing the Service tag for a given IP to knowing the system harware details such as RAM sizes etc. This is where Remote Inventory Management comes in handy. There is vault of already existing vb scripts/perl scripts and batch files. To me it

Re: Converting an ugly path to a shell path

2010-09-13 Thread Jerry Hill
On Mon, Sep 13, 2010 at 7:07 PM, wrote: > The problem that occurs now is when the user selects an "ugly" path like > this /home/user/!" §$/. > The shell don't understand the special chars so i have to escape them with > "\" . > Is there a function that does this ? http://stackoverflow.com/questi

Re: SendKeys and Python 2.7

2010-09-13 Thread Jakson A. Aquino
On Mon, Sep 13, 2010 at 4:02 PM, Michel Claveau - MVP wrote: > Re! > > Sorry for time, but I am very busy... > > > With Python + Pywin32, you can force the activation of a window (before > send some keys...) > See: >  win32gui.SetForegroundWindow(w_handle) > > or >  win32gui.SetActiveWindow(w_hand

Re: smtplib with Google

2010-09-13 Thread narke
On 2010-09-13, member thudfoo wrote: > On Mon, Sep 13, 2010 at 9:20 AM, narke wrote: >> >> Hi, >> >> Can anyone please show me a workable example that can let me use >> google's smtp server to send out a message?  Thanks. >> > > Go here: > > http://code.activestate.com/recipes/langs/python/

Re: Expected bahaviour of os.chroot and os.getcwd

2010-09-13 Thread Lawrence D'Oliveiro
In message , r0g wrote: > i.e. So do I always have to change directory after changing into a chroot? When all else fails, read the man page . -- http://mail.python.org/mailman/listinfo/python-list

Re: Frustrating segfaults with Shelf

2010-09-13 Thread Edward Grefenstette
Dear Emile, Thank you for your response. Upgrading python and starting with a blank database somehow did the trick! Best, Edward On Sep 13, 7:09 pm, Emile van Sebille wrote: > On 9/13/2010 10:05 AM Edward Grefenstette said... > > > Dear Pythonistas, > > > Below is a simple script that reads rel

Re: WMI in Python

2010-09-13 Thread KING LABS
On Sep 13, 8:31 pm, Jerry Hill wrote: > On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > > Hi All, > > > I am new to programming and python, Being a system administrator I > > have chose Inventory (Software & Hardware ) as my first project. > > You'll probably want to look at the python WMI >

Re: WMI in Python

2010-09-13 Thread KING LABS
On Sep 14, 10:39 am, KING LABS wrote: > On Sep 13, 8:31 pm, Jerry Hill wrote: > > > On Mon, Sep 13, 2010 at 8:45 AM, KING LABS wrote: > > > Hi All, > > > > I am new to programming and python, Being a system administrator I > > > have chose Inventory (Software & Hardware ) as my first project. >