Re: UnicodeDecodeError, how to elegantly deal with this?

2008-08-05 Thread Jorgen Bodde
ink I will look at it. ps. sorry for the direct mail, I can't get used to one mailinglist always replying to the list, and the other replying to the user by default ;-) With regards, - Jorgen On Tue, Aug 5, 2008 at 11:00 AM, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 5, 4:23 am, &qu

Re: UnicodeDecodeError, how to elegantly deal with this?

2008-08-05 Thread Jorgen Bodde
es, I can help. > > thx. Edwin > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Jorgen Bodde > Sent: Monday, August 04, 2008 2:24 PM > To: python-list@python.org > Subject: UnicodeDecodeError, how to elegantly deal

UnicodeDecodeError, how to elegantly deal with this?

2008-08-04 Thread Jorgen Bodde
Hi All, I am relatively new to python unicode pains and I would like to have some advice. I have this snippet of code: def playFile(cmd, args): argstr = list() for arg in appcfg.options[appcfg.CFG_PLAYER_ARGS].split(): thefile = args["file"] filemask = u"%file%" th

Re: Very weird bug!

2008-07-08 Thread Jorgen Bodde
Maybe the interpreter remembered the values of some objects you used? If you type in the interpreter, the objects you create have a lifetime as long as the interpreter is active, which means it can get a state behaviour that otherwise is not present if you start a new interpreter instance. To be sa

Re: Send output to printer

2008-06-24 Thread Jorgen Bodde
Hi, It depends on how your printer can be accessed. Is there a driver for it? The most simple way might be using ShellExecute (under windows) but I found no way to supress the print dialog. Another way is using win32com module and instantiate an IE automation object, which you feed a HTML page a

Print HTML from Python

2008-05-21 Thread Jorgen Bodde
Hi All, I am at a loss. This is slightly OT because it concerns Windows and HTML printing. I would like to print a HTML document from Python, but not showing the printing dialog. After numerous searches and trials I came to the conclusion that ShellExecute with the "print" command and a HTML docum

Re: comtypes question

2008-03-17 Thread Jorgen Bodde
y COM. By sending an XML script to it, I can set the variables for that label and issue a print command. With kind regards, - Jorgen On Mon, Mar 17, 2008 at 12:58 PM, Thomas Heller <[EMAIL PROTECTED]> wrote: > Jorgen Bodde schrieb: > > > > Hi All, > > > > I am tryi

comtypes question

2008-03-17 Thread Jorgen Bodde
Hi All, I am trying to automate a 3rd party application, and all I have to work on is the type library and some documentation. I hope a Python / COM guru can answer this or put me on the right path because I don't know why it does not work. First I imported the typelib with comtypes like; >> fro

Re: Small problem executing python script as shortcut

2008-02-08 Thread Jorgen Bodde
Hi Larry, Sorry for accidentally mailing you personally. I fixed the problem, it was a problem with the search path, and once that was fixed it works fine! thanks again, - Jorgen On Feb 8, 2008 9:26 AM, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > Hi Larry, > > > Sure there is

Small problem executing python script as shortcut

2008-02-07 Thread Jorgen Bodde
Hi all, This is slightly OT but it drives me nuts. Whenever I create a shortcut in the start menu (in Windows) of a python script, it will only execute it when the path where the script resides in contains no spaces. For example; d:\src\app\app.py If I drag that to the Start Menu it can be execu

Re: where do my python files go in linux?

2008-01-16 Thread Jorgen Bodde
Hi All, Sorry for the late reply back, I had a busy weekend ... it seems there is no clear way to do it and maybe that is why I was / am so confused. Eventually I searched for *.py files, and like I said most apps seem to install in /usr/share/{app} I believe that location is for data only that i

Re: where do my python files go in linux?

2008-01-12 Thread Jorgen Bodde
Hi Jeroen, Thanks for the advice. > Personally I'd be loathe to put app.py in /usr/bin. This directory is normally > reserved for OS-specific binaries. For personal/system-extended stuff I'd use > /usr/local/bin or whatever your system mandates. (But hey, that's the typical > mentality difference

where do my python files go in linux?

2008-01-12 Thread Jorgen Bodde
Hi All, I am trying to make a debian package. I am following the tutorial by Horst Jens (http://showmedo.com/videos/video?name=linuxJensMakingDeb&fromSeriesID=37) and it is very informative. However one thing my app has and his doesn't, is multiple python files which need to be executed. For exam

Re: Web update library in python?

2007-11-21 Thread Jorgen Bodde
t;[EMAIL PROTECTED]> wrote: > On 2007-11-20, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > Jorgen Bodde wrote: > > > >> Hi, A.T.Hofkamp (sorry for not knowing your first name ;-), > > Well Jorgen, it is at the bottom of each post (usually)... ;-) > > &g

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi Paul, Like I said, I do not want to limit my end users into installing something in Apache or some other solution in order to get my tool working. On the end user side (which also are the people who are creating the repositories for others) there must be no burden whatsoever. Your thoughts are

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
ected. thanks for pointing that out.. Regards, - Jorgen On Nov 20, 2007 12:41 PM, Jorgen Bodde <[EMAIL PROTECTED]> wrote: > Hi Diez , > > I fail to see that. If I am the one that can only put new "archive > files" on my server by FTP or HTTP upload or whatever, and I upd

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi Diez , I fail to see that. If I am the one that can only put new "archive files" on my server by FTP or HTTP upload or whatever, and I update the file which contains the information about what updates are present on my site as last, there is no data corruption or loss of data. There are two ro

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi A.T.Hofkamp, Using svn still requires the people wanting to offer updates to have a svn server installed, or use one of the svn services available and that is simply too limiting. I will explain a bit more where I will use this for. I am writing a tool that takes a repository (e.g. a bunch of

Re: Web update library in python?

2007-11-20 Thread Jorgen Bodde
20, 2007 10:48 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde wrote: > > > Hi all, > > > > I want to provide my users the ability to download a repository from > > the web, and after that check for updates. I thought of a mechanism > > that could

Web update library in python?

2007-11-20 Thread Jorgen Bodde
Hi all, I want to provide my users the ability to download a repository from the web, and after that check for updates. I thought of a mechanism that could do that, but since there is patch and diff readily available I wondered if there is a python solution that allows me to download a file, and l

Re: toprettyxml messes up with whitespaces

2007-10-09 Thread Jorgen Bodde
Dear list, Thanks for the suggestions and clarification. After playing with XML for a while I noticed whitespaces can indeed be more important then I thought. I did came to the following conclusions; 1. Removing whitespaces was done by my code, not by the xml.dom.minidom so I regret the fact I sa

Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Jorgen Bodde
Hi Paul, > This seems like a reasonable explanation without having looked at the > source code myself. It's by thorough investigation ;-) > Which part of the standard is this? Here's the XML 1.0 specification's > section on whitespace: > > http://www.w3.org/TR/2006/REC-xml-20060816/#sec-white-sp

Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Jorgen Bodde
serve it and mess up the formatting in the end? Regards, - Jorgen On 10/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 2, 11:43 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I parse an XML file, replace a node with a ne

toprettyxml messes up with whitespaces

2007-10-02 Thread Jorgen Bodde
Hi all, I parse an XML file, replace a node with a new one (like updating cache) and write it back. Every write, new spaces are added. For example, first read - update - write cycle; My First App Second cycle:

Re: How to determine the bool between the strings and ints?

2007-09-07 Thread Jorgen Bodde
Awesome! Thanks you! As for why caring if they are bools or not, I write True and False to the properties, the internal mechanism works like this so I need to make that distinction. Thanks again guys, - Jorgen ps. Sorry TheFlyingDutch for mailing you personally, I keep forgetting this mailinglis

How to determine the bool between the strings and ints?

2007-09-07 Thread Jorgen Bodde
Hi All, I have a dictionary with settings. The settinfgs can be strings, ints or bools. I would like to write this list dynamically to disk in a big for loop, unfortunately the bools need to be written as 0 or 1 to the config with WriteInt, the integers also with WriteInt and the strings with a si

Using python for dynamic behavior from C++

2007-08-15 Thread Jorgen Bodde
Hi all, I am looking into using Python to introduce dynamic behavior in my C++, e.g. something like a simulation where objects can interact with eachother. I know Python can be called from C++, but is it possible to call a binary compiled Python file / array from C++ ? The reason I ask is that if

moving files in a seperate thread (and/or with progress?)

2007-08-15 Thread Jorgen Bodde
Hi all, I want to make a small batch copy tool that scans for certain files, and copies them to a specified directory. Since the files are huge (AVI / DIVX) typical 300 to 700 Mb, I want to provide the user with some feedback during the file copy. Here is my dillemma; When I use shutil.move(..,..

Re: Too many 'self' in python.That's a big flaw in this language.

2007-06-27 Thread Jorgen Bodde
I had the same feeling when I started, coming from a C++ background, I forgot about self a lot, creating local copies of what should be an assign to a class instance, or methods that could not be found because I forgot 'self' . Now I am 'kinda' used to it, as every language has some draw backs (yo

Re: Adding a DB regs to a wx listbox

2007-06-12 Thread Jorgen Bodde
self.list_box_1_copy.Append( your_item ) In the wxWidgets help: http://www.wxwidgets.org/manuals/2.8.0/wx_wxcontrolwithitems.html#wxcontrolwithitems And in the wxPython help: http://www.wxpython.org/docs/api/wx.ItemContainer-class.html Regards, - Jorgen On 6/12/07, Marcpp <[EMAIL PROTECTED]>

Re: function in a function accessing vars

2007-06-06 Thread Jorgen Bodde
On 6/6/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde wrote: > > > Hi all, > > > > I wanted to solve a small problem, and I have a function that is > > typically meant only as a function belonging inside another function. > >>From the i

function in a function accessing vars

2007-06-06 Thread Jorgen Bodde
Hi all, I wanted to solve a small problem, and I have a function that is typically meant only as a function belonging inside another function. >From the inner function I want to access a variable from the outer function like; def A(): some_var = 1 def B(): some_var += 1 B() But this

Re: [Fwd: Re: managed lists?]

2007-05-24 Thread Jorgen Bodde
@ Larry, As much as I like to follow the idiom that Python has, I do not see the usefulness of making an add function that checks the interface that other objects might need. Besides the fact it is a bit overhead and not to mention performance draining, in an application that I develop myself, wit

Re: [Fwd: Re: managed lists?]

2007-05-22 Thread Jorgen Bodde
Hi Gabriel, Yep that basically covered my implementation as well. It was rather trivial to make it, and even for a python newbie it was simple which says enough about the language itself. ;-) Although I understand the opinions that you should not care about types, I do believe putting a constrain

Re: [Fwd: Re: managed lists?]

2007-05-22 Thread Jorgen Bodde
Hi, Thanks. I agree that it is only 'me' that is the one doing it wrong. But consider this scenario: - Somewhere in my app I add a wrong type to an open regular list - The app continues like it should - After a (long) while I need to perform some search on the list, or whatever - Exception occurs

Re: [Fwd: Re: managed lists?]

2007-05-21 Thread Jorgen Bodde
Hi Bruno, Thanks for your answer. Well what I am after is a list of relations to some class type. And in that list I do not wish to have accidentally put ints, strings, only one type of object, or interface. Now I can make the list interface safe, but it is only meant for relational purposes only

Re: Python and GUI

2007-05-21 Thread Jorgen Bodde
Well wxPython offers all of the above. They use XRC which is a XML file which can be loaded inside the GUI, that auto-creates the components + layout for you. It also supports creating the gui programatically, which might be very handy when your layout is undetermined or changes when users select o

managed lists?

2007-05-21 Thread Jorgen Bodde
Hi all, I have been slowly progressing with my application written in wxPython. I love the freedom, speed and lack of the compiling run. I still have to get used to the lack of (strong) types, and it sometimes frustates me to no end that a wrongly given argument explodes somewhere deep inside my a

Re: Real globals inside a module

2007-05-13 Thread Jorgen Bodde
great! Thanks it makes perfect sense, but before attempting some code rewrite I just wanted to be sure ;-) Regards, - Jorgen On 5/13/07, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Sun, May 13, 2007 at 11:41:12AM +0200, Jorgen Bodde wrote: > > I am wrestling with some archite

Real globals inside a module

2007-05-13 Thread Jorgen Bodde
Hi All, I am wrestling with some architecture inside my app. Let's say I have a tunings collection, which contains e.g. 23 types of guitar tunings. In my song object I want to restore a relation between one of the tuning objects inside the tunings module. I already figured out I need somethign li

Re: preferred windows text editor?

2007-05-10 Thread Jorgen Bodde
I prefer PsPad. If you like Notepad++, PSPad might be a better choice. More intuitive. I've used Notepad++ for a while, I really disliked the fact that every new install my settings XML file would get overwritten, and what does that guy have with Comic sans MS? Every default style is hard coded in

Re: changing a var by reference of a list

2007-05-09 Thread Jorgen Bodde
Hi Bruno, Unfortunately SQLAlchemy will be too involved at this point I will have to rewrite a lot of code to remove my current DB solution and use that. Howerver I've learned from my mistake and the next project will use it, as it seems to be a nice way of mapping objects to databases.. I'v solv

Re: changing a var by reference of a list

2007-05-08 Thread Jorgen Bodde
Ok thanks, I will try this approach. The idea was that I could give a list to the SQL execute command, so that the results coming back would automatically be assigned to variables. With regards, - Jorgen On 5/8/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde wrote:

changing a var by reference of a list

2007-05-08 Thread Jorgen Bodde
Hi, I am trying to simplify my code, and want to automate the assigning of variables I get back from a set. I was thinking of putting the variables I want changed in a list: L = [self._varA, self._varB ] self._varA is a variable I want to change when I pass L to a function. I know doing this; L

Relative import problem

2007-04-19 Thread Jorgen Bodde
Hi all, I want to structure my app so that I have two dirs like; obj/{object files} gui/{gui files} Here comes the catch. From the GUI dir, I would like to access the obj submodule path. I need to go one dir back.. I read there was something like from .. import x in python 2.5 so that I could a

Re: PYTHON and GUIS and LOGIC... What First? (NEWBIE)

2007-04-17 Thread Jorgen Bodde
Hi, Basically your data model needs to be defined. It depends on your 'problem area'. It is usually good practice to keep your datamodel free of GUI elements, so that it can be easily reused. The GUI in the other hand can know everything about the public interface of the data model. I've recently

Re: Import From SubFolder

2007-04-17 Thread Jorgen Bodde
>From what I know, if you place a __init__.py file in the folder that will become your subfolder, you can make it a module subfolder. Like; d:\src\app\submodule\__init__.py (can be empty file) Then in d:\src\app\main.py simply do; import submodule # use your new module like submodule.somefu

Re: OverflowError: mktime argument out of range ???

2007-04-17 Thread Jorgen Bodde
Thanks again, I will explain what happened. I am a python newbie. The time and datetime modules are confusing at the beginning, but after diving into them I started to understand the structure. So what I did was using the time module for date storage, but I came to understand that time is actually

Re: OverflowError: mktime argument out of range ???

2007-04-15 Thread Jorgen Bodde
Ok thanks, I missed out on datetime where the methods I need are also present. I'll be refactoring my data a bit, thanks again! - Jorgen On 4/15/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Jorgen Bodde schrieb: > > Hi List > > > > I am working on a

OverflowError: mktime argument out of range ???

2007-04-15 Thread Jorgen Bodde
Hi List I am working on an app to store guitar songs I am practicing, and for the fun of it I want to store the date of songs when they were originally made. So far so good.. However, my taste of music is "Rag Time Blues" and that os OLD, very OLD music. So it happened I entered a song from the

Re: sqlite3 question

2007-04-13 Thread Jorgen Bodde
heir help! - Jorgen On 4/12/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Thu, 2007-04-12 at 13:43 +0200, Marc 'BlackJack' Rintsch wrote: > > In <[EMAIL PROTECTED]>, Jorgen Bodde > > wrote: > > > > >>>> r = c.execute('select * from s

Calling private base methods

2007-04-12 Thread Jorgen Bodde
Hi All, Now that I am really diving into Python, I encounter a lot of things that us newbies find difficult to get right. I thought I understood how super() worked, but with 'private' members it does not seem to work. For example; >>> class A(object): ... def __baseMethod(self): ...

sqlite3 question

2007-04-12 Thread Jorgen Bodde
Hi all, I am using sqlite3 in python, and I wonder if there is a way to know if there are valid rows returned or not. For example I have a table song with one entry in it. The ID of that entry is 1, so when I do; >>> r = c.execute('select * from song where id = 1') >>> for s in r: ... print s

Re: Why does not my wx.html.HtmlWindow work?

2007-04-11 Thread Jorgen Bodde
Hi, Coming from the wx community, I do know that the wx.HtmlWindow is NOT meant to load full blown web pages with. It has no concept of javascript, CSS, and other complex DOM properties. If you really want to display complex web pages in a window, look at wxMozilla or the wxIE binding. So the re

Re: PyDispatcher question

2007-04-05 Thread Jorgen Bodde
With as output; C:\Documents and Settings\Jorg\Desktop>python New1.py Hello world -- Hello world Hello world Nice! Thanks a lot for the info! - Jorgen On 4/5/07, Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > Jorgen Bodde wrote: > > Hi all, > > > &

PyDispatcher question

2007-04-05 Thread Jorgen Bodde
Hi all, Hopefully someone can help me. I am fairly new to Python, and I am looking into PyDispatcher. I am familiar with the C++ sigslot variant, and I wonder how similar PyDispatches is. I run in to the following 'problem' (pseudo code, untested here) import pydispatch.dispatcher class A: def