Solved the issue, by injecting the query into the cmd line. Shell script
worked fine as if I was cutting and pasting to the prompt. Seems to still be
something with the subprocess receiving and exit code before or when the query
finishes, just when I ask to to read from the .SQL file.
example
Oscar I can confirm this behavior from terminal.
AND this works as well, simulating exactly what I'm doing permissions wise, and
calling sudo python test.py below
f1 = open('TESTDIR/file1.txt', 'w')
f1.write('some test here\n')
f1.close()
cmd1 = 'cat < TESTDIR/file1.txt > TESTDIR/file2.txt'
P
Oscar, seems you may be correct. I need to run this program as a superuser.
However, after some more tests with simple commands... I seem to be working
correctly from any permission level in python Except for the output write
command from the database to a file. Which runs fine if I past
Thanks for verifying this for me Steven. I'm glad you are seeing it work.
It's really the strangest thing.
The issue seems to be with the " > outfile.txt" portion of the command.
The actual command is running a query on a verticalDB and dumping the result.
The EXACT command run from the comm
Thanks! I am using .txt extensions. Sorry for being a little vague.
--
http://mail.python.org/mailman/listinfo/python-list
Example of the issue for arguments sake:
Platform Ubuntu server 12.04LTS, python 2.7
Say file1.txt has "hello world" in it.
subprocess.Popen("cat < file1 > file2", shell = True)
subprocess.call("cat < file1 > file2", shell = True)
os.system("cat < file1 > file2")
I'm finding that file2 IS crea
On Jun 14, 3:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Jun 14, 4:39 pm, py_genetic <[EMAIL PROTECTED]> wrote:
>
> > > You didn't try hard enough. :)
>
> > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465
>
>
>
> You didn't try hard enough. :)
>
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465
>
> --
> HTH,
> Rob
Thanks Rob, "permutation" was the keyword I shcould have used!
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm looking to generate x alphabetic strings in a list size x. This
is exactly the same output that the unix command "split" generates as
default file name output when splitting large files.
Example:
produce x original, but not random strings from english alphabet, all
lowercase. The lengt
Alex, thanks for the advise:
> > class PosRecords(tables.IsDescription):
>
> > class A(object):
> > self.__init__(self, args):
>
> This makes 0 sense; maybe you should learn elementary Python syntax well
> _before_ trying advanced stuff, no?
I accidently left that erroneous snippet in, howeve
Is this possible or is there a better way. I need to create a new
class during runtime to be used inside a function. The class
definition and body are dependant on unknows vars at time of exec,
thus my reasoning here.
class PosRecords(tables.IsDescription):
class A(object):
self.__init__(s
This is excellect advise, thank you gentelman.
Paddy:
We can't really, in this arena make assumtions about the data source.
I fully agree with your point, but if we had the luxury of really
knowing the source we wouldn't be having this conversation. Files we
can deal with could be consumer data
Hello,
I'm importing large text files of data using csv. I would like to add
some more auto sensing abilities. I'm considing sampling the data
file and doing some fuzzy logic scoring on the attributes (colls in a
data base/ csv file, eg. height weight income etc.) to determine the
most efficient
py_genetic wrote:
> I have an H5 file with one group (off the root) and two large main
> tables and I'm attempting to aggragate my data into 50+ new groups (off
> the root) with two tables per sub group.
>
> sys info:
> PyTables version: 1.3.2
> HDF5 version:
Gary Herron wrote:
> py_genetic wrote:
> > py_genetic wrote:
> >
> >> [EMAIL PROTECTED] wrote:
> >>
> >>> py_genetic wrote:
> >>>
> >>>> How can you make python interpret a string (of py code) as code. For
> >>>&g
py_genetic wrote:
> [EMAIL PROTECTED] wrote:
> > py_genetic wrote:
> > > How can you make python interpret a string (of py code) as code. For
> > > example if you want a py program to modify itself as it runs. I know
> > > this is an advantage of interp
[EMAIL PROTECTED] wrote:
> py_genetic wrote:
> > How can you make python interpret a string (of py code) as code. For
> > example if you want a py program to modify itself as it runs. I know
> > this is an advantage of interpreted languages, how is this done in
> >
How can you make python interpret a string (of py code) as code. For
example if you want a py program to modify itself as it runs. I know
this is an advantage of interpreted languages, how is this done in
python. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I have an H5 file with one group (off the root) and two large main
tables and I'm attempting to aggragate my data into 50+ new groups (off
the root) with two tables per sub group.
sys info:
PyTables version: 1.3.2
HDF5 version: 1.6.5
numarray version: 1.5.0
Zlib version: 1.2.3
BZIP2 ve
>Now I'm even more confused. What kind of array is "error" here? First you tell
>me it's a (25000, 80) array and now you are telling me it is a (25000,) array.
>Once you've defined what "error" is, then please tell me what the quantity is
>that you want to calculate. I think I told you several diff
True! it is rediculous/insane as I mentioned and noted and agreed with
you (in all your responses) and was my problem, however, not wrong
(same result), as I was just simply noting (not to be right), although,
yes, insane. Thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
>No! matrix objects use matrix multiplication for *. You seem to need
>elementwise
>multiplication.
No! when you mult a vector with itself transposed, the diagonal of the
resulting matrix is the squares of each error (albeit you do a lot of
extra calc), then sum the squares, ie trace(). Its a ni
22 matches
Mail list logo