> Always prefer to use env over a hardcoded path, because that hardcoded
> path will invariably be wrong. (Yes, for those about to nitpick, it's
> conceivable that env might be somewhere other than /usr/bin. However,
> that is very rare and results in a no-win situations regardless of the
> issue
>> Yes, but your mod_python programs still run with the privileges of the
>> Apache process, as are all the other mod_python programs. This means that
>> my mod_python program can (at least) read files belonging to you -
>> including your config file holding your database password
>
> I think
Hi group,
xtopdf: PDF creation / conversion toolkit: alpha release of v1.3
This is actually a somewhat preliminary announcement, but may be of
interest to developers / users who know Python and/or have earlier
checked out my xtopdf PDF creation / conversion toolkit:
I've released (via my web si
I'll be out of the office until approximately August 20th. If you have any
questions, please email [EMAIL PROTECTED]
-- David Wahler
--
http://mail.python.org/mailman/listinfo/python-list
I'll be out of the office until approximately August 20th. If you have any
questions, please email [EMAIL PROTECTED]
-- David Wahler
--
http://mail.python.org/mailman/listinfo/python-list
I'll be out of the office until approximately August 20th. If you have any
questions, please email [EMAIL PROTECTED]
-- David Wahler
--
http://mail.python.org/mailman/listinfo/python-list
Patch / Bug Summary
___
Patches : 402 open ( +6) / 3360 closed ( +6) / 3762 total (+12)
Bugs: 861 open ( -3) / 6114 closed (+27) / 6975 total (+24)
RFE : 228 open ( +2) / 234 closed ( +0) / 462 total ( +2)
New / Reopened Patches
__
Replace t
Andre Meyer wrote:
> Am I missing something here? What is the preferred pythonic way of
> implementing singleton elegantly?
>
> Thanks for your help
> André
Hi Andre,
You might also google for
python borg pattern
As a discussion on the 'borg' design pattern might be informative.
- Pad.
--
ht
Kevin M wrote:
> Inline
>
> > 1.) Why are you removing the .pyc file?
>
> After I had run the script once and subsequently changed the class
> file, I would run the script again, and it would use the pyc file from
> the older revision of the script. I got frustrated with having to
> manually delet
Ch3ru5 wrote:
> Hi,
> I want to write an avi to flv converter in php but i am a complete
> newbie to it.
>
> I would like to know the basic flow of entire process of how a
> converter code is written
> (ie. the basic algorithm ) .
>
> Example: "You first create an flv stream , then compress the av
Anyone have advice for importing the logging module using MacPython 2.4.3?
MacPython installs the logging module in:
/Library/Frameworks/Python.framework/Versions/2.4/lib/logging/
There's an __init__.py there and everything, but this directory is not
in sys.path. I add it to sys.path as follows:
Okay, so here is the situation. I have need to do some on-the-fly image
creation. I have everything working great except for the last part of it,
applying a perspective type transform to the image. The transform will take
a rectangular 2D image and transform it to a 3D representation in 2D.
Petr Jake wrote:
> I have a standard 12-key mobile phone keypad connected to my Linux
> machine as a I2C peripheral. I would like to write a code which allows
> the text entry to the computer using this keypad (something like T9 on
> the mobile phones)
>
> According to the http://www.yorku.ca/mack
Petr Jake wrote:
> I have a standard 12-key mobile phone keypad connected to my Linux
> machine as a I2C peripheral. I would like to write a code which allows
> the text entry to the computer using this keypad (something like T9 on
> the mobile phones)
>
> According to the http://www.yorku.ca/mac
Inline
> 1.) Why are you removing the .pyc file?
After I had run the script once and subsequently changed the class
file, I would run the script again, and it would use the pyc file from
the older revision of the script. I got frustrated with having to
manually delete the pyc file before rerunnin
Hi,
I want to write an avi to flv converter in php but i am a complete
newbie to it.
I would like to know the basic flow of entire process of how a
converter code is written
(ie. the basic algorithm ) .
Example: "You first create an flv stream , then compress the avi code ,
then copy that code in
[EMAIL PROTECTED] wrote:
> alf wrote:
>
>>I have one thread app using SocketServer and use server_forever() as a
>>main loop. All works fine, but now I need certain timer checking let's
>>say every 1 second something and stopping the main loop. So questions are:
>> -how to stop serve_forever
"Noah" <[EMAIL PROTECTED]> writes:
> I know I could do this long-form:
> q = []
> y = [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> ...
y = [tuple(reversed(t)) for t in y]
--
http://mail.python.org/mailman/listinfo/python-list
Shuaib wrote:
> Hey again,
>
> I am using the latest python available on my system (2.4). So I don't
> think that's the problem.
>
> Any more ideas? Do I need to install Tkinter as a seperate
> module/package? As I said, I've already installed Tcl/Tk, though.
This is a wild guess, but I just ins
I'm sorry. I didn't mean to offend you. I never thought your way was
inferior.
Justin Azoff wrote:
> [EMAIL PROTECTED] wrote:
> > I do appreciate the advice, but I've got a 12 line function that does
> > all of that. And it works! I just wish I understood a particular line
> > of it.
>
> You
[EMAIL PROTECTED] wrote:
> I do appreciate the advice, but I've got a 12 line function that does
> all of that. And it works! I just wish I understood a particular line
> of it.
>
> def getFileList(*extensions):
> import os
> imageList = []
> for dirpath, dirnames, files in os.walk('.
[EMAIL PROTECTED] wrote:
> I do appreciate the advice, but I've got a 12 line function that does
> all of that. And it works! I just wish I understood a particular line
> of it.
You miss the point. The functions I posted, up until get_files_by_ext
which is the equivalent of your getFileList, to
sorry ... i replied to sender instead of all ... so here we go again ...
>>>t = [('a', 1.0), ('b',2.0),('c',3.0)]
>>>t = [s[::-1] for s in t]
>>>print t
[(1.0, 'a'), (2.0, 'b'), (3.0, 'c')]
>>>
>From: "Paul McGuire" <[EMAIL PROTECTED]>
>To: python-list@python.org
>Subject: Re: How to reverse t
I do appreciate the advice, but I've got a 12 line function that does
all of that. And it works! I just wish I understood a particular line
of it.
def getFileList(*extensions):
import os
imageList = []
for dirpath, dirnames, files in os.walk('.'):
for filename in files:
[EMAIL PROTECTED] wrote:
> I've narrowed down the problem. All the problems start when I try to
> eliminate the hidden files and directories. Is there a better way to
> do this?
>
Well you almost have it, but your problem is that you are trying to do
too many things in one function. (I bet I am
"Noah" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a list of tuples
> [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
> [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
>
>>> tups = [('a', 1.0), ('b', 2.0), ('c', 3.0)]
>>>
That worked perfectly. Thank you. That was exactly what I was looking
for. However, can you explain to me what the following code actually
does?
reversed(range(len(dirnames)))
Gabriel Genellina wrote:
> At Tuesday 8/8/2006 21:11, [EMAIL PROTECTED] wrote:
>
>
> >Here's my code:
> >
> >def getF
I've narrowed down the problem. All the problems start when I try to
eliminate the hidden files and directories. Is there a better way to
do this?
[EMAIL PROTECTED] wrote:
> I'm new at Python and I need a little advice. Part of the script I'm
> trying to write needs to be aware of all the file
At Tuesday 8/8/2006 21:11, [EMAIL PROTECTED] wrote:
Here's my code:
def getFileList():
import os
imageList = []
for dirpath, dirnames, filenames in os.walk(os.getcwd()):
for filename in filenames:
for dirname in dirnames:
John Machin wrote:
> print [i, len(x.data), id(x) for i, x in enumerate(arrTests)]
but should have written:
print [(i, len(x.data), id(x)) for i, x in enumerate(arrTests)]
--
http://mail.python.org/mailman/listinfo/python-list
thebjorn wrote:
> I'm working with a MS SQL Server database created by a program from a
> fine US company who seems to have gotten run over by the Unicode truck.
> In their infinite wisdom they've decided to store Unicode data directly
> in regular varchar fields, utf-8 encoded! (on the bright sid
Thanks for all the good pointers!
I am still reading throught them, but Boost seems to be the way to go!
Roman Yakovenko wrote:
> On 8 Aug 2006 02:28:31 -0700, Qun Cao <[EMAIL PROTECTED]> wrote:
> > Hi Everyone,
> >
> > I am a beginner on cross language development. My problem at hand is to
> > bu
Something's really not reliable in my logic. I say this because if I
change the extension to .png then a file in a hidden directory (one the
starts with '.') shows up! The most frustrating part is that there are
.jpg files in the very same directory that don't show up when it
searches for jpegs.
Thanks Diez,
It is a good relief that I only need to wrap the classes I need. I
decide to try Boost first because it seems to have a wider audience
than SIP, but I would definately look into SIP if I want to do Qt
development in the future.
Diez B. Roggisch wrote:
> > Since the main program is s
Erik Max Francis wrote:
> Noah wrote:
>
>> But it seems like there should be a clever way to do this with
>> a list comprehensions. Problem is I can't see how to apply
>> reverse() to each tuple in the list because reverse() a
>> list method (not a tuple method) and because it operates
>> in-pla
Noah wrote:
> I have a list of tuples
> [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
> [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
>
> I know I could do this long-form:
> q = []
> y = [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> for i i
Noah wrote:
> I have a list of tuples
> [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
> [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
>
> I know I could do this long-form:
> q = []
> y = [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> for i
Here's my code:
def getFileList():
import os
imageList = []
for dirpath, dirnames, filenames in os.walk(os.getcwd()):
for filename in filenames:
for dirname in dirnames:
if not dirname.startswith('.'):
Kevin M wrote:
> Figures. I'll try to complicate it sufficiently ;)
>
>
> [edit] I was going to try to sum up what goes on, but I realized that I
> was retyping what I already programmed in an effort to better
> illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's
> only around 200 l
Noah wrote:
> I have a list of tuples
> [('a', 1.0), ('b', 2.0), ('c', 3.0)]
> I want to reverse the order of the elements inside the tuples.
> [(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
Python 2.4+:
y = [tuple(reversed(t)) for t in y]
--
Robert Kern
"I have come to believe that the whole
Noah wrote:
> But it seems like there should be a clever way to do this with
> a list comprehensions. Problem is I can't see how to apply
> reverse() to each tuple in the list because reverse() a
> list method (not a tuple method) and because it operates
> in-place (does not return a value). Thi
bjorn:
> I also
> tried creating an Excel VB macro using the StrConv function, but (a) it
> isn't entirely clear to me that this function can do this, and (b) the
> third argument to the function is an LCID, a Locale ID, which is
> numeric and not defined anywhere I can find it...
http://www.micr
I have a list of tuples
[('a', 1.0), ('b', 2.0), ('c', 3.0)]
I want to reverse the order of the elements inside the tuples.
[(1.0,'a'), (2.0, 'b'), (3.0, 'c')]
I know I could do this long-form:
q = []
y = [('a', 1.0), ('b', 2.0), ('c', 3.0)]
for i in y:
t=list(t)
[EMAIL PROTECTED]
> Admittedly this problem causes no actual functional issues aside from
> an occasional error message when the program exits. The error is:
>
> Unhandled exception in thread started by
> Error in sys.excepthook:
> Original exception was:
>
> Yes all that info is blank.
That's ty
On 2006-08-08 19:02:27, Stephen Kellett wrote:
> In message <[EMAIL PROTECTED]>,
> Gerhard Fiedler <[EMAIL PROTECTED]> writes
>>conclusion for me: they must not like self-documenting code... :)
>
> Oh dear. So if the code is wrong it is self documenting?
?? I'm not sure you are actually respond
Qun Cao wrote:
> I have a C++ class foo.cpp, defined in foo.h, I wrote a wrapper class
> for it to generate a python module.
>
> #include "Foo.h"
If you are on Windows it shouldn't matter but try to keep
capitalisation consistent: #include "foo.h".
> The problem is that when I bjam it, the
Kevin M wrote:
> Figures. I'll try to complicate it sufficiently ;)
>
>
> [edit] I was going to try to sum up what goes on, but I realized that I
> was retyping what I already programmed in an effort to better
> illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's
> only around 200 l
> I have a similar question (importing cx_Oracle, but not related to
> cron). I would like to use solution #2 below and it does not work. If
> I set LD_LIBRARY_PATH before running python, it works. If I try to set
> it via os.environ, it does not work.
>
> I have tried this in an interactive Py
Hi Everyone,
I just started to use boost.python and having problem trying to get my
first program working.
I have a C++ class foo.cpp, defined in foo.h, I wrote a wrapper class
for it to generate a python module.
#include "Foo.h"
#include
#include
#include
using namespace boost::python;
BOO
[EMAIL PROTECTED] wrote:
[...]
> that? And also, I'm still not sure I know exactly how os.walk() works.
> And, finally, the python docs all note that symbols like . and ..
> don't work with these commands. How can I grab the directory that my
> script is residing in?
os.getcwd() will get you th
Eighty:
> So does no one have a comment on this?
Similar proposals have appeared before (such as on python-dev about
a year ago) and haven't attracted much positive comment. The benefits
appear to be small compared to the cost of making the language larger.
You could try the formal route
Michiel Sikma wrote:
> Op 8-aug-2006, om 1:49 heeft Ben Finney het volgende geschreven:
>
> > As others have pointed out, these people really do exist, and they
> > each believe their preconception -- that significant whitespace is
> > intrinsically wrong -- is valid, and automatically makes Python
> Also, I've noticed that files are being found within hidden
> directories. I'd like to exclude hidden directories from the walk, or
> at least not add anything within them. Any advice?
The second item in the tuple yielded by os.walk() is a list of
subdirectories inside the directory indicated
I have a standard 12-key mobile phone keypad connected to my Linux
machine as a I2C peripheral. I would like to write a code which allows
the text entry to the computer using this keypad (something like T9 on
the mobile phones)
According to the http://www.yorku.ca/mack/uist01.html
dictionary-based
Figures. I'll try to complicate it sufficiently ;)
[edit] I was going to try to sum up what goes on, but I realized that I
was retyping what I already programmed in an effort to better
illustrate exactly what I'm doing. Pastebin it is. Don't fear, it's
only around 200 lines total.
Class file --
[EMAIL PROTECTED] wrote:
> Okay. This is almost solved. I just need to know how to have each
> entry in my final list have the full path, not just the file name.
from http://docs.python.org/lib/os-file-dir.html:
walk() generates the file names in a directory tree, by walking the
tree either top
Simon Forman:
> accessing it from a
> module (perhaps math.. math.infinity, math.epsilon, etc., just like
> math.pi and math.e.)
It too looks acceptable.
> I look forward to hearing your thoughts an the subject.
Thank you, but I am not expert enough on such topics to give you good
comments, s
liuliuliu wrote:
> hi -- sorry if this is trivial -- but how do you make a screenshot of a
> pygame display? i have a surface which is basically the entire visible
> screen -- how do you write this surface as an image file during
> specific events in the script execution? image format doesnt matte
[EMAIL PROTECTED] wrote:
> And, finally, the python docs all note that symbols like . and ..
> don't work with these commands.
Where did you read that? The docs for os.listdir do say that '.' and
'..' are (sensibly) not returned as *results*. AFAIK there is nothing
to stop you using '.' or '..'
At Tuesday 8/8/2006 17:55, [EMAIL PROTECTED] wrote:
I must ask, in the interest of learning, what is
[file for file in files if file.endswith(extension)]
actually doing? I know that 'file' is a type, but what's with the set
up and the brackets and all? Can someone run down the syntax for me
In message <[EMAIL PROTECTED]>,
Gerhard Fiedler <[EMAIL PROTECTED]> writes
>conclusion for me: they must not like self-documenting code... :)
Oh dear. So if the code is wrong it is self documenting?
Comments document what the code should do.
The code shows what the code actually does.
Also from
Okay. This is almost solved. I just need to know how to have each
entry in my final list have the full path, not just the file name.
Also, I've noticed that files are being found within hidden
directories. I'd like to exclude hidden directories from the walk, or
at least not add anything within
Perhaps using os you could work with lsof
[http://www.linuxcommand.org/man_pages/lsof8.html]
Jon
Thomas Bartkus wrote:
> This may be more of a Linux question, but I'm doing this from Python. .
>
> How can I know if anything (I don't care who or what!) is in the middle of
> using a particular
Miki wrote:
> Hello hj,
>
> > I have a small script here that goes to inside dir and sorts the file
> > by create date. I can return the create date but I don't know how to
> > find the name of that file...
> > I need file that is not latest but was created before the last file.
> > Any hints... I
Philippe Martin wrote:
> John & Mary Cook wrote:
>
> > I just installed Python on Windows XP Pro. When I enter 'python' at the
> > >>> prompt in Pythonwin IDE I get the following:
> >
> > Traceback (most recent call last):
> >File "", line 1, in ?
> > Name Error: name 'python' is not defined
hi -- sorry if this is trivial -- but how do you make a screenshot of a
pygame display? i have a surface which is basically the entire visible
screen -- how do you write this surface as an image file during
specific events in the script execution? image format doesnt matter.
thanks! christine
--
Erik Max Francis schrieb:
>> I use /usr/bin/env if I don't know what the operating system is;
>> some systems don't have Python in /usr/bin. I use /usr/bin/pythonX.Y
>> if I want a specific version on a specific operating system (typically
>> Linux).
>
> Even there, /usr/bin/env pythonX.Y would be
[EMAIL PROTECTED] wrote:
> I must ask, in the interest of learning, what is
>
> [file for file in files if file.endswith(extension)]
>
> actually doing? I know that 'file' is a type, but what's with the set
> up and the brackets and all?
Other people explained the list comprehension, but you m
This may be more of a Linux question, but I'm doing this from Python. .
How can I know if anything (I don't care who or what!) is in the middle of
using a particular file?
This comes in context of needing to copy a file BUT only if I can verify
that something else doesn't have an open write h
Are you refering to IDLE? or simply running python at the command
line?
In either case - python is just the language's name. It is not a
defined name within the language.
If you describe what you are trying to do, perhaps some more specific
help could be had.
What is happening:
There currently
John & Mary Cook wrote:
> I just installed Python on Windows XP Pro. When I enter 'python' at the >>>
> prompt in Pythonwin IDE I get the following:
>
> Traceback (most recent call last):
>File "", line 1, in ?
> Name Error: name 'python' is not defined
>
> Can anyone help?
>
> Thank you,
>
>
I figured it out... Just turned the POST request into a GET to see what
was getting appended to the URL - thanks Gabe!
Gabriel Genellina wrote:
> At Monday 7/8/2006 20:58, wipit wrote:
>
> >I need to process a HTML form in python. I'm using urllib2 and
> >HTMLParser to handle the html. There are s
John & Mary Cook wrote:
> I just installed Python on Windows XP Pro. When I enter 'python' at the
> >>> prompt in Pythonwin IDE I get the following:
>
> Traceback (most recent call last):
>File "", line 1, in ?
> Name Error: name 'python' is not defined
>
> Can anyone help?
>
> Thank you,
[EMAIL PROTECTED] wrote:
> hiaips wrote:
> > > [EMAIL PROTECTED] wrote:
> > > > I'm new at Python and I need a little advice. Part of the script I'm
> > > > trying to write needs to be aware of all the files of a certain
> > > > extension in the script's path and all sub-directories. Can someone
So far, so good. I just have a few more questions.
Here's my code so far:
import os
top = '/home/USERNAME/'
images = []
for files in os.walk(top, topdown=True):
images += [file for file in files[2] if file.endswith('jpg')]
print images
I still need to know how I can dynamically get the
Admittedly this problem causes no actual functional issues aside from
an occasional error message when the program exits. The error is:
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was:
Yes all that info is blank. The application is a console application
Oops, what I wrote above isn't quite correct. As another poster pointed
out, you'd want to do
for file in x[2]:
...
--dave
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Thanks, Dave. That's exactly what I was looking for, well, except for
> a few small alterations I'll make to achieve the desired effect. I
> must ask, in the interest of learning, what is
>
> [file for file in files if file.endswith(extension)]
>
> actually doing? I k
I just installed Python on Windows XP Pro. When I enter 'python' at the >>>
prompt in Pythonwin IDE I get the following:
Traceback (most recent call last):
File "", line 1, in ?
Name Error: name 'python' is not defined
Can anyone help?
Thank you,
J. T. Cook
--
http://mail.python.org/ma
ds4ff1z wrote:
> Hello, i'm looking to find and replace multiple characters in a text
> file (test1). I have a bunch of random numbers and i want to replace
> each number with a letter (such as replace a 7 with an f and 6 with a
> d). I would like a suggestion on an a way to do this. Thanks
http
ds4ff1z wrote:
> Hello, i'm looking to find and replace multiple characters in a text
> file (test1). I have a bunch of random numbers and i want to replace
> each number with a letter (such as replace a 7 with an f and 6 with a
> d). I would like a suggestion on an a way to do this. Thanks
how
> Hello, i'm looking to find and replace multiple characters in a text
> file (test1). I have a bunch of random numbers and i want to replace
> each number with a letter (such as replace a 7 with an f and 6 with a
> d). I would like a suggestion on an a way to do this. Thanks
Well, the canonical
[EMAIL PROTECTED] wrote:
> Mike Kent wrote:
> > What you want is os.walk().
> >
> > http://www.python.org/doc/current/lib/os-file-dir.html
>
> I'm thinking os.walk() could definitely be a big part of my solution,
> but I need a little for info. If I'm reading this correctly, os.walk()
> just goes
[EMAIL PROTECTED] wrote:
> Simon Forman:
> > It's unlikely to
> > be deprecated since it doesn't make much sense to make it an attribute
> > of the str type.
>
> Why?
>
> Thank you,
> bearophile
Let me toss the question back at you: Does it make sense to you that
str should have this attribute?
Terry Reedy wrote:
> whereas the analogous expansion of your proposal
>
> for x in xs:
> while cond(x):
> yield e(x)
>
> is an infinite loop and not at all what you mean.
You're right. The syntax is ambiguous. I agree it's not a good idea,
now. :)
> x for x in xs while cond(x) if blah(x)
Thanks, Dave. That's exactly what I was looking for, well, except for
a few small alterations I'll make to achieve the desired effect. I
must ask, in the interest of learning, what is
[file for file in files if file.endswith(extension)]
actually doing? I know that 'file' is a type, but what's
> I'm thinking os.walk() could definitely be a big part of my solution,
> but I need a little for info. If I'm reading this correctly, os.walk()
> just goes file by file and serves it up for your script to decide what
> to do with each one. Is that right? So, for each file it found, I'd
> have
Martin Höfling wrote:
> Hi there,
>
> is it possible to put the methods of a class in different files? I just
> want to order them and try to keep the files small.
>
> Regards
> Martin
you could do this:
file_1.py:
class A:
def __init__(self):
self.a = 1
file_2.py:
from file_
Hello, i'm looking to find and replace multiple characters in a text
file (test1). I have a bunch of random numbers and i want to replace
each number with a letter (such as replace a 7 with an f and 6 with a
d). I would like a suggestion on an a way to do this. Thanks
--
http://mail.python.org/
Mike Kent wrote:
> What you want is os.walk().
>
> http://www.python.org/doc/current/lib/os-file-dir.html
I'm thinking os.walk() could definitely be a big part of my solution,
but I need a little for info. If I'm reading this correctly, os.walk()
just goes file by file and serves it up for your s
"Eighty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Eighty wrote:
>> I suggest a new extension of the list comprehension syntax:
>>
>> [x for x in xs while cond(x)]
This does not work.
e(x) for x in xs if cond(x)
is an abbreviation of
for x in xs:
if cond(x)
yield e
Martin v. Löwis wrote:
> I use /usr/bin/env if I don't know what the operating system is;
> some systems don't have Python in /usr/bin. I use /usr/bin/pythonX.Y
> if I want a specific version on a specific operating system (typically
> Linux).
Even there, /usr/bin/env pythonX.Y would be a better
> [EMAIL PROTECTED] wrote:
> > I'm new at Python and I need a little advice. Part of the script I'm
> > trying to write needs to be aware of all the files of a certain
> > extension in the script's path and all sub-directories. Can someone
> > set me on the right path to what modules and calls t
John Salerno wrote:
> I understand the difference, but I'm just curious if anyone has any
> strong feelings toward using one over the other? I was reading that a
> disadvantage to the more general usage (i.e. env) is that it finds the
> first python on the path, and that might not be the proper
[EMAIL PROTECTED] wrote:
> I'm new at Python and I need a little advice. Part of the script I'm
> trying to write needs to be aware of all the files of a certain
> extension in the script's path and all sub-directories.
What you want is os.walk().
http://www.python.org/doc/current/lib/os-file-d
On 2006-08-08, godavemon <[EMAIL PROTECTED]> wrote:
> You guys are awesome! I had to set the 'b' flag when writing the
> binaries.
>
> file_obj = open('filename.bin', 'wb')
>
> instead of just using 'w'
>
> It worked fine for all of the other 10 binary files I made,
> but had a small error with on
Is there a native Win32 text entry dialog available through the Win32
extensions. I am looking for something similar to easygui's
(http://www.ferg.org/easygui/) enterbox. Any ideas?
TIA
--
http://mail.python.org/mailman/listinfo/python-list
Hey, I've done similar things.
You can use system comands with the following
import os
os.system('command here')
You'd maybe want to do something like
dir_name = 'mydirectory'
import os
os.system('ls ' +dir_name + ' > lsoutput.tmp')
fin = open('lsoutput.tmp', 'r')
file_list = fin.readlines()
fi
Hey, I've done similar things.
You can use system comands with the following
import os
os.system('command here')
You'd maybe want to do something like
dir_name = 'mydirectory'
import os
os.system('ls ' +dir_name + ' > lsoutput.tmp')
fin = open('lsoutput.tmp', 'r')
file_list = fin.readlines()
fi
I just downloaded matplotlib and I was trying to do some simple
date plots, but I'm running up against a puzzling error. Whenever I
attempt to plot dates, I get an exception on line 157 of
matplotlib/dates.py that says 'ValueError: need more than 0 values to
unpack'. That line is:
1 - 100 of 229 matches
Mail list logo