Re: newbee

2014-08-14 Thread alister
On Wed, 13 Aug 2014 15:31:37 -0400, Terry Reedy wrote: > On 8/13/2014 7:55 AM, alister wrote: >> >> I am not in the same league as many of the posters here when it comes >> to Python but fortunately i do have two Raspberry Pi's :-) > > Great! We really someone with hands-on experience. I Hope th

Re: newbee

2014-08-13 Thread Bob Martin
in 726715 20140813 103037 Chris Angelico wrote: >On Wed, Aug 13, 2014 at 9:57 AM, Frank Scafidi wrote: >> I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 >> programmer back in the 60's & 70's and Python is similar. I am struggling >> with some very fundamental things th

Re: newbee

2014-08-13 Thread Chris “Kwpolska” Warrick
On Aug 13, 2014 9:34 PM, "Terry Reedy" wrote: > Have you verified that Idle *does* (not just *should*) run on RPi? (That would mean having tcl/tk running, with whatever *it* requires on linux.) I am working on Idle and the idea of people (especially hobbyists, students, and other amateurs) running

Re: newbee

2014-08-13 Thread Larry Hudson
On 08/12/2014 04:57 PM, Frank Scafidi wrote: I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 programmer back in the 60's & 70's and Python is similar. I am struggling with some very fundamental things that I am not finding in the documentation. Can someone help me wit

Re: newbee

2014-08-13 Thread Terry Reedy
On 8/13/2014 7:55 AM, alister wrote: I am not in the same league as many of the posters here when it comes to Python but fortunately i do have two Raspberry Pi's :-) Great! We really someone with hands-on experience. if you are running the Pi connected to a TV/Monitor with the Gui enabled th

Re: newbee

2014-08-13 Thread William Ray Wing
On Aug 13, 2014, at 9:57 AM, alister wrote: > On Wed, 13 Aug 2014 15:13:34 +0200, Mok-Kong Shen wrote: > >> Am 13.08.2014 13:55, schrieb alister: >> [snip] >> >> A related question: How could one write a Python program and have it run >> on a mobile phone in general (independent of a PC)? >> >

Re: newbee

2014-08-13 Thread alister
On Wed, 13 Aug 2014 15:13:34 +0200, Mok-Kong Shen wrote: > Am 13.08.2014 13:55, schrieb alister: > [snip] > > A related question: How could one write a Python program and have it run > on a mobile phone in general (independent of a PC)? > > M. K. Shen you would need a python interpreter for tha

Re: newbee

2014-08-13 Thread Mok-Kong Shen
Am 13.08.2014 13:55, schrieb alister: [snip] A related question: How could one write a Python program and have it run on a mobile phone in general (independent of a PC)? M. K. Shen -- https://mail.python.org/mailman/listinfo/python-list

Re: newbee

2014-08-13 Thread alister
On Tue, 12 Aug 2014 19:57:14 -0400, Frank Scafidi wrote: > I just acquired a Raspberry Pi and want to program in Python. I was a > PL/1 programmer back in the 60's & 70's and Python is similar. I am > struggling with some very fundamental things that I am not finding in > the documentation. Can so

Re: newbee

2014-08-13 Thread Duncan Booth
Peter Otten <__pete...@web.de> wrote: > Frank Scafidi wrote: > >> I just acquired a Raspberry Pi and want to program in Python. I was a >> PL/1 programmer back in the 60's & 70's and Python is similar. I am >> struggling with some very fundamental things that I am not finding in >> the documentat

Re: newbee

2014-08-13 Thread Peter Otten
Frank Scafidi wrote: > I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 > programmer back in the 60's & 70's and Python is similar. I am struggling > with some very fundamental things that I am not finding in the > documentation. Can someone help me with the basics like h

Re: newbee

2014-08-13 Thread Chris Angelico
On Wed, Aug 13, 2014 at 9:57 AM, Frank Scafidi wrote: > I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 > programmer back in the 60's & 70's and Python is similar. I am struggling > with some very fundamental things that I am not finding in the > documentation. Can someo

Re: newbee

2014-08-13 Thread Joel Goldstick
On Tue, Aug 12, 2014 at 7:57 PM, Frank Scafidi wrote: > I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 > programmer back in the 60's & 70's and Python is similar. I am struggling > with some very fundamental things that I am not finding in the > documentation. Can someo

newbee

2014-08-12 Thread Frank Scafidi
I just acquired a Raspberry Pi and want to program in Python. I was a PL/1 programmer back in the 60's & 70's and Python is similar. I am struggling with some very fundamental things that I am not finding in the documentation. Can someone help me with the basics like how do I save a program I've wr

Re: Newbee question about running a script

2013-01-06 Thread Miki Tebeka
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 oth

Newbee question about running a script

2013-01-06 Thread marc.assin
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 ? -- http://mail.py

Re: newbee: Simple Backend Python Script Question

2007-09-14 Thread Steve Holden
joe shoemaker wrote: > I need to create python script that is threaded. So the main program > will run in infinite loop and just retrieving messages and putting them > in a queue. (Main thread) > > I need child threads from a pool to process the queue. When there is no > stuff in the queue, the

newbee: Simple Backend Python Script Question

2007-09-14 Thread joe shoemaker
I need to create python script that is threaded. So the main program will run in infinite loop and just retrieving messages and putting them in a queue. (Main thread) I need child threads from a pool to process the queue. When there is no stuff in the queue, they go to the pool and become availabl

Re: Newbee Question

2007-08-21 Thread Dave Hansen
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 + (num>22)*(num-22) ;-) -=Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbee Question

2007-08-21 Thread sentientholon
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

Re: Newbee Question

2007-08-21 Thread [EMAIL PROTECTED]
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

Re: Newbee Question

2007-08-21 Thread Steve Holden
[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 als

Re: Newbee Question

2007-08-21 Thread Ant
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 du

Re: Newbee Question

2007-08-21 Thread Asun Friere
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 pos

Re: Newbee Question

2007-08-21 Thread Asun Friere
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

Re: Newbee Question

2007-08-21 Thread Asun Friere
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 =

Re: Newbee Question

2007-08-20 Thread James Stroud
[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 i

Re: Newbee Question

2007-08-20 Thread hd1956
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

Re: Newbee Question

2007-08-20 Thread Neil Cerutti
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 li

Re: Newbee Question

2007-08-20 Thread Paul McGuire
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 tu

Re: Newbee Question

2007-08-20 Thread Wildemar Wildenburger
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 -- http://mail.python.org/mailman/lis

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
> 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

Re: Newbee Question

2007-08-20 Thread kyosohma
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

Re: Newbee Question

2007-08-20 Thread Diez B. Roggisch
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 delive

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
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 st

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
#!/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

Re: Newbee Question

2007-08-20 Thread kyosohma
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 n

Newbee Question

2007-08-20 Thread HD1956
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

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 18:05, consternation wrote: def __init__ self.mem={} I googled a way how to add elements to dict, I have read the code not the description below self.mem[key] = value I strongly suggest you read some introductory Python docs, like http://docs.python.org/tut/tut.html o

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
I think I know now where my problems come from. I spare you boring implementation code. The case look like this: I parse xml file something a like 1 <\a> 2 <\a> 3 <\a> 4<\b> <\X> <\a> <\a> <\a> <\b> <\X> I suc

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Jerry Hill
On 11/10/06, consternation <[EMAIL PROTECTED]> wrote: result:isinstance(x,X)Falsetype(x) is XFalselistI think you need to show us more of your code.  Your variable, v, is not of type X in this example.  Instead, it is of type list.  What is self.mem.items()?  It isn't a dictionary like your commen

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, consternation wrote: > Thank You for reply but > I found solution suggested by You in a tutorial yesterday. For some reason > it doesn't work in my case. > > code: > #mem-dictionary in Y class for storing objects > #Y doesn't inherit from X > for (i,v) in self.m

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
Thank You for reply but I found solution suggested by You in a tutorial yesterday. For some reason it doesn't work in my case. code: #mem-dictionary in Y class for storing objects #Y doesn't inherit from X for (i,v) in self.mem.items(): print " isinstance(x,X)" print isins

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread paul . keating
This doesn't answer your whole post because it asked a lot of questions. But as to finding out whether something is an instance of a class: class X(object): # ... defined as in your post >>> x = X('Fred') >>> x class X contains: >>> type(x) is X True >>> isinstance(x,X) True >>> x.__class__

newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
I can't find neither in tutorial nor with google It's all about isinstance, or __class__. How to test that an object is an instance of my X class?? Do I have this problems because I stre my objects in a dict? I wrote a class X like this : class X(object): def __init__(self,name):

Re: jython newbee general question docu / os.fstat

2006-02-05 Thread Diez B. Roggisch
Mark Fink schrieb: > Hi there, > > unfortunately I am new to Jython and my "Jython Essentials" book is > still in the mail. I looked into the Jython API Doc but could not find > the information. > I am porting a Python library to Jython and some parts are missing. My > question basically is where

jython newbee general question docu / os.fstat

2006-02-05 Thread Mark Fink
Hi there, unfortunately I am new to Jython and my "Jython Essentials" book is still in the mail. I looked into the Jython API Doc but could not find the information. I am porting a Python library to Jython and some parts are missing. My question basically is where do I find information on what to

Python Exercises for Newbee

2005-11-04 Thread Mostapha Amenchar
http://www.upriss.org.uk/python/PythonCourse.html -- http://mail.python.org/mailman/listinfo/python-list

Re: sudo open() ? (python newbee question)

2005-06-14 Thread Dan Sommers
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

Re: sudo open() ? (python newbee question)

2005-06-14 Thread TZOTZIOY
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 switc

Re: sudo open() ? (python newbee question)

2005-06-14 Thread Dan Sommers
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 roo

Re: sudo open() ? (python newbee question)

2005-06-14 Thread Denis WERNERT
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 pyth

sudo open() ? (python newbee question)

2005-06-14 Thread slava
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 -- http://mail.python.org/mailman/li

Re: Newbee question : List of packages

2005-06-01 Thread Simon Brunning
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

Newbee question : List of packages

2005-06-01 Thread Sébastien V.
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

Re: Python Exercises for Newbee

2005-05-30 Thread Bruno Desthuilliers
Kanthi Kiran Narisetti a écrit : > Hi ALL, > > I am Windows Administrator, moving little ahead from batch files and > scripts I started learning Python. I found that Python is very easy and > is very well documented. Still I am looking more than examples. As a > beginner i want to do lot of excers

Re: Python Exercises for Newbee

2005-05-30 Thread vincent wehren
"Kanthi Kiran Narisetti" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | Hi ALL, Hi to you too! | | I am Windows Administrator, moving little ahead from batch files and | scripts I started learning Python. I found that Python is very easy and | is very well documented. Still

Python Exercises for Newbee

2005-05-30 Thread Kanthi Kiran Narisetti
Hi ALL, I am Windows Administrator, moving little ahead from batch files and scripts I started learning Python. I found that Python is very easy and is very well documented. Still I am looking more than examples. As a beginner i want to do lot of excersice from simple addition to complex ...which