Re: Python and Math

2014-05-21 Thread wxjmfauth
Le jeudi 22 mai 2014 01:14:29 UTC+2, chris@noaa.gov a écrit : > On Tuesday, May 20, 2014 5:51:27 AM UTC-7, Frank Millman wrote: > > > > > I used it to install IPython, with the following results. > > > > > > First I ran 'pip install ipython', which worked. > > > > > > Then I read the I

Re: Copying non-existing files

2014-05-21 Thread Rustom Mody
On Wednesday, May 21, 2014 8:15:10 PM UTC+5:30, Chris Angelico wrote: > On Thu, May 22, 2014 at 12:14 AM, Rustom Mody wrote: > > > d ++ "\\" ++ f > > ITYM: > > d + "\\" + f > > or possibly: > > d + "/" + f Heh! I had a vague feeling it looked strange -- stack corrupted while context switchin

Re: Python and Math

2014-05-21 Thread chris . barker
On Tuesday, May 20, 2014 5:51:27 AM UTC-7, Frank Millman wrote: > I used it to install IPython, with the following results. > > First I ran 'pip install ipython', which worked. > > Then I read the IPython docs, which gave the following command to install > > Notebook - > > 'pip install ip

Re: Loading modules from files through C++

2014-05-21 Thread Roland Plüss
On 05/20/2014 07:55 PM, Chris Angelico wrote: > On Wed, May 21, 2014 at 3:17 AM, Roland Plüss wrote: >> The important part are the last two lines. An important module is >> lacking the __builtins__ dictionary member so I had to add it. >> >> Hopefully this works also in Py3 should I switch some t

Re: tkinter errors out without clear message

2014-05-21 Thread Kai Song
Hi Terry, I managed to find the problem! As you suggested, I installed newer version of tk/8.5.15. Then, the same test will still fail, but the error message has content now. It complains about missing font. I did some google, then fix it by installing "dejavu-sans-fonts". I laughed when I found

Re: tkinter errors out without clear message

2014-05-21 Thread Kai Song
Hi Terry, Thanks for your reply! > Nasty. I have seen TclErrors, but with a message. > > Here is a simple test I just ran (from within Idle) on Win7, 2.7.6. > > >>> import Tkinter as tk > >>> root = tk.Tk() > >>> tk.Label(root, text = 'label text').pack() > >>> tk.mainloop() > > and I see a wind

Re: cx_freeze and temporary files - security related question

2014-05-21 Thread Terry Reedy
On 5/21/2014 12:42 PM, Nagy László Zsolt wrote: I need to create an application for Windows 7 that runs from a flash drive. This program would be used to create remote backups of the pendrive. The pendrive contains sensitive data, so when I plug in the pendrive and run the program to make a backu

Re: tkinter errors out without clear message

2014-05-21 Thread Terry Reedy
On 5/21/2014 12:11 PM, Kai Song wrote: Dear Python community, I have been trying to make Tkinter work on my Scientific Linux 6 (SL6) system. The python version is the SL6 default Python/2.6.6, and the tkinter is also from SL6 repository, "tkinter-2.6.6-51.el6.x86_64". I was able to import _tkin

cx_freeze and temporary files - security related question

2014-05-21 Thread Nagy László Zsolt
I need to create an application for Windows 7 that runs from a flash drive. This program would be used to create remote backups of the pendrive. The pendrive contains sensitive data, so when I plug in the pendrive and run the program to make a backup, it should not leave any trace of operation

tkinter errors out without clear message

2014-05-21 Thread Kai Song
Dear Python community, I have been trying to make Tkinter work on my Scientific Linux 6 (SL6) system. The python version is the SL6 default Python/2.6.6, and the tkinter is also from SL6 repository, "tkinter-2.6.6-51.el6.x86_64". I was able to import _tkinter and Tkinter, and the _test() will bri

Re: Basic help

2014-05-21 Thread bob gailer
On 5/21/2014 3:31 AM, Pat Fourie wrote: > > Good Day Bob, > > Many thanks for your response. ur welcome. Some guidelines: Post in plain text (rather than formatted with colors etc.) reply to the list so we all get a chance to read your responses. > > As mentioned I am new to Python, I apologise

Re: All-numeric script names and import

2014-05-21 Thread Ethan Furman
On 05/21/2014 06:46 AM, Chris Angelico wrote: # from 1 import app as application # Doesn't work with a numeric name application = __import__("1").app The statement form of import only works with valid Python identifiers. So all numeric names won't work, names with dashes won't work, etc. -

Re: Copying non-existing files

2014-05-21 Thread Chris Angelico
On Thu, May 22, 2014 at 12:14 AM, Rustom Mody wrote: > d ++ "\\" ++ f ITYM: d + "\\" + f or possibly: d + "/" + f ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: All-numeric script names and import

2014-05-21 Thread Chris Angelico
On Thu, May 22, 2014 at 12:32 AM, Dave Angel wrote: > I don't think there's any question of dumbhood, but the answer > should be found in the formal grammar document. Yeah, I figured it'd be an issue of the grammar. It expects 1 to mean an integer, not a name - which in most contexts is correct

Re: All-numeric script names and import

2014-05-21 Thread Chris Angelico
On Thu, May 22, 2014 at 12:24 AM, Mark H Harris wrote: > On the other hand, if you open IDLE and then open the 1.py module (yes, > that's a dumb name) and then click run--> run module it will import and > run... assuming 1.py contains some valid python code. Oh, it runs fine as an application,

Re:All-numeric script names and import

2014-05-21 Thread Dave Angel
Chris Angelico Wrote in message: > If I have a file called 1.py, is there a way to import it? Obviously I > can't import it as itself, but in theory, it should be possible to > import something from it. I can manage it with __import__ (this is > Python 2.7 I'm working on, at least for the moment),

Re: Reading OpenOffice spreadsheet in Python?

2014-05-21 Thread Skip Montanaro
On Wed, May 21, 2014 at 3:53 AM, Rustom Mody wrote: > Another possibility: Use google drive/docs spreadsheet capability. > Makes much less mess than libreoffice and will export to standard formats Correct, though it separates my spreadsheet from the Git repository, and means anyone else at work w

Re: All-numeric script names and import

2014-05-21 Thread Mark H Harris
On 5/21/14 8:46 AM, Chris Angelico wrote: # from 1 import app as application # Doesn't work with a numeric name application = __import__("1").app Is there a way to tell Python that, syntactically, this thing that looks like a number is really a name? Or am I just being dumb? (Don't hold back on

Re: Copying non-existing files

2014-05-21 Thread Rustom Mody
On Wednesday, May 21, 2014 2:11:42 PM UTC+5:30, Satish ML wrote: > import xlrd, sys, os, shutil > for f in files: > for s in source: > for d in destination: > print f > print s >

All-numeric script names and import

2014-05-21 Thread Chris Angelico
If I have a file called 1.py, is there a way to import it? Obviously I can't import it as itself, but in theory, it should be possible to import something from it. I can manage it with __import__ (this is Python 2.7 I'm working on, at least for the moment), but not with the statement form. # from

Re: Adding R squared value to scatter plot

2014-05-21 Thread Jason Swails
​​ On Wed, May 21, 2014 at 7:59 AM, Jamie Mitchell wrote: > I have made a plot using the following code: > > python2.7 > import netCDF4 > import matplotlib.pyplot as plt > import numpy as np > > > swh_Q0_con_sw=netCDF4.Dataset('/data/cr1/jmitchel/Q0/swh/controlperiod/south_west/swhcontrol_swes

Adding R squared value to scatter plot

2014-05-21 Thread Jamie Mitchell
I have made a plot using the following code: python2.7 import netCDF4 import matplotlib.pyplot as plt import numpy as np swh_Q0_con_sw=netCDF4.Dataset('/data/cr1/jmitchel/Q0/swh/controlperiod/south_west/swhcontrol_swest_annavg1D.nc','r') hs_Q0_con_sw=swh_Q0_con_sw.variables['hs'][:] swh_Q3_con_sw

Re: Copying non-existing files

2014-05-21 Thread Peter Otten
Satish ML wrote: [You're back to turd-formatted text; please find a permanent fix for this] > C:\Desktop\salingeg\dest\code > Traceback (most recent call last): > File > "C:\Users\salingeg\Desktop\excel_1.py", line 24, in > shut > il.copy(s, d) > File "C:\Program Files (x86)\python26\lib\shut

Re: Python and Math

2014-05-21 Thread Robert Kern
On 2014-05-21 01:40, Dennis Lee Bieber wrote: On Sun, 18 May 2014 14:09:43 -0400, "Bill Cunningham" declaimed the following: linear algebra, expanding and factoring equations of all degrees. Geometry. Without significant add-in libraries, probably not... "Expanding and f

Re: Copying non-existing files, was Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without over

2014-05-21 Thread Satish ML
On Wednesday, May 21, 2014 2:42:49 PM UTC+5:30, Peter Otten wrote: > Satish ML wrote: [Regarding subject: let's see if we can trigger a buffer > overflow somewhere ;)] > On Wednesday, May 21, 2014 6:59:40 AM UTC+5:30, > Rustom Mody wrote: >> On Tuesday, May 20, 2014 9:35:10 PM UTC+5:30, Jagadeesh

Re: Python and Math

2014-05-21 Thread Robert Kern
On 2014-05-21 01:59, Tony the Tiger wrote: On Sun, 18 May 2014 14:09:43 -0400, Bill Cunningham wrote: linear algebra, expanding and factoring equations of all degrees. Geometry. Sounds to me like you really want something like Maple, Mathematica, or similar. Try http://www.scilab.org/ C

Copying non-existing files, was Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwrit

2014-05-21 Thread Peter Otten
Satish ML wrote: [Regarding subject: let's see if we can trigger a buffer overflow somewhere ;)] > On Wednesday, May 21, 2014 6:59:40 AM UTC+5:30, Rustom Mody wrote: >> On Tuesday, May 20, 2014 9:35:10 PM UTC+5:30, Jagadeesh N. Malakannavar >> wrote: > Hi Satish, > > Can you please send python p

Re: Code a web service with python/postgis

2014-05-21 Thread Burak Arslan
On 05/20/14 21:10, lcel...@latitude-geosystems.com wrote: > Dear all, > > I would like code a web service with python. I have already imported > several vector data > (land cover) and one Digital Elevation Model (raster layer) into my > postgresql/postgis > database (server side). > > I succeed in

Re: Reading OpenOffice spreadsheet in Python?

2014-05-21 Thread Rustom Mody
On Tuesday, May 20, 2014 10:08:06 PM UTC+5:30, Skip Montanaro wrote: > I don't have Windows and since upgrading my Mac to Mavericks I no > longer have Excel of any flavor. I have a few Excel spreadsheets in > which I store parameters from which I generate other config files. I > read those spreadsh

Re: Copying files from sub folders under source directories into sub folders with same names as source directory sub folders in destination directories without overwriting already existing files of sa

2014-05-21 Thread Satish ML
On Wednesday, May 21, 2014 6:59:40 AM UTC+5:30, Rustom Mody wrote: > On Tuesday, May 20, 2014 9:35:10 PM UTC+5:30, Jagadeesh N. Malakannavar > wrote: > Hi Satish, > > Can you please send python part in plain text format? > Python code here is > > difficult to read. It would be helpful to read >

Re: 'Swampy' installation through 'pip'

2014-05-21 Thread Ronak Dhakan
After reading the suggestions... I uninstalled Python 2.7.6 from 'E:\Program Files\Python 2.7.6' & installed in 'C:\Python27'. Then I put 'get-pip.py' file in 'C:\Python27' , opened command prompt, navigated to 'C:\Python27' & ran 'python get-pip.py' and pip was installed.