Re: How to add a current string into an already existing list

2013-11-04 Thread Nick the Gr33k

Στις 5/11/2013 12:46 πμ, ο/η Denis McMahon έγραψε:

On Mon, 04 Nov 2013 19:03:58 +0200, Nick the Gr33k wrote:



There is no built in support in the python / mysql system for puttinga
list straight into a database, because mysql does not have"collection"
record type.


Does postgresql has this 'collection' record type



You could convert the python list into a storable entity, for example
imploding a list of strings with some arbitrary separator to create a
long string, store the long string, then when you read it from the
database explode it back into a list.
Which method you use is up to you. There may be others.
Pick a method and code it.


Okey here is my attempt to code your solution as best as i can get my 
head around it:


This is the part that is responsible to do the database insertion 
converting scalars to lists and backwards.


=
try:
		# if first time for webpage; create new record( primary key is 
automatic, hit is defaulted ), if page exists then update record
		cur.execute('''INSERT INTO counters (url) VALUES (%s) ON DUPLICATE KEY 
UPDATE hits = hits + 1''', page )

cID = cur.lastrowid

# fetch those columns that act as lists but are stored as 
strings
		cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE 
counterID = %s''', cID )

data = cur.fetchone

ref = data[0]
visit = data[1]
download = data[2]

# retrieve long strings and convert them into lists respectively
refs = ref.split()
visits = visit.split()
downloads = download.split()

# add current strings to the each list respectively
refs.appends( ref )
visits.appends( visit )
downloads.appends( download )

# convert lists back to longstrings
refs = ', '.join( refs )
visits = ', '.join( visits )
downloads = ', '.join( downloads )

# add this visitor entry into database (hits && downloads are 
defaulted)
		cur.execute('''INSERT INTO visitors (counterID, refs, host, city, 
useros, browser, visits, hits = hits + 1, downloads) VALUES (%s, %s, %s, 
%s, %s, %s, %s, %s, %s)''',

(cID, refs, host, city, useros, 
browser, visits, hits, downloads) )

con.commit()
except pymysql.ProgrammingError as e:
print( repr(e) )
con.rollback()
sys.exit(0)
===

Please tell me if this logic is correct, for some reason it doesn't do 
what i need it to do.


Thank you.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Basic Python Questions - Oct. 31, 2013

2013-11-04 Thread E.D.G.
"Jim Gibson"  wrote in message 
news:031120131018099327%jimsgib...@gmail.com...



One way to generate plot within a CGI program is this:


  To start off with, I am not a CGI expert.  Also, I have several 
degrees in the physical sciences and many years of doing computer 
programming.  But the programming work is done just to get various science 
projects to work.


  The question that I could not get an answer for was, “How can you get 
Gnuplot to run on an Internet server computer?”


  And I would eventually have to ask that same question for Python.

  My Internet Server looks like it has Perl, Perl5, and PHP available. 
And I have created a number of CGI Perl programs that run on the Web site. 
But as I said, I would not know how to get Gnuplot or Python to run at the 
site.


  Any recommendations for how to do that?  Or should I just do a search 
for the necessary documentation?


--
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread Steven D'Aprano
On Tue, 05 Nov 2013 04:33:46 +, Steven D'Aprano wrote:

> On Mon, 04 Nov 2013 14:34:23 -0800, jonas.thornvall wrote:
> 
>> Den måndagen den 4:e november 2013 kl. 15:27:19 UTC+1 skrev Dave Angel:
>>> On Mon, 4 Nov 2013 05:53:28 -0800 (PST), jonas.thornv...@gmail.com
>>> wrote:
> [...]
>>> > This is not the solution but this is why it is working.
>>> 
>>> > 65536=256^2=16^4=***4^8***=2^16
> 
> "this" being Jonas' alleged lossless compression method capable of
> compressing random data.

/facepalm

I meant "it", not "this", as in "why it (the compression method) is 
working". Sorry for any confusion.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread Steven D'Aprano
On Mon, 04 Nov 2013 14:34:23 -0800, jonas.thornvall wrote:

> Den måndagen den 4:e november 2013 kl. 15:27:19 UTC+1 skrev Dave Angel:
>> On Mon, 4 Nov 2013 05:53:28 -0800 (PST), jonas.thornv...@gmail.com
>> wrote:
[...]
>> > This is not the solution but this is why it is working.
>> 
>> > 65536=256^2=16^4=***4^8***=2^16

"this" being Jonas' alleged lossless compression method capable of 
compressing random data.


>> > Yes i am aware that 256 is a single byte 8 bits, but the approach
>> is valid anyway.

I must say, I cannot see the connection between the fact that 256**2 == 
2**16 and compression of random data. I might as well state that I have 
squared the circle, and offer as proof that 3+4 == 5+2.



>> And e ^ (I * pi) == -1
>> 
>> So what. ?
>> 
>> 
> e is an approximation... and your idea is not general for any n.

e is not an approximation, it is a symbolic name for an exact  
transcendental number which cannot be specified exactly by any finite 
number of decimal places.

Your comment about "n" is irrelevant, since Euler's Identity e**(i*pi)=-1 
has nothing to do with "n". But in case you actually meant "i", again you 
are mistaken. i is a symbolic name for an exact number.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Terry Reedy

On 11/4/2013 7:23 PM, Travis Griggs wrote:


On Nov 4, 2013, at 9:22 AM, Travis Griggs  wrote:


I'm playing with a BeagleBone Black running the angstrom distro. Of course, 
stock python is 2.7, I'd rather use python3. There isn't a python3 package 
available for angstrom. So I downloaded the source and compiled. It seemed to 
work pretty well. I used the basic approach outlined in the REAMDE:

./configure
make
make test
make install

Now, I want to repeat the process, but be a little more judicious about what 
all is compiled. For example, I don't really need tk stuff (in fact, it just 
kept telling me it wasn't there). And there's probably a number of other 
modules/libraries in the kitchen sink known as the stock install, that I could 
forgo on a tiny little computer like this.

I see, looking at ./configure --help | less, that I could provide 
--disable-FEATURE and --without-PACKAGE directives to my ./configure 
invocation. But what I don't see is how to generate a list of what 
FEATURES/PACKAGES I could put there for consideration of omission. Is there 
some magic juju that generates that?



Should I have asked this question on python-dev instead? Not currently 
subscribed there… but would if that would generate more informed responses.


pydev is for concrete discussion of developing future CPython releases.
Questions about using current releases belong here. If you cannot get an 
answer after a week, because no one knows or can get the answer, then 
there might be a case for improving something.


--
Terry Jan Reedy


--
https://mail.python.org/mailman/listinfo/python-list


Re: Trouble with utf-8 values

2013-11-04 Thread Ben Finney
Ulrich Goebel  writes:

> I have an object (a variable) name

This confuses me. Is it an object, a variable, or a name?

> which gets its value from a PostgreSQL database via a SELECT
> statement, an it sometimes has german special characters as ß, ä, ö...

What is the type of that object? You can interrogate Python for the
answer, by using ‘type(foo)’ which will return the type of the object
named by “foo”.

> Then I would like to insert that value into a table in a SQLite
> database. So I make a cursor cur on the table and prepare a SQL
> statement like this:
>
> sql = 'insert into tbl values(?)'
> cur.execute(sql, (name,))

What version of Python are you running?

Do you get different results in Python 2 versus Python 3? One of the
biggest improvements in Python 3 is the proper handling of Unicode, with
more explicit rejection of ambiguity between bytes versus text.

-- 
 \  “The face of a child can say it all, especially the mouth part |
  `\of the face.” —Jack Handey |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread Dave Angel
On Mon, 4 Nov 2013 14:34:23 -0800 (PST), jonas.thornv...@gmail.com 
wrote:

e is an approximation... and your idea is not general for any n.


e is certainly not an approximation,  and I never mentioned n.

--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list


Trouble with utf-8 values

2013-11-04 Thread Ulrich Goebel

Hallo,

again: a python beginner problem... but I spent ours to solve it without 
success.


I have an object (a variable) name, which gets its value from a 
PostgreSQL database via a SELECT statement, an it sometimes has german 
special characters as ß, ä, ö...


Then I would like to insert that value into a table in a SQLite 
database. So I make a cursor cur on the table and prepare a SQL 
statement like this:


sql = 'insert into tbl values(?)'
cur.execute(sql, (name,))

That ends up with the exception, for example,

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: 
ordinal not in range(128)


The "position 6" is exactly the position of the special character, ß in 
this case.


What to do?

Ulrich


--
Ulrich Goebel
Paracelsusstr. 120, 53177 Bonn
--
https://mail.python.org/mailman/listinfo/python-list


RE: Compiling Python 3.3.2 on CentOS 6.4 - unable to find compiled OpenSSL?

2013-11-04 Thread Joseph L. Casale
> Any thoughts on what we're doing wrong?

Building them yourself:)

Try iuscommunity.org for prebuilt packages...
-- 
https://mail.python.org/mailman/listinfo/python-list


Compiling Python 3.3.2 on CentOS 6.4 - unable to find compiled OpenSSL?

2013-11-04 Thread Victor Hooi
Hi,

We have a machine running CentOS 6.4, and we're attempting to compile Python 
3.3.2 on it:

# cat /etc/redhat-release
CentOS release 6.4 (Final)

We've compiled openssl 1.0.1e 11 by hand on this box, and installed it into 
/usr/local/:

# openssl
OpenSSL> version
OpenSSL 1.0.1e 11 Feb 2013
 
# ls /usr/local/include/openssl/
aes.h   blowfish.h  cmac.h  crypto.h   dso.h ec.h  
hmac.h  md4.h  obj_mac.h  pem2.hrand.hsafestack.h  ssl23.h  
symhacks.h   ui.h
asn1.h  bn.hcms.h   des.h  dtls1.h   engine.h  
idea.h  md5.h  ocsp.h pem.h rc2.h seed.h   ssl2.h   
tls1.h   whrlpool.h
asn1_mac.h  buffer.hcomp.h  des_old.h  ebcdic.h  e_os2.h   
krb5_asn.h  mdc2.h opensslconf.h  pkcs12.h  rc4.h sha.hssl3.h   
ts.h x509.h
asn1t.h camellia.h  conf_api.h  dh.h   ecdh.herr.h 
kssl.h  modes.hopensslv.h pkcs7.h   ripemd.h  srp.hssl.h
txt_db.h x509v3.h
bio.h   cast.h  conf.h  dsa.h  ecdsa.h   evp.h 
lhash.h objects.h  ossl_typ.h pqueue.h  rsa.h srtp.h   stack.h  
ui_compat.h  x509_vfy.h

However, when we try to build Python 3.3.2, it can't seem to find the SSL 
installation:

# make
---
Modules/Setup.dist is newer than Modules/Setup;
check to make sure you have all the updates you
need in your Modules/Setup file.
Usually, copying Modules/Setup.dist to Modules/Setup will work.
---
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_ssl' extension
gcc -pthread -fPIC -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-I./Include -I. -IInclude -I/usr/local/include -I/root/Python-3.3.2/Include 
-I/root/Python-3.3.2 -c /root/Python-3.3.2/Modules/_ssl.c -o 
build/temp.linux-x86_64-3.3/root/Python-3.3.2/Modules/_ssl.o
gcc -pthread -shared 
build/temp.linux-x86_64-3.3/root/Python-3.3.2/Modules/_ssl.o -L/usr/local/lib 
-lssl -lcrypto -o build/lib.linux-x86_64-3.3/_ssl.cpython-33m.so
*** WARNING: renaming "_ssl" since importing it failed: 
build/lib.linux-x86_64-3.3/_ssl.cpython-33m.so: undefined symbol: 
EC_KEY_new_by_curve_name
 
Python build finished, but the necessary bits to build these modules 
were not found:
_dbm   _gdbm  _lzma  
_tkinter  
To find the necessary bits, look in setup.py in detect_modules() for 
the module's name.
 
 
Failed to build these modules:
_ssl 
 
running build_scripts
copying and adjusting /root/Python-3.3.2/Tools/scripts/pydoc3 -> 
build/scripts-3.3
copying and adjusting /root/Python-3.3.2/Tools/scripts/idle3 -> 
build/scripts-3.3
copying and adjusting /root/Python-3.3.2/Tools/scripts/2to3 -> 
build/scripts-3.3
copying and adjusting /root/Python-3.3.2/Tools/scripts/pyvenv -> 
build/scripts-3.3
changing mode of build/scripts-3.3/pydoc3 from 644 to 755
changing mode of build/scripts-3.3/idle3 from 644 to 755
changing mode of build/scripts-3.3/2to3 from 644 to 755
changing mode of build/scripts-3.3/pyvenv from 644 to 755
renaming build/scripts-3.3/pydoc3 to build/scripts-3.3/pydoc3.3
renaming build/scripts-3.3/idle3 to build/scripts-3.3/idle3.3
renaming build/scripts-3.3/2to3 to build/scripts-3.3/2to3-3.3
renaming build/scripts-3.3/pyvenv to build/scripts-3.3/pyvenv-3.3

I also tried editing the Modules/Setup.dist file, no luck there either.

Any thoughts on what we're doing wrong?

Cheers,
Victor
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Travis Griggs

On Nov 4, 2013, at 9:22 AM, Travis Griggs  wrote:

> I'm playing with a BeagleBone Black running the angstrom distro. Of course, 
> stock python is 2.7, I'd rather use python3. There isn't a python3 package 
> available for angstrom. So I downloaded the source and compiled. It seemed to 
> work pretty well. I used the basic approach outlined in the REAMDE:
> 
> ./configure
> make
> make test
> make install
> 
> Now, I want to repeat the process, but be a little more judicious about what 
> all is compiled. For example, I don't really need tk stuff (in fact, it just 
> kept telling me it wasn't there). And there's probably a number of other 
> modules/libraries in the kitchen sink known as the stock install, that I 
> could forgo on a tiny little computer like this.
> 
> I see, looking at ./configure --help | less, that I could provide 
> --disable-FEATURE and --without-PACKAGE directives to my ./configure 
> invocation. But what I don't see is how to generate a list of what 
> FEATURES/PACKAGES I could put there for consideration of omission. Is there 
> some magic juju that generates that?
> 

Should I have asked this question on python-dev instead? Not currently 
subscribed there… but would if that would generate more informed responses.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Practice Problems

2013-11-04 Thread alex23

On 4/11/2013 12:06 PM, yungwong@gmail.com wrote:

Hi, who has some problems to practice using Python?


Try http://projecteuler.net/

--
https://mail.python.org/mailman/listinfo/python-list


Re: ValueError: zero length field name in format - Running under Python 2.7.3?

2013-11-04 Thread Victor Hooi
Hi,

You're right - it was sudo playing up with the virtualenv.

The script was in /opt, so I was testing with sudo to get it to run.

I should have setup a service account, and tested it with that =).

$ python sync_bexdb.py
2.7.3 (default, Jan  7 2013, 11:52:52)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]

$ sudo python sync_bexdb.py
[sudo] password for victor:
2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]

Cheers,
Victor

On Tuesday, 5 November 2013 10:02:50 UTC+11, Chris Angelico  wrote:
> On Tue, Nov 5, 2013 at 9:33 AM, Victor Hooi  wrote:
> 
> > However, when I run this line, I get the following error:
> 
> >
> 
> > Traceback (most recent call last):
> 
> >   File "my_script.py", line 25, in 
> 
> > LOG_FILENAME = 
> > 'my_something_{}.log'.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S'))
> 
> > ValueError: zero length field name in format
> 
> >
> 
> >
> 
> > The weird thing, when I start a Python REPL and run that line 
> > interactively, it works fine
> 
> 
> 
> Google tells me that that was an issue in Python 2.6, so my first
> 
> check would be to see what `/usr/bin/env python` actually gives you -
> 
> are you running inside an environment that changes your path? Drop a
> 
> "import sys; print(sys.version)" at the top of your script and see
> 
> what it's really running as.
> 
> 
> 
> ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: zero argument member functions versus properties

2013-11-04 Thread Peter Cacioppi
Ian said :

"Since the compiler generally can't predict what the types of objects will be, 
the bytecode that it generates can't depend on those types." 

very nice, the py is strong with you. Thanks, Pete



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ValueError: zero length field name in format - Running under Python 2.7.3?

2013-11-04 Thread Chris Angelico
On Tue, Nov 5, 2013 at 9:33 AM, Victor Hooi  wrote:
> However, when I run this line, I get the following error:
>
> Traceback (most recent call last):
>   File "my_script.py", line 25, in 
> LOG_FILENAME = 
> 'my_something_{}.log'.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S'))
> ValueError: zero length field name in format
>
>
> The weird thing, when I start a Python REPL and run that line interactively, 
> it works fine

Google tells me that that was an issue in Python 2.6, so my first
check would be to see what `/usr/bin/env python` actually gives you -
are you running inside an environment that changes your path? Drop a
"import sys; print(sys.version)" at the top of your script and see
what it's really running as.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to add a current string into an already existing list

2013-11-04 Thread Denis McMahon
On Mon, 04 Nov 2013 19:03:58 +0200, Nick the Gr33k wrote:

> Please since this column you mentioned is able to store a Python's list
> datatype could you tell me what needs alternation in:

We've already told you, there is NO mysql datatype that can store a 
python list directly. There are ways of storing lists in mysql, but you 
can't pass a list directly into a mysql update or insert query as a 
single record field (you may be able to pass a list of tuples in for a 
multi row update or insert, but that's a different issue).

You could convert the python list into a storable entity, for example 
imploding a list of strings with some arbitrary separator to create a 
long string, store the long string, then when you read it from the 
database explode it back into a list.

Or you could store each element of the list in a "downloads" tables along 
with a reference to the associated record in the "users" table.

These are two possible methods of storing a list that is associated with 
a user entry. Which method you use is up to you. There may be others. 
Pick a method and code it.

There is no built in support in the python / mysql system for putting a 
list straight into a database, because mysql does not have a "collection" 
record type.

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


ValueError: zero length field name in format - Running under Python 2.7.3?

2013-11-04 Thread Victor Hooi
Hi,

I have a Python script that's using a format string without positional 
specifiers. I.e.:

LOG_FILENAME = 
'my_something_{}.log'.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S'))

I'm running this from within a virtualenv, running under Python 2.7.3.

$ python -V
Python 2.7.3
$ which python
/opt/my_project_venv/bin/python

The first line of the script is:

#!/usr/bin/env python

However, when I run this line, I get the following error:

Traceback (most recent call last):
  File "my_script.py", line 25, in 
LOG_FILENAME = 
'my_something_{}.log'.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S'))
ValueError: zero length field name in format


The weird thing, when I start a Python REPL and run that line interactively, it 
works fine:

$ python
Python 2.7.3 (default, Jan  7 2013, 11:52:52)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> LOG_FILENAME = 
'my_project_{}.log'.format(datetime.now().strftime('%Y-%d-%m_%H.%M.%S'))
>>> print(LOG_FILENAME)
my_project_2013-05-11_09.29.47.log

My understanding was that in Python 2.7/3.1, you could omit the positional 
specifiers in a format string.



Cheers,
Victor
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread jonas . thornvall
Den måndagen den 4:e november 2013 kl. 15:27:19 UTC+1 skrev Dave Angel:
> On Mon, 4 Nov 2013 05:53:28 -0800 (PST), jonas.thornv...@gmail.com 
> 
> wrote:
> 
> > Den lördagen den 2:e november 2013 kl. 22:31:09 UTC+1 skrev Tim 
> 
> Roberts:
> 
> > > Here's another way to look at it.  If f(x) is smaller than x for 
> 
> every x,
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > > that means there MUST me multiple values of x that produce the 
> 
> same f(x).
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > > Do you see?  If x is three bits and f(x) is two bits, that means 
> 
> there are
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > > 8 possible values for x but only 4 values for f(x).  So, given an 
> 
> f(x), y=
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > > cannot tell which value of x it came from.  You have lost 
> 
> information.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > Well let me try to explain why it is working and i have implemented 
> 
> one.
> 
> > I only need to refresh my memory it was almost 15 years ago.
> 
> > This is not the solution but this is why it is working.
> 
> > 65536=256^2=16^4=***4^8***=2^16
> 
> 
> 
> 
> 
> > Yes i am aware that 256 is a single byte 8 bits, but the approach 
> 
> is valid =
> 
> > anyway.
> 
> 
> 
> And e ^ (I * pi) == -1
> 
> So what. ?
> 

e is an approximation... and your idea is not general for any n.
 
> 
> Better file that patent, before the patent office realizes the 
> 
> analogy to the perpetual motion machine.
> 
> 
> 
> -- 
> 
> DaveA

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Practice Problems

2013-11-04 Thread Amirouche Boubekki
https://github.com/amirouche/1001-Projects


2013/11/4 Terry Reedy 

> On 11/4/2013 12:28 AM, memilanuk wrote:
>
>> On 11/03/2013 06:06 PM, yungwong@gmail.com wrote:
>>
>>> Hi, who has some problems to practice using Python?
>>> Thx a lot!
>>>
>>>
>> http://projecteuler.net/ is always a good bet
>>
>
> Also www.checkio.org
>
>
> --
> Terry Jan Reedy
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python and Google App intergration

2013-11-04 Thread Amirouche Boubekki
Héllo,


Look for Google Apps APIs. I'm not sure what you want to do is possible, at
least manipulating the spreadsheet is doable from Pythonl:

http://stackoverflow.com/questions/2377301/how-to-write-a-python-script-to-manipulate-google-spreadsheet-data


2013/11/4 

> I don't know Python well.  Only recently started taking the
> Codeacademy.com class.
> Is there a way to take input from a Google Spreadsheet and use it to add
> membership to a Google Group?
> If not Python, is there another language that could perform this function?
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Amirouche Boubekki
Hi Travis,

I see, looking at ./configure --help | less, that I could provide
> --disable-FEATURE and --without-PACKAGE directives to my ./configure
> invocation. But what I don't see is how to generate a list of what
> FEATURES/PACKAGES I could put there for consideration of omission. Is there
> some magic juju that generates that?
>

I don't remember correctly, I think it's a environment variable, also there
was a bug in python 2.7 regarding this...

Have a look at the setup.py of your python version there is some juju magic
mojo variable that configures the compiled extensions [1]

Also, whenever you want to compile something check gentoo ebuild aka.
compilation recipe, for instance for Python
3.3.2or
linux
from scratch .

Distcc might be helpful.


[1]
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.2.3.ebuild?view=markup
-- 
https://mail.python.org/mailman/listinfo/python-list


Auto-authorization for Google Drive using Python in Mac OS X

2013-11-04 Thread Pratik Mehta
I have written Python code for Google Drive which uploads the image files to my 
drive app. I have three queries. Here is my code:

#!/usr/bin/python

import httplib2
import pprint

from apiclient.discovery import build
from apiclient.http import MediaFileUpload
from oauth2client.client import OAuth2WebServerFlow
from apiclient import errors
import sys


CLIENT_ID = 'CLIENT_ID'
CLIENT_SECRET = 'CLIENT_SECRET'

OAUTH_SCOPE = ['https://www.googleapis.com/auth/drive.readonly', 
'https://www.googleapis.com/auth/drive.file']

REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'

FILENAME = "filepath/filename.png"

flow = OAuth2WebServerFlow(CLIENT_ID, CLIENT_SECRET, OAUTH_SCOPE, REDIRECT_URI)
flow.params['access_type'] = 'offline'
flow.params['approval_prompt'] = 'force'
authorize_url = flow.step1_get_authorize_url()
print 'Go to the following link in your browser: ' + authorize_url
code = raw_input('Enter verification code: ').strip()

credentials = flow.step2_exchange(code)

http = httplib2.Http()
http = credentials.authorize(http)

drive_service = build('drive', 'v2', http=http)

media_body = MediaFileUpload(FILENAME, mimetype='image/png', resumable=True)
body = {
'title': 'Screen Shot 2013-11-03 at 3.54.08 AM',
'description': 'A test screenshot',
'mimeType': 'image/png'
}

file = drive_service.files().insert(body=body, media_body=media_body).execute()

new_permission = {
  'type': 'anyone',
  'role': 'reader'
}

try:
drive_service.permissions().insert(
fileId=file['id'], body=new_permission).execute()
except errors.HttpError, error:
print 'An error occurred: %s' % error

pprint.pprint(file)



My Queries:

1. This program will upload all the images to my given client_id and 
client_secret.
How do I make users to use my app and upload their images to their own Google 
Drive?

2. I want to automate this task. Whenever I run this application in terminal, 
it always asks me for the authorization code, which I don't want. Can this be 
bypassed?

3. I read about refresh_tokens, but couldn't find how can I implement this in 
my app for automating the authorization.
So, is refresh_tokens used for that? If yes, then how do I implement it in my 
program?
If not, then how can I make sure that as soon as my application is loaded, that 
particular file gets uploaded on google drive directly, without any 
authorization, or with any auto-authorization way, so that user interaction is 
chucked completely.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Serhiy Storchaka

04.11.13 20:01, Mark Lawrence написав(ла):

On 04/11/2013 17:34, Ethan Furman wrote:

On 11/04/2013 09:29 AM, random...@fastmail.us wrote:


I did, incidentally, notice a bug in macpath's *split* function;
macpath.split(':foo::bar') should return (':foo::','bar') rather than
(':foo:','bar').


Open a bug report.  :)

http://bugs.python.org

--
~Ethan~


Before or after it's been discussed on Python ideas? :)


Instead.

--
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Mark Lawrence

On 04/11/2013 17:34, Ethan Furman wrote:

On 11/04/2013 09:29 AM, random...@fastmail.us wrote:


I did, incidentally, notice a bug in macpath's *split* function;
macpath.split(':foo::bar') should return (':foo::','bar') rather than
(':foo:','bar').


Open a bug report.  :)

http://bugs.python.org

--
~Ethan~


Before or after it's been discussed on Python ideas? :)

--
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Ethan Furman

On 11/04/2013 09:29 AM, random...@fastmail.us wrote:


I did, incidentally, notice a bug in macpath's *split* function;
macpath.split(':foo::bar') should return (':foo::','bar') rather than
(':foo:','bar').


Open a bug report.  :)

http://bugs.python.org

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread rusi
On Monday, November 4, 2013 9:47:18 PM UTC+5:30, Chris Angelico wrote:
> Blargh, wrong list. It should have been private anyway. Kindly take no
> notice of the man behind the 3AM clock...
> 
> 
> ChrisA

Ive got a little list Ive got a little list
For Australians of all kinds Ive got a little list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread random832
On Mon, Nov 4, 2013, at 11:07, Chris Angelico wrote:
> Then os.path.join is probably the wrong tool for the job. Do you want
> to collapse "/foo/bar" + "../quux" into "/foo/quux"? That rewrites the
> first. If not, don't use a function that does that. Try simple string
> concatenation instead.

>>> posixpath.join('/foo/bar','../quux')
'/foo/bar/../quux'
>>> macpath.join('foo:bar','::quux')
'foo:bar::quux'

The old mac module (and VMS if it existed) demonstrates join does more
than simply put two things together with sep between (also neatly
demonstrating why "simple string concatenation" is not a viable
solution), so this is clearly deliberate behavior rather than something
that merely "falls out of" a naive implementation as one could assume
the posix one to be.

I did, incidentally, notice a bug in macpath's *split* function;
macpath.split(':foo::bar') should return (':foo::','bar') rather than
(':foo:','bar').
-- 
https://mail.python.org/mailman/listinfo/python-list


Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Travis Griggs
I'm playing with a BeagleBone Black running the angstrom distro. Of course, 
stock python is 2.7, I'd rather use python3. There isn't a python3 package 
available for angstrom. So I downloaded the source and compiled. It seemed to 
work pretty well. I used the basic approach outlined in the REAMDE:

./configure
make
make test
make install

Now, I want to repeat the process, but be a little more judicious about what 
all is compiled. For example, I don't really need tk stuff (in fact, it just 
kept telling me it wasn't there). And there's probably a number of other 
modules/libraries in the kitchen sink known as the stock install, that I could 
forgo on a tiny little computer like this.

I see, looking at ./configure --help | less, that I could provide 
--disable-FEATURE and --without-PACKAGE directives to my ./configure 
invocation. But what I don't see is how to generate a list of what 
FEATURES/PACKAGES I could put there for consideration of omission. Is there 
some magic juju that generates that?

Travis Griggs
--I multiply all estimates by tau to account for running around in circles
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to add a current string into an already existing list

2013-11-04 Thread Nick the Gr33k

Στις 3/11/2013 2:16 μμ, ο/η Roy Smith έγραψε:

In article ,
  Gregory Ewing  wrote:


Nick the Gr33k wrote:

I just want a mysql column type that can be eligible to store an array
of elements, a list that is, no need for having a seperate extra table
for that if we can have a column that can store a list of values.


Relational database systems typically don't provide any
such type, because it's not the recommended way of storing
that kind of data in a relational database.

The recommended way is to use a secondary table, as has
been pointed out.


Most SQL databases allow you to store arbitrary data as an opaque value
(i.e. BLOB).  So, one possibility would be to just serialize your list
(pickle, json, whatever) and store it that way.  I've seen databases
that didn't use BLOB, but just stored json in a string field.

The limitation, of course, is that the data is opaque as far as the
database goes; you can't do queries against it.  But, if all you need to
do is store the list and be able to retrieve it, it's a perfectly
reasonable thing to do, and a lot more efficient than doing a join on a
secondary table.

Normalization is for database weenies :-)



Exactly my sentiments Roy!

Call me picky but even if they try to hit me hard i wll always get to 
pick the simplest and better looking way.



I have managed to make my code work by:


create table visitors
(
  counterID integer(5) not null,
  host varchar(50) not null,
  refs varchar(25) not null,
  city varchar(20) not null,
  userOS varchar(10) not null,
  browser varchar(10) not null,
  visits datetime not null,
  hits integer(5) not null default 1,
  downloads varchar(50) not null default '',
  foreign key (counterID) references counters(ID),
  unique index (visits)
 )ENGINE = MYISAM;


=
# add this visitor entry into database (hits && downloads are defaulted)
cur.execute('''INSERT INTO visitors (counterID, refs, host, city, 
useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s)''',  (cID, 
ref, host, city, useros, browser, lastvisit) )

=

and later on 

=
torrents = []
# check if visitor has downloaded movies
for download in downloads:
if download != '':
torrents.append( download )

# present visitor's movie picks if any
if torrents:
print( '' )
for n, torrent in enumerate( torrents ):
if n == 0:
op_selected = 'selected'
else:
op_selected = ''
print( ' %s ' % (op_selected, torrent) )
print( '' )
else:
	print( ' Δεν πραγματοποίηθηκαν ακόμη! 
' )

break
=


Please since this column you mentioned is able to store a Python's list 
datatype could you tell me what needs alternation in:


1. MySQL's visitor's table definition time
2. python database cur.execute method
3. retrieval time

Thank you very much for anyone wishes to give me a hand here.

--
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Ethan Furman

On 11/04/2013 08:07 AM, Chris Angelico wrote:

On Tue, Nov 5, 2013 at 2:29 AM, anatoly techtonik  wrote:

Right. But I am working more with URL paths nowadays. In there if I
want to join two paths, no matter if 2nd starts with slash or not, I
don't really expect the 2nd to rewrite the first.


Then os.path.join is probably the wrong tool for the job. Do you want
to collapse "/foo/bar" + "../quux" into "/foo/quux"? That rewrites the
first. If not, don't use a function that does that. Try simple string
concatenation instead.


Wrong mailing list.  ;)

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Chris Angelico
Blargh, wrong list. It should have been private anyway. Kindly take no
notice of the man behind the 3AM clock...

ChrisA

On Tue, Nov 5, 2013 at 3:07 AM, Chris Angelico  wrote:
> On Tue, Nov 5, 2013 at 2:29 AM, anatoly techtonik  wrote:
>> Right. But I am working more with URL paths nowadays. In there if I
>> want to join two paths, no matter if 2nd starts with slash or not, I
>> don't really expect the 2nd to rewrite the first.
>
> Then os.path.join is probably the wrong tool for the job. Do you want
> to collapse "/foo/bar" + "../quux" into "/foo/quux"? That rewrites the
> first. If not, don't use a function that does that. Try simple string
> concatenation instead.
>
> ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-ideas] os.path.join

2013-11-04 Thread Chris Angelico
On Tue, Nov 5, 2013 at 2:29 AM, anatoly techtonik  wrote:
> Right. But I am working more with URL paths nowadays. In there if I
> want to join two paths, no matter if 2nd starts with slash or not, I
> don't really expect the 2nd to rewrite the first.

Then os.path.join is probably the wrong tool for the job. Do you want
to collapse "/foo/bar" + "../quux" into "/foo/quux"? That rewrites the
first. If not, don't use a function that does that. Try simple string
concatenation instead.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Slicing with negative strides

2013-11-04 Thread Steven D'Aprano
On Mon, 04 Nov 2013 00:15:40 +0100, Martin Manns wrote:

> On 29 Oct 2013 05:22:00 GMT
> Steven D'Aprano  wrote:
> 
>> Does anyone here use slices (or range/xrange) with negative strides
>> other than -1?
> 
> I have used negative strides for comparing discrete sequences e. g. for
> turbulence analysis, and I hope that my code will still run in Python 4.

Can you show us a typical example of how you would normally use such 
negative strides?


Thanks,



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread rusi
On Monday, November 4, 2013 7:57:19 PM UTC+5:30, Dave Angel wrote:
> On Mon, 4 Nov 2013 05:53:28 -0800 (PST), Jonas wrote:
> > Well let me try to explain why it is working and i have implemented one.
> > I only need to refresh my memory it was almost 15 years ago.
> > This is not the solution but this is why it is working.
> > 65536=256^2=16^4=***4^8***=2^16

> > Yes i am aware that 256 is a single byte 8 bits, but the approach 
> > is valid anyway.

> And e ^ (I * pi) == -1
> So what. ?

> Better file that patent, before the patent office realizes the 
> analogy to the perpetual motion machine.

Now I am too much of a dim-wit to comprehend all this compressified
profundification but I think I have a (dim) clue how such a patent
will be obtained:

Just make a submission in such an unreadable double (then triple,
quadruple...) spaced format that the patent office will grant it in
exasperation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread Dave Angel
On Mon, 4 Nov 2013 05:53:28 -0800 (PST), jonas.thornv...@gmail.com 
wrote:
Den lördagen den 2:e november 2013 kl. 22:31:09 UTC+1 skrev Tim 

Roberts:
> Here's another way to look at it.  If f(x) is smaller than x for 

every x,




> that means there MUST me multiple values of x that produce the 

same f(x).




> Do you see?  If x is three bits and f(x) is two bits, that means 

there are




> 8 possible values for x but only 4 values for f(x).  So, given an 

f(x), y=




> cannot tell which value of x it came from.  You have lost 

information.




Well let me try to explain why it is working and i have implemented 

one.

I only need to refresh my memory it was almost 15 years ago.
This is not the solution but this is why it is working.
65536=256^2=16^4=***4^8***=2^16



Yes i am aware that 256 is a single byte 8 bits, but the approach 

is valid =

anyway.


And e ^ (I * pi) == -1
So what. ?

Better file that patent, before the patent office realizes the 
analogy to the perpetual motion machine.


--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread jonas . thornvall
Den måndagen den 4:e november 2013 kl. 14:53:28 UTC+1 skrev 
jonas.t...@gmail.com:
> Den lördagen den 2:e november 2013 kl. 22:31:09 UTC+1 skrev Tim Roberts:
> 
> > jonas.thornv...@gmail.com wrote:
> 
> > 
> 
> > >
> 
> > 
> 
> > >Well then i have news for you.
> 
> > 
> 
> > 
> 
> > 
> 
> > Well, then, why don't you share it?
> 
> > 
> 
> > 
> 
> > 
> 
> > Let me try to get you to understand WHY what you say is impossible.  Let's
> 
> > 
> 
> > say you do have a function f(x) that can produce a compressed output y for
> 
> > 
> 
> > any given x, such that y is always smaller than x.  If that were true, then
> 
> > 
> 
> > I could call f() recursively:
> 
> > 
> 
> > f(f(...f(f(f(f(f(x)...))
> 
> > 
> 
> > and eventually the result get down to a single bit.  I hope it is clear
> 
> > 
> 
> > that there's no way to restore a single bit back into different source
> 
> > 
> 
> > texts.
> 
> > 
> 
> > 
> 
> > 
> 
> > Here's another way to look at it.  If f(x) is smaller than x for every x,
> 
> > 
> 
> > that means there MUST me multiple values of x that produce the same f(x).
> 
> > 
> 
> > Do you see?  If x is three bits and f(x) is two bits, that means there are
> 
> > 
> 
> > 8 possible values for x but only 4 values for f(x).  So, given an f(x), you
> 
> > 
> 
> > cannot tell which value of x it came from.  You have lost information.
> 
> > 
> 
> > -- 
> 
> > 
> 
> > Tim Roberts, t...@probo.com
> 
> > 
> 
> > Providenza & Boekelheide, Inc.
> 
> 
> 
> Well let me try to explain why it is working and i have implemented one.
> 
> I only need to refresh my memory it was almost 15 years ago.
> 
> This is not the solution but this is why it is working.
> 
> 65536=256^2=16^4=***4^8***=2^16
> 
> 
> 
> Yes i am aware that 256 is a single byte 8 bits, but the approach is valid 
> anyway.

You see if the program behave intelligent some small operations can perform 
wonder on a number.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread jonas . thornvall
Den lördagen den 2:e november 2013 kl. 22:31:09 UTC+1 skrev Tim Roberts:
> jonas.thornv...@gmail.com wrote:
> 
> >
> 
> >Well then i have news for you.
> 
> 
> 
> Well, then, why don't you share it?
> 
> 
> 
> Let me try to get you to understand WHY what you say is impossible.  Let's
> 
> say you do have a function f(x) that can produce a compressed output y for
> 
> any given x, such that y is always smaller than x.  If that were true, then
> 
> I could call f() recursively:
> 
> f(f(...f(f(f(f(f(x)...))
> 
> and eventually the result get down to a single bit.  I hope it is clear
> 
> that there's no way to restore a single bit back into different source
> 
> texts.
> 
> 
> 
> Here's another way to look at it.  If f(x) is smaller than x for every x,
> 
> that means there MUST me multiple values of x that produce the same f(x).
> 
> Do you see?  If x is three bits and f(x) is two bits, that means there are
> 
> 8 possible values for x but only 4 values for f(x).  So, given an f(x), you
> 
> cannot tell which value of x it came from.  You have lost information.
> 
> -- 
> 
> Tim Roberts, t...@probo.com
> 
> Providenza & Boekelheide, Inc.

Well let me try to explain why it is working and i have implemented one.
I only need to refresh my memory it was almost 15 years ago.
This is not the solution but this is why it is working.
65536=256^2=16^4=***4^8***=2^16

Yes i am aware that 256 is a single byte 8 bits, but the approach is valid 
anyway.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-04 Thread Tim Chase
On 2013-11-03 19:40, Mark Janssen wrote:
> But you cheated by using a piece of information from "outside the
> system": length.  A generic compression algorithm doesn't have this
> information beforehand.

By cheating with outside information, you can perfectly compress any
one data-set down to 1 bit.  Just store the data in the program, then
store 1 bit of "is this file the data we have stored in the
program?".  Granted, in modern OSes, you waste 7 extra bits since
they require you to write an entire byte at a time. :-)

And with that, you could even have an empty file and test for a file
extension. ;-)

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: install package from github repository

2013-11-04 Thread Chris Angelico
On Mon, Nov 4, 2013 at 8:56 PM, C. Ng  wrote:
> Hi,
>
> I have cloned someone's repository on my local drive using git command:
> git clone http://github.com/xxx.git
>
> But I don't find any setup.py file. How do I install the package xxx? So that 
> I can 'import xxx' in my python script.

Does the package have installation instructions? Look for a README or similar.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Automation

2013-11-04 Thread Denis McMahon
On Sun, 03 Nov 2013 23:32:46 +, Denis McMahon wrote:

> On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:
> 
>> I have one .xls file with the values of PV MV and SP, I wanna to
>> calculate Kp Ki Kd with python from this file, can anyone give me any
>> suggestion about how can I do this? From now, thanks.
> 
> Why use Python? Why not simply write excel to do the calculations?
> 
> Assuming PV, MV and SP are in columns, you simply need to write your
> equations for Kp, Ki and Kd so that they reference the relevant columns,
> and then past them down the whole spreadsheet.
> 
> Seems to me like you're using a sledgehammer to shell a peanut.

For some reason OP is now continuing the conversation with my by email 
and adding me to his social networks.

To the OP - observation - in the original post you said .xls file, 
not .csv file. If your data is in .csv format, you should have said so, 
not called it an .xls file.

If you ant to convert your .csv containing columns a, b and c into a .csv 
containing columns a, b, c, x, y and z, then the solution is to read your 
existing .csv file one line at a time, calculate the extra values x, y 
and z, and then write the 6 values to a new file.

You might want to delete the old file and rename the new one to the old 
name when you finish, that might be part of the implementation 
requirements.

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: install package from github repository

2013-11-04 Thread Amirouche Boubekki
create a setup.py and install it


2013/11/4 C. Ng 

> Hi,
>
> I have cloned someone's repository on my local drive using git command:
> git clone http://github.com/xxx.git
>
> But I don't find any setup.py file. How do I install the package xxx? So
> that I can 'import xxx' in my python script.
>
> Many thanks.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


install package from github repository

2013-11-04 Thread C. Ng
Hi,

I have cloned someone's repository on my local drive using git command:
git clone http://github.com/xxx.git

But I don't find any setup.py file. How do I install the package xxx? So that I 
can 'import xxx' in my python script. 

Many thanks.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-04 Thread Antoon Pardon
Op 04-11-13 10:07, Ben Finney schreef:
> Antoon Pardon  writes:
> 
>> This is a typical: "Heads, I win, Tail, you lose" situation that is
>> being set up.
> 
> If you see a discussion as a zero-sum game – like a coin toss, where one
> person's win can only be at the expense of someone else's loss – then I
> fear this isn't going to be productive.

I don't see it that way. My point is that Steve seems to work hard
creating the impression that he does see it that way. My impression
is that Steve is not that much interrested in a welcoming group as
he is interrested in a group where he himself feels at ease. Where
the two coincide, he argues for a welcoming group. Where the two
may be in conflict, he is more interested in defending his behaviour
or brushing it of than he is in contributing to a welcoming group.

> Suffice it to say that any number of parties can be behaving badly in a
> discussion. If one person declares their choice not to continue an
> unhelpful discussion, that does does not mean that they declare victory,
> nor that they declare defeat. Discussions that are about “winning” or
> “losing” the discussion are pretty futile in this forum anyway.

Unhelpful for whom? My thought is that a welcoming group is able to
resolve or a least discuss conflicts. If you declare the discussion
not helpful and see that as a reason not to continue with it, you
are IMO not contributing to such a group. With the numerous times
Steve told the rest about how he wants a welcoming group, he doesn't
seem that much interrested in actually doing an effort himself.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Practice Problems

2013-11-04 Thread Terry Reedy

On 11/4/2013 12:28 AM, memilanuk wrote:

On 11/03/2013 06:06 PM, yungwong@gmail.com wrote:

Hi, who has some problems to practice using Python?
Thx a lot!



http://projecteuler.net/ is always a good bet


Also www.checkio.org


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Automation

2013-11-04 Thread Mark Lawrence

On 04/11/2013 00:16, bob gailer wrote:

Let's remember that it is the job of the OP to explain his problem so we
can offer solutions.



It's also the job of the responder to help if possible, e.g. by 
providing some context with their messages, which is clearly absent above.


--
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-04 Thread Ben Finney
Antoon Pardon  writes:

> This is a typical: "Heads, I win, Tail, you lose" situation that is
> being set up.

If you see a discussion as a zero-sum game – like a coin toss, where one
person's win can only be at the expense of someone else's loss – then I
fear this isn't going to be productive.

Suffice it to say that any number of parties can be behaving badly in a
discussion. If one person declares their choice not to continue an
unhelpful discussion, that does does not mean that they declare victory,
nor that they declare defeat. Discussions that are about “winning” or
“losing” the discussion are pretty futile in this forum anyway.

-- 
 \  “The only tyrant I accept in this world is the still voice |
  `\ within.” —Mohandas Gandhi |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-04 Thread Antoon Pardon
Op 03-11-13 23:11, Ben Finney schreef:
> Antoon Pardon  writes:
> 
>> Op 03-11-13 06:17, Steven D'Aprano schreef:
>>> I'm trying hard to give up threads like this, where people debate
>>> the subjective tone of an email and ever more pedantic arguments
>>> about the precise wording. Even when all participants are arguing in
>>> good faith, they risk becoming quagmires which go nowhere in dozens
>>> of posts.
>>
>> So it seems you want this to be a welcoming community, as long as we
>> don't propose you to change your own behaviour.
> 
> We aim to be a community that always welcomes diversity of people. This
> does not entail always welcoming bad behaviour.

But the question was whether some behaviour of steve himself was
contributing or in conflict with his aim.

> Steven is aiming to change his behaviour to make the community more
> welcoming of people: he is aiming to cease contributing to threads where
> the bad behaviour is an interminable discussion of tone and pedantry.
> This is, as I see it, wholly compatible with making the community more
> welcoming to people, by reducing the volume of such threads.

Sorry but from my side that sounds awefully convenient. When the
behaviour of others is questionable, they undermine the welcoming
atmosphere of the community. When Steves behaviour is questionable the
others are behaving badly by discussing tone and pedantry.

This is a typical: "Heads, I win, Tail, you lose" situation that is
being set up.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list