[Tutor] os.path.join question

2007-05-03 Thread Jason Coggins
Is it possible to use os.path.join to link to a file located in the directory 
above where you are currently located?

If so, what is the syntax?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] What's wrong with this?

2007-05-03 Thread Jason Coggins
I have the following function in a program:

os.popen('filename.py')

What I want to do is launch the program in the os.popen() function.  The file I 
am trying to launch is located in the same directory as the program the 
function is contained in.  I also use Linux if that makes a difference.

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] exec syntax

2007-05-05 Thread Jason Coggins
Would someone please provide me with a simple example of the syntax to use the 
exec command to open a file.

I can see how to use it to execute a script of code embedded in the program 
(that example was provided in the documentation) but I cannot figure out the 
syntax to use it to run another python program in another file.

Thanks,

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] base directory

2007-05-05 Thread Jason Coggins
I am new to Linux.  On Windows the base directory is c:\.  If I wanted to open 
a file in a specific location in windows I would use a path such as 
c:\programs\fileName.py.

What is the base directory for Linux?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] command lines

2007-05-06 Thread Jason Coggins
Is there a way to send a command to the Linux Terminal from inside a Python 
program?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Command Line Promps

2007-06-03 Thread Jason Coggins
Is it possible to have a Python program issue a command line promp to the 
terminal while the program is running?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Command Line Promps

2007-06-03 Thread Jason Coggins
I am using Linux and yes I am wanting the program to run another program.  I 
have tried these before but, if I remember correctly, these methods caused 
the original program to "freeze" while waiting on the "spawned" program to 
return a value (usually either true or false).  I am planning on having the 
program start another program and then exit the original program after the 
second program is started but before the second program ends.  I will take 
another look at these to see if I can work around the "freezing" problem 
because I have a little more experience then when I tried it the first time.

I used the reply button to send a reply to the first message.  I did not 
realize it would send the reply directly to you instead of the list.  I have 
tried to send this reply to the list.

Thanks,

Jason

- Original Message - 
From: "Bob Gailer" <[EMAIL PROTECTED]>
To: "Jason Coggins" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, June 03, 2007 4:24 PM
Subject: Re: [Tutor] Command Line Promps


> Please always reply to the list, not just me. We are all working on these 
> questions and we all learn from them.
>
> Jason Coggins wrote:
>> These seem to be ways of getting imput from the user.  I do not want to 
>> send a command line to the user (for example, in the form of a question) 
>> and get the users input.
>>
>> I want the Python program to open a terminal (if need be) and send a 
>> command to the computer (through the terminal) that the program is 
>> running on.
> I think what you really want is to have Python run another program. True?
>
> (Not that it matters a lot but which OS are you running?)
>
> See os.system() and os.popen()
>>
>> Sorry if I was not more clear on this earlier,
> Well it is often hard to be clear, but it sure saves time and energy.
>
> -- 
> Bob Gailer
> 510-978-4454
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Command Line Promps

2007-06-03 Thread Jason Coggins
Will the program that is started by the thread continue to run if the 
program that started the thread exits?

Jason

- Original Message - 
From: "jim stockford" <[EMAIL PROTECTED]>
To: "Jason Coggins" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, June 03, 2007 5:37 PM
Subject: Re: [Tutor] Command Line Promps


>
> sounds like threading is a solution.
>
> On Jun 3, 2007, at 2:05 PM, Jason Coggins wrote:
>
>> I am using Linux and yes I am wanting the program to run another program. 
>> I
>> have tried these before but, if I remember correctly, these methods 
>> caused
>> the original program to "freeze" while waiting on the "spawned" program 
>> to
>> return a value (usually either true or false).  I am planning on having 
>> the
>> program start another program and then exit the original program after 
>> the
>> second program is started but before the second program ends.  I will 
>> take
>> another look at these to see if I can work around the "freezing" problem
>> because I have a little more experience then when I tried it the first 
>> time.
>>
>> I used the reply button to send a reply to the first message.  I did not
>> realize it would send the reply directly to you instead of the list.  I 
>> have
>> tried to send this reply to the list.
>>
>> Thanks,
>>
>> Jason
>>
>> - Original Message -
>> From: "Bob Gailer" <[EMAIL PROTECTED]>
>> To: "Jason Coggins" <[EMAIL PROTECTED]>
>> Cc: 
>> Sent: Sunday, June 03, 2007 4:24 PM
>> Subject: Re: [Tutor] Command Line Promps
>>
>>
>>> Please always reply to the list, not just me. We are all working on 
>>> these
>>> questions and we all learn from them.
>>>
>>> Jason Coggins wrote:
>>>> These seem to be ways of getting imput from the user.  I do not want to
>>>> send a command line to the user (for example, in the form of a 
>>>> question)
>>>> and get the users input.
>>>>
>>>> I want the Python program to open a terminal (if need be) and send a
>>>> command to the computer (through the terminal) that the program is
>>>> running on.
>>> I think what you really want is to have Python run another program. 
>>> True?
>>>
>>> (Not that it matters a lot but which OS are you running?)
>>>
>>> See os.system() and os.popen()
>>>>
>>>> Sorry if I was not more clear on this earlier,
>>> Well it is often hard to be clear, but it sure saves time and energy.
>>>
>>> -- 
>>> Bob Gailer
>>> 510-978-4454
>>>
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> http://mail.python.org/mailman/listinfo/tutor
>>
> 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] ftp

2007-06-03 Thread Jason Coggins
What would be the best method to (1) check if there is a particular file 
available for download on the internet and (2) if the file is available, 
download the file to a particular directory.

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] example of spawn

2007-06-05 Thread Jason Coggins
Would someone please provide me a short, simple example of the spawn statement. 
 I am having trouble figuring the syntax out.

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] example of spawn

2007-06-05 Thread Jason Coggins
In the example listed below, reproduced from the web page you recommended, 
what does `cp`, `cp` and `/dev/null` do?  I am assuming `index.html` is the 
name of the program that will be launched.

example:--
os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')


Jason

- Original Message - 
From: "Alan Gauld" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, June 05, 2007 5:32 PM
Subject: Re: [Tutor] example of spawn


> "Jason Coggins" <[EMAIL PROTECTED]> wrote
>
>> Would someone please provide me a short, simple
>> example of the spawn statement.
>> I am having trouble figuring the syntax out.
>
> There are two examples in the os module documentation.
>
> http://docs.python.org/lib/os-process.html
>
>
> What part do you not understand?
>
>
> -- 
> Alan Gauld
> Author of the Learn to Program web site
> http://www.freenetpages.co.uk/hp/alan.gauld
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] the bios serial number

2008-02-15 Thread Jason Coggins
How do you pull up the bios serial number in Python?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Processing .NK2 files

2008-02-15 Thread Jason Coggins
How can I check the speed of the internet connection in Python?

Jason___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor