On 18Dec2012 05:39, Dave Angel wrote:
| On 12/18/2012 05:27 AM, Hans Mulder wrote:
| > On 18/12/12 06:10:43, photonym...@gmail.com wrote:
| >> I hope I understand the question... but shouldn't you wait for the process
to complete before exiting?
| >>
| >> Something like:
| >>
| >> pid = subproces
On 17/12/12 21:56:50, py_genetic wrote:
> /usr/local/Calpont/mysql/bin/mysql
> --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root myDB <
> /home/myusr/jobs/APP_JOBS/JOB_XXX.SQL > /home/myusr/jobs/APP_JOBS/JOB_XXX.TXT
If you're trying to interact with a MySQL database, then
you should really
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
Can you trim content and interleave your response (instead of
top-posting) please?
On 18 December 2012 18:26, py_genetic wrote:
> HOWEVER...
>
> when using this command from before no dice
>
> /usr/local/Calpont/mysql/bin/mysql
> --defaults-file=/usr/local/Calpont/mysql/my.cnf -u root myDB <
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
On 18/12/12 11:39:56, Dave Angel wrote:
> On 12/18/2012 05:27 AM, Hans Mulder wrote:
>> On 18/12/12 06:10:43, photonym...@gmail.com wrote:
>>> I hope I understand the question... but shouldn't you wait for the process
>>> to complete before exiting?
>>>
>>> Something like:
>>>
>>> pid = subprocess
On 12/18/2012 05:27 AM, Hans Mulder wrote:
> On 18/12/12 06:10:43, photonym...@gmail.com wrote:
>> I hope I understand the question... but shouldn't you wait for the process
>> to complete before exiting?
>>
>> Something like:
>>
>> pid = subprocess.Popen(...)
>> pid.wait()
>>
>> Otherwise, it'll
On 18/12/12 06:10:43, photonym...@gmail.com wrote:
> I hope I understand the question... but shouldn't you wait for the process to
> complete before exiting?
>
> Something like:
>
> pid = subprocess.Popen(...)
> pid.wait()
>
> Otherwise, it'll exit before the background process is done.
Why w
I hope I understand the question... but shouldn't you wait for the process to
complete before exiting?
Something like:
pid = subprocess.Popen(...)
pid.wait()
Otherwise, it'll exit before the background process is done.
--
http://mail.python.org/mailman/listinfo/python-list
On 17 December 2012 20:56, py_genetic wrote:
> 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 f
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
On 17 December 2012 16:39, py_genetic wrote:
> 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 d
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
py_genetic writes:
> Example of the issue for arguments sake:
>
> Platform Ubuntu server 12.04LTS, python 2.7
>
> Say file1.txt has "hello world" in it.
^
Here, you speak of "file1.txt" (note the extension ".txt")
> subprocess.Popen("cat < file1 > file2", shell = True)
> subprocess
On Fri, 14 Dec 2012 10:13:38 -0800, py_genetic wrote:
> 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 =
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
Nathan Rice wrote:
> I just ran into this yesterday, and I am curious if there is a
> rational behind it...
>
> I have a class that uses a dictionary to dispatch from other classes
> (k) to functions for those classes (v). I recently ran into a bug
> where the dictionary would report that a clas
On Thu, Dec 15, 2011 at 7:34 AM, Nathan Rice
wrote:
> I just ran into this yesterday, and I am curious if there is a
> rational behind it...
>
> I have a class that uses a dictionary to dispatch from other classes
> (k) to functions for those classes (v). I recently ran into a bug
> where the dic
It would be more work than I want to go into to provide full context
(unless it is to file a bug report, if it actually is a bug). I
verified that there are no cyclical dependency issues using snakefood,
and I doublechecked that just changing the import from full to partial
name is sufficient to r
On 12/15/2011 09:34 AM, Nathan Rice wrote:
I just ran into this yesterday, and I am curious if there is a
rational behind it...
I have a class that uses a dictionary to dispatch from other classes
(k) to functions for those classes (v). I recently ran into a bug
where the dictionary would repor
I just ran into this yesterday, and I am curious if there is a
rational behind it...
I have a class that uses a dictionary to dispatch from other classes
(k) to functions for those classes (v). I recently ran into a bug
where the dictionary would report that a class which was clearly in
the dicti
On 2011.09.22 03:12 AM, Chris Angelico wrote:
> In theory, this should mean that you load it fresh every time - I
> think. If not, manually deleting entries from sys.modules might help,
> either with or without the list of modules.
I've played around with sys.modules, and it seems there are issues
On 2011.09.22 03:25 AM, Steven D'Aprano wrote:
> Objects left lying around from before the reload will keep references
> open to the way things were before the reload. This often leads to
> confusion when modules are edited, then reloaded. (Been there, done that.)
I'll keep that in mind. My modul
On Wed, 21 Sep 2011 23:47:55 -0500, Andrew Berg wrote:
> On 2011.09.21 11:22 PM, Steven D'Aprano wrote:
>> You could
>> try something like this (untested):
> That works. Thanks!
> This makes me wonder what else stays around after a reload
Practically everything. A reload doesn't delete anything,
On Thu, Sep 22, 2011 at 5:59 PM, Andrew Berg wrote:
> That's quite unappealing for a few reasons. First, that would likely
> require writing an entirely new bot (I'm not even that familiar with the
> current one; I've only been writing a module for it).
Ah, then yeah, it's probably not a good ide
On 2011.09.22 01:46 AM, Chris Angelico wrote:
> I think Pike may be a good choice for you.
That's quite unappealing for a few reasons. First, that would likely
require writing an entirely new bot (I'm not even that familiar with the
current one; I've only been writing a module for it). Also, I don'
On Thu, Sep 22, 2011 at 3:54 PM, Andrew Berg wrote:
> The main program is an IRC bot, which could potentially be in use by
> many people in several channels on a network. As it is, the bot can only
> connect to one server, but it could probably be set up to connect to any
> number of networks. Mak
On 2011.09.22 12:09 AM, Chris Angelico wrote:
> On-the-fly reloading of modules isn't really one of Python's
> strengths. Everyone who asks about it seems to be doing rapid
> development/debugging and wanting to save on startup time (as opposed
> to, say, running a server and updating code in it wh
On Thu, Sep 22, 2011 at 2:47 PM, Andrew Berg wrote:
> This makes me wonder what else stays around after a reload and what side
> effects there are, though. I would really like to purge everything from
> the previous import. The main program has no dependence on the module
> whatsoever.
>
On-the-f
On 2011.09.21 11:22 PM, Steven D'Aprano wrote:
> You could
> try something like this (untested):
That works. Thanks!
This makes me wonder what else stays around after a reload and what side
effects there are, though. I would really like to purge everything from
the previous import. The main progra
On Wed, 21 Sep 2011 20:53:04 -0500, Andrew Berg wrote:
> When using a logger in a module and then using imp.reload to reload the
> module, logger messages are repeated in direct proportion to the number
> of times the modules was loaded. That is, on the first import, the
> message is written once,
On Thu, Sep 22, 2011 at 12:44 PM, Andrew Berg wrote:
> The reload isn't controlled by the module, but I have no problem
> clearing out any loggers at the beginning.
I'm thinking more along the lines of closing them in the old module
before firing imp.reload() - maybe have a function in the module
On 2011.09.21 08:57 PM, Chris Angelico wrote:
> Unfortunately, Python doesn't really like modules to be reloaded. Are
> you able to explicitly close the logger before reloading?
The reload isn't controlled by the module, but I have no problem
clearing out any loggers at the beginning. I'm looking t
On Thu, Sep 22, 2011 at 11:53 AM, Andrew Berg wrote:
> What causes this, and how can I fix it (or at least work around it)? Due
> to the nature of the program, it's much more convenient to reload a
> module than to restart the entire program (especially when testing).
>
Unfortunately, Python does
When using a logger in a module and then using imp.reload to reload the
module, logger messages are repeated in direct proportion to the number
of times the modules was loaded. That is, on the first import, the
message is written once, but on the second run, each message is written
twice, three tim
En Fri, 13 Nov 2009 16:23:31 -0300, Tilson, Greg (IS)
escribió:
In Windows Python 2.6.3 calling TarFile.add requires arcname= to be set
to work with WinZIP or WinRAR [...]If arcname= is not set during
extraction all filenames are "None"
Suggest document change or filing a bug report
Pos
In Windows Python 2.6.3 calling TarFile.add requires arcname= to be set
to work with WinZIP or WinRAR
Documentation reads:
TarFile.add(name, arcname=None, recursive=True, exclude=None)
Add the file name to the archive. name may be any type of file
(directory, fifo, symbolic link, etc.). If given
On Thu, 26 Mar 2009 17:01:40 -, Edd Barrett wrote:
On Mar 26, 4:21 pm, Steven D'Aprano wrote:
A few more comments, based on your code.
> def __classdef_integer(self):
Double-underscore name mangling is often more trouble than it is worth.
Unless you really need it, not just think you
Hi there,
First of all, thanks to everyone for replying. This has been a great
help.
On Mar 26, 4:21 pm, Steven D'Aprano wrote:
> On Thu, 26 Mar 2009 08:36:49 -0700, Edd Barrett wrote:
> > My question is: why has 'parent_struct_sig' changed? I was under the
> > impression the assignment operator
On Thu, 26 Mar 2009 08:36:49 -0700, Edd Barrett wrote:
> Hi there,
>
> My first post here, so hello :)
Hello and welcome. Let me comment on a few things out of order.
> My question is: why has 'parent_struct_sig' changed? I was under the
> impression the assignment operator copies, not referen
But you didn't do an assignment, you did an append. Append modifies the
object, which is referenced by both parent_struct_sig and
this_cdata["struct-sig"]
If you're sure you want a *copy* of the list before the modifications,
you might do something like
parent_struct_sig = \
On Thu, 2009-03-26 at 08:36 -0700, Edd Barrett wrote:
> Hi there,
>
> My first post here, so hello :)
>
> Just a little background, I am writing my dissertation, which is a JIT
> compiler based upon LLVM and it's python bindings, along with the
> aperiot LL(1) parser.
>
> I have some code here,
Hi there,
My first post here, so hello :)
Just a little background, I am writing my dissertation, which is a JIT
compiler based upon LLVM and it's python bindings, along with the
aperiot LL(1) parser.
I have some code here, which is not behaving as I would expect. Could
someone enlighten me as t
On Mon, Jun 9, 2008 at 4:58 PM, Lie <[EMAIL PROTECTED]> wrote:
> Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to
> the python interpreter, I happen to do this:
>
> ### START OF PYTHON SESSION ###
> Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubu
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to
the python interpreter, I happen to do this:
### START OF PYTHON SESSION ###
Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more
* Gabriel Genellina (Fri, 01 Feb 2008 23:13:27 -0200)
> En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge
> <[EMAIL PROTECTED]> escribió:
> > If you're using the offficial Win32 port of Python than you
> > probably want to use the Cygwin version because Win32 version
> > doesn't support readline any
En Sat, 02 Feb 2008 01:40:50 -0200, Steve Holden <[EMAIL PROTECTED]>
escribi�:
> Gabriel Genellina wrote:
>> I don't understand the comment. Most of the readline functionality is
>> already present on Windows XP (command history, up/down arrows, edit
>> [...]
> Until you try to do something li
Gabriel Genellina wrote:
> En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge
> <[EMAIL PROTECTED]> escribió:
>
>> If you're using the offficial Win32 port of Python than you probably
>> want to use the Cygwin version because Win32 version doesn't support
>> readline anyways.
>
> I don't understand
On 2008-02-02, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge
><[EMAIL PROTECTED]> escribió:
>
>> If you're using the offficial Win32 port of Python than you
>> probably want to use the Cygwin version because Win32 version
>> doesn't support readline
> That's odd, because readline seems to work fine in a Windows
> console (recalling previous lines and line editing).
That's an illusion. The Windows version of Python does not
support or use GNU readline at all. What you see is a feature
of the console window.
Regards,
Martin
--
http://mail.pyt
En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge
<[EMAIL PROTECTED]> escribió:
> If you're using the offficial Win32 port of Python than you probably
> want to use the Cygwin version because Win32 version doesn't support
> readline anyways.
I don't understand the comment. Most of the readline fun
On 2008-02-02, Ross Ridge <[EMAIL PROTECTED]> wrote:
>>When I ssh into a windows machine (running Cygwin sshd), I can
>>invoke python at the shell prompt (you have to use -i option
>>and I don't really understand why).
>>
>>Once it's started there are couple rather odd behaviors:
>>
>> 1) readline
Grant Edwards <[EMAIL PROTECTED]> wrote:
>When I ssh into a windows machine (running Cygwin sshd), I can
>invoke python at the shell prompt (you have to use -i option
>and I don't really understand why).
>
>Once it's started there are couple rather odd behaviors:
>
> 1) readline support doesn't wo
When I ssh into a windows machine (running Cygwin sshd), I can
invoke python at the shell prompt (you have to use -i option
and I don't really understand why).
Once it's started there are couple rather odd behaviors:
1) readline support doesn't work.
2) you have call sys.exit() to exit (neithe
On Dec 22, 7:35 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> > But an expression (e.g. string) is NOT a variable.
>
> in this case, it is. I don't know if it's worth spending more time on
> this, since you're not listening, but let's make one more attempt.
Sure I'm listening (well,
Lie wrote:
> But an expression (e.g. string) is NOT a variable.
in this case, it is. I don't know if it's worth spending more time on
this, since you're not listening, but let's make one more attempt.
for the Entry widget, the "textvariable" argument, if given, identifies
an *internal* Tkint
> But an expression (e.g. string) is NOT a variable. It's fine if the
> value mirrored when I set the textvariable conf to the same variable,
> but in this case I'm setting them to the same expression (e.g. string).
On the other hand, the oddness multiplied since the value replication
doesn't happ
On Dec 22, 1:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> >>> Inspect the following code:
>
> >>> --- start of code ---
> >>> import Tkinter as Tk
> >>> from Tkconstants import *
> >>> root = Tk.Tk()
> >>> e1 = Tk.Entry(root, text = 'Hello World')
> >>> e2 = Tk.Entry(root, text =
Lie wrote:
>>> Inspect the following code:
>>>
>>> --- start of code ---
>>> import Tkinter as Tk
>>> from Tkconstants import *
>>> root = Tk.Tk()
>>> e1 = Tk.Entry(root, text = 'Hello World')
>>> e2 = Tk.Entry(root, text = 'Hello World')
>>
>> the "text" (or "textvariable") option to the Entry
On Dec 22, 4:05 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Lie wrote:
> > Inspect the following code:
>
> > --- start of code ---
> > import Tkinter as Tk
> > from Tkconstants import *
>
> > root = Tk.Tk()
>
> > e1 = Tk.Entry(root, text = 'Hello World')
> > e2 = Tk.Entry(root, text = 'Hello Wor
On Dec 21, 12:30 pm, Lie <[EMAIL PROTECTED]> wrote:
> Inspect the following code:
>
> --- start of code ---
> import Tkinter as Tk
> from Tkconstants import *
>
> root = Tk.Tk()
>
> e1 = Tk.Entry(root, text = 'Hello World')
> e2 = Tk.Entry(root, text = 'Hello World')
>
> e1.grid(row = 1, column = 1
Lie wrote:
> Inspect the following code:
>
> --- start of code ---
> import Tkinter as Tk
> from Tkconstants import *
>
> root = Tk.Tk()
>
> e1 = Tk.Entry(root, text = 'Hello World')
> e2 = Tk.Entry(root, text = 'Hello World')
the "text" (or "textvariable") option to the Entry widget is the na
Inspect the following code:
--- start of code ---
import Tkinter as Tk
from Tkconstants import *
root = Tk.Tk()
e1 = Tk.Entry(root, text = 'Hello World')
e2 = Tk.Entry(root, text = 'Hello World')
e1.grid(row = 1, column = 1)
e2.grid(row = 2, column = 1)
e1.insert(END, 'Hello Python')
root.mai
[EMAIL PROTECTED] wrote:
please stop top-posting, it's getting very annoying
> ya know, I've searched for these "new classes" at least five times.
Then go and buy yourself a pair of glasses. It's one of the entrie in
the "documentation" menu of python.org.
--
bruno desthuilliers
python -c "pri
THANK YOU!
Now I can actually worry about the advantages/disadvantages!
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> ya know, I've searched for these "new classes" at least five times.
> I've heard all the wonderful things about how they make your life into
> a piece of chocolate with rainbows sprinkled in it. Never once have I
> found a site that explains what syntax to use to make th
[EMAIL PROTECTED] schrieb:
> ya know, I've searched for these "new classes" at least five times.
> I've heard all the wonderful things about how they make your life into
> a piece of chocolate with rainbows sprinkled in it. Never once have I
> found a site that explains what syntax to use to make
ya know, I've searched for these "new classes" at least five times.
I've heard all the wonderful things about how they make your life into
a piece of chocolate with rainbows sprinkled in it. Never once have I
found a site that explains what syntax to use to make these new
classes.
Anyone have a U
[EMAIL PROTECTED] wrote:
> I'm getting rather inconsistent behavior with staticmethod.
Not really.
class A:
> def orig():
> print "hi"
> st = staticmethod(orig)
> st2 = st
> wrapped = [ orig ]
> wrapped2 = [ st ]
...
A.wrapped[0]() # ODD - wra
I'm getting rather inconsistent behavior with staticmethod.
@staticmethod has the same problems, but I'm demonstrating it with
staticmethod() because it shows things more clearly
---
>>> class A:
def orig():
print "hi"
On Fri, 11 Nov 2005 11:34:47 -0800, Greg wrote:
> Forgive me, and be kind, as I am just a newby learning this language
> out of M.L. Hetland's book. The following behavior of 2.4.1 seems very
> strange
x = ['aardvark', 'abalone', 'acme', 'add', 'aerate']
x.sort(key=len)
x
> ['add'
On 2005-11-11, Kristian Zoerhoff <[EMAIL PROTECTED]> wrote:
> On 11 Nov 2005 11:34:47 -0800, Greg <[EMAIL PROTECTED]> wrote:
>> Forgive me, and be kind, as I am just a newby learning this language
>> out of M.L. Hetland's book. The following behavior of 2.4.1 seems very
>> strange
>> >>> x = ['aar
On 11 Nov 2005 11:34:47 -0800, Greg <[EMAIL PROTECTED]> wrote:
> Forgive me, and be kind, as I am just a newby learning this language
> out of M.L. Hetland's book. The following behavior of 2.4.1 seems very
> strange
> >>> x = ['aardvark', 'abalone', 'acme', 'add',
> 'aerate']
> >>> x.sort(ke
Forgive me, and be kind, as I am just a newby learning this language
out of M.L. Hetland's book. The following behavior of 2.4.1 seems very
strange
>>> x = ['aardvark', 'abalone', 'acme', 'add',
'aerate']
>>> x.sort(key=len)
>>> x
['add', 'acme', 'aerate', 'abalone', 'aardvark']
>>> x.sort(re
In article <[EMAIL PROTECTED]>,
"Yin" <[EMAIL PROTECTED]> wrote:
> I am writing a script that monitors a child process. If the child
> process dies on its own, then the parent continues on. If the child
> process is still alive after a timeout period, the parent will kill the
> child process. E
I am writing a script that monitors a child process. If the child
process dies on its own, then the parent continues on. If the child
process is still alive after a timeout period, the parent will kill the
child process. Enclosed is a snippet of the code I have written. For
some reason, unless
Erik: Thanks, that was it! Figured it was something along those lines,
but like I said, I didn't know specifically what was going on or what
to look for.
Larry: That recipe could be useful, thanks a lot :)
And thanks for the quick replies, too, you guys are awesome.
Regards,
Jeff
--
http://ma
Take a look at this recipe which is part of the latest
Python Cookbook. I think it will help you.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207
Larry Bates
Jeffrey E. Forcier wrote:
> This is a difficult issue to search for, and Googling (and reviewing
> the pertinent Python do
Jeffrey E. Forcier wrote:
> Doing multiple print statements inside a for loop, using the 'comma at
> the end eats the newline' variant, results in zero output until the
> loop completes its entire iteration.
sys.stdout is line buffered. Put an intervening sys.stdout.flush() in
between your prin
This is a difficult issue to search for, and Googling (and reviewing
the pertinent Python docs) has not found me anything useful. It's also
not a super important issue, but regardless of whether it's avoidable,
I still want to know what the heck is going on.
Doing multiple print statements inside
81 matches
Mail list logo