Re: Generators.

2009-12-07 Thread Taylor
On Dec 7, 1:29 pm, Jorge Cardona  wrote:
> 2009/12/7 Lie Ryan :
>
>
>
> > On 12/7/2009 7:22 AM, Jorge Cardona wrote:
>
> >> Hi,
>
> >> I was trying to create a function that receive a generator and return
> >> a list but that each elements were computed in a diferent core of my
> >> machine. I start using islice function in order to split the job in a
> >> way that if there is "n" cores each "i" core will compute the elements
> >> i,i+n,i+2n,..., but islice has a weird (to me) behavior, look:
>
> > it's nothing weird, python just do what you're telling it to:
>
> > transform all x in X with f(x)
>
> >> g = (f(x) for x in X)
>
> > then slice the result of that
>
> >> print(list(x for x in islice(g,0,None,2)))
>
> When i wrote that first line of code i thought that i was creating a
> generator that will later compute  the elements of X with function f,
> if i will like to transform them immediately i would use [] instead
> (), so, the result is not where i want to slice, even so, is exactly
> the same to slice, after or before, the only difference is that after
> the compute i'm losing 5 in unnecessary execution of the function f.
>
> > what you want to do is to slice before you transform:
>  g = (x for x in islice(X, 0, None, 2))
>  print(list(f(x) for x in g))
> > eval: 0
> > eval: 2
> > eval: 4
> > eval: 6
> > eval: 8
> > [0, 2, 4, 6, 8]
>
> What i want to do is a function that receive any kind of generator and
> execute it in several cores (after a fork) and return the data, so, i
> can't slice the set X before create the generator.
>
>
>
> >> islice execute the function at the generator and drop the elements
> >> that aren't in the slice. I found that pretty weird, the way that i
> >> see generators is like an association between and indexing set (an
> >> iterator or another generator) and a computation that is made indexed
> >> by the indexing set, and islice is like a "transformation" on the
> >> indexing set,it doesn't matter the result of the function, the slice
> >> should act only on the indexing set, some other "transformation" like
> >> takewhile act on the result so, the execution it has to be made, but
> >> in the islice, or other "transformation" that act only in the indexing
> >> set, the function shouldn't be executed at each element, but only on
> >> that new set that result of the application of the "transformation" on
> >> the original set.
>
> > that seems like an extremely lazy evaluation, I don't know if even a true
> > lazy language do that. Python is a strict language, with a few laziness
> > provided by generators, in the end it's still a strict language.
>
> Yes, it looks like lazy evaluation, but, i don't see why there is not
> a better control over the iterable associated to a generator, even
> with Python that is a strict language, it will increase the
> functionality of it, and the performance too, imagine that you pass a
> function that takes 1 sec in run, and for several reason you can't
> slice before (as the smp function that i want to create), the final
> performance with the actual islice it gets really reduced
> Just creating the separation between those transformation that act on
> the index(islice, or tee) on those that act on the result(dropwhile,
> takewhile, etc.) the control could be fine enough to increase
> usability (that's the way i think right now), and you will be able to
> combine generator without lose performance.
>
> >> Well, it works for what i need, but is not very neat, and i think that
> >> there it should be a formal way to act on the base indexing iterator,
> >> such way exists? Is there a better approach to get what i need?
>
> > Reverse your operation.
> > --
> >http://mail.python.org/mailman/listinfo/python-list
>
> --
> Jorge Eduardo Cardona
> jorgeecard...@gmail.com
> jorgeecardona.blogspot.com
> 
> Linux registered user  #391186
> Registered machine    #291871
> 

What would you have your islice do for the following generator?

def fib(n):
a,b=0,1
for x in range(n):
a,b=b,a+b
yield a

In order for some value it yields to be correct, it needs execute all
the previous times. If it happens that some of the results aren't
used, they are thrown out. As is, using your islice (on, say, fib(10))
gives a KeyError for the key '.0'.
Point is, generators don't work that way. You aren't guaranteed to be
able to jump around, only to find the next value. If you need to split
a particular generator up into parts that can be computed separately,
your best bet is probably to rewrite that generator.
-- 
http://mail.python.org/mailman/listinfo/python-list


Designing a Pythonic search DSL for SQL and NoSQL databases

2013-07-19 Thread Alec Taylor
Dear Python community,

I am analysing designing an abstraction layer over a select few NoSQL
and SQL databases.

Specifically:

- Redis, Neo4j, MongoDB, CouchDB
- PostgreSQL

Being inexperienced; it is hard to know a nice way of abstracting search.

For conciseness in my explanation, think of `Table` as being table,
object, entity or key; and `name` as being name or type.

Maybe `res = Table.name.search()`

Or on multiple `Table`:
`res = AbstractDB().AbstractSearch(
 )`

Then: `res.paginate(limit=25, offset=5)`

Or if you want all: `res.all()`

And additionally borrow/alias from a relevant subset of PEP249, e.g.:
`fetchone` and `fetchmany`

Will open-source this once it's of sufficient functionality.

What do you think?

Advice on better design; or just feedback on what I've mentioned?

Thanks,

Alec Taylor

PS: I am using Bottle. You'll note that some of the syntax I've
references is inspired from web2py's DAL and ODMG.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Designing a Pythonic search DSL for SQL and NoSQL databases

2013-07-19 Thread Alec Taylor
Hmm, looking at the capabilities of Redis; you're likely right.

Would welcome discussion on the implementability and usefulness of a
central search abstraction to the other stores mentioned.

One thing could be that using the paradigm the database was made for
is better than any advantages abstracting their differences creates.

On Fri, Jul 19, 2013 at 10:49 PM, Roy Smith  wrote:
> In article ,
>  Alec Taylor  wrote:
>
>> Dear Python community,
>>
>> I am analysing designing an abstraction layer over a select few NoSQL
>> and SQL databases.
>>
>> Specifically:
>>
>> - Redis, Neo4j, MongoDB, CouchDB
>> - PostgreSQL
>
> This isn't really a Python question.
>
> Before you even begin to think about "how to do this in Python", you
> need to think about "how to do this at all".  You've got a huge range of
> storage paradigms there.  Redis is basically a key-value store.  Mongo
> does documents.  Postgres does relations.  I'm not familiar with Neo and
> Couch, but I assume they also have their own interesting ways of storing
> things.
>
> You need to figure out what it means to abstract search over such a
> diverse range of technologies.  I honestly don't think it's possible,
> but maybe you've got some good ideas.  In any case, you need to figure
> that part out before you even begin to think about how to implement it
> in any particular language.
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Facebook

2012-06-24 Thread Alec Taylor
This is the most active one, forked from the official facebook one
(when they used to maintain it themselves):
https://github.com/pythonforfacebook/facebook-sdk

On Mon, Jun 25, 2012 at 1:35 AM, Chris Angelico  wrote:
> On Mon, Jun 25, 2012 at 1:16 AM, Jerry Rocteur  
> wrote:
>>
>> Hi,
>>
>> I posted this mail on Friday and received no replies..
>>
>> I'm curious..
>>
>> Is it because
>>
>> 1) Python is not the language to use for Facebook, use Javascript or XXX
>> ?? instead ? Please tell.
>> 2) I've missed the point and this is very well documented so RTFM (I
>> couldn't find it)
>> 3) You guys don't use Facebook, you have a life ..
>
> I personally don't use Facebook, but I don't have much of a life
> either. But I've never heard of a specific Python-Facebook module,
> until just now when I googled it and found a couple of things.
>
> Two points:
>
> 1) Python's pretty good at networking. If all else fails, you can
> always just implement whatever Facebook's API is (the Google snippets
> suggest it's REST, ie all HTTP, which Python does admirably), and go
> from there.
>
> 2) An active Python-Facebook module will have active developers who
> probably know far more about how to use their module than random
> people like me who happen to read all of python-list :) There may well
> be such people on this list, but since you've received no replies,
> it's possible there aren't. (It's also possible that they don't
> monitor this list on weekends, though. You never know.)
>
> 3) What do Facebook think of you downloading all their content and
> viewing it without their ads? Not that I particularly care, but it may
> be something to consider, since you're effectively going to get
> everything that Facebook offers you (ie posts/pics/etc) without
> everything that Facebook steals from you and sells (page views, ad
> impressions, etc).
>
> (Among our points are such diverse elements as... wrong Pythons, but 
> whatever.)
>
> There's no official Python-Facebook module (afaik!!), but a quick web
> search for 'python facebook' should get you to the couple that I saw,
> and possibly others. The next question is, do you trust any of them...
> Good luck with that one! :)
>
> Chris Angelico
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OAuth 2.0 implementation

2012-07-05 Thread Alec Taylor
On Fri, Jul 6, 2012 at 12:06 AM, Demian Brecht  wrote:
> FWIW, this package has undergone a major overhaul (474 LOC down to much 
> happier 66) and is available at https://github.com/demianbrecht/sanction. 
> Also available from PyPI.

Thanks for this, I've now shared it on my favourite web-framework
(which unfortunately recommends Janrain) as an alternative:
https://groups.google.com/forum/#!topic/web2py/XjUEewfP5Xg
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OAuth 2.0 implementation

2012-07-06 Thread Alec Taylor
On Sat, Jul 7, 2012 at 1:38 AM, Demian Brecht  wrote:
> Supported provider list (with example code) is now:
> * Facebook
> * Google
> * Foursquare
> * bitly
> * GitHub
> * StackExchange
> * Instagram
>
> Other providers may also be supported out of the box, but have been untested 
> thus far.

Looking good. Keep adding more to the list!

I'd especially be interesting in seeing the 3-phase Twitter and
LinkedIn auths added to the list.

Also I'll be extending it a little more at some point to make it "friendlier" :P

Thanks for merging my last pull-request,

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


Re: OAuth 2.0 implementation

2012-07-06 Thread Alec Taylor
Yeah, seems Twitter is still stuck on 1.0a...

But LinkedIn seems to support 1.0a for REST and 2 for JS:
https://developer.linkedin.com/apis

So that could be a definite contender for Sanction support

On Sat, Jul 7, 2012 at 4:49 AM, Demian Brecht  wrote:
> No worries, thanks for the request.
>
> Unfortunately AFAIK (according to the OAuth provider list on Wikipedia),
> both Twitter and LinkedIn still use OAuth 1.0a, so until they hop on the
> OAuth 2.0 bandwagon, they won't be added.
>
> -Original Message-
> From: Alec Taylor [mailto:alec.tayl...@gmail.com]
> Sent: Friday, July 06, 2012 11:42 AM
> To: Demian Brecht
> Cc: comp.lang.pyt...@googlegroups.com; python-list@python.org
> Subject: Re: OAuth 2.0 implementation
>
> On Sat, Jul 7, 2012 at 1:38 AM, Demian Brecht 
> wrote:
>> Supported provider list (with example code) is now:
>> * Facebook
>> * Google
>> * Foursquare
>> * bitly
>> * GitHub
>> * StackExchange
>> * Instagram
>>
>> Other providers may also be supported out of the box, but have been
> untested thus far.
>
> Looking good. Keep adding more to the list!
>
> I'd especially be interesting in seeing the 3-phase Twitter and LinkedIn
> auths added to the list.
>
> Also I'll be extending it a little more at some point to make it
> "friendlier" :P
>
> Thanks for merging my last pull-request,
>
> Alec Taylor
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyPy, is it a 1:1 replacement for CPython?

2012-07-20 Thread Alec Taylor
ask on PyPy's list

But yes, it is designed as a 1:1 replacement of CPython

On Sat, Jul 21, 2012 at 1:35 PM, Simon Cropper
 wrote:
> Hi,
>
> Can you use PyPy as a direct replacement for the normal python or is it a
> specialized compiler that can only work with libraries that are manipulated
> to operate within its constraints (if it has any).
>
> Are there any issues with using PyPy? For example, if programs are created
> under PyPy are they subtle different from normal code that would make the
> program incompatible with the normal compiler?
>
> --
> Cheers Simon
>
>Simon Cropper - Open Content Creator
>
>Free and Open Source Software Workflow Guides
>
>Introduction   http://www.fossworkflowguides.com
>GIS Packages   http://www.fossworkflowguides.com/gis
>bash / Pythonhttp://www.fossworkflowguides.com/scripting
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Intermediate Python user needed help

2012-08-06 Thread Alec Taylor
On Tue, Aug 7, 2012 at 2:05 AM, Ethan Furman  wrote:
> John Mordecai Dildy wrote:
>>
>> I am currently using python 2.6 and am not going to install the newer
>> versions of python and i am looking for people that are still using ver 2.6
>> in python to help with with the code line:
>>
>> sentence = "All good things come to those who wait."
>>
>> then im getting this error message when i dont see the problem with it:
>>
>>   File "ex26.py", line 77
>> sentence = "All good things come to those who wait."
>>^
>> SyntaxError: invalid syntax
>
>
> John Mordecai Dildy wrote:
>> Current Problem at the moment
>>
>> Traceback (most recent call last):
>>   File "ex26.py", line 66, in 
>> beans, jars, crates = secret_formula(start-point)
>> NameError: name 'start' is not defined
>>
>> anyone know how to make start defined
>
> In your subject line you state that you are an intermediate Python user.
> These are not the errors an intermediate user would make, nor the questions
> an intermediate user would ask.  These are the errors that somebody who
> doesn't know Python would make.
>
> Please do not misrepresent yourself.
+1

>
> ~Ethan~
>
> P.S.  The scale I am accustomed to is Novice -> Intermediate -> Advanced ->
> Master

What, no n00b before Novice?

:P

>
> Are there scales out there that would put these types of questions in the
> "intermediate" category?
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: running Lua in Python

2012-09-02 Thread Alec Taylor
Or you can use a module made for this task:

http://labix.org/lunatic-python

http://pypi.python.org/pypi/lupa

On Sun, Sep 2, 2012 at 7:24 PM, Ian Kelly  wrote:
>
> On Sun, Sep 2, 2012 at 3:04 AM, Arnaud Delobelle  wrote:
> > Hi all,
> >
> > I'm looking for a way to run Lua scripts in Python, and also send and
> > receive data between the two.  Something like lunatic-python [1] would
> > be ideal.  However, so far I haven't been able to build it on the
> > machines it's supposed to run on (macs with OS X Lion) and it seems to
> > be dormant.
> >
> > My requirements are stock OS X Python (which is 2.7) and Lua 5.2.  I'm
> > looking for either a way to make lunatic-python work or another tool
> > that would do the job.
>
> The simple approach would be to run the Lua scripts with the
> subprocess module, using JSON (or something equally accessible) as an
> interchange format.
>
> If you need to embed the Lua interpreter in the Python process, and
> you can't get an existing third-party module to work, consider rolling
> your own C module for the purpose.  My recollection of working with
> Lua is that it's a very easy language to embed.
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python CAD libraries?

2012-09-11 Thread Alec Taylor
Blender is definitely the most popular open-source CAD software; it
has even forked its own version of Python to make things run neatly :P

On Tue, Sep 11, 2012 at 5:33 PM, Dwight Hutto  wrote:
> And just a little more for you from:
>
> http://wiki.python.org/moin/Applications#A3D_CAD.2FCAM
>
> This looked interesting:
> http://free-cad.sourceforge.net/
>>
>>
> but I have to get to a few other things, so I hope this helps.
>
>
>
> --
> Best Regards,
> David Hutto
> CEO: http://www.hitwebdevelopment.com
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: submit jobs on multi-core

2012-09-11 Thread Alec Taylor
http://celeryproject.org/

Don't eat it all at once

On Tue, Sep 11, 2012 at 2:16 PM, Dhananjay  wrote:
> Dear all,
>
> I have a python script in which I have a list of files to input one by one
> and for each file I get a number as an output.
> I used for loop to submit the file to script.
> My script uses one file at a time and returns the output.
>
> My computers has 8 cores.
> Is there any way that I could submit 8 jobs at a time and get all the output
> faster ?
> In other words, how can I modify my script so that I could submit 8 jobs
> together on 8 different processors ?
>
> I am bit new to this stuff, please suggest me some directions.
>
> Thank you.
>
> -- Joshi
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: For Counter Variable

2012-09-23 Thread Alec Taylor
You can always use a counter if you don't like our fancy for-each loops;

foolist = [1,24,24,234,23,423,4]
for i in xrange(len(foolist)):
print foolist[i]

On Mon, Sep 24, 2012 at 9:29 AM, Tim Chase wrote:

> On 09/23/12 17:54, Steven D'Aprano wrote:
> > On Sun, 23 Sep 2012 10:45:53 -0700, jimbo1qaz wrote:
> >> On Sunday, September 23, 2012 9:36:19 AM UTC-7, jimbo1qaz wrote:
> >>> Am I missing something obvious, or do I have to manually put in a
> >>> counter in the for loops? That's a very basic request, but I couldn't
> >>> find anything in the documentation.
> >>
> >> Ya, they should really give a better way, but for now, enumerate works
> >> pretty well.
> >
> > Define "a better way". What did you have in mind that would work better?
>
> I can only imagine jimbo1qaz intended "a more C-like way".  blech.
>
> I **far** prefer The Python Way™.  The vast majority of the time,
> I'm looping over some iterable where indices would only get in the
> way of readability.  Tuple-unpacking the results of enumerate() is
> an elegant way of getting both the items+indices on the seldom
> occasion I need the index too (though I'm minorly miffed that
> enumerate()'s starting-offset wasn't back-ported into earlier 2.x
> versions and have had to code around it for 1-based indexing; either
> extra "+1"s or whip up my own simple enumerate() generator).
>
> -tkc
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Fastest web framework

2012-09-24 Thread Alec Taylor
Can you throw in web2py?

Thanks

On Sun, Sep 23, 2012 at 7:19 PM, Andriy Kornatskyy <
andriy.kornats...@live.com> wrote:

>
> I have run recently a benchmark of a trivial 'hello world' application for
> various python web frameworks (bottle, django, flask, pyramid, web.py,
> wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9... you might
> find it interesting:
>
> http://mindref.blogspot.com/2012/09/python-fastest-web-framework.html
>
> Comments or suggestions are welcome.
>
> Thanks.
>
> Andriy Kornatskyy
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Fastest web framework

2012-09-26 Thread Alec Taylor
Thanks Andriy for benchmarking web2py.

With this public benchmark the entire web2py community will be hard at work
to bring our numbers up higher :)

On Tue, Sep 25, 2012 at 9:01 PM, Andriy Kornatskyy <
andriy.kornats...@live.com> wrote:

>
> Alec
>
> While performing benchmark for web2py I noticed a memory leak. It
> constantly grows and never release it...
>
> Thanks.
>
> Andriy Kornatskyy
>
> 
> > Date: Mon, 24 Sep 2012 17:36:25 +1000
> > Subject: Re: Fastest web framework
> > From: alec.tayl...@gmail.com
> > To: andriy.kornats...@live.com
> > CC: python-list@python.org
> >
> > Can you throw in web2py?
> >
> > Thanks
> >
> > On Sun, Sep 23, 2012 at 7:19 PM, Andriy Kornatskyy
> > mailto:andriy.kornats...@live.com>> wrote:
> >
> > I have run recently a benchmark of a trivial 'hello world' application
> > for various python web frameworks (bottle, django, flask, pyramid,
> > web.py, wheezy.web) hosted in uWSGI/cpython2.7 and gunicorn/pypy1.9...
> > you might find it interesting:
> >
> > http://mindref.blogspot.com/2012/09/python-fastest-web-framework.html
> >
> > Comments or suggestions are welcome.
> >
> > Thanks.
> >
> > Andriy Kornatskyy
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


REST code-golf: How concisely can you expose and consume services?

2012-09-27 Thread Alec Taylor
web2py (7 lines): https://gist.github.com/3798093

Includes creation of models, validator, controllers and urls.

Rules:
- Must have [at least] the same functionality as my 7-line example
- Imports are allowed and not taken into line count, on the condition
that everything remains generic. I.e.: one can change model and
controller names &etc without modifying imported libraries
- Can't import/take the code from web2py (e.g.:
https://github.com/web2py/web2py/blob/master/gluon/tools.py#L4098)

(feel free to write them in reply to this email and/or as gist comments =])

Good luck!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: REST code-golf: How concisely can you expose and consume services?

2012-09-28 Thread Alec Taylor
On Sat, Sep 29, 2012 at 12:17 AM, Demian Brecht  wrote:
> (A little OT so my apologies up front)
>
>
> On 12-09-28 12:39 AM, Chris Angelico wrote:
>>
>> I love the idea, even though I shan't be entering. Code golf is awesome
>> fun!
>
>
> Code golf is indeed awesome fun and I usually enjoy taking part as well.
> However, I'm not a fan of code golf such as this, that uses a framework and
> then defines a rule that you *can't* hack on the same framework.
>
> In the framework/external module spirit, I *could* write a module that does
> *all* of this for me (in Pyramid, Django, web2py, etc) and then enter with a
> simple method call in another module.
>
> Done. One liner. I win ;)
>
> I much prefer code golf that tests algorithmic/core language feature
> knowledge. Of course, that's entirely only my opinion.
>
> --
> Demian Brecht
> @demianbrecht
> http://demianbrecht.github.com
> --
> http://mail.python.org/mailman/listinfo/python-list

Well I suppose I could lax that same requirement. I.e.: if you can get
these decorators (also working with RBAC) in, for example: Django;
then it still satisfied the rules :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pydelicious documentation

2012-10-09 Thread Alec Taylor
Hi Professor Soto,

Not sure what's going on with their servers', but I was able to find
the documentation on their repo:

https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/index.html
https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/HACKING.html
https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/dlcs.html
https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/pydelicious.html

Just save the files locally then open them in your browser.

All the best,

Alec Taylor

On Tue, Oct 9, 2012 at 10:06 PM, Andres Soto  wrote:
> Does somebody know where I can get the documentation for pydelicious?
> The documentation links ("For code documentation see doc/pydelicious or
> doc/dlcs.py.") in http://packages.python.org/pydelicious/README.html#id3
> gave me
>
> 404 Not Found
>
> 
> nginx/1.1.19
>
> Prof. Dr. Andrés Soto
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pydelicious documentation

2012-10-09 Thread Alec Taylor
Actually it seems this project has been official abandoned.

Unofficially use this, was updated only a month ago:
https://github.com/mgan59/python-pinboard

On Tue, Oct 9, 2012 at 10:47 PM, Alec Taylor  wrote:
> Hi Professor Soto,
>
> Not sure what's going on with their servers', but I was able to find
> the documentation on their repo:
>
> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/index.html
> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/HACKING.html
> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/dlcs.html
> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/pydelicious.html
>
> Just save the files locally then open them in your browser.
>
> All the best,
>
> Alec Taylor
>
> On Tue, Oct 9, 2012 at 10:06 PM, Andres Soto  wrote:
>> Does somebody know where I can get the documentation for pydelicious?
>> The documentation links ("For code documentation see doc/pydelicious or
>> doc/dlcs.py.") in http://packages.python.org/pydelicious/README.html#id3
>> gave me
>>
>> 404 Not Found
>>
>> 
>> nginx/1.1.19
>>
>> Prof. Dr. Andrés Soto
>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pydelicious documentation

2012-10-10 Thread Alec Taylor
No worries, happy to help :)

On Tue, Oct 9, 2012 at 11:44 PM, Andres Soto  wrote:
> This one I didn't know
> Thanks you!
> Prof. Dr. Andrés Soto
>
>
> ________
> From: Alec Taylor 
> To: Andres Soto 
> Cc: "python-list@python.org" 
> Sent: Tuesday, October 9, 2012 1:52 PM
> Subject: Re: pydelicious documentation
>
> Actually it seems this project has been official abandoned.
>
> Unofficially use this, was updated only a month ago:
> https://github.com/mgan59/python-pinboard
>
> On Tue, Oct 9, 2012 at 10:47 PM, Alec Taylor  wrote:
>> Hi Professor Soto,
>>
>> Not sure what's going on with their servers', but I was able to find
>> the documentation on their repo:
>>
>> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/index.html
>> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/HACKING.html
>> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/dlcs.html
>> https://pydelicious.googlecode.com/svn/trunk/doc/htmlref/pydelicious.html
>>
>> Just save the files locally then open them in your browser.
>>
>> All the best,
>>
>> Alec Taylor
>>
>> On Tue, Oct 9, 2012 at 10:06 PM, Andres Soto 
>> wrote:
>>> Does somebody know where I can get the documentation for pydelicious?
>>> The documentation links ("For code documentation see doc/pydelicious or
>>> doc/dlcs.py.") in http://packages.python.org/pydelicious/README.html#id3
>>> gave me
>>>
>>> 404 Not Found
>>>
>>> 
>>> nginx/1.1.19
>>>
>>> Prof. Dr. Andrés Soto
>>>
>>>
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>>
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: can we append a list with another list in Python ?

2012-10-23 Thread Alec Taylor
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> [1,2,3,4,5] + [99,88,77,66,0]
[1, 2, 3, 4, 5, 99, 88, 77, 66, 0]

On Tue, Oct 23, 2012 at 6:36 PM, inshu chauhan  wrote:
> can we append a list with another list in Python ? using the normal routine
> syntax but with a for loop ??
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: surprising += for lists

2012-11-04 Thread Alec Taylor
Quick aside, you can insert tuples without much effort: `points += ((3,5),)`

And also that I can't do the reverse, i.e.:
>>> foo = tuple()
>>> foo += [5,6]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only concatenate tuple (not "list") to tuple

On Sun, Nov 4, 2012 at 10:57 PM, Ulrich Eckhardt  wrote:
> Hi everybody!
>
> I was just smacked by some very surprising Python 2.7 behaviour. I was
> assembling some 2D points into a list:
>
>  points = []
>  points += (3, 5)
>  points += (4, 6)
>
> What I would have expected is to have [(3, 5), (4, 6)], instead I got [3,
> 5, 4, 6]. My interpretations thereof is that the tuple (x, y) is iterable,
> so the elements are appended one after the other. Actually, I should have
> used points.append(), but that's a different issue.
>
> Now, what really struck me was the fact that [] + (3, 5) will give me a
> type error. Here I wonder why the augmented assignment behaves so much
> different.
>
> Can anyone help me understand this?
>
> Thanks!
>
> Uli
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Yet another Python textbook

2012-11-22 Thread Alec Taylor
No worries,

I've just sent you my pull-request :)

On Thu, Nov 22, 2012 at 1:11 PM, Pavel Solin  wrote:
> Hi Alec,
>
>> Can you put your website—http://femhub.com/textbook-python/—on your
>> github—https://github.com/femhub/nclab-textbook-python?
>
> Done, thank you so much.
>
> I edited the textbook based on responses that I received. Based
> on several inquiries we also decided to add Python 3.2 to NCLab.
> New release is coming in one or two weeks.
>
> Cheers,
>
> Pavel
>
>
> On Wed, Nov 21, 2012 at 4:34 PM, Alec Taylor  wrote:
>>
>> Dear Prof. Solin,
>>
>> Can you put your website—http://femhub.com/textbook-python/—on your
>> github—https://github.com/femhub/nclab-textbook-python?
>>
>> I will then send you a pull request with a bootstrapped homepage with good
>> UX.
>>
>> All the best,
>>
>> Alec Taylor
>
>
>
>
> --
> Pavel Solin
> Associate Professor
> Applied and Computational Mathematics
> University of Nevada, Reno
> http://hpfem.org/~pavel
>
-- 
http://mail.python.org/mailman/listinfo/python-list


MVC web-framework with RESTfully Decoupled Views?

2012-12-07 Thread Alec Taylor
I have used a variety of different MVC web-frameworks.

My current methodology for web and mobile [PhoneGap/Cordova]
development is as follows:

Web framework (MVC)

1. Write the Models (db schema stuff)
2. Write the Controllers (manage interface between models and views,
or just expose certain data; e.g.: RESTfully)
3. Write the Views (HTML &etc for presentation to the viewer; usually
includes a seamless Template, Form and Auth layer from the framework)

JavaScript framework (MVC)

1. Write the Models (for storing what the controllers grab)
2. Write the Controllers (grab required stuff RESTfully, also do
sanisation type stuff [pun intended!])
3. Write the Views

>---<

It seems to me that I would be much better served by a web-framework
which integrates decoupled Views. This would shorten development time
and prevent pseudo double-typing.

Are there any Python web-frameworks which has added functionality for
generating decoupled views?

Thanks for all suggestions,

Alec Taylor

BTW: Full disclosure, also posted this on stackoverflow:
http://stackoverflow.com/q/13761200
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Command Line Progress Bar

2012-12-26 Thread Alec Taylor
On Thu, Dec 27, 2012 at 3:05 AM, Irmen de Jong  wrote:
> On 26-12-2012 7:17, Kevin Anthony wrote:
>> Hello,
>> I'm writing a file processing script(Linux), and i would like to have a 
>> progress bar.
>>  But i would also like to be able to print messages.  Is there a simple way 
>> of doing
>> this without implementing something like ncurses?
>
> This little library can prove useful: http://pypi.python.org/pypi/fish/
>
> -Irmen
>
> --
> http://mail.python.org/mailman/listinfo/python-list

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


Re: Compiling native extensions with Visual Studio 2012?

2013-01-12 Thread Alec Taylor
Okay, got all extensions I require to compile successfully with MSVC 2012.

Trick was using this fork: https://github.com/wcdolphin/py-bcrypt

(See their issue log for traceback)

=]

On Sat, Jan 12, 2013 at 6:45 PM, Alec Taylor  wrote:
> There have been various threads for MSVC 2010[1][2], but the most
> recent thing I found for MSVC 2012 was [3]… from 6 months ago.
>
> Basically I want to be able to compile bcrypt—and yes I should be
> using Keccak—x64 binaries on Windows x64.
>
> There are other packages also which I will benefit from, namely I
> won't need to use the unofficial setup files and will finally be able
> to use virtualenv.
>
> So anyway, can I get an update on the status of MSVC 2010 and MSVC
> 2012 compatibility?
>
> Thanks,
>
> Alec Taylor
>
> [1] http://bugs.python.org/issue13210
> [2] 
> http://webcache.googleusercontent.com/search?q=cache:xPaU9mlCBNEJ:wiki.python.org/moin/VS2010+&cd=1&hl=en&ct=clnk
> [3] https://groups.google.com/d/topic/dev-python/W1RpFhaOIGk
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Compiling native extensions with Visual Studio 2012?

2013-01-12 Thread Alec Taylor
On Sun, Jan 13, 2013 at 1:34 AM, Christian Heimes  wrote:
> Am 12.01.2013 08:45, schrieb Alec Taylor:
>> There have been various threads for MSVC 2010[1][2], but the most
>> recent thing I found for MSVC 2012 was [3]… from 6 months ago.
>>
>> Basically I want to be able to compile bcrypt—and yes I should be
>> using Keccak—x64 binaries on Windows x64.
>>
>> There are other packages also which I will benefit from, namely I
>> won't need to use the unofficial setup files and will finally be able
>> to use virtualenv.
>>
>> So anyway, can I get an update on the status of MSVC 2010 and MSVC
>> 2012 compatibility?
>
> The problem is that every MSVC has its own libc / CRT (msvcrt.dll) with
> its own implementations of malloc(), FILE pointer, thread local storage,
> errno etc. You shouldn't mix multiple CRTs in one program as this may
> lead to crashes and hard to find bugs.
>
> Why do you want to compile your own Keccak / SHA-3 binaries anyway? I
> have build and released binaries for X86 and X86_64 Windows and for
> Python 2.6 and 3.3. For Python 3.4 I'm working on a PEP about the
> integration of pbkdf2, bcrypt and scrypt into Python's stdlib.
>
> Christian

Would be awesome to get these built into stdlib.

Compiling my own versions mostly for virtualenv purposes; though
sometimes I can't find the binary on:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Algorithms in Python

2012-01-25 Thread Alec Taylor
The thing about algorithms is they are applicable to many programming
languages (in general).

Read http://en.wikipedia.org/wiki/Turing_machine

On Wed, Jan 25, 2012 at 9:06 PM, Chetan Harjani
 wrote:
> Is there any book or site on python algorithms which asks more and
> teaches less, I don't want to get bored, and at the same time I want
> to learn and act more. I use ubuntu. (just in case if its needed).
> #ALGORITHMS
>
>
>
> --
> Chetan H Harjani
> IIT Delhi
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


autoconf error on Windows

2012-01-29 Thread Alec Taylor
PyCrypto's install is giving an autoconf error on Windows, whether I
install from the git repo or normally.

Traceback (most recent call last):
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()

  File "C:\Projects\satchmo_test\satchmo_test\src\pycrypto\setup.py",
line 274, in run
raise RuntimeError("autoconf error")

RuntimeError: autoconf error


Command C:\Python27\python.exe -c "import setuptools;
__file__='C:\\Projects\\satchmo_test\\satchmo_test\\src\\pycrypto\\setup.py';
exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__,
'exec'))" develop --no-deps failed with error code 1
Full output: http://pastebin.com/Dp3aw077

How can I get PyCrypto to install?

Thanks for all suggestions,

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


Re: autoconf error on Windows

2012-01-29 Thread Alec Taylor
Thanks, but I already have MinGW installed and in PATH.

C:\>where g++
C:\libraries\MinGW\bin\g++.exe
C:\libraries\perl\c\bin\g++.exe

On Sun, Jan 29, 2012 at 8:07 PM, Chris Rebert  wrote:
> On Sun, Jan 29, 2012 at 12:52 AM, Alec Taylor  wrote:
>> PyCrypto's install is giving an autoconf error on Windows, whether I
>> install from the git repo or normally.
>>
>> Traceback (most recent call last):
>>  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>    cmd_obj.run()
>>
>>  File "C:\Projects\satchmo_test\satchmo_test\src\pycrypto\setup.py",
>> line 274, in run
>>    raise RuntimeError("autoconf error")
>>
>> RuntimeError: autoconf error
>>
>> 
>> Command C:\Python27\python.exe -c "import setuptools;
>> __file__='C:\\Projects\\satchmo_test\\satchmo_test\\src\\pycrypto\\setup.py';
>> exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__,
>> 'exec'))" develop --no-deps failed with error code 1
>> Full output: http://pastebin.com/Dp3aw077
>
> Judging by the earlier "'sh' is not recognized as an internal or
> external command, operable program or batch file." error message and
> after scanning thru the setup.py, sounds like you need to have MinGW
> (http://www.mingw.org ) installed. FWICT, there don't seem to be any
> current Windows binaries for PyCrypto.
>
> Cheers,
> Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: autoconf error on Windows

2012-01-29 Thread Alec Taylor
Thanks, adding MSYS's bin to PATH solved that issue.

Now I'm getting linker errors on:

C:\libraries\MinGW\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win-amd64-2.7\Release\src\winrand.o
build\temp.win-amd64-2.7\Release\src\winrandom.def -LC:\Python27\libs
-LC:\Python27\PCbuild\amd64 -lws2_32 -ladvapi32 -lpython27 -lmsvcr90
-o 
"C:\Projects\satchmo_test\Prototype\src\pycrypto\lib\Crypto\Random\OSRNG\winrandom.pyd"

Full output: http://pastebin.com/SYBkFt3h
-- 
http://mail.python.org/mailman/listinfo/python-list


Linker errors when attempting to install PyCrypto

2012-02-03 Thread Alec Taylor
I'm getting linker errors when trying to install PyCrypto on Windows:

C:\libraries\MinGW\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win-amd64-2.7\Release\src\winrand.o
build\temp.win-amd64-2.7\Release\src\winrandom.def -LC:\Python27\libs
-LC:\Python27\PCbuild\amd64 -lws2_32 -ladvapi32 -lpython27 -lmsvcr90
-o 
"C:\Projects\satchmo_test\Prototype\src\pycrypto\lib\Crypto\Random\OSRNG\winrandom.pyd"

Full output: http://pastebin.com/SYBkFt3h

How can I resolve installation issues to get PyCrypto install properly
on Python 2.7.2 x64?

Thanks for all suggestions,

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


[Perl Golf] Round 1

2012-02-05 Thread Alec Taylor
One sentence can contain one or more strings next to each-other, which
can be joined to make another word.

e.g.:

"to get her" == "together"
"an other" == "another"
"where about" == "whereabouts"

&etc

Solve this problem using as few lines of code as possible[1].

Good luck!

[1] Don't use external non-default libraries; non-custom word-lists excepted
-- 
http://mail.python.org/mailman/listinfo/python-list


PyCrypto builds neither with MSVC nor MinGW

2012-02-05 Thread Alec Taylor
PIL, PyCrypto and many other modules require a C compiler and linker.

Unfortunately neither install on my computer, with a PATH with the following:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
C:\libraries\MinGW\msys\1.0\bin
C:\libraries\MinGW
C:\Python27\Scripts

Output from G:\pycrypto>vcvarsall.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Error output from G:\pycrypto>python setup.py build --compiler msvc
http://pastebin.com/nBsuXDGg

Error output from G:\pycrypto>python setup.py build --compiler mingw32
1> log1 2> log2
Log1: http://pastebin.com/yG3cbdZv
Log2: http://pastebin.com/qvnshPeh

Will there ever be support for newer MSVC versions? - Also, why
doesn't even MinGW install PyCrypto for me?

Thanks for all suggestions,

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


Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-05 Thread Alec Taylor
A 4 year old compiler?

I also have MSVC11 installed. Can the python project add support for
that so that we aren't waiting 5 years between compiler support?

On Mon, Feb 6, 2012 at 2:23 AM, Christian Heimes  wrote:
> Am 05.02.2012 15:40, schrieb Alec Taylor:
>> PIL, PyCrypto and many other modules require a C compiler and linker.
>>
>> Unfortunately neither install on my computer, with a PATH with the following:
>>
>> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
>> C:\libraries\MinGW\msys\1.0\bin
>> C:\libraries\MinGW
>> C:\Python27\Scripts
>
> MSVC 10 is not supported, you need VC 9 (2008).
>
> Christian
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Visual Studio 2010 Support

2012-02-06 Thread Alec Taylor
PIL, PyCrypto and many other modules require a C compiler and linker.

Unfortunately neither install on my computer, with a PATH with the following:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
C:\libraries\MinGW\msys\1.0\bin
C:\libraries\MinGW
C:\Python27\Scripts

Output from G:\pycrypto>vcvarsall.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Error output from G:\pycrypto>python setup.py build --compiler msvc
http://pastebin.com/nBsuXDGg

Error output from G:\pycrypto>python setup.py build --compiler mingw32 1> log1 
2> log2
Log1: http://pastebin.com/yG3cbdZv
Log2: http://pastebin.com/qvnshPeh

Will there ever be support for newer MSVC versions? - Also, why doesn't even 
MinGW install PyCrypto for me?

Thanks for all suggestions,

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


Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-07 Thread Alec Taylor
Thanks all for your replies.

I have now installed MSVC8 and YASM.

I was able to successfully run configure.bat and make.bat (including
make.bat check).

However, I'm unsure what to do about install, since there is no
install arg. Do I copy it across to my VC\bin folder, or does it need
it's own place in PATH + system variables?

I am asking because I don't know where it is looking for the MPIR library.

Thanks for all suggestions,

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


Re: PyCrypto builds neither with MSVC nor MinGW

2012-02-08 Thread Alec Taylor
Thanks, but to get it to work with pip, wouldn't I need to add it to
PATH? - Or can I just add those library args to pip?

On Wed, Feb 8, 2012 at 9:48 PM, Case Van Horsen  wrote:
> On Tue, Feb 7, 2012 at 9:37 PM, Alec Taylor  wrote:
>> Thanks all for your replies.
>>
>> I have now installed MSVC8 and YASM.
> I assume you installed Visual Studio. I've omitted the commands to use
> the SDK compiler below.
>>
>> I was able to successfully run configure.bat and make.bat (including
>> make.bat check).
>>
>> However, I'm unsure what to do about install, since there is no
>> install arg. Do I copy it across to my VC\bin folder, or does it need
>> it's own place in PATH + system variables?
>
> The following is just a guess.
>
> I copy the files to a convenient location and then specify that
> location to setup.py. Below is an excerpt from my build process.
>
> mkdir c:\src\lib
> mkdir c:\src\include
> xcopy /Y mpir.h c:\src\include\*.*
> xcopy /Y win\mpir.lib c:\src\lib\*.*
>
> python setup.py build_ext -Ic:\src\include -Lc:\src\lib install
>
>>
>> I am asking because I don't know where it is looking for the MPIR library.
>>
>> Thanks for all suggestions,
>>
>> Alec Taylor
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: round down to nearest number

2012-02-10 Thread Alec Taylor
o.O

Very nice

On Fri, Feb 10, 2012 at 8:58 PM, Arnaud Delobelle  wrote:
> On 10 February 2012 06:21, Ian Kelly  wrote:
>> (3219 + 99) // 100 * 100
>>> 3300
>> (3289 + 99) // 100 * 100
>>> 3300
>> (328678 + 99) // 100 * 100
>>> 328700
>> (328 + 99) // 100 * 100
>>> 400
>>>
>>> Those are all rounded up to the nearest 100 correctly.
>>
>> One thing to be aware of though is that while the "round down" formula
>> works interchangeably for ints and floats, the "round up" formula does
>> not.
>>
> (3300.5 + 99) // 100 * 100
>> 3300.0
>>
>
> I'm surprised I haven't seen:
>
 212 - (212 % -100)
> 300
>
> Here's a function that:
> * rounds up and down
> * works for both integers and floats
> * is only two operations (as opposed to 3 in the solutions given above)
>
 def round(n, k):
> ...     return n - n%k
> ...
 # Round down with a positive k:
> ... round(167, 100)
> 100
 round(-233, 100
> ... )
> -300
 # Round up with a negative k:
> ... round(167, -100)
> 200
 round(-233, -100)
> -200
 # Edge cases
> ... round(500, -100)
> 500
 round(500, 100)
> 500
 # Floats
> ... round(100.5, -100)
> 200.0
 round(199.5, 100)
> 100.0
>
> --
> Arnaud
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: generate Windows exe on Linux

2012-02-22 Thread Alec Taylor
http://www.pyinstaller.org/

or

http://cx-freeze.sourceforge.net/

You can also run py2exe in WINE

On Thu, Feb 23, 2012 at 4:42 AM, Jérôme  wrote:
> Wed, 22 Feb 2012 18:19:12 +0100
> Waldek M. a écrit:
>
>> On Wed, 22 Feb 2012 04:12:29 -0800 (PST), Plumo wrote:
>> > I have a python script using only the standard libraries.
>> > Currently I use a Windows VM to generate exe's, which is cumbersome.
>>
>> And what exactly *is* this exe about?
>
> Whatever.
>
>> > Has anyone had success generating exe's from within Linux?
>>
>> That doesn't seem to have anything to do with Python,
>> but you might want to google for cross-compiling.
>
> I think his question is totally python related.
>
> As I understand it, Richard creates executables from python scripts using a
> tool, such as py2exe [1], that requires windows. He would like to have an
> equivalent tool that runs on linux, to avoid going through the trouble of
> having to run a windows installation.
>
> I'm interested in such a tool as well.
>
> [1] http://www.py2exe.org/
>
> --
> Jérôme
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Python math is off by .000000000000045

2012-02-22 Thread Alec Taylor
Simple mathematical problem, + and - only:

>>> 1800.00-1041.00-555.74+530.74-794.95
-60.9500045

That's wrong.

Proof
http://www.wolframalpha.com/input/?i=1800.00-1041.00-555.74%2B530.74-794.95
-60.95 aka (-(1219/20))

Is there a reason Python math is only approximated? - Or is this a bug?

Thanks for all info,

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


Spacing and timing for comparing algorithms and data-structures

2012-03-01 Thread Alec Taylor
What would you recommend I use to compare data-structures and
algorithms on space and time? (runtime)

Thanks for all suggestions,

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


Porting the 2-3 heap data-structure library from C to Python

2012-03-07 Thread Alec Taylor
I am planning to port the 2-3 heap data-structure as described by
Professor Tadao Takaoka in Theory of 2-3 Heaps published in 1999 and
available in PDF:
http://www.cosc.canterbury.ac.nz/tad.takaoka/2-3heaps.pdf

The source-code used has been made available:
http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.h
http://www.cosc.canterbury.ac.nz/research/RG/alg/ttheap.c

I plan on wrapping it in a class.

This tutorial I used to just test out calling C within Python
(http://richizo.wordpress.com/2009/01/25/calling-c-functions-inside-python/)
and it seems to work, but this might not be the recommended method.

Any best practices for how best to wrap the 2-3 heap data-structure
from C to Python?

Thanks for all suggestions,

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


Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-12 Thread Alec Taylor
On a brand new Windows install now, with a brand new VS8 installed
with new YASM and MPIR in c:\usr\src\include and c:\usr\src\lib.

But it still isn't working:

C:\workingdir\pycrypto>python setup.py build_ext -Ic:\usr\src\include
-Lc:\usr\src\lib install
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

building 'Crypto.Random.OSRNG.winrandom' extension
Traceback (most recent call last):
  File "setup.py", line 452, in 
core.setup(**kw)
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
  File "setup.py", line 249, in run
build_ext.run(self)
  File "C:\Python27\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
  File "setup.py", line 146, in build_extensions
build_ext.build_extensions(self)
  File "C:\Python27\lib\distutils\command\build_ext.py", line 448, in
build_extensions
self.build_extension(ext)
  File "C:\Python27\lib\distutils\command\build_ext.py", line 498, in
build_extension
depends=ext.depends)
  File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
self.initialize()
  File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in
query_vcvarsall
raise ValueError(str(list(result.keys(
ValueError: [u'path']

On Wed, Feb 8, 2012 at 11:31 PM, Case Van Horsen  wrote:
> On Wed, Feb 8, 2012 at 4:24 AM, Alec Taylor  wrote:
>> Thanks, but to get it to work with pip, wouldn't I need to add it to
>> PATH? - Or can I just add those library args to pip?
> I don't think so. pyCrypto probably builds a single DLL so the MPIR library is
> statically linked into that DLL. Only the innvocation of setup.py should need
> to refer to the MPIR library locations.  I don't use pip so I'm not sure how 
> to
> get pip to install the resulting DLL, etc.
>>
>> On Wed, Feb 8, 2012 at 9:48 PM, Case Van Horsen  wrote:
>>> On Tue, Feb 7, 2012 at 9:37 PM, Alec Taylor  wrote:
>>>> Thanks all for your replies.
>>>>
>>>> I have now installed MSVC8 and YASM.
>>> I assume you installed Visual Studio. I've omitted the commands to use
>>> the SDK compiler below.
>>>>
>>>> I was able to successfully run configure.bat and make.bat (including
>>>> make.bat check).
>>>>
>>>> However, I'm unsure what to do about install, since there is no
>>>> install arg. Do I copy it across to my VC\bin folder, or does it need
>>>> it's own place in PATH + system variables?
>>>
>>> The following is just a guess.
>>>
>>> I copy the files to a convenient location and then specify that
>>> location to setup.py. Below is an excerpt from my build process.
>>>
>>> mkdir c:\src\lib
>>> mkdir c:\src\include
>>> xcopy /Y mpir.h c:\src\include\*.*
>>> xcopy /Y win\mpir.lib c:\src\lib\*.*
>>>
>>> python setup.py build_ext -Ic:\src\include -Lc:\src\lib install
>>>
>>>>
>>>> I am asking because I don't know where it is looking for the MPIR library.
>>>>
>>>> Thanks for all suggestions,
>>>>
>>>> Alec Taylor
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-12 Thread Alec Taylor
FYI: When running "vcvarsall" manually, I get a variety of linker
errors, even though I have the SDK and everything else installed:

running build_ext
building 'Crypto.Random.OSRNG.winrandom' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c
/nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc/ -Isrc/inc-msvc/
-Ic:\usr\src\include -IC:\Python27\include -IC:\Python27\PC
/Tcsrc/winrand.c /Fobuild\temp.win-amd64-2.7\Release\src/winrand.obj
winrand.c
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe
/DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\usr\src\lib
/LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64
ws2_32.lib advapi32.lib /EXPORT:initwinrandom
build\temp.win-amd64-2.7\Release\src/winrand.obj
/OUT:build\lib.win-amd64-2.7\Crypto\Random\OSRNG\winrandom.pyd
/IMPLIB:build\temp.win-amd64-2.7\Release\src\winrandom.lib
/MANIFESTFILE:build\temp.win-amd64-2.7\Release\src\winrandom.pyd.manifest
   Creating library build\temp.win-amd64-2.7\Release\src\winrandom.lib
and object build\temp.win-amd64-2.7\Release\src\winrandom.exp
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyObject_Free referenced in function _WRdealloc
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyExc_SystemError referenced in function _WRdealloc
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyErr_Format referenced in function _WRdealloc
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyExc_TypeError referenced in function _WRdealloc
winrand.obj : error LNK2019: unresolved external symbol
__imp___PyObject_New referenced in function _winrandom_new
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyArg_ParseTupleAndKeywords referenced in function
_winrandom_new
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyString_FromStringAndSize referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyMem_Free referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyErr_NoMemory referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyMem_Malloc referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyErr_SetString referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyExc_ValueError referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyArg_ParseTuple referenced in function _WR_get_bytes
winrand.obj : error LNK2019: unresolved external symbol
__imp__Py_FindMethod referenced in function _WRgetattr
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyInt_FromLong referenced in function _WRgetattr
winrand.obj : error LNK2019: unresolved external symbol
__imp__Py_FatalError referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyErr_Occurred referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyModule_AddStringConstant referenced in function
_initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyModule_AddIntConstant referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__Py_InitModule4 referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyType_Type referenced in function _initwinrandom
build\lib.win-amd64-2.7\Crypto\Random\OSRNG\winrandom.pyd : fatal
error LNK1120: 21 unresolved externals
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-12 Thread Alec Taylor
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyInt_FromLong referenced in function _WRgetattr
winrand.obj : error LNK2019: unresolved external symbol
__imp__Py_FatalError referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyErr_Occurred referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyModule_AddStringConstant referenced in function
_initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyModule_AddIntConstant referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__Py_InitModule4 referenced in function _initwinrandom
winrand.obj : error LNK2019: unresolved external symbol
__imp__PyType_Type referenced in function _initwinrandom
build\lib.win-amd64-2.7\Crypto\Random\OSRNG\winrandom.pyd : fatal error LNK1120:
 21 unresolved externals
error: command '"C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\BIN\link.exe"' failed with exit status 1120

On Tue, Mar 13, 2012 at 2:59 PM,   wrote:
> On Monday, March 12, 2012 1:38:29 PM UTC-7, Alec Taylor wrote:
>> On a brand new Windows install now, with a brand new VS8 installed
>> with new YASM and MPIR in c:\usr\src\include and c:\usr\src\lib.
>>
>> But it still isn't working:
>>
> This was a little challenging. I looked through the setup.py to figure out 
> what assumptions their build process made. First, the file 
> pycrypto-2.5\src\inc-msvc\config.h must be modified. Below is the file I used:
>
> config.h
> ===
> /* Define to 1 if you have the declaration of `mpz_powm', and to 0 if you
>   don't. */
> #define HAVE_DECL_MPZ_POWM 1
>
> /* Define to 1 if you have the declaration of `mpz_powm_sec', and to 0 if you
>   don't. */
> #define HAVE_DECL_MPZ_POWM_SEC 0
>
> /* Define to 1 if you have the `gmp' library (-lgmp). */
> #undef HAVE_LIBGMP
>
> /* Define to 1 if you have the `mpir' library (-lmpir). */
> #define HAVE_LIBMPIR 1
>
> /* Define to 1 if you have the  header file. */
> #define HAVE_STDINT_H 1
> ===
>
> Although I was able to specify an include directory for mpir.h with 
> -Ic:\usr\include, I was not able specify a lib directory with -Lc:\usr\lib. 
> It looks like setup.py does not honor the -L option. So I finally gave up and 
> just copied the mpir.h file into my Python27\include directory and the 
> mpir.lib file into my Python27\libs directory.
>
> After copying the files "python setup.py install" was successful. I created a 
> binary installer with "python setup.py bdist-wininst".
>
> There may be a cleaner way to build PyCrypto, but these steps worked for me.
>
> casevh
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-12 Thread Alec Taylor
Nope, I have C:\Python27 (and C:\Python27\Scripts) in my PATH.

C:\workingdir\pycrypto>where python
C:\Python27\python.exe

On Tue, Mar 13, 2012 at 4:44 PM, Case Van Horsen  wrote:
> On Mon, Mar 12, 2012 at 9:57 PM, Alec Taylor  wrote:
>> Hmm, I just tried that method, but the output I got was still:
>>
>> C:\workingdir\pycrypto>python setup.py install
>> running install
>> running build
>> running build_py
>> running build_ext
>> building 'Crypto.Random.OSRNG.winrandom' extension
>> Traceback (most recent call last):
>>  File "setup.py", line 452, in 
>>    core.setup(**kw)
>>  File "C:\Python27\lib\distutils\core.py", line 152, in setup
>>    dist.run_commands()
>>  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
>>    self.run_command(cmd)
>>  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>    cmd_obj.run()
>>  File "C:\Python27\lib\distutils\command\install.py", line 563, in run
>>    self.run_command('build')
>>  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>    self.distribution.run_command(command)
>>  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>    cmd_obj.run()
>>  File "C:\Python27\lib\distutils\command\build.py", line 127, in run
>>    self.run_command(cmd_name)
>>  File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
>>    self.distribution.run_command(command)
>>  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
>>    cmd_obj.run()
>>  File "setup.py", line 249, in run
>>    build_ext.run(self)
>>  File "C:\Python27\lib\distutils\command\build_ext.py", line 339, in run
>>    self.build_extensions()
>>  File "setup.py", line 146, in build_extensions
>>    build_ext.build_extensions(self)
>>  File "C:\Python27\lib\distutils\command\build_ext.py", line 448, in
>> build_extensions
>>    self.build_extension(ext)
>>  File "C:\Python27\lib\distutils\command\build_ext.py", line 498, in
>> build_extension
>>    depends=ext.depends)
>>  File "C:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile
>>    self.initialize()
>>  File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize
>>    vc_env = query_vcvarsall(VERSION, plat_spec)
>>  File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in
>> query_vcvarsall
>>    raise ValueError(str(list(result.keys(
>> ValueError: [u'path']
>>
>> --
>> and when I manually run vcvarsall (which is in PATH), I get the
>> aforementioned linker errors:
>> --
>>
>> C:\workingdir\pycrypto>python setup.py install
>> running install
>> running build
>> running build_py
>> running build_ext
>> building 'Crypto.Random.OSRNG.winrandom' extension
>> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c
>> /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc/ -Isrc/inc-msvc/
>> -IC:\Python27\include -IC:\Python27 \PC /Tcsrc/winrand.c
>> /Fobuild\temp.win-amd64-2.7\Release\src/winrand.obj winrand.c
>> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe
>> /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs
>> /LIBPATH:C:\Python27\PCbuild\amd64 ws2 _32.lib advapi32.lib
>> /EXPORT:initwinrandom build\temp.win-amd64-2.7\Release\src/
>> winrand.obj /OUT:build\lib.win-amd64-2.7\Crypto\Random\OSRNG\winrandom.pyd 
>> /IMPL
>> IB:build\temp.win-amd64-2.7\Release\src\winrandom.lib
>> /MANIFESTFILE:build\temp.win-amd64-2.7\Release\src\winrandom.pyd.manifest
>>   Creating library build\temp.win-amd64-2.7\Release\src\winrandom.lib
>> and object build\temp.win-amd64-2.7\Release\src\winrandom.exp
>> winrand.obj : error LNK2019: unresolved external symbol
>> __imp__PyObject_Free referenced in function _WRdealloc
>> winrand.obj : error LNK2019: unresolved external symbol
>> __imp__PyExc_SystemError referenced in function _WRdealloc
>> winrand.obj : error LNK2019: unresolved external symbol
>> __imp__PyErr_Format referenced in function _WRdealloc
>> winrand.obj : error LNK2019: unresolved external symbol
>> __imp__PyExc_TypeError referenced in function _WRdealloc
>> winrand.obj : error LNK2019: unresolved external symbol
>> __imp___PyObject_New referenced in function _winrandom_new
>> winrand.obj : error LNK2019: unresolved external symbol
&

Re: PyCrypto builds neither with MSVC nor MinGW

2012-03-14 Thread Alec Taylor
Oh wait, just realised it was loading the (x86) tools. Doing a quick
search I noticed that I didn't have the x64 components installed, so
loading up the MSVC08 setup again and installing it, then:
copying vcvarsamd64.bat to vcvarsall.bat and adding its directory
(C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\) to
PATH

AND IT WORKS!

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


Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:06 AM, Mark Lawrence  wrote:
> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>
 with open("filename", "w") as f
>  File "", line 1
>
>    with open("filename", "w") as f
>                                  ^
> SyntaxError: invalid syntax
>
> --
> Cheers.
>
> Mark Lawrence.
>

Erred for me also; but under f:

Python 2.7.3rc1 (default, Feb 24 2012, 21:28:59) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> with open("filename", "w") as f
  File "", line 1
with open("filename", "w") as f
  ^
SyntaxError: invalid syntax
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm
 wrote:
> On 3/15/2012 13:21, Chris Angelico wrote:
>>
>> On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm
>>   wrote:
>>>
>>> On 3/15/2012 12:47, Chris Angelico wrote:

 It's a little odd, perhaps, if seen in a vacuum. But everything counts
 from zero - list indices, etc - so it makes sense for range(len(lst))
 to return indices valid for lst.
>>>
>>>
>>> Maybe range uses [...) intervals? So range(a,b) is a,a+1,a+2,...,b-1 and
>>> range(b) is just short-hand for range(0,b)?
>>
>>
>> Yup. It's amazing how accurate your conjectures are - it's almost like
>> you've been reading the docs! :D
>
>
> Come on... that was easy! :)
>
>
>> But yeah, that's pretty logical IMHO;
>> and having gotten used to [) intervals in many areas of computing,
>> I've come to find [] intervals disconcerting. Bible passages are
>> described as, for instance, John 14:5-7, which is a three-verse
>> passage (5, 6, 7), even though 7-5=2.
>
>
> Common people use mainly inclusive intervals as far as I can tell.
> For instance, "from" and "to" are inclusive.
> They could tell you they don't like your intervals because 8-5+1 = 4 instead
> of 3.
>
>
>> However, inclusive-inclusive intervals have the benefit that they
>> don't require the element "beyond the last" to be indexable. This is
>> important if you're working with something that takes up all of
>> addressable memory - going back to the IBM PCs on which I learned to
>> code, you could use one 64KB segment for an array, but then there's no
>> way for a 16-bit integer to indicate "past the end".
>
>
> But you lose the empty interval (a,a). You're forced to use (a,a-1) or
> something similar. There's always a drawback.
>
 List comps are pretty readable if you know how programming languages
 work. Python need not be readable by everyone and his grandmother, and
 it does a fairly good job of being grokkable to someone who has a few
 ranks in Coding. (Yeah, I'm a D&D nerd. )
>>>
>>>
>>> I like what I've seen so far.
>>
>>
>> Python has its problems, but it's a good language. I personally prefer
>> to delimit blocks of code with braces than with indentation,
>
>
> I, on the other hand, prefer indentation. I find braces redundant (in fact,
> I never use them in pseudo-code).
>
>
>> and I
>> also prefer explicit declaration of variables (yes, it's extra work,
>> but you can have infinitely nested scopes and easily-caught syntax
>> errors when you misspell one), but they're relatively minor.
>
>
> I usually declare my variables but close to where I need them.
>
>
>> One of my
>> favorite aspects of Python is that *everything* is an object. There's
>> no magic syntax that gives you a piece of an object, or something
>> special about variables that contain this, that, or the other. A
>> literal list [like, this, one] can be used in exactly the same ways as
>> the name of a variable containing a list or a function call returning
>> a list - there is no difference. Oh how I yearn for that when working
>> in C++ or PHP!
>
>
> Don't worry. Soon you'll be using C++0x :)))
>
> Kiuhnm
> --
> http://mail.python.org/mailman/listinfo/python-list

C++0x? You mean C++11? :P

On that note, is Python upgrading to use C11? :V
-- 
http://mail.python.org/mailman/listinfo/python-list


Templated rich-text egg

2012-03-23 Thread Alec Taylor
Good morning,

We've all seen document templates in a variety of systems, such as
PowerPoint, MailChimp and Google Docs.

I would like to utilise the same sorts of capabilities on my website.

The following features I require:
• Create a library of document templates
• Allow others to pick a document template to create there document from
• Allow others to swap the template their document has without losing data
• Document authoring in rich-text (e.g. using CKEditor)

(I will probably end up using a full CMS such as Mezzanine around the
whole system.)

Please suggest modules allowing me to do the aforementioned.

Thanks for all recommendations,

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


Re: Is Programing Art or Science?

2012-04-03 Thread Alec Taylor
Programming is neither Art nor Science

It's practically maths

[pun intended]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 274

2012-04-07 Thread Alec Taylor
I have it in 2.7.3

On Sun, Apr 8, 2012 at 2:35 AM, Terry Reedy  wrote:
> On 4/7/2012 7:20 AM, Rodrick Brown wrote:
>>
>> This proposal was suggested in 2001 and is only now being
>> implemented. Why the extended delay?
>
>
> It was implemented in revised form 3 years ago in 3.0.
>
> --
> Terry Jan Reedy
>
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


How would I go about building an API converter?

2012-05-02 Thread Alec Taylor
I have multiple different APIs with different schemas serialised in XML or
JSON which I need to output as a standardised schema.

Main features needed:

   - *Serialisation to XML and JSON*
   - *Authentication*
  - I.e.: can't get/set data unless you have the correct user+pass
   - *Role/Scope limitation*
  - I.e.: you can't access everything in our database, only what your
  role allows for
   - *Get/set (conversion) between different schemas*
  - I.e.: No matter the input API, you can get it formatted in
  whichever output API you request

Is this the sort of problem Slumber <http://slumber.in/> with
TastyPie<http://tastypieapi.org/>would be best for?

Or are there a different libraries you'd recommend?

Thanks for all suggestions,

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


Python SOAP library

2012-05-02 Thread Alec Taylor
What's the best SOAP library for Python?

I am creating an API converter which will be serialising to/from a variety of 
sources, including REST and SOAP.

Relevant parsing is XML [incl. SOAP] and JSON.

Would you recommend: http://code.google.com/p/soapbox/

Or suggest another?

Thanks for all information,

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


Re: Python SOAP library

2012-05-02 Thread Alec Taylor
Client and server (unfortunately)

I need to support serialisation between formats

On Thu, May 3, 2012 at 7:24 AM, John Nagle  wrote:
> On 5/2/2012 8:35 AM, Alec Taylor wrote:
>>
>> What's the best SOAP library for Python?
>> I am creating an API converter which will be serialising to/from a variety
>> of sources, including REST and SOAP.
>> Relevant parsing is XML [incl. SOAP] and JSON.
>> Would you recommend: http://code.google.com/p/soapbox/
>>
>> Or suggest another?
>> Thanks for all information,
>
>
>   Are you implementing the client or the server?
>
>   Python "Suds" is a good client-side library. It's strict SOAP;
> you must have a WSDL file, and the XML queries and replies must
> verify against the WSDL file.
>
>    https://fedorahosted.org/suds/
>
>                                                John Nagle
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sorting 1172026 entries

2012-05-06 Thread Alec Taylor
Also, is there a reason you are sorting the data-set after insert
rather than using a self-sorting data-structure?

A well chosen self-sorting data-structure is always more efficient
when full data flow is controlled.

I.e.: first insert can be modified to use the self-sorting data-structure

I cannot think of a situation requiring permanently sorted data-sets
which would be better served with a non-self-sorting data-structure
except those where you do not have full data-flow control.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: which book?

2012-05-08 Thread Alec Taylor
plot issues?

On Wed, May 9, 2012 at 4:16 AM,   wrote:
> folks
> hi,
> I am going to learn python for some plot issues. which book or sources, do 
> you recommend please?
> Cheers,
> Dave
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Python web-framework with the widest scalability?

2012-05-12 Thread Alec Taylor
I am building a project requiring high performance and scalability,
entailing:

   - Role-based
authenticationwith
   
API-keylicensing
to access data of specific users
   - API exposed
with
   REST 
(XML,
   JSON ),
XMLRPC,
   JSONRPC  and
SOAP
   - "Easily" configurable getters and
settersto create APIs
accessing the same data but with input/output in different
   schemas 

A conservative estimate of the number of tables—often whose queries require
joins—is: 20.

Which database type—e.g.: NoSQL 
or DBMS
—key-value data store
or
object-relational
database —e.g.:
Redis  or
PostgreSQL—and
web-framework —e.g.
Django ,
Web2Pyor
Flask —would you recommend?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Opening a csv file in python on a mac

2012-05-12 Thread Alec Taylor
Import csv

Lookup usage in the python docs
On 13/05/2012 9:22 AM, "Brian Heese"  wrote:

> I created a csv file called python test file.csv. It is stored on my
> Desktop directory.  When I try to open it using the command open ('Desktop
> python test file.csv') I get the following error: "No such file or
> directory". The same thing happens if I use open ('python test file.csv').
> What I am I doing wrong?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Good data structure for finding date intervals including a given date

2012-05-13 Thread Alec Taylor
There is an ordered dict type since Python 3.1[1] and Python 2.7.3[2].

If you are looking for the best possible self-sorting structure for
searching, then perhaps you are looking for what's outlined in the
2002 article by Han & Thorup: Integer Sorting in O(n sqrt(log log n))
Expected Time and Linear Space[3].

[1] http://www.python.org/getit/releases/3.1/
[2] http://www.python.org/getit/releases/2.7.3/
[3] http://dl.acm.org/citation.cfm?id=645413.652131

On Sat, May 12, 2012 at 10:17 PM, Jean-Daniel
 wrote:
>
> Hello,
>
> I have a long list of n date intervals that gets added or suppressed
> intervals regularly. I am looking for a fast way to find the intervals
> containing a given date, without having to check all intervals (less
> than O(n)).
>
> Do you know the best way to do this in Python with the stdlib?
>
> A variant of the red black trees can do the job quickly [1], is this a
> good enough use case to discuss the inclusion of a red black tree
> implementation in the stdlib?
>
> This has been discussed here: http://bugs.python.org/issue1324770 ,
> and lack of good use case was the reason the bug was closed. A dict
> implemented with red black trees is slower (but not too slow) at
> inserting, searching and deleting but the dict is always kept ordered.
> Bigger projects have their own implementation of ordered dict so such
> datastructures in the standard library would help the porting of the
> project to other platforms. Take the example of the zodb and the
> C-only implementation of the btree: btree in the stdlib in Python
> would help the porting to GAE or pypy [2].
>
> Cheers,
>
> [1] in the "Cormen" book:
> http://en.wikipedia.org/wiki/Introduction_to_Algorithms
> [2] https://blueprints.launchpad.net/zodb/+spec/remove-btree-dependency
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Python web-framework+db with the widest scalability?

2012-05-14 Thread Alec Taylor
I am building a project requiring high performance and scalability, entailing:

• Role-based authentication with API-key licensing to access data of specific 
users
• API exposed with REST (XML, JSON), XMLRPC, JSONRPC and SOAP
• "Easily" configurable getters and setters to create APIs accessing the same 
data but with input/output in different schemas

A conservative estimate of the number of tables—often whose queries require 
joins—is: 20.

Which database type—e.g.: NoSQL or DBMS—key-value data store or 
object-relational database—e.g.: Redis or PostgreSQL—and web-framework—e.g. 
Django, Web2Py or Flask—would you recommend?

Thanks for all suggestions,

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


Automatically caching computationally intensive variable values?

2012-05-26 Thread Alec Taylor
I am working with a few corpora included in nltk-data with NTLK
(http://nltk.org/) to figure out certain algorithms.

So my code would generally be something of the style:

import re, nltk, random
from nltk.corpus import reuters

def find_test_and_train_data():
return [fileid for fileid in reuters.fileids() if
re.match(r"^training/", fileid)], [fileid for fileid in
reuters.fileids() if re.match(r"^test/", fileid)]

def generate_random_data(train_and_test_fileids):
random.seed(348) ; random.shuffle(train_and_test_fileids[0])
return train_and_test_fileids[0][2000:], 
train_and_test_fileids[0][:2000]

def fileid_words(fileid):
return [word.lower() for line in reuters.words(fileid) for word 
in
line.split() if re.match('^[A-Za-z]+$', word)]

if __name__ == '__main__':
train_fileids, dev_fileids = 
generate_random_data(find_test_and_train_data())
train_data=fileid_words(train_fileids)
dev_data=fileid_words(dev_fileids)

So if I run it into an interactive interpreter I can then perform
tasks on `train_data`, `dev_data` and their corresponding fileids
without repopulating the variables (a very time consuming task, e.g.:
this takes 7 minutes to run each time).

However, I want to be able to write it into a .py file so that I can
save statistically interesting algorithms.

I could do this by double-typing, e.g.: when I get a function working
in the interpreter I then copy+paste it into the .py file, but this is
quite inefficient and I lose out on my IDEs' features.

Are there any IDEs or Python modules which can automatically keep the
Python script running in memory, or store the value of a variable—such
as `test_data`—in a db?

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


Templating library which generates HTML+JS for interfacing RESTfully?

2012-05-31 Thread Alec Taylor
Are there any templating libraries—e.g.: Jinja2, Django Template Engine, Mako 
&etc—which can be used to interface over REST, XMLRPC xor JSONRPC?

My use-cases follow:
1. Generate a website, e.g.: to run from example.com (currently every 
templating language does this out of the box)
2. Generate the JS, HTML and CSS to put into a mobile phone app (PhoneGap)
3. Generate JavaScript "widget" code for pasting onto your site (see footnote 
[1] for popular examples)

My current plan is to write the entire client using HTML, CSS 
(twitter-bootstrap responsive) and JavaScript—e.g.: with Backbone.js—allowing 
me to use that same client code for the website and PhoneGap clients. With that 
done, the widgets wouldn't be too difficult to extrapolate.

However, this seems like a really complex way of doing things, especially when 
taking into consideration checks requiring login, forced redirects and more 
fine grained RBAC.

Is there a templating language which can easily interface via REST (XML xor 
JSON), XMLRPC xor JSONRPC?

Thanks for all information and suggestions,

Alec Taylor

[1] | The example JavaScript widgets:
- DISQUS gives the following snippet:
 `http://example.disqus.com/combination_widget.js?num_items=5&hide_mods=0&color=blue&default_tab=people&excerpt_length=200"</a>;>http://disqus.com/";>Powered by Disqus`

- Facebook gives the following snippet:
 `(function(d, s, id) {var js, fjs = 
d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = 
d.createElement(s); js.id = id;js.src = 
"//connect.facebook.net/en_US/all.js#xfbml=1&appId=237216179703726";fjs.parentNode.insertBefore(js,
 fjs);}(document, 'script', 'facebook-jssdk'));`
 ``

- Twitter gives the following snippet:
 `http://widgets.twimg.com/j/2/widget.js"</a>;>new 
TWTR.Widget({version: 2,type: 'profile',rpp: 4,interval: 3,width: 
250,height: 300,theme: {shell: {background: '#33',color: '#ff'},tweets: 
{background: '#00',color: '#ff',links: '#4aed05'}},features: 
{scrollbar: false,loop: false,live: false,behavior: 
'all'}}).render().setUser('twitter').start();`
-- 
http://mail.python.org/mailman/listinfo/python-list


python View Controller for decoupled website architectures?

2012-06-03 Thread Alec Taylor
I'm developing a database (Model Controller) in Python (web2py) that exposes 
APIs in REST (HTTP)[CSV, XML, JSON] and RPC (XML, JSON).

The client I'm developing in JavaScript to interface with my remote database 
via its API.

Unfortunately JavaScript is rather troublesome when it comes to managing 
user-sessions, routing and RBACing templates (e.g.: `if "admin" in user.role: 
Caution: you are logged in as admin`).

Is there a Pythonic way of managing the client-side? - E.g.: Skulpt, Pyjamas or 
some way of getting web2py views to work with remote calls - If so, can you 
show me some boilerplate for session control, routing and RBAC templates?

Thanks,

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


Re: PIL for the Python 3.2.3

2012-06-15 Thread Alec Taylor
On Fri, Jun 15, 2012 at 10:18 PM, Gonzalo de Soto wrote:

> Dear Python Org,
>
> It wanted to know if already PIL's
> version is available for Python 3.2.3.
>
> ** **
>
> Thanks.
>
>Gonzalo
>
>   
>
> ** **
>
> * *
>
> ** **
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
Looks like the PIL fork "Pillow" is coming close to support for Python 3:
https://github.com/collective/Pillow/pull/25
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Academic citation of Python

2012-06-15 Thread Alec Taylor
Maybe quote the "Programming Python" book, since Guido wrote the forward?

http://www.python.org/doc/essays/foreword2/

On Sat, Jun 16, 2012 at 1:24 PM, Mark Livingstone
 wrote:
> Hello!
>
> I wish to properly cite Python in an academic paper I am writing.
>
> Is there a preferred document etc to cite?
>
> Thanks in advance,
>
> MArkL
> --
> http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Academic citation of Python

2012-06-15 Thread Alec Taylor
I think it's more like when you see articles with a passage like:


The C programming language[1] or the C++ programming language[2] are both
> examples of...
>


Are both easy to find the proper reference for.

On Sat, Jun 16, 2012 at 2:13 PM, Ben Finney wrote:

> Mark Livingstone  writes:
>
> > I wish to properly cite Python in an academic paper I am writing.
> >
> > Is there a preferred document etc to cite?
>
> I think you're best positioned to answer that. Python isn't a document,
> so what specifically are you citing it as?
>
> --
>  \   “A ‘No’ uttered from deepest conviction is better and greater |
>  `\   than a ‘Yes’ merely uttered to please, or what is worse, to |
> _o__)  avoid trouble.” —Mohandas K. Gandhi |
> Ben Finney
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: which one do you prefer? python with C# or java?

2012-06-15 Thread Alec Taylor
On Sun, Jun 10, 2012 at 8:44 AM, Yesterday Paid
 wrote:
>
> I'm planning to learn one more language with my python.
> Someone recommended to do Lisp or Clojure, but I don't think it's a
> good idea(do you?)
> So, I consider C# with ironpython or Java with Jython.
> It's a hard choice...I like Visual studio(because my first lang is VB6
> so I'm familiar with that)
> but maybe java would be more useful out of windows.
>
> what do you think?

Learn C and Python.

They work well together... you can write Python modules in C (using
Cython or CTypes), and the most popular implementation is written in C
(CPython).

Alternatively learn C++ and Python.

You can can generate C++ from Python using ShedSkin
(http://shed-skin.blogspot.com.au/), and you can write extension to
Python in C++ 
(http://docs.python.org/extending/extending.html#writing-extensions-in-c).
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What Programing Language are the Largest Website Written In?

2011-08-12 Thread Alec Taylor
C++ (Wt xor CppCMS)

WOOT!

On Sat, Aug 13, 2011 at 1:58 AM, Tim Bradshaw  wrote:
> On 2011-08-02 15:41:06 +0100, ccc31807 said:
>
>>
>> Most of these are tech companies. Tech companies are very important,
>> but so are other kinds of companies. What do manufacturing companies
>> use, like Ford and Toyota, energy companies like BP and Exxon,
>> pharmaceutical companies, consumer product companies, and so on? What
>> about the big retailers, Sears, WalMart, Target, etc.?
>
> A more important metric is how critical the web presence is to the company.
>  For Amazon, say, it's pretty critical, so what they do is likely to be
> interesting: if their site is broken they're not making any money.  For
> Toyota, say, well, an outage would probably be embarrassing, but it's not
> anything like as critical to them.
>
> Unfortunatly I suspect that with web stuff as with other stuff, the answer
> is that it entirely depends.  I am endlessly horrified by the poor state of
> software that is really critical to large companies.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List spam

2011-08-18 Thread Alec Taylor
5963 unread emails.

Thanks python-list + other mailing-lists!

My recommendation to you is to setup a different account for your
mailing-lists. Alternatively setup some mail rules.

On Fri, Aug 19, 2011 at 3:46 AM, Chris Angelico  wrote:
> On Thu, Aug 18, 2011 at 3:37 PM, Ghodmode  wrote:
>> Make an effort to curb the spam even if it means killing the newsgroup
>> availability.  Choose mailman or Google Groups, or another single
>> solution.  Make it members only, but allow anyone to register with an
>> automated confirmation email and a CAPTCHA.  Appoint a list admin who
>> has a few minutes each day to scan subjects of emails for spammers and
>> remove them from the members list.
>>
>
> Unfortunately spammers can create email addresses very quickly, and
> CAPTCHAs are inherently weak (even the best of them are easily cracked
> by the Chinese human "botnets"). However, I wouldn't be against a
> system of spam filtering with three levels: Not Spam, gets straight
> onto the list; Definite Spam, gets deleted; and Dubious, which gets
> dropped into a mod's basket.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Word Perfect integration

2011-08-18 Thread Alec Taylor
wow, people still use WordPerfect?

On Fri, Aug 19, 2011 at 2:51 AM, John Gordon  wrote:
> In  Ethan Furman 
>  writes:
>
>> I have WordPerfect v13 which we are currently using for letter merges.
>> I would like to automate this with Python instead of learning the WP
>> Macro language.
>
> I suspect that learning how to integrate python with wordperfect will
> end up being much more work than learning wordperfect macros.
>
> Just my two cents.
>
> --
> John Gordon                   A is for Amy, who fell down the stairs
> gor...@panix.com              B is for Basil, assaulted by bears
>                                -- Edward Gorey, "The Gashlycrumb Tinies"
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Word Perfect integration

2011-08-19 Thread Alec Taylor
:P

Personally, I use LaTeX, which fits all my requirements.

On Fri, Aug 19, 2011 at 5:24 AM, Ethan Furman  wrote:
> Alec Taylor wrote:
>>
>> wow, people still use WordPerfect?
>
> Them's fightin' words right there!  :)
>
> Yes, we still use Word Perfect, and will as long as it is available. The
> ability to see the codes in use (bold, margins, columns, etc) has so far
> been unequaled in anything else I have looked at.
>
> ~Ethan~
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Stop quoting spam [was Re: Hot Girls ...]

2011-08-20 Thread Alec Taylor
On Sat, Aug 20, 2011 at 9:24 AM, Albert W. Hopkins
 wrote:
>
>
> On Friday, August 19 at 17:12 (-0400), Matty Sarro said:
>
>>
>> If you're that offended then spend the cycles fixing the damn list so
>> it
>> stops having so much spam. You realize spam comes in almost
>> constantly,
>> right? Enough that multiple tines over the past weeks there have been
>> no
>> less than 3 threads about it.
>
> For me, the original post ended in my spam box, which means my filter is
> doing it's job, but when you re-post it, my filter did not regard it as
> spam.  I actually wish it had.  Therefore you are an enabler.
>
>
>> If php, red hat, and perl can manage it for their lists, why not
>> python? Is
>> that a statement about python programmers?
>>
>
> The python list is (also) a Usenet newsgroup.  Usenet is distributed and
> therefore there is no central place to filter spam (each usenet host
> would have to have its own filter and what one considers spam another
> might consider ham)... anyway, that's neither here nor there.  Having my
> own filter usually works.
>
> I'm not here to dis you, just to try to help you understand the how/why
> regarding the re-post and why your attitude about it might give the
> impression of apathy toward your peer community.
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I found said joke rather funny :P
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Windows Extensions for Mac

2011-08-21 Thread Alec Taylor
Perhaps you'd be better off with something like RunDeck (Free,
Open-Source, Cross-Platform, CopyLeft) for this kind of problem.

On Sun, Aug 21, 2011 at 5:30 PM, Chris Angelico  wrote:
> On Sun, Aug 21, 2011 at 6:38 AM, Johnny Venter  wrote:
>> Yes, I want to make my queries from a remote non-Windows computer. Here is 
>> the scenario:
>>
>> From my mac, I want to use python to access and read objects from a remote  
>> Windows computer joined to a Windows 2003 functional level domain. Given 
>> this, what is the best way to accomplish this?
>>
>
> Then the "use Python" part is relatively immaterial; what you need to
> know is: What network protocol are you using to "access and read
> objects"? Start by researching that; once you know the details (is it
> even TCP/IP-based?), you can look into whether Python has facilities
> for speaking that protocol.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/Eclipse

2011-08-28 Thread Alec Taylor
Editra

On Sun, Aug 28, 2011 at 5:56 PM, flebber  wrote:
> On Aug 27, 6:34 pm, UncleLaz  wrote:
>> On Aug 26, 5:18 pm, Dave Boland  wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > I'm looking for a good IDE -- easy to setup, easy to use -- for Python.
>> >   Any suggestions?
>>
>> > I use Eclipse for other projects and have no problem with using it for
>> > Python, except that I can't get PyDev to install.  It takes forever,
>> > then produces an error that makes no sense.
>>
>> > An error occurred while installing the items
>> >    session context was:(profile=PlatformProfile,
>> > phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install,
>> > operand=null --> [R]org.eclipse.cvs 1.0.400.v201002111343,
>> > action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBu
>> >  ndleAction).
>> >    Cannot connect to keystore.
>> >    This trust engine is read only.
>> >    The artifact file for
>> > osgi.bundle,org.eclipse.cvs,1.0.400.v201002111343 was not found.
>>
>> > Any suggestions on getting this to work?
>>
>> > Thanks,
>> > Dave
>>
>> I use Aptana Studio 3, it's pretty good and it's based on eclipse
>
> Emacs with emacs-for-python makes the install and setup a breeze and
> emacs does a lot for you without much learning.
> http://gabrielelanaro.github.com/emacs-for-python/
>
> geany is great I use it the most.
> http://www.geany.org/
>
> Finally this is a fairly new project, but it could be pretty good.
> they are heavy in development of version 2. Ninja ide
> http://ninja-ide.org/
> they provide packages for Debian/ubuntu fedora mandriva & windows and
> the developers are very helpful if you have any issues or questions
> jump on IRC for a chat.
>
> Sayth
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for open-source Python projects to help out with

2011-09-07 Thread Alec Taylor
Hi Tyler,

I'm currently working on building a new kind of social-network for
Users-Groups, Game-Clans & Student-Groups.

Building it using DJango with Pinax.

Detailed Feature-Set (planned):
• Event management
• Conference management (including ticketing with payment-gateway integration)
• Video+Audio Conferencing of event, with online interaction
possibilitiy (great for webinars)
• Join/create/delete/list groups
• Sitewide calendar
• Sitewide feed from non-private groups
• SSO integration (facebook, twitter & linkedin)
• Wall (+feed) for each group
• Listing of who's in which group
• PM group members

I will probably be releasing it under the New BSD license, although
I'm happy to consider others given a good argument.

Interested?

On Wed, Sep 7, 2011 at 12:19 PM, Littlefield, Tyler  wrote:
> Hello:
> I've got a bit of time on my hands, so I'm curious what sorts of projects
> there are that people needs help with. I'd like to choose something that
> doesn't have a ton of red tape, but is stable, which is why I ask here
> instead of just Googling open source projects. My main interests lie in
> accessibility, Utilities and security.
>
> --
>
> Take care,
> ~Ty
> Web: http://tds-solutions.net
>
> Sent from my toaster.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for open-source Python projects to help out with

2011-09-07 Thread Alec Taylor
The project page is: http://SamuelMarks.GitHub.com/groupHub

/me is thinking a rename to "groupSwitch", thoughts?

The project is currently in planning stage. All help is appreciated.

On Wed, Sep 7, 2011 at 6:32 PM, Fayaz Yusuf Khan
 wrote:
> On Wednesday, September 07, 2011 01:09:51 PM Alec Taylor wrote:
>> Hi Tyler,
>>
>> I'm currently working on building a new kind of social-network for
>> Users-Groups, Game-Clans & Student-Groups.
>>
>> Building it using DJango with Pinax.
>>
>> Detailed Feature-Set (planned):
>> • Event management
>> • Conference management (including ticketing with payment-gateway
>> integration) • Video+Audio Conferencing of event, with online interaction
>> possibilitiy (great for webinars)
>> • Join/create/delete/list groups
>> • Sitewide calendar
>> • Sitewide feed from non-private groups
>> • SSO integration (facebook, twitter & linkedin)
>> • Wall (+feed) for each group
>> • Listing of who's in which group
>> • PM group members
>>
>> I will probably be releasing it under the New BSD license, although
>> I'm happy to consider others given a good argument.
>>
>> Interested?
> The project page and mailing list?
>
> --
> Fayaz Yusuf Khan
> Cloud developer and designer
> Dexetra SS, Kochi, India
> fayaz.yusuf.khan_AT_gmail_DOT_com
> fayaz_AT_dexetra_DOT_com
> +91-9746-830-823
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looking for open-source Python projects to help out with

2011-09-07 Thread Alec Taylor
Accessibility?

Hmm, you could look at
http://groups.google.com/group/django-users/browse_thread/thread/44a4dbf8771e0f4f
(https://groups.google.com/forum/#!topic/django-users/RKTb-HceD08)

On Thu, Sep 8, 2011 at 1:12 AM, Eric Snow  wrote:
> On Tue, Sep 6, 2011 at 8:19 PM, Littlefield, Tyler  
> wrote:
>> Hello:
>> I've got a bit of time on my hands, so I'm curious what sorts of projects
>> there are that people needs help with. I'd like to choose something that
>> doesn't have a ton of red tape, but is stable, which is why I ask here
>> instead of just Googling open source projects. My main interests lie in
>> accessibility, Utilities and security.
>
> An interesting one that I haven't had time to help on yet is the
> "extensions for unittest" project:
>
> https://code.google.com/p/unittest-ext/issues/list
>
> Basically it's adding an extensions framework to the stdlib unittest
> module.  I'm sure Michael Foord wouldn't mind the help.  Like I said,
> a very interesting project, though not directly related to
> accessibility or security.
>
> -eric
>
>>
>> --
>>
>> Take care,
>> ~Ty
>> Web: http://tds-solutions.net
>>
>> Sent from my toaster.
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Python IDE/text-editor

2011-04-15 Thread Alec Taylor
Good Afternoon,

I'm looking for an IDE which offers syntax-highlighting,
code-completion, tabs, an embedded interpreter and which is portable
(for running from USB on Windows).

Here's a mockup of the app I'm looking for: http://i52.tinypic.com/2uojswz.png

Which would you recommend?

Thanks in advance for any suggestions,

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


Re: Python IDE/text-editor

2011-04-15 Thread Alec Taylor
Thanks, but non of the IDEs so far suggested have an embedded python
interpreter AND tabs... a few of the editors (such as Editra) have
really nice interfaces, however are missing the embedded
interpreter... emacs having the opposite problem, missing tabs (also,
selecting text with my mouse is something I do often).

Please continue your recommendations.

Thanks,

Alec Taylor

On Sat, Apr 16, 2011 at 3:29 PM, John Bokma  wrote:
> Ben Finney  writes:
>
>> Alec Taylor  writes:
>>
>>> I'm looking for an IDE which offers syntax-highlighting,
>>> code-completion, tabs, an embedded interpreter and which is portable
>>> (for running from USB on Windows).
>>
>> Either of Emacs http://www.gnu.org/software/emacs/> or Vim
>> http://www.vim.org/> are excellent general-purpose editors that
>> have strong features for programmers of any popular language or text
>> format.
>
> I second Emacs or vim. I currently use Emacs the most, but I think it's
> good to learn both.
>
> --
> John Bokma                                                               j3b
>
> Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
>    Freelance Perl & Python Development: http://castleamber.com/
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-16 Thread Alec Taylor
IDLE loses syntax highlighting annoyingly often, and interpreter isn't embedded.

Boa Constructor gave errors on installation (keys).

Komodo might be good, however isn't free nor can't be run from USB :(

On Sat, Apr 16, 2011 at 4:31 PM, CM  wrote:
> On Apr 16, 1:43 am, Alec Taylor  wrote:
>> Thanks, but non of the IDEs so far suggested have an embedded python
>> interpreter AND tabs... a few of the editors (such as Editra) have
>> really nice interfaces, however are missing the embedded
>> interpreter... emacs having the opposite problem, missing tabs (also,
>> selecting text with my mouse is something I do often).
>
> Boa Constructor has syntax-highlighting, code-completion, tabs, line
> numbers, and an embedded interpreter.  It also does a lot of other
> IDEish stuff and it's a GUI builder, too. I've never tried to run it
> from a USB, though, and the interpreter (the "shell") is in a separate
> tab, not on the bottom as you've drawn it.
>
> You might want to just look at this page for other ideas:
> http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-17 Thread Alec Taylor
Thanks for all the replies (I love the python mailing-list!)

I've tried all the IDEs/text-editors mentioned.

PyScripter is great, however is unmaintained thus doesn't support
64-bit :[ (and is a little buggy)
Also, it requires network connectivity, which could prove troublesome
on my locked-down Uni network (requires localhost for python shell)

DreamPIE isn't what I'm looking for.

Editra has a python plugin? - Excellent! — Got the plugin working...
is there a shortcut (e.g.: F9) for running the opened python script?

UliPad is quite good, however badly coded (a new console window opens
then closes each time I run a script)... I might fix that bug if I
ever get the time.

MonoDevelop doesn't seem to support Python (I pressed: "New Solution")

GEdit probably won't work from a USB, and the embedded console isn't
user friendly (you'd need to type: "import x.py" or whatever)

Emacs and vim are good, however I often find myself on a workstation
without direct console access. GVim leaves a lot aesthetically
desired. Also there's a learning-curve to both of them, whereas nano,
and all the text-editors/IDEs above are user-friendly. None I've found
to have a big learning curve (more about finding the right preference
to change in settings than anything else!)

Kate I haven't tried yet... it's currently downloading.

On Sun, Apr 17, 2011 at 3:05 AM, Terry Reedy  wrote:
> On 4/16/2011 3:03 AM, Alec Taylor wrote:
>>
>> IDLE loses syntax highlighting annoyingly often
>
> Could you exlain?
> When does it do that with a file labelled .py?
>
> Terry Jan Reedy

Just randomly, sometimes on first save to a .py, other-times on files
that I've opened with a .py extension.

It loses all syntax highlighting!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
Geany I've tried in the past, it's really buggy on my home computer
and at Uni... however from my phone it works wonderfully! (Use it for
C++ projects on Rhobuntu)

Eric 4 was suggested to me on the #python channel on Freenode...
however I've never been able to get it compiled/working. Too many
dependencies I'm guessing...

PTK looks great, and does everything I want (from screenshots).
Unfortunately, it doesn't run on my system; Win7 x64, Python 2.7.1
x64, WxPython 2.8 x64. Install ran as admin.

Emacs and vim still seem like good alternatives, when I get the time.
However, currently have 3 assignments to start and finish so would
like a simple Notepad2 with python interpreter attached (and keyboard
shortcut to run script) type program.

Please continue recommending

Thanks,

Alec Taylor

On Mon, Apr 18, 2011 at 6:13 AM, Westley Martínez  wrote:
> On Sun, 2011-04-17 at 09:08 +1000, Chris Angelico wrote:
>> On Sun, Apr 17, 2011 at 8:31 AM, Westley Martínez  wrote:
>> >
>> > Either way doesn't it require python be installed on the system?
>>
>> Most Python development is going to require that...
>>
>> I'm rather puzzled by this question; I think I've misunderstood it.
>> You can't run Python programs without a Python interpreter installed.
>>
>> Chris Angelico
>
> Didn't the OP ask for a portable system, i.e. you can carry everything
> around on a flash drive and pop it into any computer? Or is he just
> asking that the editor be portable?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Yep, flash-drive portable if you please =]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
The current finalists:

*Editra* with PyShell in Shelf

Pros: Syntax highlighting, tabs, ¿portable? and embedded python interpreter
(PyShell 0.8)
Cons: No run button or keyboard shortcut for quick running of script (made
issue: http://code.google.com/p/editra/issues/detail?id=641) and doesn't
save settings changes for editor

*PyScripter*

Pros: Syntax highlighting, tabs, ¿portable?, embedded python interpreter,
keyboard shortcut (Ctrl+F9 [though would prefer single key...]) and run
button
Cons: Unmaintained, so doesn't support x64 and has a few bugs

*UliPad*

Pros: Syntax highlighting, tabs, ¿portable?, embedded python interpreter,
keyboard shortcut (F5) and run button
Cons: Command-prompt window appears whenever script is run (could be admin
issues at Uni) and is unmaintained, so can expect bugs and non-modern
interfaces for length of use

Please continue suggesting Python IDEs and/or fixes for the above Cons.

Thanks,

Alec Taylor

FYI: I can't test Kate, as all the mirrors I've tried have no files on them.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
The current finalists:

Editra with PyShell in Shelf

Pros: Syntax highlighting, tabs, ¿portable? and embedded python
interpreter (PyShell 0.8)
Cons: No run button or keyboard shortcut for quick running of script
(made issue: http://code.google.com/p/editra/issues/detail?id=641) and
doesn't save settings changes for editor

PyScripter

Pros: Syntax highlighting, tabs, ¿portable?, embedded python
interpreter, keyboard shortcut (Ctrl+F9 [though would prefer single
key...]) and run button
Cons: Unmaintained, so doesn't support x64 and has a few bugs

UliPad

Pros: Syntax highlighting, tabs, ¿portable?, embedded python
interpreter, keyboard shortcut (F5) and run button
Cons: Command-prompt window appears whenever script is run (could be
admin issues at Uni) and is unmaintained, so can expect bugs and
non-modern interfaces for length of use

Please continue suggesting Python IDEs and/or fixes for the above Cons.

Thanks,

Alec Taylor

FYI: I can't test Kate, as all the mirrors I've tried have no files on them.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-18 Thread Alec Taylor
SPE looks good, however I couldn't get it running (svn'd it). Do you
know if there's an installer?

Editra has a really active support team, and have addressed all 3 of
the bugs I found. (although mostly the bugs were me not knowing how it
works!)

Code completion would be nice, especially for a beginner like
myself... so I'll continue looking at the competition.

Please continue with your recommendations.

Thanks,

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


Re: Teaching Python

2011-04-19 Thread Alec Taylor
Author
 Series
 Lectures Slides/Documentation
 Assignments
 Difficulty
  MIT
 A Gentle Introduction to Programming Using Python
 on iTunes U
http://itunes.apple.com/us/itunes-u/introduction-to-computer-science/id341597455
 http://stuff.mit.edu/iap/python/

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2010/index.htm
 Beginner Programmer
  Python
 Tutorial
 N/A
 http://docs.python.org/tutorial/
 N/A
 Average or beginner programmer
  Python
 N/A
 N/A
 http://wiki.python.org/moin/BeginnersGuide/NonProgrammers
 N/A
 Beginner or non-programmer
  Google
 Google's Python Class
 on YouTube (see Sidebar for links)
 http://code.google.com/edu/languages/google-python-class/index.html
 See "Python Exercises" in sidebar
 Good programmer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Teaching Python

2011-04-19 Thread Alec Taylor
Here are a few tutorials which may be helpful for notes &etc:

Author,Series,Lectures,Slides/Documentation,Assignments,Difficulty
MIT,A Gentle Introduction to Programming Using Python,on iTunes
Uÿhttp://itunes.apple.com/us/itunes-u/introduction-to-computer-science/id341597455,http://stuff.mit.edu/iap/python/,http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2010/index.htm,Beginner
Programmer
Python,Tutorial,N/A,http://docs.python.org/tutorial/,N/A,Average or
beginner programmer
Python,N/A,N/A,http://wiki.python.org/moin/BeginnersGuide/NonProgrammers,N/A,Beginner
or non-programmer
Google,Google's Python Class,on YouTube (see Sidebar for
links),http://code.google.com/edu/languages/google-python-class/index.html,"See
""Python Exercises"" in sidebar",Good programmer

(Unfortunately can't paste table... but here is what the table looks
like: http://i51.tinypic.com/zof9yt.png, email me directly for table)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Terrible FPU performance

2011-04-26 Thread Alec Taylor
What's an FPU?

On Tue, Apr 26, 2011 at 11:40 PM, Mihai Badoiu  wrote:
> Hi,
> I have terrible performance for multiplication when one number gets very
> close to zero.  I'm using cython by writing the following code:
>     cdef int i
>     cdef double x = 1.0
>     for 0 <= i < 1000:
>         x *= 0.8
>         #x += 0.01
>     print x
> This code runs much much slower (20+ times slower) with the line x += 0.01
> uncommented.  I looked at the deassembled code and it looks correct.
>  Moreover, it's just a few lines and by writing a C code (without python on
> top), I get the same code, but it's much faster.  I've also tried using sse,
> but I get exactly the same behavior.  The best candidate that I see so far
> is that Python sets up the FPU in a different state than C.
> Any advice on how to solve this performance problem?
> thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-04-26 Thread Alec Taylor
Excellent news everyone!

They've released an update for Editra with the bugfix for the issues I
submitted.

So now PyScripter and Editra do exactly what I need, but since Editra
is updated it isn't buggy.

=]

Editra has tabs (in the right place!), syntax-highlight, shortcuts to
run code, embedded interpreter, syntax-highlighting and
code-completion.

Thanks for all the suggestions, glad I found the right one!

Cheers,

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


Re: Deditor

2011-04-27 Thread Alec Taylor
Thanks, any plans for a Windows version?

On Thu, Apr 28, 2011 at 1:53 AM, Kruptein  wrote:
> Hey,
>
> I released a new version (0.2.5) of my pythonic text-editor called
> Deditor.
>
> It is a text-editor aimed to fasten your python development. (it
> perfectly handels other languages too)
> Some features are:
> - python shell to do quick commands or checks
> - pyflakes error check on save
> - pylint error check on demand (menu entry)
> - Inspecting of current file
> - ...
>
> Syntax highlighting is supported for 78 languages.
>
> An extensive plugin system, written in python, makes it very easy to
> add new elements to the program.
> Networking (ssh & sftp) are standard included and project management
> too (you can disable them)
>
> Please try it out and leave your comment!
>
> download link: http://launchpad.net/deditor
>
> ( only a .deb is available for download now, if you would like another
> format (.tar.gz) please comment )
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deditor

2011-04-27 Thread Alec Taylor
By all means I use Linux... when it's available, but I'm often on
non-Linux machines (at Uni), so it'd be great if something like
Deditor was available.

On Thu, Apr 28, 2011 at 7:07 AM, Yico Gaga  wrote:
> yeah ,I know ,Ubuntu is based on Debian , i said why not linux ,
> because someone ask for windows version of this Deditor ,
> so, I type :why not linux.. i mean he may like to try a linux-desktop OS;
> THX~
>

That'd be great, saw a bit of the YouTube video, can I confirm that
there's a keyboard shortcut to run the code in the embedded
interpreter, and that there's code-completion?

> Well actually I have a working version of deditor for windows! it is
> 0.2.4 though I will do my best to release a windows version asap :)
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Thanks for the speedy reply,

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


Re: Python IDE/text-editor

2011-04-28 Thread Alec Taylor
Your probably right.

I suppose I'll just wait till I finish my fooIDE project

> On Fri, Apr 29, 2011 at 2:21 AM, Albert van der Horst
>  wrote:
>> In article ,
>> Alec Taylor   wrote:
>>>Geany I've tried in the past, it's really buggy on my home computer
>>>and at Uni... however from my phone it works wonderfully! (Use it for
>>>C++ projects on Rhobuntu)
>>>
>>>Eric 4 was suggested to me on the #python channel on Freenode...
>>>however I've never been able to get it compiled/working. Too many
>>>dependencies I'm guessing...
>>>
>>>PTK looks great, and does everything I want (from screenshots).
>>>Unfortunately, it doesn't run on my system; Win7 x64, Python 2.7.1
>>>x64, WxPython 2.8 x64. Install ran as admin.
>>>
>>>Emacs and vim still seem like good alternatives, when I get the time.
>>>However, currently have 3 assignments to start and finish so would
>>>like a simple Notepad2 with python interpreter attached (and keyboard
>>>shortcut to run script) type program.
>>>
>>>Please continue recommending
>>>
>>>Thanks,
>>>
>>>Alec Taylor
>>
>> You will never be satisfied, until you've written something yourself.
>> Start writing now. A friend of mine started writing in 1983,
>> and since 1985 I'm a happy user. The only language that is a candidate
>> to write in is C, however.
>>
>> Groetjes Albert
>>
>> --
>> --
>> Albert van der Horst, UTRECHT,THE NETHERLANDS
>> Economic growth -- being exponential -- ultimately falters.
>> albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDLE lost from Windows menu !

2011-04-28 Thread Alec Taylor
Search for the following key in regedit: HKEY_CLASSES_ROOT\*\shell

Right click on “shell”, choose create new key.

Name it “Edit with IDLE"

Create a new key below that one and call it “command.”

Now double click on the (Default) value that you will find in the
right hand pane, and type in the following: python.exe %1

(or if you don't have it in your PATH, then put in the absolute python
directory, ie: C:\Python27\bin\python.exe)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deditor

2011-04-29 Thread Alec Taylor
I'll create an installer or two (an NSIS or InnoSetup .exe and an MSI)
if you like, once you've released the windows version.

On Fri, Apr 29, 2011 at 6:16 AM, Kruptein  wrote:
> On 28 apr, 07:46, jmfauth  wrote:
>> On 27 avr, 19:22, Alec Taylor  wrote:
>>
>> > Thanks, any plans for a Windows version?
>>
>> - Download the deb
>> - Unpack it with a utility like 7zip
>> - Throw away the unnecessary stuff, (keep the "deditor part")
>> - Depending on your libs, adatpt the "import"
>> - Launch deditor.py
>> - Then ...
>>
>> [5 minutes]
>>
>> In fact, this kind of app can be simply packed in a zip file.
>>
>> jmf
>
> It isn't that easy as you might have hoped ;)  I'm using wxpython for
> rendering the GUI  somehow some things that work in the linux version
> break in the windows version  so I need to do some small
> modifications  and as I'm a hardcore linux fan I ony use windows for
> gaming it usually takes a little longer for a windows release,  I'm
> releasing a tarball now btw :D
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deditor

2011-05-01 Thread Alec Taylor
Maybe I'm missing something, but I downloaded the zip file and ran
each .py and .pyc file in turn, but none brought up the nice deditor
GUI I've seen screenshots of...

On the other subject, did you have a preference to what installer I
should code for it? - InnoSetup (exe), NSIS (exe) or MSI (.msi)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What other languages use the same data model as Python?

2011-05-01 Thread Alec Taylor
I think ruby does

On Sun, May 1, 2011 at 6:45 PM, Steven D'Aprano
 wrote:
> Python uses a data model of "name binding" and "call by object" (also
> known as "call by sharing"). I trust I don't need to define my terms, but
> just in case:
>
> http://effbot.org/zone/call-by-object.htm
> http://effbot.org/zone/python-objects.htm
>
>
> Now, this is different from languages like C and Pascal, which is based
> on variables, or Forth, which explicitly manipulates a stack. Quite
> often, when people want to impress upon others that Python is not C, they
> will say:
>
> "Python's data model is different from other languages"
>
> which is perfectly correct, if you think of C as "other languages". But
> it's equally correct to say that Python's data model is the same as other
> languages. As I understand it, Python and Ruby have the same data model.
> So does Java, so long as you only consider objects and ignore unboxed
> native values. I believe (but could be wrong) that another language of
> about the same vintage as Python, Emerald, also uses the same model.
> That's not surprising, because I believe that Emerald (just like Python)
> was strongly influenced by CLU.
>
> What other languages use the same, or mostly similar, data model as
> Python?
>
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python IDE/text-editor

2011-05-01 Thread Alec Taylor
!!!

=]

http://code.google.com/p/fooide

Contact me if you'd like to join the project :D

On Mon, May 2, 2011 at 1:39 AM, Yico Gaga  wrote:
>   foolDE :)!!!
>
> 2011/4/29 Alec Taylor 
>>
>> Your probably right.
>>
>> I suppose I'll just wait till I finish my fooIDE project
>>
>> > On Fri, Apr 29, 2011 at 2:21 AM, Albert van der Horst
>> >  wrote:
>> >> In article ,
>> >> Alec Taylor   wrote:
>> >>>Geany I've tried in the past, it's really buggy on my home computer
>> >>>and at Uni... however from my phone it works wonderfully! (Use it for
>> >>>C++ projects on Rhobuntu)
>> >>>
>> >>>Eric 4 was suggested to me on the #python channel on Freenode...
>> >>>however I've never been able to get it compiled/working. Too many
>> >>>dependencies I'm guessing...
>> >>>
>> >>>PTK looks great, and does everything I want (from screenshots).
>> >>>Unfortunately, it doesn't run on my system; Win7 x64, Python 2.7.1
>> >>>x64, WxPython 2.8 x64. Install ran as admin.
>> >>>
>> >>>Emacs and vim still seem like good alternatives, when I get the time.
>> >>>However, currently have 3 assignments to start and finish so would
>> >>>like a simple Notepad2 with python interpreter attached (and keyboard
>> >>>shortcut to run script) type program.
>> >>>
>> >>>Please continue recommending
>> >>>
>> >>>Thanks,
>> >>>
>> >>>Alec Taylor
>> >>
>> >> You will never be satisfied, until you've written something yourself.
>> >> Start writing now. A friend of mine started writing in 1983,
>> >> and since 1985 I'm a happy user. The only language that is a candidate
>> >> to write in is C, however.
>> >>
>> >> Groetjes Albert
>> >>
>> >> --
>> >> --
>> >> Albert van der Horst, UTRECHT,THE NETHERLANDS
>> >> Economic growth -- being exponential -- ultimately falters.
>> >> albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
>> >>
>> >> --
>> >> http://mail.python.org/mailman/listinfo/python-list
>> >>
>> >
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Deditor

2011-05-01 Thread Alec Taylor
Traceback (most recent call last):
 File "O:\deditor\deditor\deditor.py", line 7, in 
   import wx, os, datetime, sys, ConfigParser, wx.aui, wx.lib.scrolledpanel
 File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 4
5, in 
   from wx._core import *
 File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, i
n 
   import _core_
ImportError: DLL load failed: %1 is not a valid Win32 application.

On Mon, May 2, 2011 at 12:33 AM, Kruptein  wrote:
> On 1 mei, 10:59, Alec Taylor  wrote:
>> Maybe I'm missing something, but I downloaded the zip file and ran
>> each .py and .pyc file in turn, but none brought up the nice deditor
>> GUI I've seen screenshots of...
>>
>> On the other subject, did you have a preference to what installer I
>> should code for it? - InnoSetup (exe), NSIS (exe) or MSI (.msi)
>
> not a msi, for the rest it doesn't matter :),  on my windows if you
> run deditor.py   it should launch however you need to have the
> wxpython-2.8 package installed,   what happens if you run deditor.py
> from console?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   3   >