Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:58:43 UTC+10, Michael Torrie wrote: > On 09/06/2013 09:05 PM, Leo Carnovale wrote: > > > Ah and one other thing! What is this crypto algorithm you speak of? I > > > desperately need some sort of encryption as at the moment anyone can > > > simply open the text f

Installing resource data files and finding them

2013-09-06 Thread Ben Finney
Howdy all, How do I package a Python application with its resource files separate from the Python modules, such that the resource files can be discovered by the Python code when it runs? I am working on an existing Python application code base. The application currently assumes that its resource

Re: file handling issues

2013-09-06 Thread Michael Torrie
On 09/06/2013 09:05 PM, Leo Carnovale wrote: > Ah and one other thing! What is this crypto algorithm you speak of? I > desperately need some sort of encryption as at the moment anyone can > simply open the text file and change the numbers to numbers that > work! Where can I learn more about it? Th

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 13:03:14 UTC+10, Leo Carnovale wrote: > On Saturday, 7 September 2013 02:17:03 UTC+10, Piet van Oostrum wrote: > > > leo.carnov...@gmail.com writes: > > > > > > > > > > > > > I am making this little game and I am trying to make some sort of script > > > that

Re: file handling issues

2013-09-06 Thread Leo Carnovale
On Saturday, 7 September 2013 02:17:03 UTC+10, Piet van Oostrum wrote: > leo.carnov...@gmail.com writes: > > > > > I am making this little game and I am trying to make some sort of script > > that does the following: > > >>Checks to see if a file exists > > > >If it does, check the numbers

Re: can't find win32api from embedded pyrun call

2013-09-06 Thread David M. Cotter
the problem was: ActivePython does not install debug libraries, so you must link with release libraries in your project. but if you run the debug version, you're linking against debug libraries which conflict with the ones linked to by python. "fixed" by running the release version. basical

Re: Confessions of a terrible programmer

2013-09-06 Thread Steven D'Aprano
On Fri, 06 Sep 2013 13:17:20 -0400, Joel Goldstick wrote: > On Fri, Sep 6, 2013 at 12:56 PM, Steven D'Aprano > wrote: >> Not specifically about Python, but still relevant: >> >> http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible- programmer.html > Pardon me, but I completely don

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-06 Thread roggero . n
shut off the HD, start the SO form an USB and shut on again the HD -- https://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a terrible programmer

2013-09-06 Thread Chris Angelico
On Sat, Sep 7, 2013 at 3:17 AM, Joel Goldstick wrote: > On Fri, Sep 6, 2013 at 12:56 PM, Steven D'Aprano > wrote: >> Not specifically about Python, but still relevant: >> >> http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html >> >> >> >> >> >> -- >> Steven >> -- >>

Re: Multiprocessing / threading confusion

2013-09-06 Thread Piet van Oostrum
Paul Pittlerson writes: [...] > def run(self): > while True: > > sleep(0.1) > > if not self.q.empty(): > print self.q.get() > > else: > break [...] > This works great on lin

Re: Python KeyError

2013-09-06 Thread Ethan Furman
On 09/05/2013 01:37 AM, Robert Gliguroski wrote: I have installed OpenERP, an open source ERP software and then I installed an extension for connecting it to Magento. But when I configure it and try to connect them, I am getting and error that says: [snip] You might try asking at either Stac

Re: Multiprocessing / threading confusion

2013-09-06 Thread Dave Angel
On 6/9/2013 14:27, Paul Pittlerson wrote: f> Ok here is the fixed and shortened version of my script: > > #!/usr/bin/python > > from multiprocessing import Process, Queue, current_process > from threading import Thread > from time import sleep > > class Worker(): > def __init__(self, Que): >

Re: how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread Neil Cerutti
On 2013-09-06, stas poritskiy wrote: > I am working on application. App is processing a list of files > in folders. Folders act as a NEW-LOOP. so if all files in one > folder had been worked on, file is then saved and next folder > is picked up. it works fine only if i have a SINGLE folder, > howe

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Chris Angelico
On Sat, Sep 7, 2013 at 1:46 AM, Piet van Oostrum wrote: > The FSR simply stores a Unicode string as an array[*] of ints (the Unicode > code points of the characters of the string. That's it. Then it uses a > memory-efficient way to store this array of ints. But that has nothing to do > with cha

Re: how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread stas poritskiy
Guys, as i was writing a very detailed message with code samples, following the guide that Steven linked, i found the problem. a pretty lame one, actually. in my class that was processing the images, i created an object instance, via __INIT__ , self.data = attributes() but i was iterating throug

Re: Confessions of a terrible programmer

2013-09-06 Thread Skip Montanaro
> Pardon me, but I completely don't get this article. Let me in on what > is supposed to be the joke please! I don't really think there's a joke. I think the author is saying in a somewhat sly way is that often, the difference between a terrible programmer and a great programmer is the discipline

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Chris Angelico
On Sat, Sep 7, 2013 at 2:59 AM, wrote: > Incidentally, how does all this interact with ctypes unicode_buffers, > which slice as strings and must be UTF-16 on windows? This was fine > pre-FSR when unicode objects were UTF-16, but I'm not sure how it would > work now. That would be pre-FSR *with a

Re: Multiprocessing / threading confusion

2013-09-06 Thread Skip Montanaro
On Fri, Sep 6, 2013 at 1:27 PM, Paul Pittlerson wrote: > Ok here is the fixed and shortened version of my script: Before going any further, I think you need to return to marduk's response and consider if you really and truly need both threads and fork (via multiprocessing). http://www.linuxprogr

Confessions of a terrible programmer

2013-09-06 Thread Steven D'Aprano
Not specifically about Python, but still relevant: http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Confessions of a terrible programmer

2013-09-06 Thread Terry Reedy
On 9/6/2013 12:56 PM, Steven D'Aprano wrote: Not specifically about Python, but still relevant: to what? http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html I think link posts should have at least a sentence summarizing the content of the linked page so I wo

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Piet van Oostrum
wxjmfa...@gmail.com writes: > The Flexible String Representation has conceptually to > face the same problem. It splits "unicode" in chunks and > it has to solve two problems at the same time, the coding > and the handling of multiple "char sets". The problem? > It fails. > "This poor Flexible Str

Re: how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread Terry Reedy
On 9/6/2013 1:05 PM, stas poritskiy wrote: The code in development is mine, and i am using the API provided by a main developer. At the moment, i am not using any try/except functionality. here is the full Exception output: [CODE] Exception in Tkinter callback Traceback (most recent call last)

Re: Confessions of a terrible programmer

2013-09-06 Thread Walter Hurry
On Fri, 06 Sep 2013 13:17:20 -0400, Joel Goldstick wrote: > On Fri, Sep 6, 2013 at 12:56 PM, Steven D'Aprano > wrote: >> Not specifically about Python, but still relevant: >> >> http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible- programmer.html > > Pardon me, but I completely d

Re: Multiprocessing / threading confusion

2013-09-06 Thread Paul Pittlerson
Ok here is the fixed and shortened version of my script: #!/usr/bin/python from multiprocessing import Process, Queue, current_process from threading import Thread from time import sleep class Worker(): def __init__(self, Que): self._pid = current_process().pid self.q

Re: how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread stas poritskiy
The code in development is mine, and i am using the API provided by a main developer. At the moment, i am not using any try/except functionality. here is the full Exception output: [CODE] Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\32bit\lib\lib-tk\Tkint

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread random832
On Fri, Sep 6, 2013, at 11:46, Piet van Oostrum wrote: > The FSR does not split unicode in chuncks. It does not create problems > and therefore it doesn't have to solve this. > > The FSR simply stores a Unicode string as an array[*] of ints (the > Unicode code points of the characters of the stri

Re: Confessions of a terrible programmer

2013-09-06 Thread Joel Goldstick
On Fri, Sep 6, 2013 at 12:56 PM, Steven D'Aprano wrote: > Not specifically about Python, but still relevant: > > http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html > > > > > > -- > Steven > -- > https://mail.python.org/mailman/listinfo/python-list Pardon me, but I

Re: file handling issues

2013-09-06 Thread Piet van Oostrum
leo.carnov...@gmail.com writes: > I am making this little game and I am trying to make some sort of script that > does the following: >>Checks to see if a file exists > >If it does, check the numbers in it > >If it doesn't, make one and fill it with some numbers >>Sorts out if the numbers in th

Re: PEP8 79 char max

2013-09-06 Thread Metallicow
Google(will) Search This Message: Industry Standards, PEP8, Whitespace, Print, Printing, Opinion' I could add more... For example: Pantone color wheel. -- https://mail.python.org/mailman/listinfo/python-list

how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread stas poritskiy
hey guys, I am working on application. App is processing a list of files in folders. Folders act as a NEW-LOOP. so if all files in one folder had been worked on, file is then saved and next folder is picked up. it works fine only if i have a SINGLE folder, however, when another folder is there, i

Re: how to trouble shoot - RuntimeError: Open Failed

2013-09-06 Thread Steven D'Aprano
On Fri, 06 Sep 2013 08:00:13 -0700, stas poritskiy wrote: > hey guys, > I am working on application. App is processing a list of files in > folders. Folders act as a NEW-LOOP. so if all files in one folder had > been worked on, file is then saved and next folder is picked up. it > works fine only

Re: to be pythonic: should caller or callee log?

2013-09-06 Thread Gildor Oronar
El 04/09/13 20:14, Xaxa Urtiz escribió: and what about something like that : class AbsctractAccount(): def transaction(self, amount, target): logging.info("Start transaction of %s to %s" % (amount, target)) self.DoTransaction(amount,target) def DoTransaction(sel

Re: PEP8 79 char max

2013-09-06 Thread Metallicow
On Thursday, September 5, 2013 11:01:31 PM UTC-5, Steven D'Aprano wrote: > On Thu, 05 Sep 2013 19:59:34 -0700, Metallicow wrote: > > PEP8 needs a bit of revision anyway, In my opinion... According to > > real-world standards for equipment/devices. linking to a table/list of > > affected devices/min

Re: How to split with "\" character, and licence copyleft mirror of ©

2013-09-06 Thread random832
On Thu, Sep 5, 2013, at 23:33, Tim Roberts wrote: > random...@fastmail.us wrote: > > > >Of course, in 99% of situations where you can use a windows pathname in > >Python, you are free to use it with a forward slash instead of a > >backslash. > > This is actually worth repeating, because it's not w

Re: PEP8 79 char max

2013-09-06 Thread Neil Cerutti
On 2013-09-06, Tim Chase wrote: > On 2013-09-06 20:47, Tim Delaney wrote: >> On 6 September 2013 20:35, Tim Chase wrote: >> > I'm just glad it's no longer 40-chars-per-column and purely >> > upper-case like the Apple ][+ on which I cut my programming >> > teeth. >> >> Couldn't you switch the ][+

Re: PEP8 79 char max

2013-09-06 Thread Tim Chase
On 2013-09-06 20:47, Tim Delaney wrote: > On 6 September 2013 20:35, Tim Chase wrote: > > I'm just glad it's no longer 40-chars-per-column and purely > > upper-case like the Apple ][+ on which I cut my programming teeth. > > Couldn't you switch the ][+ into high-res mode? You could with the > IIe.

Re: PEP8 79 char max

2013-09-06 Thread Metallicow
RailRoadTieWidth = 79.1234567890 >>> 79 = 'Width Of A Horse"s Ass' File "", line 1 SyntaxError: can't assign to literal >>>RailRoadTieWidth.attribute ("American", "Steam") >>>79.attribute = ("Roman", "Chariot") File "", line 1 79.attribute = ("Roman", "Chariot") ^ SyntaxE

Re: Python Debugger tool

2013-09-06 Thread Fabio Zadrozny
On Fri, Sep 6, 2013 at 3:14 AM, chandan kumar wrote: > Hi > > Is any one aware of free ipython debugger tool.How good is this tool for > a beginner to use like ,placing breakpoints,checking variables ,call stack > (function flow) etc.I don't like to use python PDB . > I have heard about wingware

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Ned Batchelder
On 9/6/13 5:11 AM, wxjmfa...@gmail.com wrote: The Flexible String Representation has conceptually to face the same problem. It splits "unicode" in chunks and it has to solve two problems at the same time, the coding and the handling of multiple "char sets". The problem? It fails. Just once, ple

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Antoon Pardon
Op 06-09-13 11:11, wxjmfa...@gmail.com schreef: > > The Flexible String Representation has conceptually to > face the same problem. It splits "unicode" in chunks and > it has to solve two problems at the same time, the coding > and the handling of multiple "char sets". The problem? Not true. The

Re: Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread Steven D'Aprano
On Fri, 06 Sep 2013 02:11:56 -0700, wxjmfauth wrote: > Short comment about the "detection" tools from a previous discussion. > > The tools supposed to detect the coding scheme are all working with a > simple logical mathematical rule: > > p ==> q<==> non q ==> non p . Incorrect. charde

Re: PEP8 79 char max

2013-09-06 Thread Tim Delaney
On 6 September 2013 20:35, Tim Chase wrote: > On 2013-09-06 05:09, Skip Montanaro wrote: > > And thank goodness for SIGWINCH. :-) > > BEDEVERE: How do you know she is a SIGWINCH? > > VILLAGER: She looks like one. > > CROWD: Right! Yeah! Yeah! > > > :-) > > I'm just glad it's no longer 40-chars-pe

Re: PEP8 79 char max

2013-09-06 Thread Tim Chase
On 2013-09-06 05:09, Skip Montanaro wrote: > And thank goodness for SIGWINCH. :-) BEDEVERE: How do you know she is a SIGWINCH? VILLAGER: She looks like one. CROWD: Right! Yeah! Yeah! :-) I'm just glad it's no longer 40-chars-per-column and purely upper-case like the Apple ][+ on which I cut m

Re: file handling issues

2013-09-06 Thread leo . carnovale
On Friday, 6 September 2013 20:20:02 UTC+10, leo.ca...@gmail.com wrote: > I am making this little game and I am trying to make some sort of script that > does the following: > > >Checks to see if a file exists > > >If it does, check the numbers in it > > >If it doesn't, make one and fill it

file handling issues

2013-09-06 Thread leo . carnovale
I am making this little game and I am trying to make some sort of script that does the following: >Checks to see if a file exists >If it does, check the numbers in it >If it doesn't, make one and fill it with some numbers >Sorts out if the numbers in the file are in the right format >If they ar

Re: PEP8 79 char max

2013-09-06 Thread Skip Montanaro
> Well, what I interpret as the PEP8 79 is chars visible minus the '\n' or > '\r\n'(which would be 2; 81) line enders. You young un's. Always makin' stuff up... :-) In these days of fancy single-user PCs with sophisticated window systems, people tend to forget that BITD there was a thriving mark

Re: Importing Definitions

2013-09-06 Thread Oscar Benjamin
On 5 September 2013 19:06, Skip Montanaro wrote: >>> You can! Any name will work, functions aren't special. >>> >>> from module1 import method1, A, B, C, D, E >> >> Better practice is to use: >> >> import module1 >> print module1.A >> print module2.B >> >> and so forth since that makes it far more

Re: Importing Definitions

2013-09-06 Thread Azureaus
Thanks for the advice, much appreciated - I didn't realise you could also import definitions. I do always read the documentation before posting but sometimes I don't know how it's necessarily applicable to my own case sometimes - hence the post. I'll avoid using '*' at all costs, I've had the pl

Chardet, file, ... and the Flexible String Representation

2013-09-06 Thread wxjmfauth
Short comment about the "detection" tools from a previous discussion. The tools supposed to detect the coding scheme are all working with a simple logical mathematical rule: p ==> q<==> non q ==> non p . Shortly -- and consequence -- they do not detect a coding scheme they only detect