Re: A photo/image/video sharing app in Python

2015-09-21 Thread Chris Angelico
On Tue, Sep 22, 2015 at 3:53 PM, Cai Gengyang  wrote:
> A piece of software that would let end users easily create gorgeous 
> real-life, real-time cartoons on the web might not exist yet. But if it were 
> possible to invent this and get it commercialised , it could indeed become a 
> great product that users love and pay good money to use ... You might even 
> become a billionaire just through inventing and commercialising such a tool / 
> system  ...
>

Yes, you might become a billionaire. Does that suggest something to
you? If a project could make _that much money_, wouldn't someone have
done it already? The scope of this project is enormous, and if you're
to tackle it, you'll need to have a lot more than a basic notion of
"hey wouldn't this be nice".

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


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Cai Gengyang
On Tuesday, September 22, 2015 at 4:34:45 AM UTC+8, Christian Gollwitzer wrote:
> Am 21.09.15 um 17:16 schrieb Cai Gengyang:
> > 2) A system where where the users can then edit these
> > photos/images/videos into short , funny cartoons/videos
> >
> > This one's a bit open-ended, but more importantly, it needs a lot of
> > front-end work. Editing images in Python code won't be particularly
> > hard; but letting your users choose how those images are put
> > together? That's going to require a boatload of JavaScript work. How
> > good are you at front-end design and coding?
> >
> >  No experience at all. Guess I'll have to learn Javascript to do
> > this. I'll also need the capability to let users edit their
> > photos/images and videos into great looking real-time cartoons based
> > on themes
>  >
> > (what technologies would I need to learn to create this?)
> >
> 
> Magic.
> 
> Seriously, have you already seen a software which does approximately the
> image editing that you have in mind? If not, chances are that it is not
> possible or possible only by a group of experts. Drawing a cartoon is
> not a thing that a computer can do easily, much less if the only input
> is a photograph. Currently, cartoons are made by humans using computers, 
> not by an algorithm.
> 
> If you can make it work, you'll be a star on SIGGRAPH (a conference
> about image processing).
> 
>   Christian

Christian,

A piece of software that would let end users easily create gorgeous real-life, 
real-time cartoons on the web might not exist yet. But if it were possible to 
invent this and get it commercialised , it could indeed become a great product 
that users love and pay good money to use ... You might even become a 
billionaire just through inventing and commercialising such a tool / system  ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-21 Thread Ryan Stuart
On Thu, Sep 17, 2015 at 2:24 PM, sol433tt  wrote:

> I would like to have the Sqlite pragma statement "locking_mode" set to
> "EXCLUSIVE" by default (RO database). Does this need to be compiled in? How
> might this be achieved?
>

You can issue any PRAGA statement you like using the execute method on a
connection as per the documentation (
https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.execute).
For information on the specific PRAGMA option you need, see
https://www.sqlite.org/pragma.html#pragma_locking_mode. I can't see any
mention of it being a compile time PRAGMA.

Cheers


>
> There is some performance to be gained. I have a number of python scripts,
> and don't want to alter the pragma statement for every script. This
> computer never writes to the databases.
>
> thank you
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Ryan Stuart, B.Eng
Software Engineer

W: http://www.kapiche.com/
M: +61-431-299-036
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread cjgohlke
On Monday, September 21, 2015 at 9:54:51 AM UTC-7, Robin Becker wrote:
> .
> >
> > This also sounds like the C++ stuff just wasn't installed.  I'm afraid
> > reinstallation is probably your best bet.
> >
> I used the default installation, but it failed first time around (perhaps a 
> network thing) and I stupidly assumed 'repair' would work.
> 
> After a full reinstallation at least vcvarsall is present and  I can at least 
> get the amd64/x86 compilers to work with bdist_wheel (I didn't get any errors 
> from using my already compiled relocatable libs) and I can no build the open 
> source reportlab extensions.
> 
> One simple extension
> 
> https://bitbucket.org/rptlab/pyrxp
> 
> doesn't get built. For some reason I get a hang in the linker for both amd64 
> & 
> x86. This builds fine for 27, 33 & 34.
> 
> 
> However, I see this in the output
> 
>   | creating C:\ux\XB33\repos\pyRXP\build\lib.win-amd64-3.5
>   | C:\Program Files (x86)\Microsoft Visual Studio 
> 14.0\VC\BIN\amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL
> /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\ux\XB33\py35_amd64\libs 
> /LIBPATH:C:\python35\libs /LIBPATH:C:\python35
> /LIBPATH:C:\ux\XB33\py35_amd64\PCbuild\amd64 "/LIBPATH:C:\Program Files 
> (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64"
>   "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 
> 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Win
> dows Kits\10\lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files 
> (x86)\Windows 
> Kits\NETFXSDK\4.6\lib\um\x64" "/LIBPATH
> :C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" wsock32.lib 
> /EXPORT:PyInit_pyRXPU build\temp.win-amd64-3.5\
> Release\ux\XB33\repos\pyRXP\src\pyRXP.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\xmlparser.obj bui
> ld\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\url.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
> rc\rxp\charset.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\string16.obj 
> build\temp.win-amd64-3.5\Re
> lease\ux\XB33\repos\pyRXP\src\rxp\ctype16.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\dtd.obj build
> \temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\input.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
> rc\rxp\stdio16.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\system.obj 
> build\temp.win-amd64-3.5\Rele
> ase\ux\XB33\repos\pyRXP\src\rxp\hash.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\version.obj 
> build\
> temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\namespaces.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyR
> XP\src\rxp\http.obj 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\nf16check.obj 
> build\temp.win-amd64-3.5\
> Release\ux\XB33\repos\pyRXP\src\rxp\nf16data.obj 
> /OUT:build\lib.win-amd64-3.5\pyRXPU.cp35-win_amd64.pyd /IMPLIB:build\te
> mp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib
> 
>   | pyRXP.obj : warning LNK4197: export 'PyInit_pyRXPU' specified 
> multiple times; using first specification
>   |Creating library 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib
>  
> and ob
> ject 
> build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.exp
> 
> 
>   | Generating code
> Stderr:  | error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 
> 14.0\\VC\\BIN\\amd64\\link.exe' failed with
> exit status 1
> 
> so there are some warnings which I don't understand. Maybe I need to do 
> something special for pyRXP (possibly I have some ifdefs poorly configured).
> -- 
> Robin Becker

How long did you let it "hang"? For me the incremental linker took in the order 
of 30 minutes to link. I mentioned this on the Python issue tracker at 
. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-21 Thread Sol T
Is anyone aware of documentation that describes how to compile various
sqlite options?



On Thu, Sep 17, 2015 at 2:24 PM, sol433tt  wrote:

> hello
>
> I would like to have the Sqlite pragma statement "locking_mode" set to
> "EXCLUSIVE" by default (RO database). Does this need to be compiled in? How
> might this be achieved?
>
> There is some performance to be gained. I have a number of python scripts,
> and don't want to alter the pragma statement for every script. This
> computer never writes to the databases.
>
> thank you
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Chris Angelico
On Tue, Sep 22, 2015 at 7:36 AM,   wrote:
> Thank you very much. Can I write .py pages like in PHP or should I
> use a framework like Django, Web2py or TurboGears?

I recommend using WSGI and a framework that uses it (my personal
preference is Flask, but the above will also work). Here are a couple
of simple sites:

https://github.com/Rosuav/Flask1
https://github.com/Rosuav/MinstrelHall

You can see them in operation here:

http://rosuav.com/1/
http://minstrelhall.com/

Note how URLs are defined in the code, rather than by having a bunch
of loose files (the way a PHP web site works). This makes it a lot
easier to group things logically, and utility lines like redirects
become very cheap. The maintenance burden is far lighter with this
kind of one-file arrangement.

These sites are really tiny, though, so if you have something a bit
bigger, you'll probably want to split things into multiple files. Good
news! You can do that, too - it's easy enough to split on any boundary
you find logical.

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Cameron Simpson

On 21Sep2015 18:07, Chris Angelico  wrote:

On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:

Chris Angelico :


On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:

For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
so on. Compact yet unbounded.


[...]

It's generally a lot faster to do a read(2) than a loop with any
number of read(1), and you get some kind of bound on your allocations.
Whether that's important to you or not is another question, but
certainly your chosen encoding is a good way of allowing arbitrary
integer values.


You can read a full buffer even if you have a variable-length length
encoding.


Not sure what you mean there. Unless you can absolutely guarantee that
you didn't read too much, or can absolutely guarantee that your
buffering function will be the ONLY way anything reads from the
socket, buffering is a problem.


I'm using buffered io streams, so that layer will be reading in chunks. Pulling 
things from that buffer with fp.read(1) is cheap enough for my use.


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


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 10:29:48 PM UTC+2, alister wrote:
> On Mon, 21 Sep 2015 12:51:09 -0700, tropical.dude.net wrote:
> 
> > On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com
> > wrote:
> >> On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote:
> >> > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com>
> >> > tropical.dude@gmail.com writes:
> >> > 
> >> > > print("Content-Type: text/html;charset=utf-8")
> >> > > print("Hello World!")
> >> > 
> >> > As I recall, you must have a blank line between the headers and the
> >> > content.
> >> > 
> >> > But that may or may not be your problem, as you haven't told us
> >> > exactly what is going wrong.
> >> > 
> >> > --
> >> > 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"
> >> 
> >> I am new to Ubuntu, is there a command so I can find out what the
> >> problem is?
> > 
> > The only error I can see right now is forbedden, you don't have
> > permission to access /index.py on this server.
> 
> this is not a linux permissions error it is an error with the apache 
> configuration you need to check roe acache config files
> (you may also want to investigate WSGI as CGI is outdated) 
> 
> 
> 
> -- 
> Perfection is acheived only on the point of collapse.
> - C. N. Parkinson

Thank you very much. Can I write .py pages like in PHP or should I
use a framework like Django, Web2py or TurboGears? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Grant Edwards
On 2015-09-21, Cai Gengyang  wrote:

> I'll also need the capability to let users edit their photos/images
> and videos into great looking real-time cartoons based on themes
> (what technologies would I need to learn to create this?)

Well, the usual technology for turning some images into greal looking
real-time cartoons is to hire an animation studio and pay them
tens/hundreds of thousands of dollars.  Based on the names I seen in
credits, I'd say there seem to be a lot of them in Korea.

Alternatively, you could hire a team of artists, writers, animators
and build a rendering farm.

> [...]

> Guess the first step I would need to do is to create a basic website
> in Python using Flask, Django then 

1) Create a basic website in Python using Flask, Django

2) ?

3) Profit!

-- 
Grant Edwards   grant.b.edwardsYow! Spreading peanut
  at   butter reminds me of
  gmail.comopera!!  I wonder why?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Christian Gollwitzer

Am 21.09.15 um 17:16 schrieb Cai Gengyang:

2) A system where where the users can then edit these
photos/images/videos into short , funny cartoons/videos

This one's a bit open-ended, but more importantly, it needs a lot of
front-end work. Editing images in Python code won't be particularly
hard; but letting your users choose how those images are put
together? That's going to require a boatload of JavaScript work. How
good are you at front-end design and coding?

 No experience at all. Guess I'll have to learn Javascript to do
this. I'll also need the capability to let users edit their
photos/images and videos into great looking real-time cartoons based
on themes

>

(what technologies would I need to learn to create this?)



Magic.

Seriously, have you already seen a software which does approximately the
image editing that you have in mind? If not, chances are that it is not
possible or possible only by a group of experts. Drawing a cartoon is
not a thing that a computer can do easily, much less if the only input
is a photograph. Currently, cartoons are made by humans using computers, 
not by an algorithm.


If you can make it work, you'll be a star on SIGGRAPH (a conference
about image processing).

Christian

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


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread alister
On Mon, 21 Sep 2015 12:51:09 -0700, tropical.dude.net wrote:

> On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com
> wrote:
>> On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote:
>> > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com>
>> > tropical.dude@gmail.com writes:
>> > 
>> > > print("Content-Type: text/html;charset=utf-8")
>> > > print("Hello World!")
>> > 
>> > As I recall, you must have a blank line between the headers and the
>> > content.
>> > 
>> > But that may or may not be your problem, as you haven't told us
>> > exactly what is going wrong.
>> > 
>> > --
>> > 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"
>> 
>> I am new to Ubuntu, is there a command so I can find out what the
>> problem is?
> 
> The only error I can see right now is forbedden, you don't have
> permission to access /index.py on this server.

this is not a linux permissions error it is an error with the apache 
configuration you need to check roe acache config files
(you may also want to investigate WSGI as CGI is outdated) 



-- 
Perfection is acheived only on the point of collapse.
- C. N. Parkinson
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:47:33 PM UTC+2, tropical...@gmail.com wrote:
> On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote:
> > In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> 
> > tropical.dude@gmail.com writes:
> > 
> > > print("Content-Type: text/html;charset=utf-8")
> > > print("Hello World!")
> > 
> > As I recall, you must have a blank line between the headers and the
> > content.
> > 
> > But that may or may not be your problem, as you haven't told us exactly
> > what is going wrong.
> > 
> > -- 
> > 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"
> 
> I am new to Ubuntu, is there a command so I can find out what the problem is?

The only error I can see right now is forbedden, you don't have permission to 
access /index.py on this server.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:41:29 PM UTC+2, John Gordon wrote:
> In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> 
> tropical.dude@gmail.com writes:
> 
> > print("Content-Type: text/html;charset=utf-8")
> > print("Hello World!")
> 
> As I recall, you must have a blank line between the headers and the
> content.
> 
> But that may or may not be your problem, as you haven't told us exactly
> what is going wrong.
> 
> -- 
> 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"

I am new to Ubuntu, is there a command so I can find out what the problem is?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:30:11 PM UTC+2, Albert Visser wrote:
> On Mon, 21 Sep 2015 20:41:13 +0200,  wrote:
> 
> > Hello everybody,
> >
> (...)
> >
> > I created index.py:
> > #!/usr/bin/env python
> > # -*- coding: UTF-8 -*-# enable debugging
> > import cgitb
> >
> > cgitb.enable()
> > print("Content-Type: text/html;charset=utf-8")
> > print("Hello World!")
> >
> > But it is still not working.
> >
> > Can anybody help me out?
> >
> > Thanks in advance.
> 
> Which Python are you running? If it's Python 3, change the shebang  
> accordingly because "python" is assuming Python 2.
> 
> -- 
> Vriendelijke groeten / Kind regards,
> 
> Albert Visser
> 
> Using Opera's mail client: http://www.opera.com/mail/

I am running python3.4
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread John Gordon
In <44e870a7-9567-40ba-8a65-d6b52a8c5...@googlegroups.com> 
tropical.dude@gmail.com writes:

> print("Content-Type: text/html;charset=utf-8")
> print("Hello World!")

As I recall, you must have a blank line between the headers and the
content.

But that may or may not be your problem, as you haven't told us exactly
what is going wrong.

-- 
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"

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


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
On Monday, September 21, 2015 at 9:20:22 PM UTC+2, sohca...@gmail.com wrote:
> On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com 
> wrote:
> > Hello everybody,
> > 
> > I installed the LAMP stack on in Ubuntu, but I am having
> > problems configuring Apache to run python CGI scripts.
> > 
> > I ran:
> > sudo a2enmod cgi
> > 
> > I added to apache2.conf
> > 
> > Options +ExecCGI
> > AddHandler cgi-script .py
> > 
> > 
> > I created index.py:
> > #!/usr/bin/env python
> > # -*- coding: UTF-8 -*-# enable debugging
> > import cgitb
> > 
> > cgitb.enable()
> > print("Content-Type: text/html;charset=utf-8")
> > print("Hello World!")
> > 
> > But it is still not working.
> > 
> > Can anybody help me out?
> > 
> > Thanks in advance.
> 
> "It isn't working" is about as useful as telling a mechanic "My car doesn't 
> work" without giving details on what exactly is happening.
> 
> What exactly isn't working?  What error message are you getting?
> 
> The first thing I would check is to make sure the permissions on index.py are 
> set to allow execution.  It is easy to forget to do that.

The error message that I am receiving in my browser is:
403: You don't have permission to access /index.py on this server.

The permissions of index.py is 755
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread Albert Visser

On Mon, 21 Sep 2015 20:41:13 +0200,  wrote:


Hello everybody,


(...)


I created index.py:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-# enable debugging
import cgitb

cgitb.enable()
print("Content-Type: text/html;charset=utf-8")
print("Hello World!")

But it is still not working.

Can anybody help me out?

Thanks in advance.


Which Python are you running? If it's Python 3, change the shebang  
accordingly because "python" is assuming Python 2.


--
Vriendelijke groeten / Kind regards,

Albert Visser

Using Opera's mail client: http://www.opera.com/mail/
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread sohcahtoa82
On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com wrote:
> Hello everybody,
> 
> I installed the LAMP stack on in Ubuntu, but I am having
> problems configuring Apache to run python CGI scripts.
> 
> I ran:
> sudo a2enmod cgi
> 
> I added to apache2.conf
> 
> Options +ExecCGI
> AddHandler cgi-script .py
> 
> 
> I created index.py:
> #!/usr/bin/env python
> # -*- coding: UTF-8 -*-# enable debugging
> import cgitb
> 
> cgitb.enable()
> print("Content-Type: text/html;charset=utf-8")
> print("Hello World!")
> 
> But it is still not working.
> 
> Can anybody help me out?
> 
> Thanks in advance.

"It isn't working" is about as useful as telling a mechanic "My car doesn't 
work" without giving details on what exactly is happening.

What exactly isn't working?  What error message are you getting?

The first thing I would check is to make sure the permissions on index.py are 
set to allow execution.  It is easy to forget to do that.
-- 
https://mail.python.org/mailman/listinfo/python-list


Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread tropical . dude . net
Hello everybody,

I installed the LAMP stack on in Ubuntu, but I am having
problems configuring Apache to run python CGI scripts.

I ran:
sudo a2enmod cgi

I added to apache2.conf

Options +ExecCGI
AddHandler cgi-script .py


I created index.py:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-# enable debugging
import cgitb

cgitb.enable()
print("Content-Type: text/html;charset=utf-8")
print("Hello World!")

But it is still not working.

Can anybody help me out?

Thanks in advance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Robin Becker

.


This also sounds like the C++ stuff just wasn't installed.  I'm afraid
reinstallation is probably your best bet.

I used the default installation, but it failed first time around (perhaps a 
network thing) and I stupidly assumed 'repair' would work.


After a full reinstallation at least vcvarsall is present and  I can at least 
get the amd64/x86 compilers to work with bdist_wheel (I didn't get any errors 
from using my already compiled relocatable libs) and I can no build the open 
source reportlab extensions.


One simple extension

https://bitbucket.org/rptlab/pyrxp

doesn't get built. For some reason I get a hang in the linker for both amd64 & 
x86. This builds fine for 27, 33 & 34.



However, I see this in the output

 | creating C:\ux\XB33\repos\pyRXP\build\lib.win-amd64-3.5
 | C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\BIN\amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL
/MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\ux\XB33\py35_amd64\libs 
/LIBPATH:C:\python35\libs /LIBPATH:C:\python35
/LIBPATH:C:\ux\XB33\py35_amd64\PCbuild\amd64 "/LIBPATH:C:\Program Files 
(x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64"
 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Win
dows Kits\10\lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows 
Kits\NETFXSDK\4.6\lib\um\x64" "/LIBPATH
:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" wsock32.lib 
/EXPORT:PyInit_pyRXPU build\temp.win-amd64-3.5\
Release\ux\XB33\repos\pyRXP\src\pyRXP.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\xmlparser.obj bui
ld\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\url.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
rc\rxp\charset.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\string16.obj 
build\temp.win-amd64-3.5\Re
lease\ux\XB33\repos\pyRXP\src\rxp\ctype16.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\dtd.obj build
\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\input.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\s
rc\rxp\stdio16.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\system.obj 
build\temp.win-amd64-3.5\Rele
ase\ux\XB33\repos\pyRXP\src\rxp\hash.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\version.obj build\
temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\namespaces.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyR
XP\src\rxp\http.obj 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\rxp\nf16check.obj 
build\temp.win-amd64-3.5\
Release\ux\XB33\repos\pyRXP\src\rxp\nf16data.obj 
/OUT:build\lib.win-amd64-3.5\pyRXPU.cp35-win_amd64.pyd /IMPLIB:build\te

mp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib

 | pyRXP.obj : warning LNK4197: export 'PyInit_pyRXPU' specified 
multiple times; using first specification
 |Creating library 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.lib 
and ob
ject 
build\temp.win-amd64-3.5\Release\ux\XB33\repos\pyRXP\src\pyRXPU.cp35-win_amd64.exp



 | Generating code
Stderr:  | error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 
14.0\\VC\\BIN\\amd64\\link.exe' failed with

exit status 1

so there are some warnings which I don't understand. Maybe I need to do 
something special for pyRXP (possibly I have some ifdefs poorly configured).

--
Robin Becker

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


Re: Getting PyCharm to import sklearn

2015-09-21 Thread edanmizrahi
On Monday, September 21, 2015 at 9:12:43 AM UTC-7, edanm...@gmail.com wrote:
> On Monday, September 21, 2015 at 9:00:16 AM UTC-7, Joel Goldstick wrote:
> > On Mon, Sep 21, 2015 at 11:27 AM,   wrote:
> > Beginner here.
> > 
> > 
> > 
> > I'm trying to use sklearn in pycharm. When importing sklearn I get an error 
> > that reads "Import error: No module named sklearn" The project interpreter 
> > in pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the 
> > right one. Under default preferenes, project interpreter, I see all of 
> > anacondas packages. I've double clicked and installed the packages scikit 
> > learn and sklearn. I still receive the "Import error: No module named 
> > sklearn"
> > 
> > 
> > 
> > Does anyone know how to solve this problem?
> > 
> > --
> > 
> > https://mail.python.org/mailman/listinfo/python-list
> > 
> > 
> > It looks like they changed the name.  Maybe this link will help you:
> > 
> > 
> > http://scikit-learn.org/stable/install.html
> > 
> > 
> > -- 
> > 
> > 
> > 
> > Joel Goldstick
> > http://joelgoldstick.com
> 
> Thanks Joel.
> 1. In the terminal I get: Requirement already up-to-date: scikit-learn in 
> /anaconda/lib/python2.7/site-packages"
> 
> 2. In pycharm, a simple:
> import sklearn
> print sklearn.__file__
> 
> I get.. 
> 
> 3. /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 
> /Users/EdanMizrahi/PycharmProjects/untitled3/tryagain
> Traceback (most recent call last):
>   File "/Users/EdanMizrahi/PycharmProjects/untitled3/tryagain", line 1, in 
> 
> import sklearn
> ImportError: No module named sklearn
> 
> Process finished with exit code 1


Nevermind. Got it to work. Thanks again Joel!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Getting PyCharm to import sklearn

2015-09-21 Thread edanmizrahi
On Monday, September 21, 2015 at 9:00:16 AM UTC-7, Joel Goldstick wrote:
> On Mon, Sep 21, 2015 at 11:27 AM,   wrote:
> Beginner here.
> 
> 
> 
> I'm trying to use sklearn in pycharm. When importing sklearn I get an error 
> that reads "Import error: No module named sklearn" The project interpreter in 
> pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the 
> right one. Under default preferenes, project interpreter, I see all of 
> anacondas packages. I've double clicked and installed the packages scikit 
> learn and sklearn. I still receive the "Import error: No module named sklearn"
> 
> 
> 
> Does anyone know how to solve this problem?
> 
> --
> 
> https://mail.python.org/mailman/listinfo/python-list
> 
> 
> It looks like they changed the name.  Maybe this link will help you:
> 
> 
> http://scikit-learn.org/stable/install.html
> 
> 
> -- 
> 
> 
> 
> Joel Goldstick
> http://joelgoldstick.com

Thanks Joel.
1. In the terminal I get: Requirement already up-to-date: scikit-learn in 
/anaconda/lib/python2.7/site-packages"

2. In pycharm, a simple:
import sklearn
print sklearn.__file__

I get.. 

3. /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 
/Users/EdanMizrahi/PycharmProjects/untitled3/tryagain
Traceback (most recent call last):
  File "/Users/EdanMizrahi/PycharmProjects/untitled3/tryagain", line 1, in 

import sklearn
ImportError: No module named sklearn

Process finished with exit code 1

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


Re: Getting PyCharm to import sklearn

2015-09-21 Thread Joel Goldstick
On Mon, Sep 21, 2015 at 11:27 AM,  wrote:

> Beginner here.
>
> I'm trying to use sklearn in pycharm. When importing sklearn I get an
> error that reads "Import error: No module named sklearn" The project
> interpreter in pycharm is set to 2.7.10 (/anaconda/bin/python.app), which
> should be the right one. Under default preferenes, project interpreter, I
> see all of anacondas packages. I've double clicked and installed the
> packages scikit learn and sklearn. I still receive the "Import error: No
> module named sklearn"
>
> Does anyone know how to solve this problem?
> --
> https://mail.python.org/mailman/listinfo/python-list
>

It looks like they changed the name.  Maybe this link will help you:

http://scikit-learn.org/stable/install.html

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Getting PyCharm to import sklearn

2015-09-21 Thread edanmizrahi
Beginner here.

I'm trying to use sklearn in pycharm. When importing sklearn I get an error 
that reads "Import error: No module named sklearn" The project interpreter in 
pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the right 
one. Under default preferenes, project interpreter, I see all of anacondas 
packages. I've double clicked and installed the packages scikit learn and 
sklearn. I still receive the "Import error: No module named sklearn"

Does anyone know how to solve this problem?
-- 
https://mail.python.org/mailman/listinfo/python-list


Looking for a Database Developer with 2-3 years Python experience

2015-09-21 Thread liannebloemen
Looking for Database Developer - London (up to £30k)

The Database Developer requires a wide set of database development and data 
integration skills, along with demonstrated excellence in problem solving and 
communication. Experience with Python is highly essential, as we will be 
developing a bespoke Django framework that allows the organisation direct 
access to marketing software and their client database. You will work from the 
London office within a company that has invested significant resources in 
building what is already an impressive data management team. 

The Database Developer works on data querying and manipulation tools, marketing 
software, and automatising key business procedures.

It is a must to have 2-3 year's experience in programming in Python!

You will be supporting and adding to the bespoke data administering systems and 
improving ways to integrate the data with he rest of the organisation. 

Key skills

* Python!
* Experience manipulating databases
* Basic HTML knowledge
* Experience with web design and web app development
* Django experience
* Familiar with test-driven development working practices

Apply now and send your CV to ja...@caseltonclark.co.uk

Caselton Clark are a recruitment agency specialising in Media and Events based 
in Central London. For our latest vacancies please visit www.caseltonclark.co.uk
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Cai Gengyang
Hi ChrisA,

1) A system where users can upload photos/images/videos of their loved ones and 
family onto the web-based app (It's going to be web-based website) 

Creating a web site using Python is pretty easy. Grab Flask, Django, etc, and 
off you go.Uploading files isn't difficult, although since you're working with 
large files here, you'll eventually need some beefy hardware to run this on 
(free accounts might not have enough storage and/or bandwidth to handle lots of 
users). 

 Sure , sounds good.

2) A system where where the users can then edit these photos/images/videos into 
short , funny cartoons/videos 

This one's a bit open-ended, but more importantly, it needs a lot of front-end 
work. Editing images in Python code won't be particularly hard; but letting 
your users choose how those images are put together? That's going to require a 
boatload of JavaScript work. How good are you at front-end design and coding? 

 No experience at all. Guess I'll have to learn Javascript to do this. I'll 
also need the capability to let users edit their photos/images and videos into 
great looking real-time cartoons based on themes (what technologies would I 
need to learn to create this?)

3) A system where users can create an account with username/password/log in 
information 

Subtly tricky to get right if you do it manually, but trivially easy to get 
someone else to do the work for you. Grab something like Flask-Login and the 
job's done. 

 Ok , sounds good

4) A system where users can then share and publish these pictures on the 
website itself using their account and also link and upload onto other 
traditional social networks like Facebook, Twitter and Google+ accounts and 
also onto their other handheld devices like IPhone , Apple Devices, Samsung 
handphones etc 

Fundamentally, all this requires is stable URLs that people can post. That's 
pretty easy (esp if you're using a good framework). Making sure they work 
properly on mobile phones is generally a matter of starting with something 
simple, and then testing every change on lots of devices. It's a bit of work, 
but nothing unattainable. 

- Ok, sounds good

Your hardest part is #2, and sadly, that's also the part that makes or breaks 
this service. Without that, all you're doing is recreating FTP. So that's what 
you have to think about: Can you write all that front-end code? This will not 
be simple; it'll be a pretty big project. 

- Yup, I'll have to find a way to make it work really well. The user must 
have the capability to create and design really good-looking real-time 
video-cartoons that they can then share with other users. It's going to be what 
differentiates my product from other services (as far as I can tell, no other 
site currently in existence has such a capability) 


Guess the first step I would need to do is to create a basic website in Python 
using Flask, Django then 

Cai Gengyang


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


Re: Hello

2015-09-21 Thread Zachary Ware
On Thu, Sep 17, 2015 at 10:10 AM, moon khondkar  wrote:
> Hello I have problem with python installation.I downloaded python 3.5 but I 
> cannot use it on my computer.I can not open the idle. I get something like 
> saying "users\local settings\Application 
> data\programs\python\python35-32\pythonw.exe is not valid win32 application. 
> Thanks that will be help if you can solve this.

This sounds suspiciously like you tried to install on Windows XP or
Windows Server 2003, both of which are not supported by Python 3.5.

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Zachary Ware
On Mon, Sep 21, 2015 at 7:55 AM, Robin Becker  wrote:
> I have installed VS2015; this is the full version and was a great deal of
> trouble to install. First time out it started whining and I had to 'repair'
> it.
>
> Anyhow after the 'repair' it said all was OK and no complaints.
>
> However, when I try to use it I don't see options for starting C++ projects,
> but instead only C#.

This ...

> I get an error like this trying to build for x86 or amd64
>
>  | building 'reportlab.lib._rl_accel' extension
> Stderr:  | error: Unable to find vcvarsall.bat
>
> There is a folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC",
> but it doesn't contain any batch scripts.

... and especially this make it sound like somehow the C++ options in
the installer were not checked (or not enough of them were).  I seem
to remember having to be sure to choose options carefully, as they
weren't selected by default.

> Any ideas how to get this to work? Should I try a full reinstall of VS2015?
> I can start the VS2015 Developer command prompt, but it doesn't then know
> about the "cl" command.

This also sounds like the C++ stuff just wasn't installed.  I'm afraid
reinstallation is probably your best bet.

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Phil Thompson
On 21 Sep 2015, at 3:00 pm, Robin Becker  wrote:
> 
> 
>> 
>> The most reported problem trying to build anything on Windows that is Python
>> related.
>> 
> .
>> 
>> I'd be inclined to go for the reinstall, painful as that might be.  I've 
>> tried
>> finding the batch file as a separate download but there's just too many hits
>> about "download Visual Studio".
>> 
> I think that's where I'm headed.
> 
> Sadly this has been the worst python upgrade for a long time in windows land. 
> I would gladly forgo all the bells and whistles for a simple install of the C 
> compiler, but I'm never certain that I'll be able to do cross-compiles etc 
> etc etc  :(

I had no problems with the community edition. Just select a Custom install and 
select "Common Tools for Visual C++ 2015" as the only feature. That gave me 
command shells in the start menu for native and cross-compilers.

Phil

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Mark Lawrence

On 21/09/2015 15:00, Robin Becker wrote:




The most reported problem trying to build anything on Windows that is
Python
related.


.


I'd be inclined to go for the reinstall, painful as that might be.
I've tried
finding the batch file as a separate download but there's just too
many hits
about "download Visual Studio".


I think that's where I'm headed.

Sadly this has been the worst python upgrade for a long time in windows
land. I would gladly forgo all the bells and whistles for a simple
install of the C compiler, but I'm never certain that I'll be able to do
cross-compiles etc etc etc  :(


You used to be able to work around the "can't find vcvarsall.bat" 
problem by hard coding the path to it, but that now fails with some 
other obscure message, so I've given up trying to build anything other 
than core Python.


An essential site for anybody trying to do serious work on Windows is 
Christoph Gohlke's "Unofficial Windows Binaries for Python Extension 
Packages" at http://www.lfd.uci.edu/~gohlke/pythonlibs/


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Robin Becker




The most reported problem trying to build anything on Windows that is Python
related.


.


I'd be inclined to go for the reinstall, painful as that might be.  I've tried
finding the batch file as a separate download but there's just too many hits
about "download Visual Studio".


I think that's where I'm headed.

Sadly this has been the worst python upgrade for a long time in windows land. I 
would gladly forgo all the bells and whistles for a simple install of the C 
compiler, but I'm never certain that I'll be able to do cross-compiles etc etc 
etc  :(

--
Robin Becker

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


Re: Postscript to pdf

2015-09-21 Thread Christian Gollwitzer

Am 20.09.15 um 20:27 schrieb Baladjy KICHENASSAMY:

Hello,

I'm using macosx, ps2pdf version i don't know :/ sorry
ok actually i found what is the problem...

There is no problem with the ps file every thing is fine =)



You could try

ps2pdf -dEPSCrop input.ps output.pdf

that should create a PDF with the papersize derived from an EPS image.

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 11:27 PM, Mark Lawrence  wrote:
>> There is a folder "C:\Program Files (x86)\Microsoft Visual Studio
>> 14.0\VC", but it doesn't contain any batch scripts. Document
>> https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx claims to be
>> about VS2015, but has as example
>>
>> cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
>>
>> which is presumably not for VS2015.
>
>
> Correct, the folder you referenced first should contain the batch file.
>

Which indicates a possible text bug in the linked-to document. None of
us can change that, though.

For some actually Python-specific info, I'd recommend checking out
what Steve Dower has written:

http://stevedower.id.au/blog/building-for-python-3-5-part-two/

Poking around on his blog and web site might turn up some other useful
info, too. I'm not a Windows guy so I can't help any more than that,
sorry.

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


Re: problem building python 3.5 extensions for windows

2015-09-21 Thread Mark Lawrence

On 21/09/2015 13:55, Robin Becker wrote:

I have installed VS2015; this is the full version and was a great deal
of trouble to install. First time out it started whining and I had to
'repair' it.

Anyhow after the 'repair' it said all was OK and no complaints.

However, when I try to use it I don't see options for starting C++
projects, but instead only C#.

I get an error like this trying to build for x86 or amd64

  | building 'reportlab.lib._rl_accel' extension
Stderr:  | error: Unable to find vcvarsall.bat


The most reported problem trying to build anything on Windows that is 
Python related.




There is a folder "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC", but it doesn't contain any batch scripts. Document
https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx claims to be
about VS2015, but has as example

cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"

which is presumably not for VS2015.


Correct, the folder you referenced first should contain the batch file.



Any ideas how to get this to work? Should I try a full reinstall of
VS2015? I can start the VS2015 Developer command prompt, but it doesn't
then know about the "cl" command.


I'd be inclined to go for the reinstall, painful as that might be.  I've 
tried finding the batch file as a separate download but there's just too 
many hits about "download Visual Studio".


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 10:53 PM, Cai Gengyang  wrote:
> Ok, so basically these are the features I want the app to have :
>
> 1) A system where users can upload photos/images/videos of their loved ones 
> and family onto the web-based app (It's going to be web-based website)
> 2) A system where where the users can then edit these photos/images/videos 
> into short , funny cartoons/videos
> 3) A system where users can create an account with username/password/log in 
> information
> 4) A system where users can then share and publish these pictures on the 
> website itself using their account and also link and upload onto other 
> traditional social networks like Facebook, Twitter and Google+ accounts and 
> also onto their other handheld devices like IPhone , Apple Devices, Samsung 
> handphones etc
>
> As for the architecture itself , it will probably be similar to wedpics 
> (https://www.wedpics.com/) but better designed with gorgeous and pristine 
> features and a system where users can edit their pictures/photos/videos into 
> cartoons with different themes with their faces on it (funny, natural, 
> science) --- i.e. imagine you are able to make a cartoon of your bride , 
> family members and friends at your wedding ceremony into a funny cartoon with 
> your faces imprinted on cartoon characters , the have these cartoons 
> published on the website and also link with other social networks where you 
> can publish these cartoons on them as well 
>
> I currently have minimal experience with programming , and have only done a 
> course on Python on CodeAcademy(That's about it) , so I am posting here to 
> ask for help --- where is the best place to start and resources?
>

You've done the first step - figure out what you want, and (more
importantly) how it's different from existing services you know about.
Great!

The next step, though, is to get some idea of the scope of the
project. Let's take a quick run through your basic features.

> 1) A system where users can upload photos/images/videos of their loved ones 
> and family onto the web-based app (It's going to be web-based website)

Creating a web site using Python is pretty easy. Grab Flask, Django,
etc, and off you go. Uploading files isn't difficult, although since
you're working with large files here, you'll eventually need some
beefy hardware to run this on (free accounts might not have enough
storage and/or bandwidth to handle lots of users).

> 2) A system where where the users can then edit these photos/images/videos 
> into short , funny cartoons/videos

This one's a bit open-ended, but more importantly, it needs a lot of
front-end work. Editing images in Python code won't be particularly
hard; but letting your users choose how those images are put together?
That's going to require a boatload of JavaScript work. How good are
you at front-end design and coding?

> 3) A system where users can create an account with username/password/log in 
> information

Subtly tricky to get right if you do it manually, but trivially easy
to get someone else to do the work for you. Grab something like
Flask-Login and the job's done.

> 4) A system where users can then share and publish these pictures on the 
> website itself using their account and also link and upload onto other 
> traditional social networks like Facebook, Twitter and Google+ accounts and 
> also onto their other handheld devices like IPhone , Apple Devices, Samsung 
> handphones etc
>

Fundamentally, all this requires is stable URLs that people can post.
That's pretty easy (esp if you're using a good framework). Making sure
they work properly on mobile phones is generally a matter of starting
with something simple, and then testing every change on lots of
devices. It's a bit of work, but nothing unattainable.

Your hardest part is #2, and sadly, that's also the part that makes or
breaks this service. Without that, all you're doing is recreating FTP.
So that's what you have to think about: Can you write all that
front-end code? This will not be simple; it'll be a pretty big
project.

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


Re: Postscript to pdf

2015-09-21 Thread Nobody
On Sun, 20 Sep 2015 23:11:20 +0200, Baladjy KICHENASSAMY wrote:

> i tried this
> 
> def save():
>  Canevas.update()
>  Canevas.postscript(file=tkFileDialog.asksaveasfilename(),
> colormode='color')
>  subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"])
> 
> 
> i got the ps file but i didn't get the pdf file :/

Check that subprocess.call() returns zero, or use subprocess.check_output()
instead. Also, if this is a GUI program and you have no easy way to check
what is written to stdout or stderr, try:

p = subprocess.Popen(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"],
 stderr=subprocess.PIPE)
out, err = p.communicate()
if p.returncode != 0:
raise RuntimeError(err)

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


problem building python 3.5 extensions for windows

2015-09-21 Thread Robin Becker
I have installed VS2015; this is the full version and was a great deal of 
trouble to install. First time out it started whining and I had to 'repair' it.


Anyhow after the 'repair' it said all was OK and no complaints.

However, when I try to use it I don't see options for starting C++ projects, but 
instead only C#.


I get an error like this trying to build for x86 or amd64

 | building 'reportlab.lib._rl_accel' extension
Stderr:  | error: Unable to find vcvarsall.bat

There is a folder "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC", but 
it doesn't contain any batch scripts. Document 
https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx claims to be about 
VS2015, but has as example


cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"

which is presumably not for VS2015.

Any ideas how to get this to work? Should I try a full reinstall of VS2015? I 
can start the VS2015 Developer command prompt, but it doesn't then know about 
the "cl" command.

--
Robin Becker

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


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Cai Gengyang
On Monday, September 21, 2015 at 7:38:21 PM UTC+8, Great Avenger Singh wrote:
> On Monday, 21 September 2015 15:08:53 UTC+5:30, Cai Gengyang  wrote:
> > Hello,
> > 
> > 
> > So, I want to use Python to design a photo/image/video sharing app that i 
> > can >test on users.
> 
> One Example is DropBox  doing this at very large  extent. ;)
> 
> 
> > I have Python 2.7.10, 3.3.2 and 3.3.4 downloaded and am using a Mac OS X 
> > Yosemite Version 10.10.2 laptop and having gone through the Python course 
> > on CodeAcademy a while ago (though I probably forgot most of it my now)
> > 
> > How / where do i start ? Any suggestions / resources / recommendations 
> > >appreciated. 
> 
> As you have not mentioned how you want your application to be,
> One way is using Dropbox/Google-drive Python API so user can get space 
> somewhere online and generate Public Link to Share file.
> 
> Or If User want to share it locally with other computers using 
> LAN/Bluetooth?WI-FI,
> 
> If you want to make it use with Android or IOS Kivy is there for you.(I am 
> fantasized with Kivy!)
> 
> Or First you have to decide what kind of Architecture you want with your 
> application or features. I guess my answer is vague so your question was ;)

Ok, so basically these are the features I want the app to have :

1) A system where users can upload photos/images/videos of their loved ones and 
family onto the web-based app (It's going to be web-based website)
2) A system where where the users can then edit these photos/images/videos into 
short , funny cartoons/videos 
3) A system where users can create an account with username/password/log in 
information 
4) A system where users can then share and publish these pictures on the 
website itself using their account and also link and upload onto other 
traditional social networks like Facebook, Twitter and Google+ accounts and 
also onto their other handheld devices like IPhone , Apple Devices, Samsung 
handphones etc 

As for the architecture itself , it will probably be similar to wedpics 
(https://www.wedpics.com/) but better designed with gorgeous and pristine 
features and a system where users can edit their pictures/photos/videos into 
cartoons with different themes with their faces on it (funny, natural, science) 
--- i.e. imagine you are able to make a cartoon of your bride , family members 
and friends at your wedding ceremony into a funny cartoon with your faces 
imprinted on cartoon characters , the have these cartoons published on the 
website and also link with other social networks where you can publish these 
cartoons on them as well 

My plan is to build this and get some users to test the product by posting the 
product online on sites like these, hacker news, word of mouth and also invite 
strangers on Facebook, Googles+ and Twitter to test this prototype and 
continuously iterate the product according to user feedback. Hope that is 
detailed enough to give you an idea of how it roughly would look like !

I currently have minimal experience with programming , and have only done a 
course on Python on CodeAcademy(That's about it) , so I am posting here to ask 
for help --- where is the best place to start and resources?

Thanks a lot , appreciate it !

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread MRAB

On 2015-09-21 09:47, Marko Rauhamaa wrote:

Michael Ströder :


Marko Rauhamaa wrote:

Michael Ströder :


Marko Rauhamaa wrote:

I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
are available (Linux).


If these options are not available are both option constants also not
available? Or does the implementation have to look into sys.platform?


   >>> import socket
   >>> 'TCP_CORK' in dir(socket)
   True


On which platform was this done?


Python3 on Fedora 21.
Python2 on RHEL4.

Sorry, don't have non-Linux machines to try.


How to automagically detect whether TCP_CORK is really available on a
platform?


I sure hope 'TCP_CORK' in dir(socket) evaluates to False on non-Linux
machines.


On Windows 10:

Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 
bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> 'TCP_CORK' in dir(socket)
False
>>>

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


Re: True == 1 weirdness

2015-09-21 Thread jmp

On 09/16/2015 02:53 PM, Jussi Piitulainen wrote:

 But now I expect to see a long thread about whether
chained comparisons are a natural thing to have in the language.


Nice forecast by the way.

JM


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


Re: A photo/image/video sharing app in Python

2015-09-21 Thread Great Avenger Singh
On Monday, 21 September 2015 15:08:53 UTC+5:30, Cai Gengyang  wrote:
> Hello,
> 
> 
> So, I want to use Python to design a photo/image/video sharing app that i can 
> >test on users.

One Example is DropBox  doing this at very large  extent. ;)


> I have Python 2.7.10, 3.3.2 and 3.3.4 downloaded and am using a Mac OS X 
> Yosemite Version 10.10.2 laptop and having gone through the Python course on 
> CodeAcademy a while ago (though I probably forgot most of it my now)
> 
> How / where do i start ? Any suggestions / resources / recommendations 
> >appreciated. 

As you have not mentioned how you want your application to be,
One way is using Dropbox/Google-drive Python API so user can get space 
somewhere online and generate Public Link to Share file.

Or If User want to share it locally with other computers using 
LAN/Bluetooth?WI-FI,

If you want to make it use with Android or IOS Kivy is there for you.(I am 
fantasized with Kivy!)

Or First you have to decide what kind of Architecture you want with your 
application or features. I guess my answer is vague so your question was ;) 

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


Re: Problem installing pip

2015-09-21 Thread Mark Lawrence

On 18/09/2015 06:54, Stephan wrote:

Good Morning,

I’ve tried ten times to install pip with no success in windows 10 using
python 64bit version.

Is there a solution available?

I’m looking forward hearing you soon.



The obvious solution is to get a version of Python like 3.4.3 or 3.5.0 
which comes with pip.  Failing that please cut and paste what you tried 
and what went wrong, we're not mind readers :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Jorgen Grahn
On Mon, 2015-09-21, Dennis Lee Bieber wrote:
> On Sun, 20 Sep 2015 23:36:30 +0100, "James Harris"
>  declaimed the following:

...
>>I thought UDP would deliver (or drop) a whole datagram but cannot find 
>>anything in the Python documentaiton to guarantee that. In fact 
>>documentation for the send() call says that apps are responsible for 
>>checking that all data has been sent. They may mean that to apply to 
>>stream protocols only but it doesn't state that. (Of course, UDP 
>>datagrams are limited in size so the call may validly indicate 
>>incomplete transmission even when the first part of a big message is 
>>sent successfully.)
>>
>   Looking in the wrong documentation  
>
>   You probably should be looking at the UDP RFC. Or maybe just
>
> http://www.diffen.com/difference/TCP_vs_UDP
>
> """
> Packets are sent individually and are checked for integrity only if they
> arrive. Packets have definite boundaries which are honored upon receipt,
> meaning a read operation at the receiver socket will yield an entire
> message as it was originally sent.
> """
>
>   Even if the IP layer has to fragment a UDP packet to meet limits of the
> transport media, it should put them back together on the other end before
> passing it up to the UDP layer. To my knowledge, UDP does not have a size
> limit on the message (well -- a 16-bit length field in the UDP header).

So they are "limited in size" like the OP wrote.  (A TCP stream OTOH is
potentially infinite.)

But also, the IPv4 RFC says:

All hosts must be prepared to accept datagrams of up to 576 octets
(whether they arrive whole or in fragments).  It is recommended
that hosts only send datagrams larger than 576 octets if they have
assurance that the destination is prepared to accept the larger
datagrams.

As for "all or nothing" with UDP datagrams, you also have the socket
layer case where the user does read() into a 1000 octet buffer and the
datagram was 1200 octets.  With BSD sockets you can (if you try)
detect this, but the extra 200 octets are lost forever.

> But  since it /is/ "got it all" or "dropped" with no inherent confirmation, 
> one
> would have to embed their own protocol within it -- sequence numbers with
> ACK/NAK, for example. Problem: if using LARGE UDP packets, this protocol
> would mean having LARGE resends should packets be dropped or arrive out of
> sequence (and since the ACK/NAK could be dropped too, you may have to
> handle the case of a duplicated packet -- also large).
>
>   TCP is a stream protocol -- the protocol will ensure that all data
> arrives, and that it arrives in order, but does not enforce any boundaries
> on the data; what started as a relatively large packet at one end may
> arrive as lots of small packets due to intermediate transport limits (one
> can visualize a worst case: each TCP packet is broken up to fit Hollerith
> cards; 20bytes for header and 60 bytes of data -- then fed to a reader and
> sent on AS-IS).

The problem is IMO more this: the chunks of data that the application
writes doesn't map to what the other application reads.  In the lower
layers, I don't expect TCP segments to be split, and IP fragmentation
(if it happens at all) operates at an even lower level.

However the end result is still just as you write:

> Boundaries are the end-user responsibility... line endings
> (look at SMTP, where an email message ends on a line containing just a ".")
> or embedded length counter (not the TCP packet length).
>
>>Receiving no bytes is taken as indicating the end of the communication. 
>>That's OK for TCP but not for UDP so there should be a way to 
>>distinguish between the end of data and receiving an empty datagram.
>>
>   I don't believe UDP supports a truly empty datagram (length of 0) --
> presuming a sending stack actually sends one, the receiving stack will
> probably drop it as there is no data to pass on to a client

UDP datagrams of length 0 work (just tried it on Linux).  There's
nothing special about it.

> (there is a PR
> at work because we have a UDP driver that doesn't drop 0-length messages,
> but also can't deliver them -- so the circular buffer might fill with
> undeliverable headers)

Those messages should be delivered to the receiving socket, in the
sense that they are sanity-checked, used to wake up the application
and mark the socket readable, fill up one entry in the read queue and
so on ...

Of course your system at work may have the rights to be more
restrictive, if it's special-purpose.

/Jorgen

-- 
  // Jorgen GrahnO  o   .
-- 
https://mail.python.org/mailman/listinfo/python-list


Problem installing pip

2015-09-21 Thread Stephan
Good Morning,

 

I've tried ten times to install pip with no success in windows 10 using
python 64bit version.

Is there a solution available? 

I'm looking forward hearing you soon.

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


A photo/image/video sharing app in Python

2015-09-21 Thread Cai Gengyang
Hello,


So, I want to use Python to design a photo/image/video sharing app that i can 
test on users.

I have Python 2.7.10, 3.3.2 and 3.3.4 downloaded and am using a Mac OS X 
Yosemite Version 10.10.2 laptop and having gone through the Python course on 
CodeAcademy a while ago (though I probably forgot most of it my now)

How / where do i start ? Any suggestions / resources / recommendations 
appreciated. 


Thanks a lot !

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:
>>> You can read a full buffer even if you have a variable-length length
>>> encoding.
>>
>> Not sure what you mean there. Unless you can absolutely guarantee that
>> you didn't read too much, or can absolutely guarantee that your
>> buffering function will be the ONLY way anything reads from the
>> socket, buffering is a problem.
>
> Only one reader can read a socket safely at any given time so mutual
> exclusion is needed.
>
> If you read "too much," the excess can be put in the application's read
> buffer where it is available for whoever wants to process the next
> message.

Oops, premature send - sorry! Trying again.

Which works only if you have a single concept of "application's read
buffer". That means that you have only one place that can ever read
data. Imagine a protocol that mainly consists of lines of text
terminated by CRLF, but allows binary data to be transmitted by
sending "DATA N\r\n" followed by N arbitrary bytes. The simplest and
most obvious way to handle the base protocol is to buffer your reads
as much as possible, but that means potentially reading the beginning
of the data stream along with its header. You therefore cannot use the
basic read() method to read that data - you have to use something from
your line-based wrapper, even though you are decidedly NOT using a
line-based protocol at that point.

That's what I mean by guaranteeing that your buffering function is the
only way data gets read from the socket. Either that, or you need an
underlying facility for un-reading a bunch of data - de-buffering and
making it readable again.

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa  wrote:
>> Only one reader can read a socket safely at any given time so mutual
>> exclusion is needed.
>>
>> If you read "too much," the excess can be put in the application's read
>> buffer where it is available for whoever wants to process the next
>> message.
>
> Which works only if you have a single concept of "application's read
> buffer".

Well, the socket's read buffer.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Michael Ströder :

> Marko Rauhamaa wrote:
>> Michael Ströder :
>> 
>>> Marko Rauhamaa wrote:
 I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
 are available (Linux).
>>>
>>> If these options are not available are both option constants also not
>>> available? Or does the implementation have to look into sys.platform?
>> 
>>>>> import socket
>>>>> 'TCP_CORK' in dir(socket)
>>True
>
> On which platform was this done?

Python3 on Fedora 21.
Python2 on RHEL4.

Sorry, don't have non-Linux machines to try.

> How to automagically detect whether TCP_CORK is really available on a
> platform?

I sure hope 'TCP_CORK' in dir(socket) evaluates to False on non-Linux
machines.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Marko Rauhamaa :

> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa  wrote:
>>> Only one reader can read a socket safely at any given time so mutual
>>> exclusion is needed.
>>>
>>> If you read "too much," the excess can be put in the application's read
>>> buffer where it is available for whoever wants to process the next
>>> message.
>>
>> Which works only if you have a single concept of "application's read
>> buffer".
>
> Well, the socket's read buffer.

To be exact, the application should associate a read buffer with each
socket.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 6:38 PM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:
>>> You can read a full buffer even if you have a variable-length length
>>> encoding.
>>
>> Not sure what you mean there. Unless you can absolutely guarantee that
>> you didn't read too much, or can absolutely guarantee that your
>> buffering function will be the ONLY way anything reads from the
>> socket, buffering is a problem.
>
> Only one reader can read a socket safely at any given time so mutual
> exclusion is needed.
>
> If you read "too much," the excess can be put in the application's read
> buffer where it is available for whoever wants to process the next
> message.

Which works only if you have a single concept of "application's read
buffer". That means that you have only one place that can ever read
data. Imagine a
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:
>> You can read a full buffer even if you have a variable-length length
>> encoding.
>
> Not sure what you mean there. Unless you can absolutely guarantee that
> you didn't read too much, or can absolutely guarantee that your
> buffering function will be the ONLY way anything reads from the
> socket, buffering is a problem.

Only one reader can read a socket safely at any given time so mutual
exclusion is needed.

If you read "too much," the excess can be put in the application's read
buffer where it is available for whoever wants to process the next
message.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Michael Ströder
Marko Rauhamaa wrote:
> Michael Ströder :
> 
>> Marko Rauhamaa wrote:
>>> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
>>> are available (Linux).
>>
>> If these options are not available are both option constants also not
>> available? Or does the implementation have to look into sys.platform?
> 
>>>> import socket
>>>> 'TCP_CORK' in dir(socket)
>True

On which platform was this done?

To rephrase myquestion:
How to automagically detect whether TCP_CORK is really available on a platform?

'TCP_CORK' in dir(socket)
or catch AttributeError

sys.platform=='linux2'
hoping that Linux 2.1 or prior is not around anymore...

...

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lightwight socket IO wrapper

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 5:59 PM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
>>> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
>>> so on. Compact yet unbounded.
>>
>> [...]
>>
>> It's generally a lot faster to do a read(2) than a loop with any
>> number of read(1), and you get some kind of bound on your allocations.
>> Whether that's important to you or not is another question, but
>> certainly your chosen encoding is a good way of allowing arbitrary
>> integer values.
>
> You can read a full buffer even if you have a variable-length length
> encoding.

Not sure what you mean there. Unless you can absolutely guarantee that
you didn't read too much, or can absolutely guarantee that your
buffering function will be the ONLY way anything reads from the
socket, buffering is a problem.

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Michael Ströder :

> Marko Rauhamaa wrote:
>> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
>> are available (Linux).
>
> If these options are not available are both option constants also not
> available? Or does the implementation have to look into sys.platform?

   >>> import socket
   >>> 'TCP_CORK' in dir(socket)
   True

The TCP_NODELAY option is available everywhere but has special semantics
with TCP_CORK.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
>> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
>> so on. Compact yet unbounded.
>
> [...]
>
> It's generally a lot faster to do a read(2) than a loop with any
> number of read(1), and you get some kind of bound on your allocations.
> Whether that's important to you or not is another question, but
> certainly your chosen encoding is a good way of allowing arbitrary
> integer values.

You can read a full buffer even if you have a variable-length length
encoding.


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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Chris Angelico
On Mon, Sep 21, 2015 at 4:27 PM, Cameron Simpson  wrote:
> I don't like embedding arbitrary size limits in protocols or data formats if
> I can easily avoid it. So (for my home grown binary protocols) I encode
> unsigned integers as big endian octets with the top bit meaning "another
> octet follows" and the bottom 7 bits going to the value. So my packets look
> like:
>
>  encoded(length)data
>
> For sizes below 128, one byte of length. For sizes 128-16383, two bytes. And
> so on. Compact yet unbounded.

Ah, the MIDI Variable-Length Integer. Decent.

It's generally a lot faster to do a read(2) than a loop with any
number of read(1), and you get some kind of bound on your allocations.
Whether that's important to you or not is another question, but
certainly your chosen encoding is a good way of allowing arbitrary
integer values.

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


Re: Postscript to pdf

2015-09-21 Thread Baladjy KICHENASSAMY
well one more question :/

i tried this

def save():
 Canevas.update()
 Canevas.postscript(file=tkFileDialog.asksaveasfilename(),
colormode='color')
 subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"])


i got the ps file but i didn't get the pdf file :/

2015-09-20 21:52 GMT+02:00 Laura Creighton :
> In a message of Sun, 20 Sep 2015 21:32:34 +0200, Baladjy KICHENASSAMY writes:
>>o ok i got it
>>actually it's very easy the commande is :
>>ps2pdf -dEPSCrop image.ps
>>
>>sorry but i'm new to python  my last question is how to integrate this
>>to python... i want that the output file must be a pdf ?
>>
>>1) i created a button which i'll save my id card as "ps" file
>>
>>def save():
>>Canevas.update()
>>Canevas.postscript(file=tkFileDialog.asksaveasfilename(), 
>> colormode='color')
>
>>2) so now i want to create a button to convert this "ps" file into "pdf" 
>>
>>def convert():
>>   help :/
>
> You need to run the subprocess module to run your command.
> https://docs.python.org/2/library/subprocess.html  (for python 2)
> https://docs.python.org/3.4/library/subprocess.html (for python 3)
>
> is this enough or do you need more help getting it to work?
>
> Laura
>



-- 
KICHENASSAMY Baladjy
Ingénieur en Génie Mécanique
Spécialiste Contrôle Non Destructif et Qualification des procédés spéciaux
COSAC CND Niveau 2 RT et PT
Aircelle SAFRAN
Tel:06.03.72.53.12
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lightwight socket IO wrapper

2015-09-21 Thread Michael Ströder
Marko Rauhamaa wrote:
> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they are
> available (Linux).

If these options are not available are both option constants also not
available? Or does the implementation have to look into sys.platform?

Ciao, Michael.

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


Re: Lightwight socket IO wrapper

2015-09-21 Thread Marko Rauhamaa
Chris Angelico :

> On Mon, Sep 21, 2015 at 2:39 PM, Marko Rauhamaa  wrote:
>> Chris Angelico :
>>
>>> If you write a packet of data, then write another one, and another,
>>> and another, and another, without waiting for responses, Nagling
>>> should combine them automatically. [...]
>>
>> Unfortunately, Nagle and delayed ACK, which are both defaults, don't go
>> well together (you get nasty 200-millisecond hickups).
>
> Only in the write-write-read scenario.

Which is the case you brought up. Ideally, application code should be
oblivious to the inner heuristics of the TCP implementation. IOW,
write-write-read is perfectly valid and shouldn't lead to performance
degradation.

Unfortunately, the socket API doesn't provide a standard way for the
application to tell the kernel that it is done sending for now. Linux's
TCP_CORK+TCP_NODELAY is a nonstandard way but does the job quite nicely.

>> As for the topic, TCP doesn't need wrappers to abstract away the
>> difficult bits. That's a superficially good idea that leads to
>> trouble.
>
> Depends what you're doing - if you're working with a higher level
> protocol like HTTP, then abstracting away the difficult bits of TCP is
> part of abstracting away the difficult bits of HTTP, and something
> like 'requests' is superb.

Naturally, a higher-level protocol hides the lower-level protocol. It in
turn has intricacies of its own. Unfortunately, Python's stdlib HTTP
facilities are too naive (ie, blocking, incompatible with asyncio) to be
usable.


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


Re: Dummy Decoder Example (was Re: Parallel decoding lesson for you.)

2015-09-21 Thread Skybuck Flying
Just to be clear on this, the code you have to write doesn't need to be 
truely parallel.


It must be parallel in potential, so it should be able to execute 
independenlty from each other and out of order.


Bye,
 Skybuck. 


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