🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27390

py2exe i sys.argv

#27390
From: 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 ::
Technical Details
Message-ID: <hnvi2q$cl9$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail
From: grizz <grizz@poczta.onet.pl>
Newsgroups: pl.comp.lang.python
Subject: py2exe i sys.argv
Followup-To: pl.comp.lang.python
Date: Fri, 19 Mar 2010 11:02:02 +0100
Organization: http://onet.pl
Lines: 24
Message-ID: <hnvi2q$cl9$1@news.onet.pl>
NNTP-Posting-Host: 77.236.8.37
Mime-Version: 1.0
X-Trace: news.onet.pl 1268992922 12969 77.236.8.37 (19 Mar 2010 10:02:02 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Fri, 19 Mar 2010 10:02:02 +0000 (UTC)
User-Agent: KNode/4.4.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit