packaging python for install.

2005-09-11 Thread J
Hi everyone, I have created an App that embedds the python interpreter and I am now in the process of creating an installer. I am currently linking python24.lib, but it is only 184k and I suspect that it imports other dlls... I am also using numarray. Does anyone have any experiences in packaging

Re: packaging python for install.

2005-09-12 Thread J
Hi Miki Thx for you reply. I have tried the procedure but I am stuck with python setup.py py2exe --includes mymodule. I get the following error: ImportError: No module named mymodule I don't know what mymodule should contain. Basically I want all of python and numarray to be part of the

packaging python for install.

2005-09-14 Thread J
Hi everyone, I have posted a question on this topic before and already received some useful advice. I am basically trying to package python with an App that embedds the interpretor. I am also including numarray (i.e. I have a #include numarray/arrayobject.h in my C++ code). However it looks

Re: packaging python for install.

2005-09-14 Thread J
Hi I found the solution to problem and I just want to document it for the next guy. I did not copy the content of the 'dist' directory created by Py2exe to the folder containing my executable. Changing HKEY_LOCAL_MACHINE\SOFTWARE\PythonCore\version. alone did not work for me... maybe I should

packaging python

2005-09-25 Thread J
Hi everyone, I managed to package python for distribution with my app. I made 'dist' using py2exe and everything runs fine except there is no more output from the python interpreter. I redirect the output like so... static PyMethodDef ioMethods[] = { {output, output, METH_VARARGS, output},

reference count

2005-09-28 Thread J
Hi, I have a problem with the reference count after an error occurs in a script which I execute as follows.. PyObject* lDict = PyDict_New(); PyDict_SetItemString(lDict, item, (PyObject*)iItem-mPyObject); PyObject* lResult = PyEval_EvalCode(mCode, ScnGlobal::sDictionary, lDict); if (! lResult) {

Re: reference count

2005-09-28 Thread J
I tend to answer my own questions a lot. But he, lets grow the knowledge base :)... PyErr_Clear() after PyErr_Print did the trick J -- http://mail.python.org/mailman/listinfo/python-list

VC++ linking problem

2005-07-07 Thread J
Hi everyone, I started embedding python into a 3D graphics App and I came across this linking problem. SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol __imp__Py_InitModule4TraceRefs SO.lib(ScnNode.obj) : error LNK2001: unresolved external symbol __imp___Py_RefTotal

Re: VC++ linking problem

2005-07-07 Thread J
Thank you very much Miki! That was an easy solution. It links... I will put a hold on compiling the latest version until I really have to. I will probably switch to VC 7 before that. Cheers Jochen Miki Tebeka wrote: Hello Jochen, I started embedding python into a 3D graphics App and I came

publishing an already instantiated class

2005-07-07 Thread J
Hi everyone, Thanks for your awsome replies. I started replacing Javascript with python 2 days ago and I already have my first scripts running. Mainly due to the wealth of information in this blog. I have a C++ object that is already instantiated and now I want to give python a reference to

Re: publishing an already instantiated class

2005-07-07 Thread J
I think I just found my own solution, so I will record it for future references I did this in my Constructor of X { PyStruct* lObject; lObject = PyObject_New(PyStruct, X::PyType); lObject-mObject = this; } What does everyone think about this. I am posting a little bit out of the hip

embedding a new method

2005-07-08 Thread J
Hi everyone, I am fairly new to python (3rd day), but i am fairly keen on replacing javascript. I want to externalize some of the mehtod in my App, an allow user to imp char* lBuffer = def handler(color):\n print 12 PyObject* lCode = Py_CompileString(lBuffer,

Re: embedding a new method

2005-07-08 Thread J
If your are reading this, I am sorry but I forgot to finish the first paragraph :(. I am trying to externalize some methods of a C++ object using python. User will be able to implement the function via the GUI and I then would like to add it to an instance... So the class consits of both

linking problem

2005-07-08 Thread J
Hi everyone, I thought that I would compile the python debug library and step through it to figure out where things fail. So, I downloaded python 2.4.1 and compile the python24_d.lib using the dsp files in PCBuild. It compiles fine whitout a problem, but when I link agains it i get a unresolved

inheritance

2005-07-10 Thread J
Hi I am trying to make a C++ class hierarchy accessible to python scripts. Am I right to assume that the type structure of a derived class must have all the members of its base class declared as well ? For example, typedef struct { PyObject_HEAD int

Re: inheritance

2005-07-10 Thread J
just to follow up. I managed to get it working by having a closer look at the xxmodules. However, the example does the following typedef struct { PyStructBaseClass mBase; int mValue; } PyStructDerivedClass; Does anything speak agains doing this ?

Adding and attribute to an instance

2005-08-09 Thread J
Hi, I am trying to add new data attributes to my extension classes from within a script. I am under the impression that python allows that implicity This is the definition of my class PyTypeObject CmdPlace::PyType = { PyObject_HEAD_INIT(NULL) 0,

Numarray, numeric, NumPy, scpy_core ??!!

2006-01-20 Thread J
Hi I hope the title of this message indicates my question. I am looking for basic array functionality in Python and it turns out that there are all these packages which are somehow related. Some are allegedly discontinued but still seem to get updated. Could we start a discussion about which

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-21 Thread J
Ok, I will look at NumPy ... I have another question about performance. Are the array operations such as matrix multiplication implemented in python or in C ? I was under the impression that the function calls in numarray are only wrappers to C code, but now I suspect that matrix multiplicaiton

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-21 Thread J
I will just jump in an use NumPy. I hope this one will stick and evolve into the mother of array packages. How stable is it ? For now I really just need basic linear algebra. i.e. matrix multiplication, dot, cross etc Cheers -- http://mail.python.org/mailman/listinfo/python-list

Email Program

2009-02-28 Thread J
Is it possible to make a GUI email program in Python that stores emails, composes, ect? -- http://mail.python.org/mailman/listinfo/python-list

Email Program

2009-02-28 Thread J
Is it possible to make a GUI email program in Python that stores emails, composes, ect? Also, could I create my own programming language in Python? What are Pythons limits, or is this just a waste of my time to learn it. -- http://mail.python.org/mailman/listinfo/python-list

Question about xml.com

2009-03-10 Thread J
] and commandlet.childNodes[2] empty? Thanks in advance! J print xmldoc.firstChild.toxml() 0.1 Beta test just a test somebody linux2 0 3.19 commandlet=xmldoc.firstChild print commandlet.firstChild.toxml() print commandlet.childNodes[0].toxml() print commandlet.childNodes[1].toxml

Willa Ford Angelina Joli Paris Hilton

2007-04-14 Thread A - J
Willa Ford Angelina Joli Paris Hilton www.alphasearch.GR-- http://mail.python.org/mailman/listinfo/python-list

NewB: Glob Question

2007-05-03 Thread J
Greetings Group- I'm trying to put together a pattern matching script that scans a directory tree for tif images contained in similar folder names, but running into a NewB problem already. Is it the way I'm trying to join multiple paths? Any help would be greatly appericated. Thanks, J! import

Matching Directory Names and Grouping Them

2007-01-11 Thread J
expressions, but so far haven't found code that can do the trick. Any help would be greatly appreciated. Thanks! J. -- http://mail.python.org/mailman/listinfo/python-list

Re: Matching Directory Names and Grouping Them

2007-01-11 Thread J
representing year and a subdirectory name containing a two digit number representing a month. The matches are grouped together and written into a text file. I hope this helps. Kind Regards, J Steve Holden wrote: J wrote: Hello Group- I have limited programming experience, but I'm looking

Python Module: nift

2009-02-08 Thread J
What are your thoughts on this module I created? ''' A Python Module created by a High School Student. Includes rev(), reet(), and leet(). Import nift Function: nift.rev() Description:Reverses a string Usage: nift.rev('string')

Re: Python Module: nift

2009-02-08 Thread J
Thanks for your answers, especially Chris Rebert and Paul McGuire's. I have a question: How far does Python go in the Game Development field? (Using Python only, no extensions) -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginning Question about Python functions, parameters...

2009-11-23 Thread j
On Nov 23, 12:37 pm, Neo n...@picture-art.eu wrote: astral orange schrieb: Hi, I am trying to teach myself Python and have a good book to help me but I am stuck on something and I would like for someone to explain the following piece of code for me and what it's actually doing. Certain

slightly OT: Python BootCamp

2009-11-28 Thread J
would like to be... Cheers Jeff -- Jonathan Swift - May you live every day of your life. - http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html -- http://mail.python.org/mailman/listinfo/python-list

Re: slightly OT: Python BootCamp

2009-11-29 Thread J
On Sun, Nov 29, 2009 at 03:57, Carl Banks pavlovevide...@gmail.com wrote: On Nov 28, 6:15 pm, J dreadpiratej...@gmail.com wrote: http://www.otg-nc.com/python-bootcamp It's a week long Python Bootcamp. I'm surprised they're able to fill out 5 days with intensive training on Python

Question about file objects...

2009-12-02 Thread J
Something that came up in class... when you are pulling data from a file using f.next(), the file is read one line at a time. What was explained to us is that Python iterates the file based on a carriage return as the delimiter. But what if you have a file that has one line of text, but that one

Re: Question about file objects...

2009-12-02 Thread J
On Wed, Dec 2, 2009 at 09:27, nn prueba...@latinmail.com wrote: Is there a way to read the file, one item at a time, delimited by commas WITHOUT having to read all 16,000 items from that one line, then split them out into a list or dictionary?? File iteration is a convenience since it is the

Re: slightly OT: Python BootCamp

2009-12-03 Thread J
On Sun, Nov 29, 2009 at 20:14, Terry Reedy tjre...@udel.edu wrote: J wrote: Ok... so I've been re-teaching myself python, as it's been several years since I last really used it.  And in the midst of this, my contracting company came up to me on Friday and asked if I'd be interested

Re: slightly OT: Python BootCamp

2009-12-03 Thread J
On Fri, Dec 4, 2009 at 09:21, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Thu, 03 Dec 2009 16:20:24 -0500, J wrote: The difference between me (learning a new language) and the guy teaching (who knows it inside and out) I don't know about that. He's teaching some pretty

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 17:42, John Machin sjmac...@lexicon.net wrote: On Dec 6, 2:46 am, W. eWatson wolftra...@invalid.com wrote: However, even at that, why can't I delete this empty file called Analysis? Are you trying to delete the file from another command window while Python is paused at

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 20:32, J dreadpiratej...@gmail.com wrote: connections eventually.  So being able to find who has a lock on a given file or directory if the program dies unexpectedly would be useful. Google tells me that the program Process Explorer from SysInternals will provide most

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 23:17, W. eWatson wolftra...@invalid.com wrote: J wrote: And those are your only options, really.  From what I've been able to see, there is no native ability in Linux to actually see who has a lock on a file that's been opened.  And I completely understand your

question about imports in a class

2009-12-07 Thread J
Just a little newbie confusion about OS imports... Why does this give me an error: class Windows: def __init__(self): ''' Constructor ''' import os self.dmidecodePath= #final path to dmidecode binary def parseDMI(self): # First, find

Re: question about imports in a class

2009-12-07 Thread J
On Mon, Dec 7, 2009 at 16:13, J dreadpiratej...@gmail.com wrote: But why does importing in the init not make os available to every other function in the class?  Do I have to import OS into every function like this: class ClassA():    def func1(self):        import os    def func2(self

Re: question about imports in a class

2009-12-07 Thread J
On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch de...@nospam.web.de wrote: if I put the import at the beginning of the class, it just dawned on me that perhaps I still have to explicitly call the function by class: sysinfo.py class myclass():    import os    def findDMIDecode(self):      

Problem using commands.getoutput()

2009-12-08 Thread J
://www.brainyquote.com/quotes/authors/j/jonathan_swift.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem using commands.getoutput()

2009-12-08 Thread J
On Tue, Dec 8, 2009 at 14:44, Jerry Hill malaclyp...@gmail.com wrote: At the very top of http://docs.python.org/library/commands.html it says Platforms: Unix, so yes, it's Unix-only. That sound you hear is me beating my head against the table now... sigh... I was too wrapped up in reading the

Help with parsing a list

2009-12-16 Thread J
Hi all, I need some help in turning a list into a dictionary... The list looks something like this: ['key1: data1','key2: data2','key3: data3',' key4: ',' \tdata4.1',' \tdata4.2',' \tdata4.3','key5: data5'] and it's derived from output (via subprocess.Popen) that in a terminal would look like

Thanks for the help not given :)

2009-12-29 Thread J
I just wanted to take a break from writing some code to thank the list for all the help you've NOT given me :-) And I do mean that but I should explain... At least three times today, I've been working on various bits of code, and run into a problem that I just could not figure out. And each

Re: Thanks for the help not given :)

2009-12-29 Thread J
to Perl and thus I try to avoid them whenever possible ;-) Cheers, Jeff -- Jonathan Swift - May you live every day of your life. - http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html -- http://mail.python.org/mailman/listinfo/python-list

Re: multivariable assignment

2009-12-31 Thread J
=[] c=[] Cheers, Jeff -- Jonathan Swift - May you live every day of your life. - http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python books, literature etc

2010-01-06 Thread J
On Wed, Jan 6, 2010 at 09:35, Shawn Milochik sh...@milochik.com wrote: Search Google. You'll find it all. Search this list's archives. This kind of thing has been discussed a thousand times. It also wouldn't hurt to brush up on this: http://catb.org/~esr/faqs/smart-questions.html Heh...

Re: Python books, literature etc

2010-01-06 Thread J
A good point was brought up to me privately, and I agree completely, that the OP should re-state the request with a bit more specifics... Since the OP says he is at least familiar with Python, does he need info on beginner level books that are general purpose, or is he interested in resources

Re: Scripting (was Re: Python books, literature etc)

2010-01-08 Thread J
On Fri, Jan 8, 2010 at 09:37, Jorgen Grahn grahn+n...@snipabacken.se wrote: Regarding the book's title: is it just me, or are Python programmers in general put off when people call it scripting? I won't attempt a strict definition of the term scripting language, but it seems like

Re: table from csv file

2010-01-08 Thread J
On Fri, Jan 8, 2010 at 13:55, Jon Clements jon...@googlemail.com wrote: On Jan 8, 5:59 pm, marlowe marlowequ...@hotmail.com wrote: I am trying to create a table in python from a csv file where I input which columns I would like to see, and the table only shows those columns. I have attached an

Re: table from csv file

2010-01-09 Thread J
On Sat, Jan 9, 2010 at 05:26, Jon Clements jon...@googlemail.com wrote: reader = open('C:/test.txt','rb') data = csv.DictReader(reader,restval='000',restkey='Misc') [snip] DictReader works, but what use to bug me was the fact you couldn't then output the cols in the 'correct' order

Re: What is built-in method sub

2010-01-11 Thread J
On Mon, Jan 11, 2010 at 15:02, Jeremy jlcon...@gmail.com wrote: I am using the re.sub command to remove trailing whitespace from lines in a text file.  The commands I use are copied below.  If you have any suggestions on how they could be improved, I would love to know. Just curious, but if

Re: Inheriting methods but over-riding docstrings

2010-01-17 Thread J
On Sun, Jan 17, 2010 at 19:45, Alf P. Steinbach al...@start.no wrote: Steven: on a personal note, earlier when I saw you (I think it was you) using the Norwegian Parrot example I thought it referred to me because that was the only sense I could make of it, it followed right after some

Re: not and is not problem

2010-01-18 Thread J
id(foo) 11875840 id(bar) 11875744 shows the location for each object in relation to the name pointing to that object... -- Joan Crawford - I, Joan Crawford, I believe in the dollar. Everything I earn, I spend. - http://www.brainyquote.com/quotes/authors/j/joan_crawford.html -- http

Re: Good Book

2010-01-28 Thread J
On Thu, Jan 28, 2010 at 11:09, talal awadh allah...@gmail.com wrote: Many people who want to learn Islam or are new converts find it hard I just wanted to thank you for reminding me that I needed to write a mail filter to delete this kind of drivel. I appreciate the reminder! Cheers, Jeff --

Ideas for creating processes

2010-03-10 Thread J
I'm working on a project and thought I'd ask for a suggestion on how to proceed (I've got my own ideas, but I wanted to see if I was on the right track) For now, I've got this: def main(): ## get our list of directories to refresh releases=sys.argv[1:] if len(releases) 1: print

Re: Ideas for creating processes

2010-03-10 Thread J
On Wed, Mar 10, 2010 at 16:52, J dreadpiratej...@gmail.com wrote: the quick and dirty would be (as I'm imagining it at the moment): for path in pathlist:    chdir into path    execute rsync or zsync but that gets me moving into one dir, updating, then moving into another. What I

Re: Ideas for creating processes

2010-03-10 Thread J
On Wed, Mar 10, 2010 at 18:03, MRAB pyt...@mrabarnett.plus.com wrote: Are you sure that you would gain from doing more than one at a time? The bottleneck will probably be the speed of your network connection, and if that's working at its maximum speed with one sync then doing several

Re: What is Islam?-1

2009-10-13 Thread J
On Tue, Oct 13, 2009 at 20:05, Aahz a...@pythoncraft.com wrote: There's no point in trying to reason with a Muslim. That's not funny, and if you were being serious, that was incredibly rude. Not as much as posting in comp.lang.python. What exactly are you claiming is rude? This entire

A stupid newbie question about output...

2009-10-20 Thread J
Can someone explain why this code results in two different outputs? for os in comp.CIM_OperatingSystem (): print os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion osVer = os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion print osVer the first print statement

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 14:53, Ethan Furman et...@stoneleaf.us wrote: osVer = %s Service Pack %d % (os.Name.split(|)[0],        os.ServicePackMajorVersion) This way, osVer is a string, and not a tuple. Thanks for the help... The tuple thing is a new concept to me... at least the vocabulary

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 16:25, Aahz a...@pythoncraft.com wrote: In article mailman.1745.1256065337.2807.python-l...@python.org, J  dreadpiratej...@gmail.com wrote: The tuple thing is a new concept to me... at least the vocabulary is, I'll go look that up now and learn info on tuples. It's been

OptParse and Constant values

2010-08-12 Thread J
How do you use OptParse with constants? Example: usage = 'Usage: %prog [OPTIONS]' parser = OptionParser(usage) parser.add_option('-l','--level', action='store_const', default=LOG_INFO, help='Set the log level to inject into

Re: OptParse and Constant values

2010-08-12 Thread J
On Thu, Aug 12, 2010 at 12:41, Robert Kern robert.k...@gmail.com wrote: On 8/12/10 11:19 AM, J wrote: How do you use OptParse with constants? http://docs.python.org/library/optparse#standard-option-actions 'store_const' means that the option is a flag without arguments and stores the value

Get Eclipse/PyDev to run scripts that don't end in .py

2010-03-31 Thread J
Is there any way to tell PyDev in Eclipse to run a script that doesn't end in .py? Even if I have to go and manually set something for each file... I've inherited (in a manner of speaking) a dev project that is done in python2.6... I pulled the latest dev branch and have it opened as a project

Regex driving me crazy...

2010-04-07 Thread J
Can someone make me un-crazy? I have a bit of code that right now, looks like this: status = getoutput('smartctl -l selftest /dev/sda').splitlines()[6] status = re.sub(' (?= )(?=([^]*[^]*)*[^]*$)', :,status) print status Basically, it pulls the first actual line of data from the

Re: Regex driving me crazy...

2010-04-07 Thread J
On Wed, Apr 7, 2010 at 22:45, Patrick Maupin pmau...@gmail.com wrote: When I saw And I am interested in the string that appears in the third column, which changes as the test runs and then completes I assumed that, not only could that string change, but so could the one before it. I guess

Re: Regex driving me crazy...

2010-04-08 Thread J
On Thu, Apr 8, 2010 at 01:16, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: Is there any particular reason you absolutely must extract the status message?  If you already have a list of possible status messages, you could just test which one of those is present in the line... Yes and

question about list extension

2010-04-16 Thread J
Ok... I know pretty much how .extend works on a list... basically it just tacks the second list to the first list... like so: lista=[1] listb=[2,3] lista.extend(listb) print lista; [1, 2, 3] what I'm confused on is why this returns None: lista=[1] listb=[2,3] print lista.extend(listb)

Re: question about list extension

2010-04-16 Thread J
On Fri, Apr 16, 2010 at 15:16, Terry Reedy tjre...@udel.edu wrote: On 4/16/2010 9:41 AM, J wrote: Ok... I know pretty much how .extend works on a list... basically it just tacks the second list to the first list... like so: lista=[1] listb=[2,3] lista.extend(listb) print lista; [1, 2, 3

Is it better to extend a class, or do something repetitious in the main part of a program?

2010-04-19 Thread J
First, before I get farther, Is there a way for the logging module to natively handle lists and dict objects when logging? e.g. take this {'key1':'val1','key2':'val2'} and have it logged like this: INFO: key1: val1 INFO: key2: val2 If I pass the dict or list directly to the logger, it is

Difference between Popen and open() for reading a file

2010-04-22 Thread J
I was reading something from a code review a little while ago and saw something that's got my curiosity up... Say I had a file, foo.txt that I wanted to read from, only one time and only read. So what's the difference between this: mylist = Popen([cat,foo.txt],

Re: Difference between Popen and open() for reading a file

2010-04-22 Thread J
On Thu, Apr 22, 2010 at 15:18, Dave Angel da...@ieee.org wrote: The same difference as between handing the paper boy three bucks, versus flying to London to open an account, making a deposit, going to a branch in Sydney and asking for a bank check, then flying back home and taking the paper

Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread J
Is there a better way to do this? def SkewTime(): ''' Optional function. We can skew time by 1 hour if we'd like to see real sync changes being enforced ''' TIME_SKEW=1 logging.info('Time Skewing has been selected. Setting clock ahead 1 hour') # Let's get our current

Re: write a 20GB file

2010-05-14 Thread J
On Fri, May 14, 2010 at 07:32, Jackie Lee jackie.sp...@gmail.com wrote: Thx, Dave, The code works fine. I just don't know how f.write works. It says that file.write won't write the file until file.close or file.flush. So I don't know if the following one is more efficient (sorry I forget to

Re: recursively remove all the directories and files which begin with '.'

2010-05-14 Thread J
On Fri, May 14, 2010 at 10:53, albert kao albertk...@gmail.com wrote: C:\pythonrmdir.py C:\test\com.comp.hw.prod.proj.war\bin ['.svn', 'com'] d .svn dotd C:\test\com.comp.hw.prod.proj.war\bin\.svn Traceback (most recent call last):  File C:\python\rmdir.py, line 14, in module    

Re: write a 20GB file

2010-05-14 Thread J
On Fri, May 14, 2010 at 15:23, Nobody nob...@nowhere.com wrote: On Fri, 14 May 2010 10:50:49 -0400, J wrote: someone smarter than me can correct me, but file.write() will write when it's buffer is filled, or close() or flush() are called. And, in all probability, seek() will either flush

Python way to printk?

2010-06-09 Thread J
Does anyone know of a way, or have a recipe, to do a linux printk equivalent in Python? I've been googling for a while and not finding anything useful. The nutshell version of this is that I need to write a routine for a test tool I'm working on that will time the amount of time used to take a

SimpleXMLRPCServer and creating a new object on for each new client request.

2009-05-06 Thread J
Hi list, My goals is to have concurrent and separated client sessions using xmlrpc. Initially my though was that SimpleXMLRPCServer was able to create a new object instance for each incoming request. But this doesn't appear to be the case, unless I'm overlooking something, if so please point me

Is there a way to create kernel log messages via Python?

2012-10-15 Thread J
Hi... I have a bit of code that does the following: uses the syslog module to inject a LOG_INFO message into the syslog on my linux machine runs a suspend/resume cycle uses the syslog module to inkect a LOG_INFO message marking the end of test. Then I parse everything between the start and stop

Re: tee-like behavior in Python

2012-05-09 Thread J
On Wed, May 9, 2012 at 11:35 AM, Florian Lindner mailingli...@xgm.de wrote: Hello, how can I achieve a behavior like tee in Python? * execute an application * leave the output to stdout and stderr untouched * but capture both and save it to a file (resp. file-like object) I have this code

Help me with a bytes decoding problem in python 3

2012-06-21 Thread J
I have a bit of a problem I hope you could help me sort out with some code I'm porting from 2.x to 3. I have a program with a wrapper for Popen that is called to run certain linux shell commands and gather system info. Essentially the code looks something like this: process =

Re: Help me with a bytes decoding problem in python 3

2012-06-21 Thread J
On Thu, Jun 21, 2012 at 5:54 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Jun 22, 2012 at 7:47 AM, J dreadpiratej...@gmail.com wrote: \xe2\x86\xb3 This is the UTF-8 encoded form of U+21B3, which is the DOWNWARDS ARROW WITH TIP RIGHTWARDS character that you're showing. That's what

Frustrating circular bytes issue

2012-06-26 Thread J
This is driving me batty... more enjoyment with the Python3 Everything must be bytes thing... sigh... I have a file that contains a class used by other scripts. The class is fed either a file, or a stream of output from another command, then interprets that output and returns a set that the main

Flushing buffer on file copy on linux

2012-08-14 Thread J
I was hoping someone could give me some ideas for a particular problem. I've got a python program that is used for basic testing of removable storage devices (usb, mmc, firewire, etc). Essentially, it looks for a mounted device (either user specified, or if not, the program loops through all

Convert AWK regex to Python

2011-05-16 Thread J
Good morning all, Wondering if you could please help me with the following query:- I have just started learning Python last weekend after a colleague of mine showed me how to dramatically cut the time a Bash script takes to execute by re-writing it in Python. I was amazed at how fast it ran. I

Re: Convert AWK regex to Python

2011-05-16 Thread J
Good morning Angelico, Do I understand correctly? Do you mean incorporating a Python dict inside the AWK command? How can I do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert AWK regex to Python

2011-05-16 Thread J
Hello Peter, Angelico, Ok lets see, My aim is to filter out several fields from a log file and write them to a new log file. The current log file, as I mentioned previously, has thousands of lines like this:- 2011-05-16 09:46:22,361 [Thread-4847133] PDU D G_CC_SMS_SERVICE_51408_656.O_

Re: Convert AWK regex to Python

2011-05-16 Thread J
Thanks for the sugestions Peter, I will give them a try Peter Otten wrote: J wrote: Hello Peter, Angelico, Ok lets see, My aim is to filter out several fields from a log file and write them to a new log file. The current log file, as I mentioned previously, has thousands of lines

Re: Convert AWK regex to Python

2011-05-17 Thread J
Hello, I have managed to get my script finished in the end by taking bits from everyone who answered. Thank you so much. the finished query string looks like this (still not the best but it gets the job done. Once I learn to code more with Python I will probably go back to it and re-write

Re: executable builder

2011-12-12 Thread J A
I am having some issues compiling an exe myself but most of that stems from the version of python I am using. That being said, try using GUI2EXE http://code.google.com/p/gui2exe this program makes the setup file go a lot easier, also it will tie in a few different tools like py2exe which is

Is there a way to merge two XML files via Python?

2012-01-12 Thread J
This is more a theory exercise and something I'm trying to figure out, and this is NOT a homework assignment... I'm trying to make a tool I use at work more efficient :) So this is at test tool that generates an XML file as it's output that is eventually used by a web service to display test

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-24 Thread J
On Tue, Jan 24, 2012 at 09:05, Martin P. Hellwig martin.hell...@gmail.com wrote: On 24/01/2012 05:57, Rick Johnson wrote: cut rant I would wish that pedantic citizens of the British colony in America stopped calling whatever misinterpreted waffle they produce, English. I, sir, as a citizen of

Help me with weird logging problem

2012-03-06 Thread J
Hi, I'm trying to add a couple log handlers to a program. The end goal is to log things at INFO or above to console, and if a -v option is set to ALSO log everything at DEBUG or above to a file. However, while I DO get the log file created, and log messages are appearing there, Debug messages

Re: Help me with weird logging problem

2012-03-06 Thread J
On Tue, Mar 6, 2012 at 11:19, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: On Mar 6, 4:09 pm, J dreadpiratej...@gmail.com wrote: Any idea what I'm doing wrong? Levels can be set on loggers as well as handlers, and you're only setting levels on the handlers. The default level on the root logger

Very stupid question about a % symbol

2010-09-16 Thread J
OK, this is a very stupid question about a very simple topic, but Google is failing me this morning... I'm trying to print a string that looks like this: Reported memory amounts are within 10% tolerance and the print line looks (for now) like this: print Reported memory amounts are within %s%s

Re: Very stupid question about a % symbol

2010-09-16 Thread J
On Thu, Sep 16, 2010 at 12:09, Grant Edwards inva...@invalid.invalid wrote: On 2010-09-16, J dreadpiratej...@gmail.com wrote: Reported memory amounts are within 10% tolerance Reported memory amounts are within %d%% tolerance % 10 'Reported memory amounts are within 10% tolerance' Thanks

How to iterate through two dicts efficiently

2011-07-19 Thread J
Hello, I am looking to improve the performance of the following piece of Python code:- for cc in StatusContainer: for srv in StatusContainer[cc]: for id in StatusContainer[cc][srv]['RECV']: if id in StageContainer['13']:

  1   2   3   4   5   6   7   8   9   10   >