Re: python backup script

2013-05-06 Thread Peter Otten
Chris Angelico wrote: > It's also worth noting that the ~/ notation is a shell feature. You > may or may not be able to use it in config.read(). The latter. Combined with """ read(self, filenames) method of ConfigParser.ConfigParser instance Read and parse a filename or a list of filenames.

Re: First python program, syntax error in while loop

2013-05-06 Thread Mark Lawrence
On 07/05/2013 01:17, alex23 wrote: On May 6, 10:37 pm, Mark Lawrence wrote: One of these days I'll work out why some people insist on using superfluous parentheses in Python code. Could it be that they enjoy exercising their fingers by reaching for the shift key in conjunction with the 9 or 0

Horror!!!!

2013-05-06 Thread MoneyMaker
HORROR ! This site is intended for all horror fans. The site have been collected and collected links to horror fans and joining a membership you can add the best moments of terror. Member can share everything horror-related. for example, videos, photos, music, stories. We hope you enjoy

Re: First python program, syntax error in while loop

2013-05-06 Thread Dan Sommers
On Mon, 06 May 2013 17:17:01 -0700, alex23 wrote: > One of these days I'll work out why some programmers consider typing to > be "effort". An ironic comment from someone who goes by the moniker wu wei! ;-) The effort, of course, comes in determining what to type, and often how to type less. --

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Ignoramus30465
On 2013-05-06, Henry Law wrote: > On 05/05/13 18:11, Ignoramus16992 wrote: >> According to CIO.com > > What an amusing thread; lightened my (non-programmer) day. > I guess you are from the python newsgroup then. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Red Black Tree implementation?

2013-05-06 Thread Chris Angelico
On Tue, May 7, 2013 at 10:55 AM, duncan smith wrote: > Here's the text I usually prepend. > > > ##Copyright (c) 2013 duncan g. smith > ## > ##Permission is hereby granted, free of charge, to any person obtaining a > ##copy of this software and associated documentation files (the "Software"), > ##t

Re: Red Black Tree implementation?

2013-05-06 Thread Dan Stromberg
On Mon, May 6, 2013 at 5:55 PM, duncan smith wrote: > > What license? >> >> Thanks! >> >> > Here's the text I usually prepend. > > > ##Copyright (c) 2013 duncan g. smith > ## > ##Permission is hereby granted, free of charge, to any person obtaining a > ##copy of this software and associated docume

Re: distributing a binary package

2013-05-06 Thread Miki Tebeka
> Basically, I'd like to know how to create a proper setup.py script http://docs.python.org/2/distutils/setupscript.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Red Black Tree implementation?

2013-05-06 Thread duncan smith
On 03/05/13 03:00, Dan Stromberg wrote: On Wed, May 1, 2013 at 7:06 PM, duncan smith mailto:buzzard@invalid.invalid>> wrote: I have an implementation that you can try out. It's not based on any other implementation, so my bugs will be independent of any bugs in the code you're curre

Re: First python program, syntax error in while loop

2013-05-06 Thread Roy Smith
In article , alex23 wrote: > On May 6, 10:37 pm, Mark Lawrence wrote: > > One of these days I'll work out why some people insist on using > > superfluous parentheses in Python code.  Could it be that they enjoy > > exercising their fingers by reaching for the shift key in conjunction > > with

Re: First python program, syntax error in while loop

2013-05-06 Thread alex23
On May 6, 10:37 pm, Mark Lawrence wrote: > One of these days I'll work out why some people insist on using > superfluous parentheses in Python code.  Could it be that they enjoy > exercising their fingers by reaching for the shift key in conjunction > with the 9 or 0 key? One of these days I'll w

Re: python backup script

2013-05-06 Thread MRAB
On 06/05/2013 23:40, MMZ wrote: On Monday, May 6, 2013 6:12:28 PM UTC-4, Chris Angelico wrote: On Tue, May 7, 2013 at 5:01 AM, MMZ wrote: > username = config.get('client', 'mmz') > password = config.get('client', 'pass1') > hostname = config.get('client', 'localhost') Are 'mmz', 'pass1',

Re: python backup script

2013-05-06 Thread Chris Angelico
On Tue, May 7, 2013 at 8:40 AM, MMZ wrote: > Thanks Chris. you are right. > So I used them directly and removed configParser. The new error is: > > Traceback (most recent call last): > File "./bbk.py", line 11, in ? > for database in os.popen(database_list_command).readlines(): > NameError:

Re: python backup script

2013-05-06 Thread MMZ
On Monday, May 6, 2013 6:12:28 PM UTC-4, Chris Angelico wrote: > On Tue, May 7, 2013 at 5:01 AM, MMZ wrote: > > > username = config.get('client', 'mmz') > > > password = config.get('client', 'pass1') > > > hostname = config.get('client', 'localhost') > > > > Are 'mmz', 'pass1', and 'localhos

Re: python backup script

2013-05-06 Thread MRAB
On 06/05/2013 23:12, m...@socialassets.org wrote: On Monday, May 6, 2013 5:48:44 PM UTC-4, Enrico 'Henryx' Bianchi wrote: Enrico 'Henryx' Bianchi wrote: > cmd2 = subprocess.Popen(['gzip' '-c'], > shell=False, > stdout=filename) Doh, my fault: cmd2 = subprocess.Popen(['gzip' '-c'],

Re: python backup script

2013-05-06 Thread John Gordon
In <36d2b7cf-2537-46a6-b984-9fce7ddd3...@googlegroups.com> m...@socialassets.org writes: > > cmd2 = subprocess.Popen(['gzip' '-c'], > > > > shell=False, > > > > stdout=filename > > > > stdin=cmd1.stdout) > Thank you Enric

Re: python backup script

2013-05-06 Thread MMZ
stdin=cmd1.stdout) ^ SyntaxError: invalid syntax On Monday, May 6, 2013 5:48:44 PM UTC-4, Enrico 'Henryx' Bianchi wrote: > Enrico 'Henryx' Bianchi wrote: > > > > > cmd2 = subprocess.Popen(['gzip' '-c'], > > > shell=False, > > > stdout=filename) > > > > Doh, my fault: > > > >

Re: python backup script

2013-05-06 Thread mina
On Monday, May 6, 2013 5:48:44 PM UTC-4, Enrico 'Henryx' Bianchi wrote: > Enrico 'Henryx' Bianchi wrote: > > > > > cmd2 = subprocess.Popen(['gzip' '-c'], > > > shell=False, > > > stdout=filename) > > > > Doh, my fault: > > > > cmd2 = subprocess.Popen(['gzip' '-c'], > >

Re: python backup script

2013-05-06 Thread Chris Angelico
On Tue, May 7, 2013 at 5:01 AM, MMZ wrote: > username = config.get('client', 'mmz') > password = config.get('client', 'pass1') > hostname = config.get('client', 'localhost') Are 'mmz', 'pass1', and 'localhost' the actual values you want for username, password, and hostname? If so, don't pass them

Re: First python program, syntax error in while loop

2013-05-06 Thread Chris Angelico
On Tue, May 7, 2013 at 6:11 AM, Terry Jan Reedy wrote: > On 5/6/2013 11:31 AM, Roy Smith wrote: >> >> In article , >> Chris Angelico wrote: >>> If I ever have even the slightest doubt, I just go ahead and type >>> " operator precedence" into a web search and check it :) >> >> >> Well, that solve

Re: python backup script

2013-05-06 Thread Enrico 'Henryx' Bianchi
Enrico 'Henryx' Bianchi wrote: > cmd2 = subprocess.Popen(['gzip' '-c'], > shell=False, > stdout=filename) Doh, my fault: cmd2 = subprocess.Popen(['gzip' '-c'], shell=False, stdout=filename stdin=cmd1.stdout) Enrico -- htt

Re: python backup script

2013-05-06 Thread Enrico 'Henryx' Bianchi
MMZ wrote: > config.read("~/my.cnf") > username = config.get('client', 'mmz') > password = config.get('client', 'pass1') > hostname = config.get('client', 'localhost') ### A simple config file ### [client] user = mmz password = pass1 host = localhost ### EOF ### #!/usr/bin/env python import Conf

Re: python backup script

2013-05-06 Thread Matt Jones
Why do you have to use that file? Why can't you copy its contents into a new file in your working directory and make whatever changes necessary? Example of the changes your code makes me think you want: # The following options will be passed to all MySQL clients [client

PIL: check if image is animated

2013-05-06 Thread Sven
Hello, I am trying to check if an image is animated. I can't rely on the extension as it may be a gif that's been renamed to .jpg or something else and is still animated. I thought that this used to work: from PIL import Image def check_animated(img): try: img.seek(1) except (E

Re: python backup script

2013-05-06 Thread MMZ
Thanks Matt. my.cnf is a readonly file and cannot be changed or modified but do you know of a file that stores similar information on CentOS?I think I'm not reading from a right file maybe. On Monday, May 6, 2013 3:46:04 PM UTC-4, Matt Jones wrote: > I've never used ConfigParser either, but sho

Re: find overlapping lines & output times observed

2013-05-06 Thread Oscar Benjamin
On 6 May 2013 19:39, Linsey Raaijmakers wrote: > I have a file like this: > action startend > 50 53215321 > 7 53235347 > 12 53395351 > 45 53735373 > 45 54205420 > 25 54255425 [snip] your code below suggests

Re: Collision of Two Rect

2013-05-06 Thread Ian Kelly
On May 6, 2013 10:39 AM, "Joshua Landau" wrote: > > On 4 May 2013 00:42, Ian Kelly wrote: >> >> The other thing that is suspicious about the code you posted is that >> it has two different notions of the ball's position that are not >> necessarily in agreement. There is the ball_rect, and there

Re: First python program, syntax error in while loop

2013-05-06 Thread Terry Jan Reedy
On 5/6/2013 11:31 AM, Roy Smith wrote: In article , Chris Angelico wrote: On Mon, May 6, 2013 at 11:08 PM, Roy Smith wrote: On the other hand, I've long since given up trying to remember operator precedence in various languages. If I ever have even the slightest doubt, I just go ahead and p

Re: python backup script

2013-05-06 Thread Matt Jones
I've never used ConfigParser either, but shouldn't the "[client]" section have the options "mmz", "pass1", or "localhost" somewhere? Do you need to add them to that file? *Matt Jones* On Mon, May 6, 2013 at 2:20 PM, MMZ wrote: > On Monday, May 6, 2013 3:11:33 PM UTC-4, Jerry Hill wrote: > > O

Re: module install failures

2013-05-06 Thread Mark Lawrence
On 06/05/2013 19:50, Milton Mobley wrote: Hi there, I hate to bother you with this, but there doesn't seem to be any ordinary online help for such issues at python.org : Lately I have tried to install several Python modules that are wrappers for C/C++ base libraries on a Windo

Re: python backup script

2013-05-06 Thread MMZ
On Monday, May 6, 2013 3:11:33 PM UTC-4, Jerry Hill wrote: > On Mon, May 6, 2013 at 3:01 PM, MMZ wrote: > > > > I am trying to backup database on CentOS linux server,I'm getting error when > running the following script. anyone can help? > > > > > Traceback (most recent call last): > >  

Re: python backup script

2013-05-06 Thread Jerry Hill
On Mon, May 6, 2013 at 3:01 PM, MMZ wrote: > I am trying to backup database on CentOS linux server,I'm getting error > when running the following script. anyone can help? > > Traceback (most recent call last): > File "./backup.py", line 8, in ? > username = config.get('client', 'mmz') > F

python backup script

2013-05-06 Thread MMZ
I am trying to backup database on CentOS linux server,I'm getting error when running the following script. anyone can help? #!/usr/bin/env python import ConfigParser import os import time config = ConfigParser.ConfigParser() config.read("~/my.cnf") username = config.get('client', 'mmz') passwor

Re: socket programming

2013-05-06 Thread Arnaud Delobelle
On 6 May 2013 17:05, Chris Angelico wrote: > I've never used Twisted, so I can't say how good it is. All I know is > that what I learned about socket programming in C on OS/2 is still > valid on Windows and on Linux, and in every language I've ever used > (bar JavaScript and ActionScript, which a

module install failures

2013-05-06 Thread Milton Mobley
Hi there, I hate to bother you with this, but there doesn't seem to be any ordinary online help for such issues at python.org: Lately I have tried to install several Python modules that are wrappers for C/C++ base libraries on a Windows 7 64 bit system. I used pip in a virtualenv environment, and

find overlapping lines & output times observed

2013-05-06 Thread Linsey Raaijmakers
Hello, I have a file like this: action startend 50 53215321 7 53235347 12 53395351 45 53735373 45 54205420 25 54255425 26 54255425 50 54515451 45 54525452 14 5

distributing a binary package

2013-05-06 Thread Eric Frederich
Hello, Hopefully a simple question. Basically, I'd like to know how to create a proper setup.py script to install a package. The package exists as a single directory with a single __init__.py file and (currently) 93 .so files. Right now I just copy it into the site-packages directory but I'd like

Re: Collision of Two Rect

2013-05-06 Thread Joshua Landau
On 4 May 2013 00:42, Ian Kelly wrote: > The other thing that is suspicious about the code you posted is that > it has two different notions of the ball's position that are not > necessarily in agreement. There is the ball_rect, and there are also > the x and y variables. > You should be caref

Re: Help with loading file into an array

2013-05-06 Thread Joshua Landau
On 5 May 2013 07:06, peter berrett wrote: > I am trying to build a program that can find comets in a series of > astronomical images. I have already written functions to find the comet in > a series of images, the data of which is stored in embedded lists. > > The area I am having difficulty with

Re: socket programming

2013-05-06 Thread Chris Angelico
On Tue, May 7, 2013 at 1:54 AM, Pedro wrote: > Thanks for the reply. I'm sending short strings as commands to my server > machine so the socket module seems to be doing the trick reliably. I'll try > to add Twisted to my arsenal though. > Cheers I've never used Twisted, so I can't say how good

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Joshua Landau
On 6 May 2013 13:03, Steven D'Aprano wrote: > On Mon, 06 May 2013 17:30:33 +1000, Chris Angelico wrote: > > > On Mon, May 6, 2013 at 4:28 PM, Fábio Santos > > wrote: > >>> And of course, the Python Programmer's moral code is only 80 > >>> characters wide. > >> > >> No! Was it not seventy characte

Re: socket programming

2013-05-06 Thread Pedro
On Saturday, May 4, 2013 5:37:42 AM UTC-4, Irmen de Jong wrote: > On 4-5-2013 4:13, Pedro wrote: > SERVER: > > import socket # Import socket > module > > s = socket.socket() # Create a socket object > host = > socket.gethostname() # Get local machine name > port = 12345 # Reserve a port > for yo

Re: First python program, syntax error in while loop

2013-05-06 Thread Roy Smith
In article , Chris Angelico wrote: >On Mon, May 6, 2013 at 11:08 PM, Roy Smith wrote: >> On the other hand, I've long since given up trying to remember operator >> precedence in various languages. If I ever have even the slightest >> doubt, I just go ahead and put in the extra parens. > >If I e

Re: learning python

2013-05-06 Thread Michael Herman
realpython.com - just launched On Sun, May 5, 2013 at 9:08 AM, leonardo selmi wrote: > hi guys > > i need to find a good book to learn python with exercises and solutions, any > suggestions? > > thanks! > > best regards > > leonardo > > -- > http://mail.python.org/mailman/listinfo/python-list > -

Re: First python program, syntax error in while loop

2013-05-06 Thread rusi
On May 6, 6:08 pm, Roy Smith wrote: > BTW, in C, I used to write: > > return (foo) > > for years until somebody pointed out to me that > > return foo > > works.  I just assumed that if I had to write: > > if (foo) > while (foo) > for (foo; bar; baz) > > then > > return (foo) > > made sense too.

Re: First python program, syntax error in while loop

2013-05-06 Thread Chris Angelico
On Mon, May 6, 2013 at 11:08 PM, Roy Smith wrote: > On the other hand, I've long since given up trying to remember operator > precedence in various languages. If I ever have even the slightest > doubt, I just go ahead and put in the extra parens. If I ever have even the slightest doubt, I just g

Re: First python program, syntax error in while loop

2013-05-06 Thread Roy Smith
In article , Mark Lawrence wrote: > > while (number != guess) and (tries < 5): > > One of these days I'll work out why some people insist on using > superfluous parentheses in Python code. Could it be that they enjoy > exercising their fingers by reaching for the shift key in conjunction >

Re: First python program, syntax error in while loop

2013-05-06 Thread Neil Cerutti
On 2013-05-06, Mark Lawrence wrote: > On 06/05/2013 13:06, Neil Cerutti wrote: >> On 2013-05-03, John Gordon wrote: >>> In Neil Cerutti >>> writes: >>> Not quite yet. Players who guess correctly on the fifth try don't get credit. >>> >>> Are you sure? tries is initialized to zero an

Re: First python program, syntax error in while loop

2013-05-06 Thread Mark Lawrence
On 06/05/2013 13:06, Neil Cerutti wrote: On 2013-05-03, John Gordon wrote: In Neil Cerutti writes: Not quite yet. Players who guess correctly on the fifth try don't get credit. Are you sure? tries is initialized to zero and isn't incremented for the initial guess. while (number != gues

Re: First python program, syntax error in while loop

2013-05-06 Thread Neil Cerutti
On 2013-05-03, John Gordon wrote: > In Neil Cerutti writes: > >> Not quite yet. Players who guess correctly on the fifth try don't >> get credit. > > Are you sure? tries is initialized to zero and isn't > incremented for the initial guess. while (number != guess) and (tries < 5): Is the condi

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Steven D'Aprano
On Mon, 06 May 2013 17:30:33 +1000, Chris Angelico wrote: > On Mon, May 6, 2013 at 4:28 PM, Fábio Santos > wrote: >>> And of course, the Python Programmer's moral code is only 80 >>> characters wide. >> >> No! Was it not seventy characters wide? Was I fooled my entire life? > > Well you see, it

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Roy Smith
In article , Fábio Santos wrote: > > And of course, the Python Programmer's moral code is only 80 characters > wide. > > No! Was it not seventy characters wide? Was I fooled my entire life? The entire moral code in a semi-tweet. How convenient. -- http://mail.python.org/mailman/listinfo/pyth

Re: Python not starting

2013-05-06 Thread DRJ Reddy
> How did you get duplicate genericpath.pyc and stat.pyc files? > If they were duplicates, why didn't they have the right code in them? > It's probably not worth spending any more time investigating, but it is > still rather mysterious. > Steven When i was running idle on 4th of May,some error c

Re: pyC11 initial publication

2013-05-06 Thread Amirouche Boubekki
Héllo, Does it support macros ? Is it possible to retrieve the list of macros and define macro values ? Thanks, Amirouche 2013/5/4 Volker Birk > pyC11 is a grammar to parse programs in the C programming language > following ISO/IEC 9899:2011. It is written using pyPEG, a parsing > framework

Re: (Learner-here) Lists + Functions = headache

2013-05-06 Thread Mark Lawrence
On 06/05/2013 02:30, Bradley Wright wrote: Aha! lessons learned - got it! The next lesson is to read the link given in my signature, digest it and take action to avoid masses of superfluous newlines in your responses. TIA. -- If you're using GoogleCrap™ please read this http://wiki.pytho

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Fábio Santos
All good points. I should probably blame the smallness of my company aswell. On 6 May 2013 09:11, "Chris Angelico" wrote: > On Mon, May 6, 2013 at 5:49 PM, Fábio Santos > wrote: > > I may rise the average pay of a Python programmer in Portugal. I have > asked > > for a raise back in December, an

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Chris Angelico
On Mon, May 6, 2013 at 5:49 PM, Fábio Santos wrote: > I may rise the average pay of a Python programmer in Portugal. I have asked > for a raise back in December, and was told that it wouldn't happen before > this year. I have done well. I think I deserve better pay than a supermarket > employee no

ANN: eGenix mxODBC 3.2.3 - Python ODBC Database Interface

2013-05-06 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Python ODBC Database Interface Version 3.2.3 mxODBC is our commercially supported Python extension providing

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Karim
Le 06/05/2013 09:49, Fábio Santos a écrit : have asked for a raise back in December, and was told that it wouldn't happen before this year. I have done well. I think I deserve better pay than a supermarket employee now. I am sure that my efforts were appreciated and I will be rewarded. I am bei

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Fábio Santos
On 6 May 2013 08:55, "Karim" wrote: > > Austerity for python programmers in Portugal !? Actually, lack of a market. I can't seem to find any other job programming python. It's all php, VB, c#, and I think there is some COBOL in there too. But who knows. Maybe I'm looking in the wrong places. --

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Fábio Santos
On 6 May 2013 08:34, "Chris Angelico" wrote: > Well you see, it was 70 bytes back in the Python 2 days (I'll defer to > Steven for data points earlier than that), but with Python 3, there > were two versions: one was 140 bytes representing 70 characters, the > other 280 bytes representing 70 chara

Re: (Learner-here) Lists + Functions = headache

2013-05-06 Thread Chris Angelico
On Mon, May 6, 2013 at 3:39 PM, 8 Dihedral wrote: > Bradley Wright於 2013年5月6日星期一UTC+8上午8時59分15秒寫道: >> def fizz_cout(x): >> >> count = 0 >> >> for item in x: >> >> while item == "fizz": >> >> count += 1 >> > >> return count >> > This is not indented right

Re: Why do Perl programmers make more money than Python programmers

2013-05-06 Thread Chris Angelico
On Mon, May 6, 2013 at 4:28 PM, Fábio Santos wrote: >> And of course, the Python Programmer's moral code is only 80 characters >> wide. > > No! Was it not seventy characters wide? Was I fooled my entire life? Well you see, it was 70 bytes back in the Python 2 days (I'll defer to Steven for data p