Dict Help

2007-07-15 Thread Robert Rawlins
Hello Guys, I'm looking for some help expanding on a dictionary I've got and storing multiple values per key and the best way to do it. I'm guessing that I need to store a list inside the value of the dictionary, but I'm not quite sure how that can be achieved, and also how to check for values

Cant run application as ./myapp.py

2008-03-03 Thread Robert Rawlins
Hello Guys, I've got an application here which for some reason won't start using the following syntax from the command line: Cd /mydirectory ./MyApplication.py I have to run this as a fully qualified python launch such as: Cd /mydirectory python MyApplication.py This is a litt

Logging Date/Time Format

2008-03-10 Thread Robert Rawlins
Hello Guys, I'm using the python logging module, however I'm not happy with the current date/time format which is used to write the timestamp into the log file. I need the logger to write the stamp without the milliseconds appended too it. This is because I use a 3rd party application to parse

MySQL DB-Api

2008-03-11 Thread Robert Rawlins
Good morning list. I'm in the process of learning my way around the DB-API module for MySQL and wanted to come and get some advice on how you all manage your database connections and cursors. Within my applications I'll have many classes which access the database, I'm wondering to what leve

Check For SELF Variable Existance

2008-03-11 Thread Robert Rawlins
Hello Guys, I want to be able to check if a class has a certain property in its 'self' scope, what's the best way to do this? I've seen a few examples of people using a try: block to test if the variable exists but to be honest, this seems a little bit verbose, do we not have a better method of

RE: Check For SELF Variable Existance

2008-03-11 Thread Robert Rawlins
, Mar 11, 2008 at 11:00 AM, Robert Rawlins <[EMAIL PROTECTED]> wrote: > I want to be able to check if a class has a certain property in its 'self' > scope, what's the best way to do this? >>> class Spam(object): ... def egg(self): ... if hasa

RE: SQLObject 0.10.0

2008-03-11 Thread Robert Rawlins
Excellent stuff Oleg, I've been looking for an ORM framework for a while and hadn't settled on one, I'll give this a look through later today. Thanks, Robert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Oleg Broytmann Sent: 11 March 2008 13:40 To: Pyt

RE: MySQL DB-Api

2008-03-12 Thread Robert Rawlins
uct, or just as importantly, if I even need to close the cursor. I'd be really interested to know how you are implementing this kind of thing, Cheers, Robert From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins Sent: 11 March 2008 11:24 To: python-lis

RE: agg (effbot)

2008-03-12 Thread Robert Rawlins
Haha, Tim, that cracks me up! lol Bring forth the Holy Hand Grenade of Antioch Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Chase Sent: 12 March 2008 15:04 To: python-list@python.org Subject: Re: agg (effbot) Importance: Low Gerhard Häring wr

"Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Rawlins
Hello Guys, I've got an awfully aggravating problem which is causing some substantial hair loss this afternoon J I want to get your ideas on this. I am trying to invoke a particular method in one of my classes, and I'm getting a runtime error which is telling me the attribute does not exist.

RE: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Rawlins
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Bossy Sent: 13 March 2008 15:51 To: python-list@python.org Subject: Re: "Attribute Doesnt Exist" ... but it does :-s Robert Rawlins wrote: > > Hello Guys, > > I've got an

RE: "Attribute Doesnt Exist" ... but.... it does :-s

2008-03-13 Thread Robert Rawlins
.. it does :-s Robert Rawlins wrote: > Hi Guys, > > Well thanks for the response, I followed your advice and chopped out all the > crap from my class, right down to the bare __init__ and the setter method, > however, the problem continued to persist. > > However, Robert menti

RE: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-14 Thread Robert Rawlins
Geert, I've not seen this issue myself, however, you might get a little more luck asking over on the MySQLdb mailing list as this seems to be more an issue with the db than your python code. It might be worth posting your question there too as it'll heighten your chances of finding someone who kno

Element Tree Help

2008-03-24 Thread Robert Rawlins
Hello Guys,I have little to no experiance with element tree and I'm struggling to find a way to parse the details from the XML document (attached) into my application. Essentialy I'm looking to take the following document and turn it into a dict of tuples, each dict element defines a datasource

Logger Configuration

2008-07-08 Thread Robert Rawlins
Hello guys, I've attached an example of my logging configuration file for you to look at. The problem I'm experiencing is that the log files are not rotating as I would expect them to, they just keep growing and growing. Can you see any reason for this to happen? This is the first time I've

No Exceptions

2008-07-08 Thread Robert Rawlins
Morning Guys, This morning I've been having a strange issue where my application doesn't appear to raise any exceptions. Even when manually placing code in the application which raises an exception explicitly like: Raise Exception, "This is a test exception" The applicat

RE: Logger Configuration

2008-07-08 Thread Robert Rawlins
Ok, I've managed to resolve this issue, it seems it was because I had the file size and number of archives to keep in "" and was thus setting them as strings instead of numerical values. Robert From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlin

Logging in __del__()

2008-07-15 Thread Robert Rawlins
Guys, I'm trying to help trace when instances of particular classes are being destroyed by the garbage collector and thought the cleanest way would be to implement a logging call in __del__() on the class. However, I'm having an issue. I inject a logger instance into my class upon construct

RE: Logging in __del__()

2008-07-15 Thread Robert Rawlins
Hi Fredrik, > When the application is running, or when it is shutting down? This is interesting, I did a test where I explicitly destroyed the instance using 'del my_instance' while the application was running and no error was thrown. It would see you are right, when the application ends it kill

RE: Logging in __del__()

2008-07-16 Thread Robert Rawlins
Hi Vinay, > Python uses reference counting with a cycle detector, but the > detector's behaviour is different if there are finalizers (__del__) - > see > > http://www.python.org/doc/ext/refcounts.html > Thank you for the link, that certainly explains a great deal. So, am I right to assume that

Get current class namespace.

2008-07-16 Thread Robert Rawlins
Guys, What's the simplest way to access a classes namespace from within itself. I want to use it in a custom __repr__() method so it prints the current namespace for the class like package.module.class. Suggestions? I'm sure there is a simple enough method built in to help me here, I've jus

Unusual Exception Behaviour

2008-07-17 Thread Robert Rawlins
Hello Chaps, I have an unusual situation with my application which I've also seen once or twice in the past but never found a solution too. Basically the application stops properly reporting Exceptions when they are thrown. My application logs extensively to a file using the python logging

RE: Unusual Exception Behaviour

2008-07-17 Thread Robert Rawlins
Hi Mk, > Why not capture exceptions themselves to a log file? > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466332 Thanks for the reply mate, I appreciate you getting back to me so quickly. I certainly like that implementation for logging the exceptions, however, at the moment I do

RE: Unusual Exception Behaviour

2008-07-17 Thread Robert Rawlins
Hi MK, >>Robert Rawlins wrote: >> >> I certainly like that implementation for logging the exceptions, however, at >> the moment I don't even know where the exceptions are occurring, or what >> type they are, could I still use this method to log any and all exce

RE: Unusual Exception Behaviour

2008-07-17 Thread Robert Rawlins
> That's seriously weird. What's your Python version and platform? On my > Windows and Linux machines, with more recent Python versions the above > trick works flawlessly. > > Check your environment, namely PYTHON* variables. There may be something > causing this behaviour. Unset them. > > Check

RE: Unusual Exception Behaviour

2008-07-17 Thread Robert Rawlins
>> That's seriously weird. What's your Python version and platform? On my >> Windows and Linux machines, with more recent Python versions the above >> trick works flawlessly. >> >> Check your environment, namely PYTHON* variables. There may be >> something causing this behaviour. Unset them. >>

RE: Unusual Exception Behaviour

2008-07-18 Thread Robert Rawlins
Hi Mk, > To tell the truth I have never used logging module extensively, so I'm > not expert in this area and can't help you there. > > However, it seems to me that you may have stumbled upon some subtle bug > / side effect of logging module that could cause some side effects in > exceptions. O

RE: Unusual Exception Behaviour

2008-07-18 Thread Robert Rawlins
> The logging configuration functionality provided by fileConfig is all- > or-nothing, i.e. it does not support incremental configuration. > > Do you know if any libraries you depend on use fileConfig? > > If you use programmatic configuration only, and don't use fileConfig > at all, does everythin

RE: __del__ methods

2008-07-19 Thread Robert Rawlins
> Yes. > > "Objects that have __del__() methods and are part of a reference cycle > cause the entire reference cycle to be uncollectable, including > objects not necessarily in the cycle but reachable only from it. > Python doesn't collect such cycles automatically because, in general, > it isn't p

RE: __del__ methods

2008-07-19 Thread Robert Rawlins
Hi Duncan, > That sounds like an appropriate use for __del__: it won't matter that it > may not be called when your app exits. Ok, well that's good to know. :-) > Yes, but there is an easy work-around. If you want to track destruction of > objects of type C then don't add a __del__ method to t

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> In Python 2.x, "classic" classes (which are not part of the unified > type hierarchy) are deprecated, and exist only for backward > compatibility with old code. > > You need to create "new-style" classes > http://www.python.org/doc/newstyle/> by inheriting from some > class that is part of the un

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> Time to fix that, then, with some documentation > http://www.python.org/doc/>, and by working through the Python > tutorial http://www.python.org/doc/tut/>. Thanks Ben, I'll be sure to read through these. I also read through this http://www.geocities.com/foetsch/python/new_style_classes.htm ear

RE: __del__ methods

2008-07-20 Thread Robert Rawlins
> Are you talking about the __new__ method ? Or about metaclasses ? Sorry Bruno, I should have made that a little clearer. I was talking about the __new__ method. Cheers mate, Robert -- http://mail.python.org/mailman/listinfo/python-list

Odd math related issue.

2008-07-21 Thread Robert Rawlins
Guys, I've got what seems to me to be a totally illogical math issue here which I can't figure out. Take a look at the following code: self.__logger.info("%i / %i" % (bytes_transferred, self.__sessions[path].total_bytes)) percentage = bytes_transferred / self.__sessions[pat

RE: Odd math related issue.

2008-07-21 Thread Robert Rawlins
> if you divide two integers, you'll get an integer back (in Python 2.X, > at least). quick fix: > > percentage = bytes_transferred * 100 / total_bytes > > Hey That worked a charm mate, thanks for the info. -- http://mail.python.org/mailman/listinfo/python-list

Daemonize an application.

2008-07-21 Thread Robert Rawlins
Guys, I've been looking to run one of my applications as a Deamon on a linux based system. I've been looking at this recipe this morning and it all looks relatively fine: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 I just noted that the recipe was written 5 years ago

Get dict value but not as reference.

2008-07-23 Thread Robert Rawlins
Guys, This feels like a strange question but it's not something I've done before, I'm sure it's quite simple. I have a dictionary, and I want to get one of the values from it, but rather than returning it as a reference I want to actually detach/remove the element from the dictionary. Like

RE: Get dict value but not as reference.

2008-07-23 Thread Robert Rawlins
> Use the pop() method of the dictionary, like this: Ah, of course! Pop! I have seen this before I think Jerry, seems to do the trick nicely. Thank you. Robert -- http://mail.python.org/mailman/listinfo/python-list

Gracefull application exit.

2008-07-24 Thread Robert Rawlins
Chaps, I'm looking to implement an exit/termination process for an application which can be triggered by A) a keyboard interrupt or B) termination of the application as a Daemon using a signal. I have a whole bunch of tasks I want to perform as a cleanup before the application is terminated

RE: Gracefull application exit.

2008-07-24 Thread Robert Rawlins
> but mind the caveats: Thanks Tim, the main caveat which worries me is the fact that it doesn't get called when being killed by SIGTERM. When I look at implementing the application as Daemon will cause complications. The implementation looks nice and is certainly the way I would like to go, but

GUID Generation

2008-07-28 Thread Robert Rawlins
Chaps, I've been looking at the following recipe for generating a GUID http://code.activestate.com/recipes/163604/ however I note that its about 6 years old. Has python since adopted an internal module for GUID generation? Or is this 3rd part module still the best option? Cheers, Robert

RE: GUID Generation

2008-07-28 Thread Robert Rawlins
> Not only is the answer, Yes: > > http://docs.python.org/lib/module-uuid.html > > but it's just featured as Doug Hellmann's module of the Week: > > http://blog.doughellmann.com/2008/07/pymotw-uuid.html > > TJG Thanks Tim, Perfect! Robert -- http://mail.python.org/mailman/listinfo/python-list

Setting my Locale

2008-08-26 Thread Robert Rawlins
Good morning Guys, I'm running python 2.5 on a Debian based system and I'm looking for your advice on how to set the locale for my application. I've read through the locale module documentation http://docs.python.org/lib/module-locale.html and tried a couple of the examples but can't seem to ge

XML Processing

2008-09-18 Thread Robert Rawlins
Guys, I'm running python 2.5 and currently using ElementTree to perform my XML parsing and creation. ElementTree really is a great package for doing this, however, I've been tasked by our deployment guys to try and move away from external libraries where possible as it makes their job easier.

RE: XML Processing

2008-09-18 Thread Robert Rawlins
> Some is going to kick themselves when they realise > that ElementTree *is* built in to Python 2.5 > > http://docs.python.org/whatsnew/modules.html#SECTION000142 Tim, Andrii, Thanks for the heads up on that! I hadn't noticed they're made it part of the platform modules, that's ex

Minimize Bandwidth

2007-06-08 Thread Robert Rawlins - Think Blue
Hello Chaps, I have a python application that hits a web service on a regular basis to post a string of CSV log data and I'm looking to minimize the amount of bandwidth that the application uses to send the log data. Is there any way to encode the string into base64 or something, that I can

Binary / SOAPpy

2007-06-08 Thread Robert Rawlins - Think Blue
Hello Guys, I have a WebService call which returns an array, the first element in that array is the binary for a zip file, however I'm having trouble writing that binary string into an actual file when it arrives, I've tried the following method. Result = call to the webservice that returns

Strange Thread Issue

2007-06-23 Thread Robert Rawlins - Think Blue
Hello Guys, I'm having an issue with a thread which I've not come across before and it has be baffled. The thread doesn't really do a lot, it simple contains a popen command to run something from cmd, now then i trigger the thread form my main application using the .start() method nothing happe

Zip File Woes

2007-06-27 Thread Robert Rawlins - Think Blue
Hello Guys, I'm having a MASSIVE headache today with zip files, I had it working a while ago but it all seems to have stopped in the past 30 minutes and I can't figure out why. I'm simply trying to write a function that will unzip a file, simple as that. I've currently got this code: Im

RE: Zip File Woes

2007-06-27 Thread Robert Rawlins - Think Blue
en them and still get the problems. Thanks guys, Rob From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 27 June 2007 15:10 To: python-list@python.org Subject: Zip File Woes Hello Guys, I'm having a MASSIVE headache today with zip files

Threads Dying?

2007-06-28 Thread Robert Rawlins - Think Blue
Hello Guys, I've got an application that seems to be a little bit unstable and freezes quite a bit, and I'm suspecting it's something in one of my threads that's causing the problem, when does a thread die? And how can I be sure that its dyeing when its mean to be? Thanks guys, Rob --

XML Parsing Help,

2007-06-29 Thread Robert Rawlins - Think Blue
Hello Chaps, I'm looking for some help with XML parsing, I've been playing around with this over the past few days and the only solution I can come up with seems to be a little slow and also leaves what I think is a memory leak in my application, which causes all kinds of problems. I have

Application Crashing

2007-06-29 Thread Robert Rawlins - Think Blue
Hello Guys, I find my application is freezing/crashing every now and then and it becoming a bit of a frustration, so this morning I sat down to try and locate the problem. After doing some debugging I think I've found the line of code that causes my problem. Print 'Read Results' New = e.re

DatePart From String

2007-07-03 Thread Robert Rawlins - Think Blue
Hello Guys, I have a date/time as a string which looks like this: 2007-02-01 00:00:00 I'm trying to get my hands on the different date parts of that string in the following formats: Time Only: 00:00:00 Day As Number: 01 Month As Number: 02 Day As Word: Monday I've tried using the

RE: DatePart From String

2007-07-03 Thread Robert Rawlins - Think Blue
AIL PROTECTED] On Behalf Of Dave Sent: 03 July 2007 10:46 To: python-list@python.org Subject: Re: DatePart From String Robert Rawlins - Think Blue thinkbluemedia.co.uk> writes: > I’ve tried using the time.strptime() function without much success so > thought I’d come and ask your advi

POpen - Wait For Process To Complete

2007-07-03 Thread Robert Rawlins - Think Blue
Hello guys, Quite a simple one I'm hoping. I've got a process that I run using popen which writes to a file, I'm then going to read the file and parse its contents. However, getting the application to wait until the process is complete and finished writing before it reads and parses the file is

Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Chaps, Is there a command I can run to confirm which version of python I'm running? Another thing I've always wondered, should i be running my applications using './MyFile.py' or 'Python MyFile.Py' what are the benefits of each method? One thing I have noticed is that when I used 'Pyt

Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Chaps, Is there a command I can run to confirm which version of python I'm running? Another thing I've always wondered, should i be running my applications using './MyFile.py' or 'Python MyFile.Py' what are the benefits of each method? One thing I have noticed is that when I used 'Pyt

RE: Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
riginal Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden Sent: 04 July 2007 11:36 Cc: python-list@python.org Subject: Re: Which Python Version Robert Rawlins - Think Blue wrote: > Is there a command I can run to confirm which version of python I'm running

Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Chaps, Is there a command I can run to confirm which version of python I'm running? Another thing I've always wondered, should i be running my applications using './MyFile.py' or 'Python MyFile.Py' what are the benefits of each method? One thing I have noticed is that when I used 'Pyt

Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Chaps, Is there a command I can run to confirm which version of python I'm running? Another thing I've always wondered, should i be running my applications using './MyFile.py' or 'Python MyFile.Py' what are the benefits of each method? One thing I have noticed is that when I used 'Pyt

Which Python Version

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Chaps, Is there a command I can run to confirm which version of python I'm running? Another thing I've always wondered, should i be running my applications using './MyFile.py' or 'Python MyFile.Py' what are the benefits of each method? One thing I have noticed is that when I used 'Pyt

GObject and Python 2.5

2007-07-04 Thread Robert Rawlins - Think Blue
Hello Guys, Firstly I should apologise for all the mails that keep landing on the list, my SMTP server (supplied by my ISP) seems to be playing silly buggers and sending multiples. I've just installed Python 2.5 on my Debian system and I'm trying to run my application and I get 'ImportError

Parsing Help

2007-07-10 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for some help building a function which can parse some XML for me using ElementTree. The document is of a very consistent format and I've copied an example of the document below.

Time A Script

2007-07-11 Thread Robert Rawlins - Think Blue
Hello Guys, What's the best way to time how long it takes a script to run, from top to bottom and then have it print that execution time at the end? Thanks guys, Rob -- http://mail.python.org/mailman/listinfo/python-list

Launch One Application From Another

2007-07-12 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for the best method to launch one Python application from another? Is something like sub process going to be my best bet? Or is there something more specific for launching one python app from another? Thanks guys, Rob -- http://mail.python.org/mailman/listinfo/

RE: Dict Help

2007-07-15 Thread Robert Rawlins - Think Blue
EMAIL PROTECTED] On Behalf Of Gabriel Genellina Sent: 15 July 2007 20:33 To: python-list@python.org Subject: Re: Dict Help En Sun, 15 Jul 2007 11:39:24 -0300, Robert Rawlins <[EMAIL PROTECTED]> escribió: > I'm looking for some help expanding on a dictionary I've got and storing

Access Object From 2 Applications or Fix Scheduler

2007-07-15 Thread Robert Rawlins - Think Blue
Hello Guys, I have two applications which I need to get talking and sharing an object, what's the best way to do this? Basically my first application parses an XML document into a bunch of lists and tuples etc, and I need to access the data in these lists and tuples from my second application.

RE: Access Object From 2 Applications or Fix Scheduler

2007-07-16 Thread Robert Rawlins - Think Blue
Guys, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hendrik van Rooyen Sent: 16 July 2007 07:29 To: python-list@python.org Subject: Re: Access Object From 2 Applications or Fix Scheduler Robert Rawlins - Think Blue wrote: >Hello Guys, >

RE: Access Object From 2 Applications or Fix Scheduler

2007-07-16 Thread Robert Rawlins - Think Blue
heard of? Thanks, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hendrik van Rooyen Sent: 16 July 2007 07:29 To: python-list@python.org Subject: Re: Access Object From 2 Applications or Fix Scheduler Robert Rawlins - Think Blue wrote: >Hello Guys,

RE: Dict Help

2007-07-17 Thread Robert Rawlins - Think Blue
briel, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 15 July 2007 20:47 To: 'Gabriel Genellina'; python-list@python.org Subject: RE: Dict Help Thanks Gabriel, That all works a charm, Iteration on this isn’t i

Subprocess Poll() to sport Application Crash

2007-07-18 Thread Robert Rawlins - Think Blue
Hello Guys, I have an application which launches a sub-process using the sub process/Popen module, which seems to work great. However on occasion the launched process will crash, it doesn't appear to full terminate though as when I run a 'top' command from the Linux system the process is still

Subprocess Poll

2007-07-18 Thread Robert Rawlins - Think Blue
Hello Guys, I have an application which launches a sub-process using the sub process/Popen module, which seems to work great. However on occasion the launched process will crash, it doesn't appear to full terminate though as when I run a 'top' command from the Linux system the process is still

Copy List

2007-07-18 Thread Robert Rawlins - Think Blue
Hello Guys, What's the best way to create a copy of a list? I've seen several method and I'm not sure what to use. This will be in a class and one method creates a list which I then want to move to the self scope, like so: __Init__(self): Self.myList = [] regenerateList

Log Memory Usage

2007-07-19 Thread Robert Rawlins - Think Blue
Hello Guys, I have an embedded application with a suspected memory leak which I'm trying to confirm. You see, the application seems to crash unexpectedly and when looking at the resource consumption after the crash system memory has crept up to nearly 100%. However this takes quite a long t

DateTime Differance

2007-07-20 Thread Robert Rawlins - Think Blue
Hello Guys, I've used the eGenix date time module to create two date time objects which I'm now looking to compare like so: If date 1 is more than 5 minutes older than date 2: Do something here... After reading through the egenix documentation I'm still a little confuse

Byte-Array to String

2007-04-19 Thread Robert Rawlins - Think Blue
Hello Guys, I have a byte array passed to me by dbus and I'm looking to convert it into a string? Is that possible? Sorry for seeming like a putts with these questions, I'm not used to all these complex data types :-D The byte array looks something like this when printed to screen. dbus

RE: Byte-Array to String

2007-04-19 Thread Robert Rawlins - Think Blue
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden Sent: 19 April 2007 15:54 Cc: python-list@python.org Subject: Re: Byte-Array to String Robert Rawlins - Think Blue wrote: > I have a byte array passed to me by dbus and I'm looking to convert it into > a string? Is that

RE: Byte-Array to String

2007-04-20 Thread Robert Rawlins - Think Blue
my syntax is pretty confused as I'm so new to the language. Like I say, there is only one element of the array I'm interested in, I just need to see them all before I know which it is. Thanks again Steve, Rob From: Steven Howe [mailto:[EMAIL PROTECTED] Sent: 19 April 2007 16:51

RE: Byte-Array to String

2007-04-20 Thread Robert Rawlins - Think Blue
From: Carsten Haese [mailto:[EMAIL PROTECTED] Sent: 20 April 2007 14:00 To: Robert Rawlins - Think Blue Cc: python-list@python.org Subject: RE: Byte-Array to String On Fri, 2007-04-20 at 09:51 +0100, Robert Rawlins - Think Blue wrote: > Morning Steve, > > > > That stuff looks mighty

Schedule Task

2007-04-21 Thread Robert Rawlins - Think Blue
Hello Guys, I've got a method in my app that I want to run every 20 minutes that the application it running, what's the best way of achieving this? At the moment I'm using this kind of method. import sched import time, sys scheduler = sched.scheduler(time.time, time.sleep) scheduler.e

Class Not Auto-Init On Import

2007-04-21 Thread Robert Rawlins - Think Blue
Hello Guys, >From my understanding of what I've read, the 'import' is meant to auto Init my class ready for me to access its methods, but it doesn't appear too, I'm having to init them myself before I can access them, like this. import LocationService Location = LocationService.Location

Styled Output

2007-04-21 Thread Robert Rawlins - Think Blue
Chaps, Hope you're all having a good weekend, I'm sure it'll only be the more 'hard core' of you reading this, anyone with any sanity would be out in the sunshine right now. I'm running a program of mine from Linux bash script and it currently outputs status messages to the command prompt,

Minidom Help

2007-04-24 Thread Robert Rawlins - Think Blue
Hello guys, Not got much experience with working with minidom, but I'm looking to parse this XML and retrieve the 'name' value from the xml. Think Blue 0x1002 1 I've got as far as parsing the XML using self.doc = xml.dom.minidom.parse(self.filepath) but that's as far as I've

If Dict Contains a particular key

2007-04-24 Thread Robert Rawlins - Think Blue
Hello Guys, I'm Looking to build a quick if/else statement that checks a dictionary for a key like follows. If myDict contains ThisKey: Do this... Else Do that... Thats the best way of doing this? Thanks, Rob -- http://mail.python.org/mailman

RE: If Dict Contains a particular key

2007-04-25 Thread Robert Rawlins - Think Blue
a particular key On Apr 24, 2007, at 12:28 PM, Robert Rawlins - Think Blue wrote: Hello Guys, I'm Looking to build a quick if/else statement that checks a dictionary for a key like follows. If myDict contains ThisKey: Do this... Else Do

If Dict Contains...

2007-04-25 Thread Robert Rawlins - Think Blue
Hello Guys, Looking to build a quick if/else statement that checks a dictionary for a key like follows. If myDict contains ThisKey: Do this... Else Do that... Thats the best way of doing this? Thanks, Rob -- http://mail.python.org/mailman/lis

popen2 results

2007-04-25 Thread Robert Rawlins - Think Blue
Hello guys, I've recently ported my application from bash to python, however there are still a few bash line utilities I -have- to use in the application as there isn't any alternative available to me. In the old days of bash I would have grep'd the output from these commands to determine the o

Now()

2007-04-25 Thread Robert Rawlins - Think Blue
Hello Guys, I'm using the following function 'str (now)' to place a date time stamp into a log file, which works fine, however it writes the stamp like this. 2007-04-25 11:06:53.873029 But I need to expel those extra decimal places as they're causing problems with the application that p

Scheduler Module Help

2007-04-26 Thread Robert Rawlins - Think Blue
Hello Guys, I'm using the sched module to create a set of functions that run every 10 or 20 minutes whilst the application is running, however it would seem that the moment I run scheduler.run() it prevents any other operations in my application from running, its sits dormant until it runs the

Re-ocurring Events

2007-04-26 Thread Robert Rawlins - Think Blue
Hello Chaps, A bit more of a complex one this time, and I thought I'd get your opinions on the best way to achieve this. Basically I'm looking for a way to describe a re-occurring event, like a calendar event or appointment I guess. I'm likely to use an XML file for the definition of the events

RE:: Re-ocurring Events

2007-04-27 Thread Robert Rawlins - Think Blue
Thank you guys for your suggestions. I've been having a look at that launchd stuff from apple but couldn’t really see how that applies to my requirements. I've been putting some serious thought into how this should work as its essentially the final part of the puzzle for my application, I'll have

RE: : Re-ocurring Events

2007-04-27 Thread Robert Rawlins - Think Blue
CTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 27 April 2007 08:24 To: python-list@python.org Subject: RE:: Re-ocurring Events Thank you guys for your suggestions. I've been having a look at that launchd stuff from apple but couldn’t really see how that applies

RE: Re-ocurring Events

2007-04-27 Thread Robert Rawlins - Think Blue
Original Message- From: Laurent Pointal [mailto:[EMAIL PROTECTED] Sent: 27 April 2007 09:49 To: Robert Rawlins - Think Blue Subject: Re: Re-ocurring Events Robert Rawlins - Think Blue a écrit : > Thank you guys for your suggestions. > > I've been having a look at that launchd st

RE: Re-ocurring Events

2007-04-27 Thread Robert Rawlins - Think Blue
s, Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 27 April 2007 09:55 To: 'Laurent Pointal' Cc: python-list@python.org Subject: RE: Re-ocurring Events Thanks for getting back to me Laurent. I've now made s

RE: what python technology for my app?

2007-04-27 Thread Robert Rawlins - Think Blue
Just thought I'd make a little suggestion about this, I don’t know how strict you want to be with the web development side of things, but I'm a web developer by trade and have recently started using python for my non-web type applications. If you're looking for a web based server side solution, th

RE: Re-ocurring Events

2007-04-27 Thread Robert Rawlins - Think Blue
: python-list@python.org Subject: Re: Re-ocurring Events Robert Rawlins - Think Blue napisał(a): > and I need to do and conditional that ensures start is before today's > date/time and end is after today's date/time. > > The string looks like: '2007-01-01 00:00:00'

RE: what python technology for my app?

2007-04-27 Thread Robert Rawlins - Think Blue
Haha, no Troll, just a shameless plug for my life's one true love ;-) Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bruno Desthuilliers Sent: 27 April 2007 14:35 To: python-list@python.org Subject: Re: what python technology for my app? R

Dict Copy & Compare

2007-04-30 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for a little advice on dicts, firstly I need to learn how to copy a dict, I suppose I could just something like. Self.newdict = self.olddict But I fear that this only creates a reference rather than an actual copy, this means that as soon as I clear out the old o

RE: Dict Copy & Compare

2007-04-30 Thread Robert Rawlins - Think Blue
pril 2007 09:41 Cc: python-list@python.org Subject: Re: Dict Copy & Compare Robert Rawlins - Think Blue wrote: > I'm looking for a little advice on dicts, firstly I need to learn how to > copy a dict, I suppose I could just something like. > Self.newdict = self.olddict > But I fe

  1   2   >