On 20/06/11 08:14:14, Florencio Cano wrote:
This works:
infile=open('/foo/bar/prog/py_modules/this_is_a_test','r')
This doesn't:
infile=open('~/prog/py_modules/this_is_a_test','r')
Can't I work with files using Unix expressions?
You can use the glob module:
http://docs.python.org/library/glob
On Sun, 19 Jun 2011 23:00:38 -0700, Tim Hanson wrote:
> This works:
> infile=open('/foo/bar/prog/py_modules/this_is_a_test','r')
>
> This doesn't:
> infile=open('~/prog/py_modules/this_is_a_test','r')
>
> Can't I work with files using Unix expressions?
The argument is treated literally, just li
On Sun, Jun 19, 2011 at 11:00 PM, Tim Hanson wrote:
> Using linux and Python 2.6, learning how to work with files from a Windows
> oriented textbook:
>
> This works:
> infile=open('/foo/bar/prog/py_modules/this_is_a_test','r')
>
> This doesn't:
> infile=open('~/prog/py_modules/this_is_a_test','r')
On Mon, 2011-06-20 at 08:14 +0200, Florencio Cano wrote:
> > This works:
> > infile=open('/foo/bar/prog/py_modules/this_is_a_test','r')
> >
> > This doesn't:
> > infile=open('~/prog/py_modules/this_is_a_test','r')
> >
> > Can't I work with files using Unix expressions?
>
> You can use the glob mod
> This works:
> infile=open('/foo/bar/prog/py_modules/this_is_a_test','r')
>
> This doesn't:
> infile=open('~/prog/py_modules/this_is_a_test','r')
>
> Can't I work with files using Unix expressions?
You can use the glob module:
http://docs.python.org/library/glob.html#module-glob
--
http://mail.p
>>> That also pops up a command shell window, which may not be
>>> desirable. On Windows, there is
>>> os.startfile("someknown.type")
Ack. You're right. I get them mixed up. And os.startfile is Windows
only.
Sorry.
rd
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>In <[EMAIL PROTECTED]>,
>BartlebyScrivener wrote:
>
It would probably break like mad under *nix
>>
>> I bet it would work the same way on linux or os x; it's the equivalent
>> of double-clicking on the file.
In <[EMAIL PROTECTED]>,
BartlebyScrivener wrote:
>>> It would probably break like mad under *nix
>
> I bet it would work the same way on linux or os x; it's the equivalent
> of double-clicking on the file.
No it doesn't work. Double clicking is not an OS thing but a a GUI thing.
Ciao,
>> It would probably break like mad under *nix
I bet it would work the same way on linux or os x; it's the equivalent
of double-clicking on the file.
rd
--
http://mail.python.org/mailman/listinfo/python-list
BartlebyScrivener wrote:
> don't know Jython, but in Python, I think you want:
>
> import os
>
> os.system('mytextfile.txt')
>
> Whatever file you reference should open in the application associated
> with it. At least that's the way it works on Win XP
>
> rd
I didn't think about that. It would pr
don't know Jython, but in Python, I think you want:
import os
os.system('mytextfile.txt')
Whatever file you reference should open in the application associated
with it. At least that's the way it works on Win XP
rd
--
http://mail.python.org/mailman/listinfo/python-list
"spike grobstein" write:
> I understand why it wasn't working and it makes sense based on the
> structure of namespaces that python defines, however, I'm just
> surprised that there isn't some kind of built-in facility for dealing
> with these types of things.
>
> Module packages are a spectacular
I understand why it wasn't working and it makes sense based on the
structure of namespaces that python defines, however, I'm just
surprised that there isn't some kind of built-in facility for dealing
with these types of things.
Module packages are a spectacular idea, it is just kinda easy to get
c
spike grobstein wrote:
> so, since python supports module packages like it does, you'd think
> that it would have ways of making add-on or extension modules to be
> more self contained.
Errm... You're not quite understanding what the problem is about. A class is
just an object. A class object may
oh, wow. that works!!!
thanks for the help!
so, since python supports module packages like it does, you'd think
that it would have ways of making add-on or extension modules to be
more self contained.
Thanks, again!
--
http://mail.python.org/mailman/listinfo/python-list
spike grobstein wrote:
> I'd like the packages to define a file path for supporting files
> (graphics, etc) that are stored inside the package. The problem is that
> the superclass's definition (stored elsewhere) has all of the code for
> actually opening the files, so when I use the
> os.path.dirn
16 matches
Mail list logo