Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Alan Gauld
On 01/06/12 00:18, Dave wrote: Thanks. I like the integer-based option. Since this is my first question to the list, is it appropriate to reply with a "thanks, that solved it" or is that considered unnecessary? Its not necessary but its not frowned on either. It is most useful where numerous

Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Dave
Thanks. I like the integer-based option. Since this is my first question to the list, is it appropriate to reply with a "thanks, that solved it" or is that considered unnecessary? On Thu, May 31, 2012 at 6:30 PM, Emile van Sebille wrote: > On 5/31/2012 3:21 PM Dave said... > > Hi. What is the

Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Emile van Sebille
On 5/31/2012 3:21 PM Dave said... Hi. What is the right way to have an iPython script check to see if the user is currently root? Googling for "python check if user is root" yields the answer: import os, sys # if not root...kick out if not os.geteuid()==0: sys.exit("\nOnly root can run t

Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Corey Richardson
On Thu, 31 May 2012 18:21:22 -0400 Dave wrote: > Hi. What is the right way to have an iPython script check to see if > the user is currently root? > > Here's how I do it in bash scripts: > > > ## CHECK USERNAME PRIVILEGE > > > if [ $(i

Re: [Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Alan Gauld
On 31/05/12 23:21, Dave wrote: Hi. What is the right way to have an iPython script check to see if the user is currently root? I don;t know anything much about ipython but so far as IO know its just a shell on standard python so: os.getuid() should work. In general if you are trying to repl

[Tutor] iPython check if user running script is root user (Linux)

2012-05-31 Thread Dave
Hi. What is the right way to have an iPython script check to see if the user is currently root? Here's how I do it in bash scripts: ## CHECK USERNAME PRIVILEGE if [ $(id -u) != "0" ];then echo "This script must be run as root."

Re: [Tutor] How install Pyramid on a Windows 7 computer?

2012-05-31 Thread James Reynolds
I don't think django 1.5 is ready, but they are targeting python3k. There is a fork of django i think on bitbucket that works as well. On May 31, 2012 12:33 PM, "Vince Spicer" wrote: > Step 1) install Ubuntu > > OK sorry couldn't resist. > > This should help. > > http://docs.pylonsproject.org/pr

Re: [Tutor] How install Pyramid on a Windows 7 computer?

2012-05-31 Thread Vince Spicer
Step 1) install Ubuntu OK sorry couldn't resist. This should help. http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html#installing-pyramid-on-a-windows-system Vince On Thu, May 31, 2012 at 10:20 AM, Tamar Osher wrote: > Months ago, I learned Python version 3. I have re

[Tutor] How install Pyramid on a Windows 7 computer?

2012-05-31 Thread Tamar Osher
Months ago, I learned Python version 3. I have read a few books, and want to learn how to use Python for the web. Pyramid is a Python web framework that is ready for Python version 3, but I don't know how to install it on my Windows 7 computer. Online, there are no Pyramid installation instr

[Tutor] separately updating parameters

2012-05-31 Thread Zsolt Turi
Dear Pythonists, I'm using Python 2.7. on Win 7. Problem description: Currently, I am working on a reinforcement learning paradigm, where I would like to update Qa values with alfaG [if decision_input = 1 and feedback_input = 1] or with alfaL [ if decision_input = 1 and feedback_value = 0]. (