Re: [Tutor] group txt files by month

2012-04-10 Thread questions anon
Thank you for this response it was a tremedous help.
It still took me awhile to work it all out and thought I would post what
worked for me.
Thanks again

GLOBTEMPLATE = r"e:/rainfall-{year}/r{year}{month:02}??.txt"

def accumulate_month(year, month):
files = glob.glob(GLOBTEMPLATE.format(year=year, month=month))
monthlyrain=[]
for ifile in files:
f=np.genfromtxt(ifile,skip_header=6)
monthlyrain.append(f)
print "year-month: ",year,"-",month, ", maximum: ",
np.max(monthlyrain), "minimum: ", np.min(monthlyrain), "mean: ",
np.mean(monthlyrain)

stop_month = datetime(2011, 12, 31)
month = datetime(2011, 01, 01)
while month < stop_month:
accumulate_month(month.year, month.month)
month += timedelta(days=32)
month = month.replace(day=01)


On Thu, Apr 5, 2012 at 4:57 PM, Peter Otten <__pete...@web.de> wrote:

> questions anon wrote:
>
> > I have been able to write up what I want to do (using glob) but I am not
> > sure how to loop it or simplify it to make the script more efficient.
> > I am currently:
> > -grouping the same months in a year using glob
> > -opening the files in a group and combining the data using a list
> > -finding max, min etc for the list and printing it
> >
> > I need to do this for many years and therefore many months so really need
> > a way to make this more efficient.
> > Any feedback will be greatly appreciated
> >
> > MainFolder=r"E:/rainfall-2011/"
> > OutputFolder=r"E:/test_out/"
> > r201101=glob.glob(MainFolder+"r201101??.txt")
> > r201102=glob.glob(MainFolder+"r201102??.txt")
> > r201103=glob.glob(MainFolder+"r201103??.txt")
> >
> > rain201101=[]
> > rain201102=[]
> > rain201103=[]
> > monthlyrainfall=[]
> >
> > for ifile in r201101:
> > f=np.genfromtxt(ifile, skip_header=6)
> > rain201101.append(f)
> >
> > for ifile in r201102:
> > f=np.genfromtxt(ifile, skip_header=6)
> > rain201102.append(f)
> >
> > for ifile in r201103:
> > f=np.genfromtxt(ifile, skip_header=6)
> > rain201103.append(f)
> >
> > print "jan", np.max(rain201101), np.min(rain201101), np.mean(rain201101),
> > np.median(rain201101), np.std(rain201101)
> > print "feb", np.max(rain201102), np.min(rain201102), np.mean(rain201102),
> > np.median(rain201102), np.std(rain201102)
> > print "mar", np.max(rain201103), np.min(rain201103), np.mean(rain201103),
> > np.median(rain201103), np.std(rain201103)
>
> Strip the code down to one month
>
> > r201103=glob.glob(MainFolder+"r201103??.txt")
> > rain201101=[]
> > for ifile in r201101:
> > f=np.genfromtxt(ifile, skip_header=6)
> > rain201101.append(f)
>
>
> then turn it into a function, roughly
>
> GLOBTEMPLATE = "e:/rainfall-{year}/r{year}{month:02}??.txt"
> def accumulate_month(year, month):
>files = glob.glob(GLOBTEMPLATE.format(year=year, month=month))
># read files, caculate and write stats
>
> and finally put it into a loop:
>
> from datetime import date, timedelta
> stop_month = date(2012, 4, 1)
> month = datetime(2011, 1, 1)
> while month < stop_month:
>accumulate_month(month.year, month.month)
>month += timedelta(days=32)
>month = month.replace(day=1)
>
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Biopython

2012-04-10 Thread Alan Gauld

On 10/04/12 21:25, Laura Scearce wrote:

Hello,
I am using Linux version 2.6 and python version 2.6.6 (gcc version 4.4.5).
I have a list of protein names and am trying to get their sequences.


OK, That's not unusual and there is a forum somewhere for Python users 
doing bio type work. However, it helps if you tell us what distribution 
of Linux since their installers etc all work slightly differently (or 
more specifically there are three or four different installer packages 
that work differently across the dozens of Linux distros.)



thought I would download Biopython, and am having troubles.


This is a list for people learning python. There may be people on the 
list that also know biopython but I wouldn't count on it. If you can 
find a biopython forum you are more likely to get useful help.



Bio/cpairwise2module.c:12: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit
status 1


This means its trying to build from source. Does your PC have a
working development environment set up? Specifically can you
build C programs using make? If you don;t, or don;t know, you are 
probably out of your depth and should try to find a pre-built

package for your system.


Here is what I tried:
debbie@debbie-VirtualBox:~/Documents/BLAST-SW$ sh biopython-1.59.tar.gz
sh: Can't open biopython-1.59.tar.gz


OK, the fact that you are trying to  run sh on a tar.gz file tells me 
you are also a newbie to Linux as well as biopython.

You need to find the tool that your distro uses to open/install
"gunzip compressed tape archives" - which is what a tar.gz file is...

You can do it manually but thats likely to lead to even more problems if 
you don't really understand what you are doing.


You might be lucky and the distro has already set up the associations, 
what happens if you just run biopython-1.59.tar.gz? That might start the 
right tool automatically. Although what the tool will do depends on what 
is inside the archive.



The end goal is to use ncbi Eutils to get protein sequences, so if
anyone has experience with this please let me know.


You really are asking on the wrong forum.
First have you read this? I found it at the top ofd my first google 
search on biopython...


http://biopython.org/wiki/Biopython

There is a download and installation guide.

Also a page full of bio help sources:

http://biopython.org/wiki/Mailing_lists

In programming it always helps to read the manual first, it is 
invariably faster than guessing.


HTH,
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Biopython

2012-04-10 Thread Walter Prins
Hi Laura,

On 10 April 2012 22:25, Laura Scearce  wrote:

> I am using Linux version 2.6 and python version 2.6.6 (gcc version 4.4.5).
>

What distribution of Linux?  (Ubuntu, Debian, Centos or something else?)


I followed the instructions and it seemed to work (see below error
> messages).
>
> [snip...]


> compilation terminated.
> error: Setup script exited with error: command 'gcc' failed with exit
> status 1
>

That means gcc is likely not installed.  GCC is the GNU C compiler.  On
Linux, Python modules written in C needs GCC to be able to install.  I
imagine BioPython is written in C, which would explain why it wants GCC
during installation.

On Ubuntu/Debian, you can fix the lack of GCC by using the following
command:

sudo apt-get install build-essential

This will install the "build-essential" package which includes GCC and a
bunch of other development tools.  (If you're not using Debian or Ubuntu or
a distribution based on Debian the above command won't work.)



> *I also tried it in the directory Downloads, because this is where the
> easyinstall was downloaded to. Same message.
>

After installing "easy_install" into your Python environment, the
originally downloaded file is redundant/irrelevant to the functioning of
easy_install, so the folder you're in doesn't actually matter.  Which is
why you get the same message. :)



>
> Then I tried downloading Biopython from
> http://pypi.python.org/pypi/biopython
> I downloaded 
> biopython-1.59.tar.gz.
> and extracted it to the folder BLAST-SW in my Documents folder.
>
> Here is what I tried:
> debbie@debbie-VirtualBox:~/Documents/BLAST-SW$ sh biopython-1.59.tar.gz
> sh: Can't open biopython-1.59.tar.gz
> debbie@debbie-VirtualBox:~$ sh biopython-1.59.tar.gz
> sh: Can't open biopython-1.59.tar.gz
> debbie@debbie-VirtualBox:~/Documents/BLAST-SW$ sh biopython-1.59
> *This had no error message, but I think that Biopython is not installed
> because:
> >>> import Bio
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named Bio
>

A .tar.gz file is not a shellscript file or bundle.  It is a type of
archive file, and to extract it you need to use the "tar" command or a GUI
tool that can read tar.gz files.  (I'm a tad puzzled as you seem to
understand this file needs to be extracted, yet the commands you issue
implies you seem to think you can run the file as-is?)  Normally you'd use
a command like this:

tar -zxvf  biopython-1.59.tar.gz

... which will extract the the biopython-1.59.tar.gz file into the current
folder.  In case the files in the archive are not in a subfolder it's
therefore  a bit
safer to create your own targer folder first, then extract from within this
new folder, e.g. something like:

mkdir biopython
cd biopython
tar -zxvf  ../biopython-1.59.tar.gz

Finally having briefly scanned the biopython download page, I want to point
out that there are Biopython packages available for Ubuntu/Debian systems,
so if you're using one of these Linux distributions you should
preferentially use Synaptic (or another Debian package tool like apt-get or
aptitude) to install BioPython as this will be a lot less grief.

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Biopython

2012-04-10 Thread Emile van Sebille

On 4/10/2012 1:25 PM Laura Scearce said...

Hello,
I am using Linux version 2.6 and python version 2.6.6 (gcc version 4.4.5).
I have a list of protein names and am trying to get their sequences. I
thought I would download Biopython, and am having troubles.


Your best source for answers pertaining to third party packages if the 
third party itself.


Try http://biopython.org/wiki/Mailing_lists -- they'll get you going 
faster than we will...  unless of course someone here has sufficient 
experience with that package.


Emile

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Biopython

2012-04-10 Thread Laura Scearce
Hello,
I am using Linux version 2.6 and python version 2.6.6 (gcc version 4.4.5).
I have a list of protein names and am trying to get their sequences. I
thought I would download Biopython, and am having troubles.
I first downloaded and installed easyinstall from
http://pypi.python.org/pypi/setuptools
I followed the instructions and it seemed to work (see below error
messages).

This is the error I get when I try to install biopython:
root@debbie-VirtualBox:/usr/local/bin# easy_install biopython
Searching for biopython
Reading http://pypi.python.org/simple/biopython/
Reading http://www.biopython.org/
Reading http://biopython.org/DIST/
Best match: biopython 1.59
Downloading http://biopython.org/DIST/biopython-1.59.zip
Processing biopython-1.59.zip
Running biopython-1.59/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-qMfJsF/biopython-1.59/egg-dist-tmp-W4L1YX
warning: no previously-included files found matching 'Tests/Graphics/*'
warning: no previously-included files matching '.cvsignore' found under
directory '*'
warning: no previously-included files matching '*.pyc' found under
directory '*'
Bio/cpairwise2module.c:12: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit
status 1

*I also tried it in the directory Downloads, because this is where the
easyinstall was downloaded to. Same message.

Then I tried downloading Biopython from
http://pypi.python.org/pypi/biopython
I downloaded 
biopython-1.59.tar.gz.
and extracted it to the folder BLAST-SW in my Documents folder.

Here is what I tried:
debbie@debbie-VirtualBox:~/Documents/BLAST-SW$ sh biopython-1.59.tar.gz
sh: Can't open biopython-1.59.tar.gz
debbie@debbie-VirtualBox:~$ sh biopython-1.59.tar.gz
sh: Can't open biopython-1.59.tar.gz
debbie@debbie-VirtualBox:~/Documents/BLAST-SW$ sh biopython-1.59
*This had no error message, but I think that Biopython is not installed
because:
>>> import Bio
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named Bio

The end goal is to use ncbi Eutils to get protein sequences, so if anyone
has experience with this please let me know.
Thanks!
Laura Scearce
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] ADO with python 2.6 without additional installs

2012-04-10 Thread Alan Gauld

On 10/04/12 10:13, Bakkestuen Roger wrote:


Is there a way to access and query trough for instance ADO without
having to install the Win32 package?


Yes, you can use ctypes to access the Microsoft DLL functions and Win32 
API directly. But thats going to be non trivial and probably painful!


There is a ctypes mailing list/forum who may have people who can help.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] summing lists

2012-04-10 Thread Hs Hs
thanks all for quick reply.  In my previous e-mail I send adding using lambda 
function. I now know that I am using too much functionality where simple ways 
to solve exist. That's python!
thanks again. 
Hs.



 From: Evert Rol 
To: Hs Hs  
Cc: "tutor@python.org"  
Sent: Tuesday, April 10, 2012 11:37 AM
Subject: Re: [Tutor] summing lists
 
> I have 4 lists:
> 
> >>> a
> [40]
> >>> b
> [2]
> >>> c
> [23]
> >>> d
> [12]
> 

Why are you using lists with a single element, instead of single integer 
variables? (thus, a=40, b=2, c=23, d=12.)


> how is it possible to do add elements in list.

sum()


> I can do this using tupples, but I do not know how to append elements to tuple

You can't. but you can make a a new tuple from two existing tuples:

>>> (1, 2) + (3, 4)
(1, 2, 3, 4)

However,

> , thats the reason I am using list. 

Lists have little to do with your problem below (the sums + division), and 
certainly not tuples.
If possible, better to use plain variables.

In this specific case, however, you can just add the lists together (which 
forms a new list), and then use sum():

>>> a+b
[40, 2]
>>> a+b+c+d
[40, 2, 23, 12]
>>> sum(a+b)/sum(a+b+c+d)
0
>>> # oops, I'm using Python 2, not Python 3 here
>>> from __future__ import division
>>> sum(a+b)/sum(a+b+c+d)
0.5454545454545454

You can also extend lists, which adds a list to an existing list:

>>> a.extend(b)
>>> a
[40, 2]
>>> a.extend(c)
>>> a
[40, 2, 23]

etc.


  Evert


> 
> I want to find the value of a+c/a+b+c+d - which is 40+23/40+2+23+12. 
> 
> Any help appreciated. 
> 
> thanks
> Hs.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] summing lists

2012-04-10 Thread Dave Angel
On 04/10/2012 11:28 AM, Hs Hs wrote:
> sorry I did this following, please advise if any better way exist:
>

You top-posted, so we lose the context you were using.

You never really say why you're using lists with exactly one element in
them, but presuming that the real lists consist of something like
a = [4, "Tom Jones"]
b = [12, "Peter Rabbit", "March Hare"]

I'll follow your convention of assuming only the zeroth element is
relevant to your 'definition of add'.

> gc = lambda x,y: x[0]+y[0]
>
> atgc = lambda x,y,k,l: x[0]+y[0]+k[0]+l[0]
>
>

No point in using lambda for that purpose.  Since you are not trying to
make it anonymous, you could simply use

def gc(x, y):
   return x[0] + y[0]

for example.

But the more interesting question is how to combine the two functions,
and make one which can take a variable number of items.


def gc(*many):
 return sum( [ x[0] for x in many ] )





-- 

DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] summing lists

2012-04-10 Thread Evert Rol
> I have 4 lists:
> 
> >>> a
> [40]
> >>> b
> [2]
> >>> c
> [23]
> >>> d
> [12]
> 

Why are you using lists with a single element, instead of single integer 
variables? (thus, a=40, b=2, c=23, d=12.)


> how is it possible to do add elements in list.

sum()


> I can do this using tupples, but I do not know how to append elements to tuple

You can't. but you can make a a new tuple from two existing tuples:

>>> (1, 2) + (3, 4)
(1, 2, 3, 4)

However,

> , thats the reason I am using list. 

Lists have little to do with your problem below (the sums + division), and 
certainly not tuples.
If possible, better to use plain variables.

In this specific case, however, you can just add the lists together (which 
forms a new list), and then use sum():

>>> a+b
[40, 2]
>>> a+b+c+d
[40, 2, 23, 12]
>>> sum(a+b)/sum(a+b+c+d)
0
>>> # oops, I'm using Python 2, not Python 3 here
>>> from __future__ import division
>>> sum(a+b)/sum(a+b+c+d)
0.5454545454545454

You can also extend lists, which adds a list to an existing list:

>>> a.extend(b)
>>> a
[40, 2]
>>> a.extend(c)
>>> a
[40, 2, 23]

etc.


  Evert


> 
> I want to find the value of a+c/a+b+c+d - which is 40+23/40+2+23+12. 
> 
> Any help appreciated. 
> 
> thanks
> Hs.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] summing lists

2012-04-10 Thread James Reynolds
On Tue, Apr 10, 2012 at 11:22 AM, Hs Hs  wrote:

> Hi:
>
> I have 4 lists:
>
> >>> a
> [40]
> >>> b
> [2]
> >>> c
> [23]
> >>> d
> [12]
>
>
> how is it possible to do add elements in list. I can do this using
> tupples, but I do not know how to append elements to tuple, thats the
> reason I am using list.
>
> I want to find the value of a+c/a+b+c+d - which is 40+23/40+2+23+12.
>
> Any help appreciated.
>
> thanks
> Hs.
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
In python, the '+' operator when applied to lists will concatenate the
lists together. So:

>>> a = [1]
>>> b = [2]
>>> print a+b
[1,2]

the 'sum' function in python can be used on lists.

>>> a = [1]
>>> b = [2]
>>> print sum(a+b)
3
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] summing lists

2012-04-10 Thread Hs Hs
sorry I did this following, please advise if any better way exist:


gc = lambda x,y: x[0]+y[0]

atgc = lambda x,y,k,l: x[0]+y[0]+k[0]+l[0]


>>> gc(a,b)/atgc(a,b,c,d)
0.54545454545454541










Hi:

I have 4 lists:

>>> a
[40]
>>> b
[2]
>>> c
[23]
>>> d
[12]


how is it possible to do add elements in list. I can do this using tupples, but 
I do not know how to append elements to tuple, thats the reason I am using 
list. 

I want to find the value of a+c/a+b+c+d - which is 40+23/40+2+23+12. 

Any help appreciated. 

thanks
Hs.___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] summing lists

2012-04-10 Thread Hs Hs
Hi:

I have 4 lists:

>>> a
[40]
>>> b
[2]
>>> c
[23]
>>> d
[12]


how is it possible to do add elements in list. I can do this using tupples, but 
I do not know how to append elements to tuple, thats the reason I am using 
list. 

I want to find the value of a+c/a+b+c+d - which is 40+23/40+2+23+12. 

Any help appreciated. 

thanks
Hs.___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] ADO with python 2.6 without additional installs

2012-04-10 Thread bob gailer

Please always reply-all so a copy goes to the list

On 4/10/2012 5:13 AM, Bakkestuen Roger wrote:


Hi

I'm struggling with finding a way to access and query an MSAccess base 
in an organisation with a very standardised environment.




I gather from your other comments this means no installing of 3rd party 
software. True?


I presume that policy is to prevent malicious code from running. True?

Please say more about your objectives.

Can you export the Access data and operate on it outside the Access 
environment?


--
Bob Gailer
919-636-4239
Chapel Hill NC

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Game of python, help please.

2012-04-10 Thread bob gailer

On 4/9/2012 10:56 PM, Dave Angel wrote:

On 04/09/2012 10:33 PM, bob gailer wrote:

On 4/9/2012 2:26 AM, leo degon wrote:

Hello all, Im trying to learn python and programming in my free time,
and I'm trying to do a little personal project to trying and gain
some skills. Im trying to do version of John conways game of life. I
have a working version of the game. Written for 3.2.2 on a mac to be
accessed through terminal.


These nested loops

for i in range(X):
 SPACE.append([])
 for j in range(Y):
 SPACE[i].append([0])


can be replaced with:

space = [0]*y]*x


not counting the typo, that's the trap I was warning about.  If he does
NOT replace the individual cells with zeroes and ones, this is wrong.
You pointed that out.  But it's also wrong for the rows, as you only
have one row here, duplicated x times.
OOPS - what comes of trying to be creative while tired. Sorry and thanks 
for pointing out my error.





--
Bob Gailer
919-636-4239
Chapel Hill NC

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] ADO with python 2.6 without additional installs

2012-04-10 Thread Christian Witts

On 2012/04/10 03:07 PM, Bakkestuen Roger wrote:


This requires install of pyodbc.

I was looking for modules in std python 2.6 or higher.

Med hilsen
Roger Bakkestuen

*Telefon:* +47 61271236 *Mobil:* +47 94833636 *e-post:* 
roger.bakkest...@vegvesen.no 


---

*Fra:*Christian Witts [mailto:cwi...@compuscan.co.za]
*Sendt:* 10. april 2012 11:24
*Til:* Bakkestuen Roger
*Kopi:* tutor@python.org
*Emne:* Re: [Tutor] ADO with python 2.6 without additional installs

On 2012/04/10 11:13 AM, Bakkestuen Roger wrote:

Hi

I’m struggling with finding a way to access and query an MSAccess base 
in an organisation with a very standardised environment.


Python 2.6 is available and Office 2010.

Is there a way to access and query trough for instance ADO without 
having to install the Win32 package?


Any suggestions or even sample code?

*Best regards*

*Roger Bakkestuen*

**

Norwegian Public Roads Administration

Eastern Region – Geodata

*Post adress:*Statens vegvesen Region øst, Postboks 1010, 2605 LILLEHAMMER

*Office adress*: Industrigaten 17, LILLEHAMMER
*Phone:* +47 61271236 *Mobile:* +47 94833636 *e-mail:* 
roger.bakkest...@vegvesen.no 
www.vegvesen.no  *e-mail:* 
firmapost-...@vegvesen.no 





___
Tutor maillist  -Tutor@python.org  
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

You can give PyODBC [1] a try as it does support MS Access [2].

[1] http://code.google.com/p/pyodbc/
[2] http://code.google.com/p/pyodbc/wiki/ConnectionStrings

--

Christian Witts
Python Developer

Unfortunately the only DB Access that's built into Python is SQLite, for 
all other databases you'll need to install 3rd party packages.

--

Christian Witts
Python Developer
//
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] ADO with python 2.6 without additional installs

2012-04-10 Thread Christian Witts

On 2012/04/10 11:13 AM, Bakkestuen Roger wrote:


Hi

I’m struggling with finding a way to access and query an MSAccess base 
in an organisation with a very standardised environment.


Python 2.6 is available and Office 2010.

Is there a way to access and query trough for instance ADO without 
having to install the Win32 package?


Any suggestions or even sample code?

*Best regards*

*Roger Bakkestuen*

**

Norwegian Public Roads Administration

Eastern Region – Geodata

*Post adress:*Statens vegvesen Region øst, Postboks 1010, 2605 LILLEHAMMER

*Office adress*: Industrigaten 17, LILLEHAMMER
*Phone:* +47 61271236 *Mobile:* +47 94833636 *e-mail:* 
roger.bakkest...@vegvesen.no 
www.vegvesen.no  *e-mail:* 
firmapost-...@vegvesen.no 




___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

You can give PyODBC [1] a try as it does support MS Access [2].

[1] http://code.google.com/p/pyodbc/
[2] http://code.google.com/p/pyodbc/wiki/ConnectionStrings

--

Christian Witts
Python Developer
//
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] ADO with python 2.6 without additional installs

2012-04-10 Thread Bakkestuen Roger
Hi
I'm struggling with finding a way to access and query an MSAccess base in an 
organisation with a very standardised environment.
Python 2.6 is available and Office 2010.

Is there a way to access and query trough for instance ADO without having to 
install the Win32 package?
Any suggestions or even sample code?


Best regards
Roger Bakkestuen

Norwegian Public Roads Administration
Eastern Region - Geodata
Post adress: Statens vegvesen Region øst, Postboks 1010, 2605 LILLEHAMMER
Office adress: Industrigaten 17, LILLEHAMMER
Phone: +47 61271236  Mobile: +47 94833636  e-mail: 
roger.bakkest...@vegvesen.no
www.vegvesen.no  e-mail: 
firmapost-...@vegvesen.no

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor