How do i convert this string todatetime objectFri, 21 Apr 2006 03:02:17 +Previously I'd been using mxDateTime (which does everything but requires a C extension) to parse e-mail style dates (i.e. the ones used in RSS and changes.xml) but it looks like they're handled by the standard library.
Hi Rob,
Rob wrote:
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]
Christopher Spears [EMAIL PROTECTED] wrote for
root,dirs,files in os.walk(base):
for name in files:
path = os.path.join(root, name)
print path
Sample output:
./gui_screenshot.jpeg
./find_items.pyc
./find_items.py
./os
./LearningToProgram/loggablebankaccount.py
I'm glad that the
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.
I'm not sure why you are traversing the paths a second time.
Why not just apply glob within
Dave Kuhlman wrote:
I believe that I've incorporated most, if not all, of the
suggestions from those on the list, except for Danny's suggestion
(above) about closures.
The document itself is still here:
http://www.rexx.com/~dkuhlman/python_comments.html#namespaces
Very nice. Just a few
Alan Gauld wrote:
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.
I'm not sure why you are traversing the paths a second time.
Why
Hi all,
I was recently playing with the problem of implementing the floor()
functionality, modulo being specifically mentioned in the briefing...
so, after grokking that x = a - (a % b) would do it (i.e. for a = 5.5
and b = 1, you'd get x =5) I felt very pleased...
...until I saw the definiton
Liam Clarke wrote:
Hi all,
I was recently playing with the problem of implementing the floor()
functionality, modulo being specifically mentioned in the briefing.
you could convert the float to a string, split on the decimal point, and
convert the left-hand side
back to an integer :)
or
I am still having a problem getting my listbox's binded to the radiobuttons.
I am getting closer.
###Assign each Radiobutton with its own listbox values, show one selected
button and one listbox###
from Tkinter import *
root = Tk()
var = StringVar()
var.set('a')
{ 'Aluminum' : ['Wrought',
I didn't know I could place the glob in the os.walk
traversal. Could you give me an example of how to do
this?
--- Alan Gauld [EMAIL PROTECTED] wrote:
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
Liam Clarke wrote:
Problem is; I can't bitshift on floats, so can't test. Can't bitshift
on floats in C either. Does anyone know how I could work on a binary
representation of a float? Any language at all, I'm desperate...
In C you can certainly get access to the binary representation of a
Hello,I'm trying to mount an usb device from python under linux.To do so, I read the kernel log /proc/kmsg and watch for something like: 6 /dev/scsi/host3/bus0/target0/lun0/:7usb-storage: device scan complete
When I compile a regular _expression_ like: r =
Hello, I want to use python to process information input into a HTML form on my website. how is this typically performed? I saw cherrypy and also quixote for web python stuff... I have no experience with python on the web. Thanks.jeff
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone
I didn't know I could place the glob in the os.walk
traversal. Could you give me an example of how to do
this?
I'm not sure why you see a problem. A simplified form of your
code is like this:
for root,dirs,files in os.walk(abs_base):
for name in dirs:
path = os.path.join(root,
arbaro arbaro wrote:
Hello,
I'm trying to mount an usb device from python under linux.
To do so, I read the kernel log /proc/kmsg and watch for something like:
6 /dev/scsi/host3/bus0/target0/lun0/:7usb-storage: device scan
complete
When I compile a regular expression like:
r =
__
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jeff Peery
Sent: Thursday, August 03, 2006 11:38 AM
To: tutor@python.org
Subject: [Tutor] python processing of web html forms
Hello, I want to
Hello!
My app should run on debian and windows platforms. For storing the
configuration data, I use the ConfigParser module.
What I find difficult is to determine a place for my configuration file. On
debian, it is simply
os.path.join(os.path.expanduser(~)),myconfig)
but what am I supposed
On Thu, 2006-08-03 at 10:38 -0700, Jeff Peery wrote:
Hello, I want to use python to process information input into a HTML
form on my website. how is this typically performed? I saw cherrypy
and also quixote for web python stuff... I have no experience with
python on the web. Thanks.
Hello,
Im just answering my own email, since I just found out what my error was.
From a regular expression howto:
http://www.amk.ca/python/howto/regex/regex.html
The match() function only checks if the RE matches at the beginning of
the string while search() will scan forward through the
On 8/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello!
My app should run on debian and windows platforms. For storing the
configuration data, I use the ConfigParser module.
What I find difficult is to determine a place for my configuration file. On
debian, it is simply
On 8/3/06, Henry Finucane [EMAIL PROTECTED] wrote:
On 8/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello!
My app should run on debian and windows platforms. For storing the
configuration data, I use the ConfigParser module.
What I find difficult is to determine a place for my
On 8/3/06, Andre Roberge [EMAIL PROTECTED] wrote:
On 8/3/06, Henry Finucane [EMAIL PROTECTED] wrote:
On 8/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello!
My app should run on debian and windows platforms. For storing the
configuration data, I use the ConfigParser module.
My app should run on debian and windows platforms.
Hard lines :-(
For storing the configuration data, I use the ConfigParser module.
What I find difficult is to determine a place for my configuration
file.
Config parser basically produces an .in file.
The rules that Windows uses to locate
I rewrote my code with Alan's suggestions in mind.
#!/usr/bin/python
import os, os.path, glob
def glob_files(pattern, base_path = '.'):
abs_base = os.path.abspath(base_path)
#path_list = []
#path_list.append(abs_base)
globbed_dict = {}
cwd = os.getcwd()
Under the LearningToProgram directory is a test
directory that doesn't contain any .pyc files, so the
script's returned value is correct. However, .pyc
files exist in the LearningToProgram directory, and I
would like to put those files in the dictionary too.
Is there an elegant way to
(Sorry about accidental posting before I had finished editing.)
On Thu, 2006-08-03 at 15:37 -0700, Christopher Spears wrote:
I rewrote my code with Alan's suggestions in mind.
#!/usr/bin/python
import os, os.path, glob
def glob_files(pattern, base_path = '.'):
abs_base =
On Thu, 2006-08-03 at 15:37 -0700, Christopher Spears wrote:
I rewrote my code with Alan's suggestions in mind.
#!/usr/bin/python
import os, os.path, glob
def glob_files(pattern, base_path = '.'):
abs_base = os.path.abspath(base_path)
#path_list = []
On Fri, 2006-08-04 at 00:26 +0100, Alan Gauld wrote:
Under the LearningToProgram directory is a test
directory that doesn't contain any .pyc files, so the
script's returned value is correct. However, .pyc
files exist in the LearningToProgram directory, and I
would like to put those
Hmmm, and then I could use struct to swing it back... so, I'll be
using string slices to model bitshifting then.
Always found it quite strange that working mathematically with binary
is so hard in programming languages. Even in Scheme, which will
happily play with imaginary numbers.
Regards,
Christopher Spears wrote:
I rewrote my code with Alan's suggestions in mind.
#!/usr/bin/python
import os, os.path, glob
def glob_files(pattern, base_path = '.'):
abs_base = os.path.abspath(base_path)
#path_list = []
#path_list.append(abs_base)
globbed_dict = {}
Here is the complete script with documentation:
#!/usr/bin/python
#This script prompts the user for a path and a glob
pattern.
#The script firsts looks in the directory denoted by
the path
#for a matching file. If a match is found, the path
and file are added
#to a dictionary as a key and
31 matches
Mail list logo