Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread spir
On 01/25/2014 05:14 AM, Steven D'Aprano wrote: On Fri, Jan 24, 2014 at 10:28:09PM -0500, bob gailer wrote: And please call () parends and [] brackets, and{} braces. Saves a lot of confusion. If you think that parentheses are spelt with a d, you're certainly confused :-) They're all

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread Mark Lawrence
On 25/01/2014 03:28, bob gailer wrote: And please call () parends and [] brackets, and{} braces. Saves a lot of confusion. Not in the UK or Australia, with the former being where English came from. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread bob gailer
On 1/24/2014 10:28 PM, bob gailer wrote: Sorry for misspelling parens. My reason for requesting the various names is that it makes communication clear, explicit and terse. When someone says just brackets what does he actually mean? For more grins see

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread Alan Gauld
On 25/01/14 19:39, bob gailer wrote: On 1/24/2014 10:28 PM, bob gailer wrote: Sorry for misspelling parens. My reason for requesting the various names is that it makes communication clear, explicit and terse. When someone says just brackets what does he actually mean? In UK English speaking

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread Steven D'Aprano
On Sat, Jan 25, 2014 at 09:11:56AM +0100, spir wrote: As a foreigner, I noticed that english native speakers use both the series round / square / curly / angle brackets, and individual terms parens (no 'd' ;-) / brackets / braces / chevrons. No major issue, except for 'brackets' which can

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread Steven D'Aprano
On Sat, Jan 25, 2014 at 02:39:11PM -0500, bob gailer wrote: On 1/24/2014 10:28 PM, bob gailer wrote: Sorry for misspelling parens. My reason for requesting the various names is that it makes communication clear, explicit and terse. When someone says just brackets what does he actually

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread Mark Lawrence
On 26/01/2014 01:55, Steven D'Aprano wrote: This is an international forum, and English an international language with many slight differences between variations and dialects. Even in American English alone, there are ambiguous terms. Coke could mean a beverage by the Coca-Cola company, a

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-25 Thread spir
On 01/26/2014 02:12 AM, Steven D'Aprano wrote: On Sat, Jan 25, 2014 at 09:11:56AM +0100, spir wrote: As a foreigner, I noticed that english native speakers use both the series round / square / curly / angle brackets, and individual terms parens (no 'd' ;-) / brackets / braces / chevrons. No

[Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Tobias Quezada
hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal. fp=open(prez.dat,r)x=fp.read(print(x)***i used fp for file pointer.I am using windows 7 and it works but on ubuntu 12.04 LTS i get this

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Keith Winston
The file would appear to not be on your search path, that is, in any directory in which Python is expecting to find it. Either move it to a directory on your path, or change your path to include it's location. The easiest way to find out what your path is, that I know, is import sys sys.path

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Keith Winston
I should have mentioned, the other possibility is that the file does not, in fact, exist, but I assume you put it out there somewhere? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Peter Otten
Tobias Quezada wrote: hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal. fp=open(prez.dat,r)x=fp.read(print(x)***i used fp for file pointer.I am using windows 7 and it works but on

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Steven D'Aprano
Hi Tobias, and welcome. On Thu, Jan 23, 2014 at 07:34:18PM -0700, Tobias Quezada wrote: hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal. fp=open(prez.dat,r) x=fp.read

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Steven D'Aprano
On Fri, Jan 24, 2014 at 04:22:20AM -0500, Keith Winston wrote: The file would appear to not be on your search path, that is, in any directory in which Python is expecting to find it. Python does not use a search path for the open() function, only for imports. With open(), it uses a simple

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread maxin...@gmail.com
hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal. fp=open(prez.dat,r)x=fp.read(print(x)***i used fp for file pointer.I am using windows 7 and it works but on ubuntu 12.04 LTS i get this

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Alan Gauld
On 24/01/14 02:34, Tobias Quezada wrote: fp=open(prez.dat,r) x=fp.read (print(x) /IOError: [Errno 2] No such file or directory: 'prez.dat'/ Python can't see your file. You can check what python is seeing by importing os and using listdir(): import os os.listdir(',') # . is the current

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Keith Winston
On Fri, Jan 24, 2014 at 4:50 AM, Steven D'Aprano st...@pearwood.info wrote: Python does not use a search path for the open() function, only for imports. With open(), it uses a simple rule: - absolute paths will look only in that exact location; - relative paths are always relative to the

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Danny Yoo
Ah! I was just running into this... I did not know that. So there's no way to get it to search a path (other than coding some string concatenation of path names or something, of course) to open a file? Potentially distutils.spawn.find_executable might apply,

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Steven D'Aprano
On Fri, Jan 24, 2014 at 04:31:49PM -0500, Keith Winston wrote: On Fri, Jan 24, 2014 at 4:50 AM, Steven D'Aprano st...@pearwood.info wrote: Python does not use a search path for the open() function, only for imports. With open(), it uses a simple rule: - absolute paths will look only in

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread bob gailer
On 1/24/2014 4:47 AM, Steven D'Aprano wrote: Hi Tobias, and welcome. On Thu, Jan 23, 2014 at 07:34:18PM -0700, Tobias Quezada wrote: hello community,i am a newbie to python and program in general. the script below works in python 2.7.3 on windows but not in the python 2.7.3 ubuntu terminal.

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread Steven D'Aprano
On Fri, Jan 24, 2014 at 10:28:09PM -0500, bob gailer wrote: And please call () parends and [] brackets, and{} braces. Saves a lot of confusion. If you think that parentheses are spelt with a d, you're certainly confused :-) They're all brackets. Often the type of bracket doesn't matter, but

Re: [Tutor] code works in windows command but not ubuntu terminal

2014-01-24 Thread eryksun
On Fri, Jan 24, 2014 at 8:38 PM, Steven D'Aprano st...@pearwood.info wrote: However, there's more to it than this. For starters, you need to decide on the exact behaviour. Clearly, file not found errors should move on to try the next prefix in the path list. But what about permission denied