I created a function that takes a pattern and a base
path and then uses os.walk and glob to traverse
directories starting from the base path and place
files that match the glob pattern in a dictionary.
#!/usr/bin/python
import os, os.path, glob
def glob_files(pattern, base = '.'):
path_l
Hi, can someone help me interpret the error output
below?
I can't tell whether this is a coding error, or a
configuration error, in which case, it would be up to my host
provider.
For privacy reasons, I have changed the actual
email addresses to [EMAIL PROTECTED] and [EMAIL PROTECTED].
Looks good Dave.
Alan G.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I'm creating a function that traverses a directory
tree and prints out paths to files:
#!/usr/bin/python
import os, os.path, glob
def traverse(base = '.'):
for root,dirs,files in os.walk(base):
for name in files:
path = os.path.join(root, name)
On Fri, Jul 28, 2006 at 02:36:08PM -0700, Danny Yoo wrote:
> > If there were really such a thing as nested scopes/namespaces, we would
> > have a function that would give us access to them, similar to the way
> > that locals() and globals() give us access to the local and global
> > namespace.
>
anil maran wrote:
> 'ascii' codec can't encode character u'\x96' in position 213: ordinal
> not in range(128)
>
> now i m getting this error
Please show your code and the traceback and reply on list, not to me
personally.
Kent
>
> */Kent Johnson <[EMAIL PROTECTED]>/* wrote:
>
> anil maran w
anil maran wrote:
> how to determine
> wat encoding it is in
> for eg i m might not know it is in latin-1
This is hard. It is better by far to know what encoding your data is in.
There is no way to determine for sure what encoding it is by looking at
the data. The best you can do is rule out some
anil maran wrote:
> In [1]: s='\x92'
>
> In [3]: s.decode('latin-1').encode('utf-8')
>
>
> Out[3]: '\xc2\x92'
>
> is this some kind of python shell, pls clarify
Yes, it's IPython.
http://ipython.scipy.org/
Kent
>
> */Kent Johnson <[EMAIL PROTECTED]>/* wrote:
>
> anil maran wrote:
> > Unico
> Lately, I have been learning about abstract data types
> (linked lists, stacks, queues, trees, etc.). While I
> do enjoy the challenge of creating these objects, I am
> not sure what they are used for.
To be honest, with the possible exception of trees, not very often!
Most of these data type
anil maran wrote:
> Unicode?
> im getting this error:
> invalid byte sequence for encoding "UTF8": 0x92
>
> since the db is not handling latin-1 and is set to use UTF8 how do i
> handle this
If you have a latin-1 string and you want utf-8, convert it to Unicode
and then to utf-8 using decode() a
Unicode?im getting this error:invalid byte sequence for encoding "UTF8": 0x92 since the db is not handling latin-1 and is set to use UTF8 how do i handle thisthanks a lot
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.__
It must be easier than I am making it.
sql = "UPDATE sa2.outfalls SET photo_content = %s WHERE
pppoint_id ='"+record[0].strip()+"';"
newsql = sql%pstuff
print newsql[:150]
cursor.execute(newsql)
__
the print newsql[:
On 8/1/06, Christopher Spears <[EMAIL PROTECTED]> wrote:
I've been working through a tutorial:http://www.ibiblio.org/obp/thinkCSpy/index.htm.Lately, I have been learning about abstract data types(linked lists, stacks, queues, trees, etc.). While I
do enjoy the challenge of creating these objects,
13 matches
Mail list logo