Re: Smallest/cheapest possible Python platform?

2012-05-28 Thread garabik-news-2005-05
Tomasz Rola  wrote:
 
> If you are on tight budget and depend so much on Python, I'm afraid you 
> should either:
> 
> a. grow your budget
> 
> b. try another language

such as PyMite...
-- 
 ---
| Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/ |
| __..--^^^--..__garabik @ kassiopeia.juls.savba.sk |
 ---
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
-- 
http://mail.python.org/mailman/listinfo/python-list


setup(**config); rookie

2012-05-28 Thread cate
I going thru a 101 and came upon this (http://
learnpythonthehardway.org/book/ex46.html)

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_requires': ['nose'],
'packages': ['NAME'],
'scripts': [],
'name': 'projectname'
}

setup(**config)

What is the construct **?

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


Re: setup(**config); rookie

2012-05-28 Thread Roy Smith
In article 
,
 cate  wrote:

> I going thru a 101 and came upon this (http://
> learnpythonthehardway.org/book/ex46.html)
> 
> try:
> from setuptools import setup
> except ImportError:
> from distutils.core import setup
> 
> config = {
> 'description': 'My Project',
> 'author': 'My Name',
> 'url': 'URL to get it at.',
> 'download_url': 'Where to download it.',
> 'author_email': 'My email.',
> 'version': '0.1',
> 'install_requires': ['nose'],
> 'packages': ['NAME'],
> 'scripts': [],
> 'name': 'projectname'
> }
> 
> setup(**config)
> 
> What is the construct **?
> 
> Thank you

It calls setup with all the elements of config as if they had been 
passed as discrete arguments.

def x(foo, bar):
print foo
print bar

args = {'foo': 1,
'bar': 2,
}

x(**args)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: setup(**config); rookie

2012-05-28 Thread Jean-Michel Pichavant

cate wrote:

I going thru a 101 and came upon this (http://
learnpythonthehardway.org/book/ex46.html)

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_requires': ['nose'],
'packages': ['NAME'],
'scripts': [],
'name': 'projectname'
}

setup(**config)

What is the construct **?

Thank you
  

Hi,

See 
http://docs.python.org/tutorial/controlflow.html#more-on-defining-functions


4.7.4. Unpacking Argument Lists

Cheers,

JM
--
http://mail.python.org/mailman/listinfo/python-list


python for android anyone?

2012-05-28 Thread rusi
Ive been wanting to try the sl4a for a new android phone Ive got hold
of as spelt out at
http://www.linuxjournal.com/article/10940

Has anyone any experience/dos/donts for this?

I am writing this while the update of the android sdk is happening and
its taking forever.
So just wondering if its worth the effort.

Any specific tips will of course be welcome but also the general idea
-- is android really python friendly (yet)?

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python for android anyone?

2012-05-28 Thread Paul Rubin
rusi  writes:
> Ive been wanting to try the sl4a for a new android phone Ive got hold
> of as spelt out at
> http://www.linuxjournal.com/article/10940
>
> Has anyone any experience/dos/donts for this?

One of my co-workers used it for something, and I've been looking into
it but haven't tried it yet.

One issue is there's not a real nice way to access the Android GUI stuff
for it, and there's no tkinter port.  Some websearch indicated someone
was working on one, but right now there seems to be no code available.

The simplest way to write a GUI application with it seems to be use a
web browser control, with HTML layout and javascript actions.  Yikes :)
-- 
http://mail.python.org/mailman/listinfo/python-list


2to3 inscrutable output

2012-05-28 Thread ru...@yahoo.com
What is this output from 2to3 supposed to mean?
  $ cat mysub.py
  isinstance (3, (int,float))
  $ 2to3 -f isinstance mysub.py
  RefactoringTool: No changes to mysub.py
  RefactoringTool: Files that need to be modified:
  RefactoringTool: mysub.py
Why does mysub.py need to be modified, and how?

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


Re: python for android anyone?

2012-05-28 Thread rusi
On May 28, 9:13 pm, Paul Rubin  wrote:
> rusi  writes:
> > Ive been wanting to try the sl4a for a new android phone Ive got hold
> > of as spelt out at
> >http://www.linuxjournal.com/article/10940
>
> > Has anyone any experience/dos/donts for this?
>
> One of my co-workers used it for something, and I've been looking into
> it but haven't tried it yet.
>
> One issue is there's not a real nice way to access the Android GUI stuff
> for it, and there's no tkinter port.  Some websearch indicated someone
> was working on one, but right now there seems to be no code available.
>
> The simplest way to write a GUI application with it seems to be use a
> web browser control, with HTML layout and javascript actions.  Yikes :)

Ok thanks for the thumbs up (or down). Hitting Ctrl-C (after an 820M
download!)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python for android anyone?

2012-05-28 Thread Temia Eszteri
On Mon, 28 May 2012 08:56:51 -0700 (PDT), rusi 
wrote:

>Ive been wanting to try the sl4a for a new android phone Ive got hold
>of as spelt out at
>http://www.linuxjournal.com/article/10940
>
>Has anyone any experience/dos/donts for this?
>
>I am writing this while the update of the android sdk is happening and
>its taking forever.
>So just wondering if its worth the effort.
>
>Any specific tips will of course be welcome but also the general idea
>-- is android really python friendly (yet)?
>
>Thanks

I myself use it, though primarily for testing out concepts or blocks
of code I think up on the road (or a quick and dirty profile if I
think of two ways to do something and want to decide which is the
best).

I can't comment on its usefulness for app development, but looking
over the article, it looks like for any such development you'd still
be better off grabbing the Android SDK.

~Temia
--
When on earth, do as the earthlings do.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python for android anyone?

2012-05-28 Thread Cousin Stanley

rusi wrote:

> 
> Any specific tips will of course be welcome 
< but also the general idea
> -- is android really python friendly (yet)?

  You might take a look at Kivy  

http://kivy.org/

  "It is built with Cython ( C extensions for Python ) 
   and, in order to create apps, Python knowledge 
   is required.

  The platforms currently supported are Linux, Windows, 
  Mac OS X and Android."

  The gallery is impressive  

http://kivy.org/#gallery

  
  I have very limited experience with Kivy
  using Debian Linux as the development platform
  and installing a couple of simple demo apps 
  on an ArchOS tablet running Android ICS 

  Back at the first of this month I had problems
  trying to build android packages using 
  the newest versions of the android sdk / ndk packages 
  on Debian  

  Advice at the time was to drop back a version and try again 
  or wait for kivy versioning to catch up a bit  
 

-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona

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


Re: setup(**config); rookie

2012-05-28 Thread Steven D'Aprano
On Mon, 28 May 2012 06:20:06 -0700, cate wrote:

> setup(**config)
> 
> What is the construct **?


It expands the dict "config" into keyword arguments. A single * expands 
to positional arguments.

A simple example:

args = [1, 2, 3]
kwargs = {'x': 4, 'y': 5}

somefunc(*args, **kwargs)

is expanded to 

somefunc(1, 2, 3, x=4, y=5)



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


Re: 2to3 inscrutable output

2012-05-28 Thread Steven D'Aprano
On Mon, 28 May 2012 09:18:29 -0700, ru...@yahoo.com wrote:

> What is this output from 2to3 supposed to mean?
>   $ cat mysub.py
>   isinstance (3, (int,float))
>   $ 2to3 -f isinstance mysub.py
>   RefactoringTool: No changes to mysub.py 
>   RefactoringTool: Files that need to be modified: 
>   RefactoringTool: mysub.py
>
> Why does mysub.py need to be modified, and how?

Bleh. Who came up with this user interface?

I call confusing output like this a UI bug. But after playing around with 
various small files, it *seems* to me that the "Files that need to be 
modified" actually means "Files that include something that a fixer cares 
about, whether or not it gets modified" (in this case, isinstance).



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