Python-list Digest, Vol 102, Issue 64

David Shi davidgshi at yahoo.co.uk
Wed Mar 14 00:05:39 CET 2012


I am looking very simple and straightforward open source Python REST and SOAP demo modules.

I really need things which are very simple and convincing.   I want to demonstrate these to other people.

I want to promote you guys' interest.   I find asp and others frustrating and occupy too much in the market and popularity.

Can we do a new tidal wave to win a reasonable portion of the development market?

Send me materials to davidgshi at yahoo.co.uk

I will give it a go on behalf of the Python community.

Regards.

David


________________________________
 From: "python-list-request at python.org" <python-list-request at python.org>
To: python-list at python.org 
Sent: Tuesday, 13 March 2012, 20:35
Subject: Python-list Digest, Vol 102, Issue 64
 
----- Forwarded Message -----

Send Python-list mailing list submissions to
    python-list at python.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
    python-list-request at python.org

You can reach the person managing the list at
    python-list-owner at python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-list digest..."

Today's Topics:

   1. Re: concatenate function (James Elford)
   2. Re: New Science Discovery: Perl Idiots Remain Idiots After A
      Decade!New    Science Discovery: Perl Idiots Remain Idiots After A
      Decade! (Kiuhnm)
   3. Re: Installing Python Apps on  Mac Lion
      (dilvanezanardine at gmail.com)
   4. Re: Software Engineer - (Pedro H. G. Souto)
   5. Re: Software Engineer - (Neil Cerutti)
   6. RE: Windows Contextmenu (Prasad, Ramit)
   7. Re: concatenate function (ferreirafm)
   8. Re: Installing Python Apps on Mac Lion (Benjamin Kaplan)
   9. Re: Windows Contextmenu (Terry Reedy)
  10. Re: concatenate function (Robert Kern)
On 13/03/12 16:02, ferreirafm wrote:
> Hi James, thank you for your replay. Indeed, the problem is qsub. And as
> warned by Robert, I don't have functions properly, but just scripts.
>  
> 
> --
> View this message in context: http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574511.html
> Sent from the Python - python-list mailing list archive at Nabble.com.

It looks like you're not calling wait() on your subprocesses: you're
effectively launching a bunch of processes, then not waiting for them to
finish before you ask the next process to operate on the same file.

If you haven't given it a good look-over already, the subprocess
documentation [1] is worth taking a little time over.

    [1]: http://docs.python.org/library/subprocess.html#popen-objects

James

On 3/12/2012 20:00, Albert van der Horst wrote:
[...]

Sorry for triple posting. I hadn't noticed the follow up and I was blaming my newsserver.
BTW, Python is the next language (right after Perl) I'm going to learn.
Then I'll probably have a look at Ruby...

Kiuhnm

Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu:
> The Lion version of the OS on the Mac comes with Python 2.7 installed, but it is in /System/Library/Frameworks/..., and this area is not writable by third party apps.
> 
> So is there a consensus on what apps that typically install under the Python site-packages directory should do in this situation?  Installing Python from python.org puts it in the writable area /Library/Frameworks/Python.framework.
> 
> So, what should a Python app installer do?
> 
> Thanks

Hello,

currently I have:

/Library/Python/2.7/
/Library/Frameworks/Python.framework/Versions/2.7/
/Users/user/Library/Python/2.7/

With 3 folders "site-packages" and do not know why.
What's the difference?

Thanks.


On 2012-03-13 12:44 PM, Paul Rudin wrote:
> Just out of interest why do people object to job adverts here? Seems
> harmless enough...
Wannabe list admins... Or list admins with a need to proof themselves... Or none of the above.

On 2012-03-13, Pedro H. G. Souto <phgsouto at gmail.com> wrote:
> On 2012-03-13 12:44 PM, Paul Rudin wrote:
>> Just out of interest why do people object to job adverts here?
>> Seems harmless enough...
>
> Wannabe list admins... Or list admins with a need to proof
> themselves... Or none of the above.

A job listing here or there would fine. If the discussion were
clogged with them, it would be really annoying.

In addition, it's more efficient to post job listing in a place
where people looking for jobs can easily find them, and it's
annoying and useless to post them in a place where reader not
looking for jobs have to delete them.

-- 
Neil Cerutti

> > Now the script runs fine but I don't get all arguments from sys.argv.
> >
> > No mather how many files I mark in the explorer I only get one as an
> > argument.
> 
> You're missing out vital information:
> 
> * How have you attached this code to the context menu? What was
> the exact registry entry (or other method) you used?

From a quick Google search, it seems that most of the context menu
entries open a single file. If multiple files are selected then
the command is called once for each file. The workaround seems
to check if the processes is already running and if it is then to
directly send it a "open" command.

That being said, since you are opening a web browser (or so it
seems to me based on the webbrowser.open), you should not have
an issue because modern web browsers will open each link in a tab.

To answer your question, you will not get more than one as an
argument. That is expected behavior. 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--

This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.


Robert Kern-2 wrote
> 
> When you report a problem, you should copy-and-paste the output that you
> got and 
> also state the output that you expected. I have no idea what you mean when
> you 
> say "subprocess.Popen seems not accept to run "qsub" over a second
> program."
> 

Code goes here: 
http://ompldr.org/vZDB5YQ

stdout:
$ no_name.py --toplist top_percent.list
Traceback (most recent call last):
  File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 73, in <module>
    main()
  File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 68, in main
    comb_slt(toplist)
  File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 55, in comb_slt
    subprocess.Popen([cmd, options], env=qsub_env)
  File "/share/apps/python/lib/python2.7/subprocess.py", line 679, in
__init__
    errread, errwrite)
  File "/share/apps/python/lib/python2.7/subprocess.py", line 1228, in
_execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

--
View this message in context: http://python.6.n6.nabble.com/concatenate-function-tp4574176p4574967.html
Sent from the Python - python-list mailing list archive at Nabble.com.

On Tue, Mar 13, 2012 at 12:42 PM, <dilvanezanardine at gmail.com> wrote:
>
> Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu:
> > The Lion version of the OS on the Mac comes with Python 2.7 installed,
> > but it is in /System/Library/Frameworks/..., and this area is not writable
> > by third party apps.
> >
> > So is there a consensus on what apps that typically install under the
> > Python site-packages directory should do in this situation?  Installing
> > Python from python.org puts it in the writable area
> > /Library/Frameworks/Python.framework.
> >
> > So, what should a Python app installer do?
> >
> > Thanks
>
> Hello,
>
> currently I have:
>
> /Library/Python/2.7/
> /Library/Frameworks/Python.framework/Versions/2.7/
> /Users/user/Library/Python/2.7/
>
> With 3 folders "site-packages" and do not know why.
> What's the difference?
>
> Thanks.
>

If I had to take a guess, having not played too much with Lion:

/Library/Python/2.7 is for user-installed packages for the system
python that are installed for all users.
/Library/Frameworks/... is for the user-installed Python (that's where
it's always gone)
/Users/user/Library... is for user-installed packages for the system
Python that are only installed for the specific user.

On 3/13/2012 5:41 AM, Szabo, Patrick (LNG-VIE) wrote:
> Hi,
> 
> I wrote the following Script which I want to run from the open with
> contextmenu in Windows.

> Now the script runs fine but I don’t get all arguments from sys.argv.
> 
> No mather how many files I mark in the explorer I only get one as an
> argument.

The right-click contextmenu is not a command line. It is more like a list of no-arg* methods to call on the selected file.

* or rather, one input arg, with others having default values set when the menu entry is created. Sometimes a second input arg is handled, at least in effect, with a second submenu, but I am not familiar with how those are done in Windows.

-- Terry Jan Reedy



On 3/13/12 6:01 PM, ferreirafm wrote:
> 
> Robert Kern-2 wrote
>> 
>> When you report a problem, you should copy-and-paste the output that you
>> got and
>> also state the output that you expected. I have no idea what you mean when
>> you
>> say "subprocess.Popen seems not accept to run "qsub" over a second
>> program."
>> 
> 
> Code goes here:
> http://ompldr.org/vZDB5YQ
> 
> stdout:
> $ no_name.py --toplist top_percent.list
> Traceback (most recent call last):
>    File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 73, in<module>
>      main()
>    File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 68, in main
>      comb_slt(toplist)
>    File "/home6/psloliveira/ferreirafm/bin/no_name.py", line 55, in comb_slt
>      subprocess.Popen([cmd, options], env=qsub_env)
>    File "/share/apps/python/lib/python2.7/subprocess.py", line 679, in
> __init__
>      errread, errwrite)
>    File "/share/apps/python/lib/python2.7/subprocess.py", line 1228, in
> _execute_child
>      raise child_exception
> OSError: [Errno 13] Permission denied

You need to use a command list like this:

['qsub', 'combine_silent.linuxgccrelease', '-database', '/home6/psloliveira/rosetta_database/', ...]

The program to run ("qsub", not "qsub combine_silent.linuxgccrelease") and each individual argument must be a separate string in the list. You cannot combine them together with spaces. The reason you get a "Permission denied" error is that it tried to find an executable file named "qsub combine_silent.linuxgccrelease" and, obviously, could not.

-- Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
  -- Umberto Eco



-- 
http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120313/50acaedb/attachment.html>


More information about the Python-list mailing list