Hello,
I've just installed Python 2.7 on Windows 7
I've been able to write and run a script Hello world
I wonder how I could specify a parameter on the command line from
within the interpreter.
Specifying a parameter on the DOS command line is no problem.
Any hint, please ?
--
On Sunday, January 6, 2013 8:03:43 AM UTC-8, marc.assin wrote:
I wonder how I could specify a parameter on the command line from
within the interpreter.
Guido wrote some advice a while back -
http://www.artima.com/weblogs/viewpost.jsp?thread=4829
Import your module and call its main.
The
Oh well since a few solutions have already been posted I thought I
might add another, just so you at the very least you have to do some
work making up your mind which one to choose. Using an incremental
approach just to be different ...
from decimal import Decimal
normal = Decimal('0.04')
over
On Aug 21, 5:41 pm, Asun Friere [EMAIL PROTECTED] wrote:
over = Decimal('1.40)
oops, that should of course be:
over = Decimal('1.40')
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 21, 5:51 pm, Asun Friere [EMAIL PROTECTED] wrote:
On Aug 21, 5:41 pm, Asun Friere [EMAIL PROTECTED] wrote: over =
Decimal('1.40)
oops, that should of course be:
over = Decimal('1.40')
oh boy ... and it should also be
normal = Decimal('0.40')
I really need to test before posting ...
On Aug 20, 11:47 pm, [EMAIL PROTECTED] wrote:
...
Thanks for the help. By the way I am trying to learn the python after
work and on weekends. If it was a dumb question, to this group, I will
not bother you all again.
It's not so much that it was a dumb question, but that it was asked in
a dumb
[EMAIL PROTECTED] wrote:
[...]
Thanks for the help. By the way I am trying to learn the python after
work and on weekends. If it was a dumb question, to this group, I will
not bother you all again.
Without help it will take me longer to learn. Thanks
Don't worry about it. There is also a
On Aug 21, 4:38 am, Ant [EMAIL PROTECTED] wrote:
On Aug 20, 11:47 pm, [EMAIL PROTECTED] wrote:
...
Thanks for the help. By the way I am trying to learn the python after
work and on weekends. If it was a dumb question, to this group, I will
not bother you all again.
It's not so much that
On Aug 21, 11:52 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I tryed your code and got an error message #I use Wing IDE:
Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)]
Type help, copyright, credits or license for more information.
Evaluating lines 1-16 from truckStops.py
On Aug 21, 2:57 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
[...]
pay = min(num, 22) * 0.4 + max(num-22, 0) * 1.4
pay = num*0.4 + (num22)*(num-22)
;-)
-=Dave
--
http://mail.python.org/mailman/listinfo/python-list
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to code my stop pay. I
get 40 cents per stop up to 22 stops, and $1.40 per stops after that.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to code my stop pay. I
get 40 cents per stop up to 22 stops, and $1.40 per stops after that.
def calc(num):
if num
#!/usr/bin/env python
normalPay = 0.4
overPay = 1.4
normalLimit = 22
def calcPay(numStops):
pay = 0
if numStops normalLimit:
pay = overPay * (numStops - normalLimit)
numStops = normalLimit
return pay + (numStops * normalPay)
if __name__ == __main__:
print
On 8/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to code my stop pay. I
get 40 cents per stop up to 22 stops, and
HD1956 schrieb:
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to code my stop pay. I
get 40 cents per stop up to 22 stops, and $1.40 per stops after that.
Sounds a bit like homework. Which usually isn't simply delivered
On Aug 20, 9:58 am, Shawn Milochik [EMAIL PROTECTED] wrote:
On 8/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to
I like to write code, so it's not a big deal when it's something so
simple. Still, that is beyond dumb! Nice code, by the way.
Mike
Yeah, it was fun to write anyway. Thanks for the compliment on the
code. I still consider myself a Python newbie, so it's good to know
I'm not trying to write it
Diez B. Roggisch wrote:
Sounds a bit like homework. Which usually isn't simply delivered here.
Wrong! Usually that happens pretty quickly here (as proven again in this
case). Not that it should, but only the seniors seem to detect lazy
learners.
/W
--
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets paid by
stops and cases. I am trying to figure out how to code my stop pay. I
get 40 cents per stop up to 22 stops, and $1.40 per stops after that.
You'll get top marks for turning
On 2007-08-20, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets
paid by stops and cases. I am trying to figure out how to code
my stop pay. I get 40 cents per stop up to 22 stops, and $1.40
per stops after that.
I wish *I* could make a deal like
On Aug 20, 11:06 am, [EMAIL PROTECTED] wrote:
On Aug 20, 9:58 am, Shawn Milochik [EMAIL PROTECTED] wrote:
On 8/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck driver who gets paid by
[EMAIL PROTECTED] wrote:
On Aug 20, 11:06 am, [EMAIL PROTECTED] wrote:
On Aug 20, 9:58 am, Shawn Milochik [EMAIL PROTECTED] wrote:
On 8/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Aug 20, 9:23 am, HD1956 [EMAIL PROTECTED] wrote:
This is probably a simple code. I am a truck
hello,
i am writing a python script that will be run by a non root user
the script needs to open a file in write mode that is owned by root
file = open('/etc/apt/sources.list', 'r+')
returns permission error
how can i call sudo on open()?
thanks alot
slava
--
The script could be SUID Root, and you could use os.setuid immediately after
having performed the task to switch to a non-priviledged user. May be a big
security risk, if someone can alter the script, he gains root access to the
system...
[EMAIL PROTECTED] wrote:
hello,
i am writing a python
On Tue, 14 Jun 2005 11:52:13 +0200,
Denis WERNERT [EMAIL PROTECTED] wrote:
The script could be SUID Root, and you could use os.setuid immediately
after having performed the task to switch to a non-priviledged
user. May be a big security risk, if someone can alter the script, he
gains root
On 14 Jun 2005 08:12:17 -0400, rumours say that Dan Sommers
[EMAIL PROTECTED] might have written:
On Tue, 14 Jun 2005 11:52:13 +0200,
Denis WERNERT [EMAIL PROTECTED] wrote:
The script could be SUID Root, and you could use os.setuid immediately
after having performed the task to switch to a
On Tue, 14 Jun 2005 16:18:19 +0300,
Christos TZOTZIOY Georgiou [EMAIL PROTECTED] wrote:
I believe that the suid bit on scripts (either *sh or python) is
completely ignored on most *nix systems.
Most *modern* systems, yes. ;-)
I must be getting old. :-(
Regards,
Dan
--
Dan Sommers
Hello,
I'm quite new in Python and I discover every day very interesting new
packages in this newsgroup : Is there somewhere on the web a list (as
complete as possible) in which main features of external packages are listed
?
Sebastien
--
http://mail.python.org/mailman/listinfo/python-list
On 6/1/05, Sébastien V. [EMAIL PROTECTED] wrote:
I'm quite new in Python and I discover every day very interesting new
packages in this newsgroup : Is there somewhere on the web a list (as
complete as possible) in which main features of external packages are listed
Try
29 matches
Mail list logo