Re: [Tutor] Running Existing Python

2011-02-26 Thread Justin Bonnell
Okay. When I try to run the script from the terminal, it still doesn't work. Here is a screenshot. <> What am I doing wrong? On Feb 25, 2011, at 6:46 PM, Alan Gauld wrote: > > "Justin Bonnell" wrote > >> Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. >> build 5664

Re: [Tutor] accessing another system's environment

2011-02-26 Thread ALAN GAULD
Bill, That's the same thing we are talking about. The problem is those environment variables are highly variable so you can't talk about a machine's environment. Two users on the same machine (at the same time) may have very different environments. And a batch file or program can add or remove v

Re: [Tutor] Running Existing Python

2011-02-26 Thread ALAN GAULD
The error says it can't find the file hello.py. That means its probably in some other folder or you need to specify the full or relative path to the file This is a MacOS issue not Python, its how your MacOS shell is searching for the file. If it is in the same folder try explicitly telling MacOS

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Steve Willoughby
On 26-Feb-11 01:19, ALAN GAULD wrote: Bill, That's the same thing we are talking about. The problem is those environment variables are highly variable so you can't talk about a machine's environment. Two users on the same machine (at the same time) may have very different environments. And a bat

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Alan Gauld
"Corey Richardson" wrote I'm slightly concerned about performance when it comes to reading/writing to disk a lot when doing things like that, since if this thing ever needs to scale I want it to be able to do that. There is always an overhead but it depends what you mean by "a lot". You m

Re: [Tutor] Running Existing Python

2011-02-26 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Justin Bonnell wrote: Okay. When I try to run the script from the terminal, it still doesn't work. Here is a screenshot. What am I doing wrong? 1) You're top-posting. Put your responses after the quote you're responding to. 2) You're trying to include graphic

Re: [Tutor] accessing another system's environment

2011-02-26 Thread David
On 25 February 2011 14:30, Bill Allen wrote: > > I have times when it is useful for me to check the environment of a user > system on our lan remotely while trouble shooting and issue with them.  Now, > this is quite easy to do while I am using a windows system via the computer > management consol

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 05:33, Corey Richardson wrote: > Aha, that explains why I didn't get any results. Each file got its own > interpreter instance. > Not wanting to nit pick, but no: It's not that each *file* does has its own interpreter instance, it's that every python instance that you start d

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 05:33, Corey Richardson wrote: > > I'm slightly concerned about performance when it comes to > reading/writing to disk a lot when doing things like that, since if this > thing ever needs to scale I want it to be able to do that. > I'd be tempted to say you should not be worry

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Corey Richardson
On 02/26/2011 06:02 AM, Walter Prins wrote: > On 26 February 2011 05:33, Corey Richardson wrote: > >> Aha, that explains why I didn't get any results. Each file got its own >> interpreter instance. >> > > Not wanting to nit pick, but no: It's not that each *file* does has its own > interpreter i

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Corey Richardson
On 02/26/2011 06:05 AM, Walter Prins wrote: > I'd be tempted to say you should not be worrying about such performance > issues at this stage. Indeed, but I can't have every piece of variable information being saved to disk and then read back again every time a player leaves or enters a room, tha

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 11:06, Corey Richardson wrote: > I ran them like this: > python use1.py > python use2.py > python plib.py > > Each file got its own instance of the interpreter. > Yes, but not because instances are intrinsically linked to seperate python modules, which is what it sounds like

Re: [Tutor] accessing another system's environment

2011-02-26 Thread python
Bill, Coming into this thread late: If you are working with Windows workstations, try posting your question on the Python Windows API mailing list. http://mail.python.org/mailman/listinfo/python-win32 You may be able to use WMI (via Python) to accomplish what you're trying to do. Malcolm __

Re: [Tutor] Cross-Module Interaction

2011-02-26 Thread Walter Prins
On 26 February 2011 11:10, Corey Richardson wrote: > On 02/26/2011 06:05 AM, Walter Prins wrote: > > I'd be tempted to say you should not be worrying about such performance > > issues at this stage. > > Indeed, but I can't have every piece of variable information being saved > to disk and then re

Re: [Tutor] Running Existing Python

2011-02-26 Thread Steven D'Aprano
Justin Bonnell wrote: Okay. When I try to run the script from the terminal, it still doesn't work. Here is a screenshot. Please don't send screenshots except as a last resort. Just copy and paste the error message -- it is ordinary text in a terminal window. The error seems pretty straight-

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Walter Prins
On 26 February 2011 04:26, Bill Allen wrote: > Yes, that's it exactly.:-) > > I administrate the workstations in our engineering environment and some of > the major pieces of software we use are configured via the Windows system > environment variables. Being able to reach out to a PC and ch

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Steve Willoughby wrote: On 26-Feb-11 01:19, ALAN GAULD wrote: Bill, That's the same thing we are talking about. The problem is those environment variables are highly variable so you can't talk about a machine's environment. Two users on the same machine (at the same t

Re: [Tutor] accessing another system's environment

2011-02-26 Thread David
On 26 February 2011 22:42, Walter Prins wrote: > > On 26 February 2011 04:26, Bill Allen wrote: >> >> I administrate the workstations in our engineering environment and some of >> the major pieces of software we use are configured via the Windows system >> environment variables. Being able to re

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Modulok
I'm coming into this thread late so I might be off the mark here, but it seems like you're going about it backwards: Instead of trying to reach in and modify a user's environment, which is highly variable and process dependent, why not just wrap the software they're running? Have a python script w

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Modulok
On 2/26/11, Modulok wrote: ... > The server then replies with any variables that the client needs to > set and their values. You could do this with a python script running > on a server sending ajax responses. (There's an ajax module in the > standard library.) ... Sorry, I meant a 'json' module,

Re: [Tutor] accessing another system's environment

2011-02-26 Thread Bill Allen
Wow! What an overwhelming response to my inquiry. All the post have been very informative and have given me plenty to consider. I can see now this is a win32 api question, not really Python. There has been more than enough here to point to some resources for win32 api and I have found libra

[Tutor] Object, methods, class

2011-02-26 Thread Christopher Brookes
Hi, Is there in Python private/protected attributes in class like in other langage ? -- Brookes Christopher. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Object, methods, class

2011-02-26 Thread Knacktus
Am 26.02.2011 18:49, schrieb Christopher Brookes: Hi, Is there in Python private/protected attributes in class like in other langage ? Yes, there is. But it's protected by convention not compiler ;-). Check out this: http://docs.python.org/tutorial/classes.html#private-variables -- Brookes Chr

Re: [Tutor] Running Existing Python

2011-02-26 Thread Justin Bonnell
On Feb 26, 2011, at 4:49 AM, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Justin Bonnell wrote: >> Okay. When I try to run the script from the terminal, it still doesn't work. >> Here is a screenshot. >> >> >> >> >> >> What am I doing wrong? >> > 1) You're top-posting. Put your response

Re: [Tutor] Running Existing Python

2011-02-26 Thread Corey Richardson
On 02/26/2011 04:10 PM, Justin Bonnell wrote: > --This is the location of the file: > > /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py > > but it still says it cannot find the directory when I try to run it or cd to > it. Is there any way that I can tell which directory the

Re: [Tutor] Running Existing Python

2011-02-26 Thread Justin Bonnell
On Feb 26, 2011, at 3:29 AM, Alan Gauld wrote: This is really helpful directions and I am trying to follow what you're saying. I think you are getting my response to another person helping me so this will basically repeat what I was saying there. I am really new to this and am trying to learn

Re: [Tutor] Running Existing Python

2011-02-26 Thread शंतनू
On 27-Feb-2011, at 2:40 AM, Justin Bonnell wrote: > On Feb 26, 2011, at 4:49 AM, Dave Angel wrote: >> 3) You don't tell us where the hello.py file actually is. Presumably it's >> not in the current directory when you run that. Two cures for that: either >> specify its real location, >> p

Re: [Tutor] Running Existing Python

2011-02-26 Thread Dave Angel
On 02/26/2011 04:10 PM, Justin Bonnell wrote: On Feb 26, 2011, at 4:49 AM, Dave Angel wrote: On 01/-10/-28163 02:59 PM, Justin Bonnell wrote: Okay. When I try to run the script from the terminal, it still doesn't work. Here is a screenshot. What am I doing wrong? 1) You're top-posting

Re: [Tutor] Running Existing Python

2011-02-26 Thread Walter Prins
On 26 February 2011 21:18, Justin Bonnell wrote: > --I tried to follow this using: > /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py > which is the correct location of the hello.py file. > Try putting quotes around the full path. The problem is that the space between "Python" and "2

Re: [Tutor] Running Existing Python

2011-02-26 Thread Steven D'Aprano
Justin Bonnell wrote: --This is the location of the file: /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py I doubt that. Mac OS is a type of Unix, and it would shock me if it puts home directories (the jwbonnell/ part) directly under the file system root / My guess i

Re: [Tutor] Running Existing Python

2011-02-26 Thread Justin Bonnell
On Feb 26, 2011, at 3:18 PM, Corey Richardson wrote: > On 02/26/2011 04:10 PM, Justin Bonnell wrote: > >> --This is the location of the file: >> >> /jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py >> >> but it still says it cannot find the directory when I try to run it or cd

Re: [Tutor] Running Existing Python

2011-02-26 Thread Corey Richardson
On 02/26/2011 04:32 PM, Justin Bonnell wrote: > --My current working directory is not what I have been trying to cd to, so > I'm assuming that I am using the cd command wrong. > > I have tried: > > $ cd /jwbonnell/bin/Python\2.7/Extras/Demo/tkinter/guido > $ cd /jwbonnell/bin/Python\2.7/Extras/

Re: [Tutor] Object, methods, class

2011-02-26 Thread Steven D'Aprano
Christopher Brookes wrote: Hi, Is there in Python private/protected attributes in class like in other langage ? There's a short answer, a long answer, and an even longer answer. The short answer is No. The long answer is, not exactly. Python has private names, but they are not enforced by t

Re: [Tutor] Running Existing Python

2011-02-26 Thread Steven D'Aprano
Justin Bonnell wrote: --My current working directory is not what I have been trying to cd to, so I'm assuming that I am using the cd command wrong. You don't need to cd into the current working directory. You're already there. That's what "working directory" means -- the directory you just

Re: [Tutor] Running Existing Python

2011-02-26 Thread ALAN GAULD
--This is the location of the file: > > >/jwbonnell/bin/Python 2.7/Extras/Demo/tkinter/guido/hello.py > > >but it still says it cannot find the directory when I try to run it or cd to >it. > >As an obvious beginner with the shell the easiest way to change folder is MacOS is to use the Finder.

Re: [Tutor] Object, methods, class

2011-02-26 Thread Alan Gauld
"Christopher Brookes" wrote Is there in Python private/protected attributes in class like in other langage ? Steven has given you a comprehensive answer but as a bit of history none of the early OOP languages used public/protected/private etc. They either made all variables private (Smallta

[Tutor] python module to search a website

2011-02-26 Thread vineeth
Hello all, I am looking forward for a python module to search a website and extract the url. For example I found a module for Amazon with the name "amazonproduct", the api does the job of extracting the data based on the query it even parses the url data. I am looking some more similar query

Re: [Tutor] python module to search a website

2011-02-26 Thread Corey Richardson
On 02/26/2011 10:11 PM, vineeth wrote: > Hello all, > > I am looking forward for a python module to search a website and extract > the url. What website, what is it searching for, and what URL is it looking for? > > For example I found a module for Amazon with the name "amazonproduct", > the

Re: [Tutor] python module to search a website

2011-02-26 Thread Bill Allen
n Sat, Feb 26, 2011 at 21:11, vineeth wrote: > Hello all, > > I am looking forward for a python module to search a website and extract > the url. > > For example I found a module for Amazon with the name "amazonproduct", the > api does the job of extracting the data based on the query it even par

Re: [Tutor] Object, methods, class

2011-02-26 Thread Knacktus
Once again a very insightfull answer. Much appreciated! Same to you, Alan. I paricularly like the "even longer answer". It remindes us of how lucky we are using Python and brings me light in dark times when I wish I had better code completion in my IDE for my own spaghetti-code ;-)) ___

Re: [Tutor] python module to search a website

2011-02-26 Thread vineeth
Hi Bill, Thanks for the reply, I know how the urllib module works I am not looking for scraping. I am looking to obtain the html page that my query is going to return. Just like when you type in a site like Amazon you get a bunch of product listing the module has to search the website and ret