🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.python
3 messages
3 total messages Started by grizz Fri, 19 Mar 2010 10:02
py2exe i sys.argv
#27390
Author: grizz
Date: Fri, 19 Mar 2010 10:02
23 lines
1349 bytes
Mam w kodzie takie coś:

def verbose (msg, level):
    try:
        for item in sys.argv:
           if item == "-v" and level == 1:
               print msg
               break
           elif item == "-vv" and level <= 2:
               print msg
               break

I o ile wywołuje to standardowo python test.py -v to wszystko 
działa...

Jednak jeżeli program jest "skompilowany" za pomocą py2exe to 
nie przyjmuje argumentów z linii poleceń  - jakieś pomysły?
-- 
::  Witek Firlej  ::
Voiceless it cries, Wingless flutters, Toothless bites, 
Mouthless mutters.
:: http://grizz.pl :: http://galeria.firlej.org :: jid: 
grizz//jabster.pl ::
Re: py2exe i sys.argv
#27392
Author: Parasit Hendersson
Date: Mon, 12 Apr 2010 15:07
12 lines
1129 bytes
On Fri, 19 Mar 2010 11:02:02 +0100, grizz <grizz@poczta.onet.pl> wrote:
> I o ile wywołuje to standardowo python test.py -v to wszystko 
> działa...
>
> Jednak jeżeli program jest "skompilowany" za pomocą py2exe to 
> nie przyjmuje argumentów z linii poleceń  - jakieś pomysły?

A jak go kompilujesz?
Masz jakiś setup? Jeśli tak to pokaż.

Pzdr
Parasit
Re: py2exe i sys.argv
#27393
Author: grizz
Date: Thu, 15 Apr 2010 13:28
32 lines
1637 bytes
Parasit Hendersson wrote:

> On Fri, 19 Mar 2010 11:02:02 +0100, grizz 
<grizz@poczta.onet.pl> wrote:
>> I o ile wywołuje to standardowo python test.py -v to 
wszystko
>> działa...
>>
>> Jednak jeżeli program jest "skompilowany" za pomocą py2exe 
to
>> nie przyjmuje argumentów z linii poleceń  - jakieś 
pomysły?
> 
> A jak go kompilujesz?
> Masz jakiś setup? Jeśli tak to pokaż.
> 
from distutils.core import setup
import py2exe

setup(windows=[{"script" : "mirlight_gui.py", 
"icon_resources": [(0, 
"mirlight.ico")]}],zipfile=None,options={"py2exe":
{"includes":["sip"],"bundle_files": 1}})

Tutaj cały projekt: http://github.com/grizz-pl/mirlight

-- 
::  Witek Firlej  ::
Voiceless it cries, Wingless flutters, Toothless bites, 
Mouthless mutters.
:: http://grizz.pl :: http://galeria.firlej.org :: jid: 
grizz//jabster.pl ::
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads