mimedecode.py version 2.5.0

2014-03-20 Thread Oleg Broytman
Hello! mimedecode.py WHAT IS IT Mail users, especially in non-English countries, often find that mail messages arrived in different formats, with different content types, in different encodings and charsets. Usually this is good because it allows us to use

[ANN]: distlib 0.1.8 released on PyPI

2014-03-20 Thread Vinay Sajip
I've released version 0.1.8 of distlib on PyPI [1]. For newcomers, distlib is a library of packaging functionality which is intended to be usable as the basis for third-party packaging tools. The main changes in this release are as follows: * Fixed issue #45: Improved thread-safety in

Re: Question about Source Control

2014-03-20 Thread Frank Millman
Frank Millman fr...@chagford.com wrote in message news:lgbe6g$j9o$1...@ger.gmane.org... To recap my basic setup, I have machine A which holds the source directory, machine B which is used to edit the program, and machines B and C which are both used to run the program. Initially, to

Re: Question about Source Control

2014-03-20 Thread Chris Angelico
On Thu, Mar 20, 2014 at 5:48 PM, Frank Millman fr...@chagford.com wrote: One thing still confuses me. Over the lifetime of a project, there could be many thousands of changesets. Some of those could be tagged as 'major releases'. Someone wishing to clone the project from scratch may want to

Re: [Python-Dev] Issues about relative absolute import way for Portingfrom python2.4 to python2.7

2014-03-20 Thread Peter Otten
北冰洋 wrote: I just wrote a sample like this: testPy/ __init__.py client.py SoamFactory.c SoamFactory.so soamapi.py sample/testP.py export PYTHONPATH=$(TEST_LOCATION):$(TEST_LOCATION)/testPy I found that soamapi was imported twice,

Re: Problem with pickle and restarting a program

2014-03-20 Thread dieter
Peace abhishek1...@gmail.com writes: ... The serial number field always remains empty even though I enter from the GUI and the receiveSerialNumber function is called and I explicitly initialize it to the variable in the model. I'm trying to save the state of the program so that next time I

Decorator

2014-03-20 Thread muru kessan
Hi guys, Is there a difference between accessing decorators via '@' symbol and hard coding that ? esp when the function passed to the decorator is a recursive one? See attachments result from deco_with@ is 1 1 0 1 1 0 1 1 0 result from deco_without@ is 1 1 2 3 5 8 13 21 34 1 1 0 3 5 0 13 21

Re: Decorator

2014-03-20 Thread Peter Otten
muru kessan wrote: Is there a difference between accessing decorators via '@' symbol and hard coding that ? esp when the function passed to the decorator is a recursive one? The difference is not the decorator but the recursive function call. Consider Case 1: @deco def f(): ...

Re: Decorator

2014-03-20 Thread Dave Angel
Peter Otten __pete...@web.de Wrote in message: In your code change fib1 = isOddMy(fib) to fib = isOddMy(fib) and the without@ version will produce the same output as the with@ version. I expect that one more thing is needed, since the above is inside a function:

PyDev 3.4.1 Released

2014-03-20 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details

Re: Decorator

2014-03-20 Thread Peter Otten
Dave Angel wrote: Peter Otten __pete...@web.de Wrote in message: In your code change fib1 = isOddMy(fib) to fib = isOddMy(fib) and the without@ version will produce the same output as the with@ version. I expect that one more thing is needed, since the above is inside

Dictionaries

2014-03-20 Thread ishish
Hi, This might sound weird, but is there a limit how many dictionaries a can create/use in a single script? My reason for asking is I split a 2-column-csv (phone#, ref#) file into a dict and am trying to put duplicated phone numbers with different ref numbers into new dictionaries. The

Re: Dictionaries

2014-03-20 Thread Peter Otten
ishish wrote: This might sound weird, but is there a limit how many dictionaries a can create/use in a single script? No. My reason for asking is I split a 2-column-csv (phone#, ref#) file into a dict and am trying to put duplicated phone numbers with different ref numbers into new

Re: Dictionaries

2014-03-20 Thread John Gordon
In mailman.8300.1395322251.18130.python-l...@python.org ishish ish...@domhain.de writes: The script [...] only creates batch1.csv. If the script only creates batch1.csv, that means Batch2 and Batch3 must be empty. for k, v in myDict.items(): if Batch1.has_key(k): if k

Re:Dictionaries

2014-03-20 Thread Dave Angel
Please don't leave new questions in an existing thread, and especially without changing subject line. Compose a new message with meaningful subject line. ishish ish...@domhain.de Wrote in message: Hi, This might sound weird, but is there a limit how many dictionaries a can create/use

Re: Dictionaries

2014-03-20 Thread ishish
Thanks Peter for the fast response, but the prob is solved. My colleague just verbally slapped me because a dict SHOULDN'T have duplicate keys... I change it around to duplicate values and it works fine I think I need coffee now... lots of it. --

running python 2 vs 3

2014-03-20 Thread notbob
Dumb noob questions: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? IOW, up till now, I've used .py on all my 2.7 files. How do I know not to run a .py in

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
notbob not...@nothome.com: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? IOW, up till now, I've used .py on all my 2.7 files. How do I know not to run a

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Marko Rauhamaa ma...@pacujo.net wrote: That's a bit of a sore spot. On a linux box, the initial line of the script indicates the interpreter: #!/usr/bin/env python2 for Python 2.x #!/usr/bin/env python3 for Python 3.x. All tutorials will tell you to start it

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 9:58 AM, notbob wrote: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? hi notbob, the two (or more) IDLE environments run very nicely

Re: running python 2 vs 3

2014-03-20 Thread Zachary Ware
On Thu, Mar 20, 2014 at 11:00 AM, notbob not...@nothome.com wrote: Ahhh! now a shabang I understand. So, I guess the only way, short of looking at the actual file, is to include the version in the filename. Can I safely assume I can run all 2.7 files w/o a shebang (which I have not, so

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Zachary Ware zachary.ware+pyl...@gmail.com wrote: If you're specifying the interpreter in your command (by calling python scriptname.py, etc), the shebang won't mean anything anyway. DOH! I was following you, fine, until that last sentence. Then how should I invoke the

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Mark H Harris harrismh...@gmail.com wrote: not) there really is no problem. The reason is that the .pyc files created for python2.x are only used by python2. Lordy, what hath I wrought!? ;) What the heck is a .pyc file and how are they created? Actually, I can see it's a

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 4:23 AM, notbob not...@nothome.com wrote: On 2014-03-20, Mark H Harris harrismh...@gmail.com wrote: not) there really is no problem. The reason is that the .pyc files created for python2.x are only used by python2. Lordy, what hath I wrought!? ;) What the heck is a

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 4:10 AM, notbob not...@nothome.com wrote: On 2014-03-20, Zachary Ware zachary.ware+pyl...@gmail.com wrote: If you're specifying the interpreter in your command (by calling python scriptname.py, etc), the shebang won't mean anything anyway. DOH! I was following you,

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 12:23 PM, notbob wrote: What the heck is a .pyc file and how are they created? Actually, I can see it's a compiled binary, but I where did it come from? The world according to me: python is an interpreter (vs compiler) which converts your source code into tokens and then into a

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: Nowadays they'll be pushed away into a separate directory, which makes them easier for you to ignore. This is a good thing. Still, I don't think Python should go and soil my directories without an explicit permission. Marko --

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Mark H Harris harrismh...@gmail.com: If you wanted to you could run your python scripts from the .pyc file alone. In other words, you may import as long as the .pyc file exists and the source does not need to be there. Some folks use this (not recommended) trick to hide or obfuscate their

Re: running python 2 vs 3

2014-03-20 Thread Gary Herron
On 03/20/2014 10:10 AM, notbob wrote: On 2014-03-20, Zachary Ware zachary.ware+pyl...@gmail.com wrote: If you're specifying the interpreter in your command (by calling python scriptname.py, etc), the shebang won't mean anything anyway. DOH! I was following you, fine, until that last

Installing ssdeep on Portable Python

2014-03-20 Thread laguna-mc
Portable Python 2.7 for Windows, the Python application have dependency on ssdeep-2.10, which is a binary exe. The ssdeep (libfuzzy) installation example was shown for Linux platform only: a) libfuzzy can be installed via apt-get:    $ sudo apt-get install libfuzzy2 b) to install

Re: Problem with pickle and restarting a program

2014-03-20 Thread peace
On Thursday, March 20, 2014 1:20:03 AM UTC-7, dieter wrote: Peace writes: ... The serial number field always remains empty even though I enter from the GUI and the receiveSerialNumber function is called and I explicitly initialize it to the variable in the model. I'm trying to

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 1:47 PM, Marko Rauhamaa wrote: Mark H Harris harrismh...@gmail.com: If you wanted to you could run your python scripts from the .pyc file alone. In other words, you may import as long as the .pyc file exists and the source does not need to be there. Some folks use this (not

Re: running python 2 vs 3

2014-03-20 Thread Mark Lawrence
On 20/03/2014 15:21, Marko Rauhamaa wrote: notbob not...@nothome.com: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? IOW, up till now, I've used .py on all

Re: running python 2 vs 3

2014-03-20 Thread John Gordon
In bp0lohf7aq...@mid.individual.net notbob not...@nothome.com writes: On 2014-03-20, Zachary Ware zachary.ware+pyl...@gmail.com wrote: If you're specifying the interpreter in your command (by calling python scriptname.py, etc), the shebang won't mean anything anyway. DOH! I was

Re: running python 2 vs 3

2014-03-20 Thread Eric Jacoboni
Le 20/03/2014 16:21, Marko Rauhamaa a écrit : All tutorials will tell you to start it with #!/usr/bin/env python which will start python2 on all (?) existing linux distros, but is expected to start python3 within the next decade. With Arch-Linux, python is python3... --

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 12:47 PM, Marko Rauhamaa wrote: I've seen it done, but at least in those Python 2 days the pyc format changed between minor releases of Python, so Python itself had to be shipped with the pyc files. hi Marko, yeah, I have not done this; being that the concept is contrary to my

Re: running python 2 vs 3

2014-03-20 Thread Alan Meyer
On 3/20/2014 11:21 AM, Marko Rauhamaa wrote: On a linux box, the initial line of the script indicates the interpreter: #!/usr/bin/env python2 for Python 2.x #!/usr/bin/env python3 for Python 3.x. All tutorials will tell you to start it with #!/usr/bin/env python which will

File Path/Global name issue

2014-03-20 Thread roy . snuffles
I am currently running code for a program called HotNet (https://github.com/raphael-group/hotnet) In its simpleRun.py file, there is a place to insert a file path to be run. parser.add_argument('-mf', '--infmat_file', required=True, help='Path to .mat file containing

Re: File Path/Global name issue

2014-03-20 Thread Skip Montanaro
On Thu, Mar 20, 2014 at 2:55 PM, roy.snuff...@gmail.com wrote: File simpleRun.py, line 29 help= ~/home/lai/Downloads/influence_matrix_files/hprd_inf_.mat) ^ SyntaxError: invalid syntax You need quotes around the filename. It's a string literal. Skip --

Re: File Path/Global name issue

2014-03-20 Thread roy . snuffles
Hi Skip! Thank you so much for the response. When I put quotes around the file name I receive this output. simpleRun.py: error: argument -mf/--infmat_file is required -- https://mail.python.org/mailman/listinfo/python-list

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Alan Meyer amey...@yahoo.com: I presume it would still be a good idea to test both python interpreters against any script that you didn't knowingly write with a feature that will only work in one of the two python versions. If it works fine in both - and many will, then use:

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 2:53 PM, Alan Meyer wrote: #!/usr/bin/env python Only use the python2 or python3 versions if you really have a reason to do so. It gets tricky for distribution (you need docs for your distros, imho) because #!/usr/bin/env python means different things on different systems. I

Re: File Path/Global name issue

2014-03-20 Thread Skip Montanaro
On Thu, Mar 20, 2014 at 3:08 PM, roy.snuff...@gmail.com wrote: simpleRun.py: error: argument -mf/--infmat_file is required I think you are misinterpreting the actual purpose of the parser_add_argument() call. It's telling you that *on the command line* you can specify it using either -mf

Re: running python 2 vs 3

2014-03-20 Thread Mark Lawrence
On 20/03/2014 20:08, Marko Rauhamaa wrote: Alan Meyer amey...@yahoo.com: I presume it would still be a good idea to test both python interpreters against any script that you didn't knowingly write with a feature that will only work in one of the two python versions. If it works fine in both -

Re: File Path/Global name issue

2014-03-20 Thread Peter Otten
roy.snuff...@gmail.com wrote: I am currently running code for a program called HotNet (https://github.com/raphael-group/hotnet) In its simpleRun.py file, there is a place to insert a file path to be run. parser.add_argument('-mf', '--infmat_file', required=True,

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 3:07 PM, Eric Jacoboni wrote: Le 20/03/2014 16:21, Marko Rauhamaa a écrit : All tutorials will tell you to start it with #!/usr/bin/env python which will start python2 on all (?) existing linux distros, but is expected to start python3 within the next decade. With

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 4:08 PM, Marko Rauhamaa wrote: Alan Meyer amey...@yahoo.com: I presume it would still be a good idea to test both python interpreters against any script that you didn't knowingly write with a feature that will only work in one of the two python versions. If it works fine in both -

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Mark Lawrence breamore...@yahoo.co.uk: The starter is 2to3 which had been in the standard library for what seems like an eternity to me. No problem there. It helps you transition from python2 to python3. However, python3 is here and you should be able to write genuine python3 code with the

Re: running python 2 vs 3

2014-03-20 Thread Dan Stromberg
On Thu, Mar 20, 2014 at 8:21 AM, Marko Rauhamaa ma...@pacujo.net wrote: notbob not...@nothome.com: I've installed python 3.3 on my Slack box, which by default comes with python 2.7. I know how to fire up the different IDLE environments, but how do I differentiate between the scripts? IOW, up

Re: running python 2 vs 3

2014-03-20 Thread Zachary Ware
On Thu, Mar 20, 2014 at 3:30 PM, Marko Rauhamaa ma...@pacujo.net wrote: I must say, though, that Python3 destroyed print forever for me. To avoid nausea, I write sys.stdout.write() in all Python3 code. To each their own :). I can't stand using 'print' as a statement. It's a very nice trick to

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Ned Batchelder n...@nedbatchelder.com: Plenty of people have adopted a dual-support strategy, with one code base that supports both Python 2 and Python 3. The six module can help a great deal with this. I wonder how easy the resulting code is to the eyes and how easy it is for the casual

Re: running python 2 vs 3

2014-03-20 Thread Mark Lawrence
On 20/03/2014 20:30, Marko Rauhamaa wrote: Mark Lawrence breamore...@yahoo.co.uk: The starter is 2to3 which had been in the standard library for what seems like an eternity to me. No problem there. It helps you transition from python2 to python3. However, python3 is here and you should be

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Dan Stromberg drsali...@gmail.com: Actually, I formerly used /usr/bin/env, but have recently (within the last couple of years) stopped. This is because the env trick doesn't play nicely with top IME. Also, it's a trick. I'm not sure I like it either, but it's a standard idiom in Pythonland.

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 4:42 PM, Marko Rauhamaa wrote: Ned Batchelder n...@nedbatchelder.com: Plenty of people have adopted a dual-support strategy, with one code base that supports both Python 2 and Python 3. The six module can help a great deal with this. I wonder how easy the resulting code is to the

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Mark Lawrence breamore...@yahoo.co.uk: On 20/03/2014 20:30, Marko Rauhamaa wrote: I must say, though, that Python3 destroyed print forever for me. To avoid nausea, I write sys.stdout.write() in all Python3 code. Not for me, I was using from __future__ import print_function for years so got

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Ned Batchelder n...@nedbatchelder.com: It's an extreme case, but the latest released version of coverage.py supports Python 2.3 through 3.3 with one code base. To do it, there's a compatibility layer (akin to six). Then you stay away from features that aren't available on all versions. In a

Re: running python 2 vs 3

2014-03-20 Thread Chris Kaynor
On Thu, Mar 20, 2014 at 1:59 PM, Marko Rauhamaa ma...@pacujo.net wrote: Well, with proper care, I suppose the same code base could support perl as well. ;) Go even farther; how about C, PHP, and bash? I'm sure if you tried, you could mix in some Python as well.

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Mark H Harris harrismh...@gmail.com wrote: When I call python2 that means python2.7.6 / When I call python3 that means python3.3.4 / I can also call python2.7, which is 2.7.2 / You get the idea. There is no one set rule, because there are many distros (gnu/linux) that

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 4:59 PM, Marko Rauhamaa wrote: Ned Batchelder n...@nedbatchelder.com: It's an extreme case, but the latest released version of coverage.py supports Python 2.3 through 3.3 with one code base. To do it, there's a compatibility layer (akin to six). Then you stay away from features that

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Ned Batchelder n...@nedbatchelder.com wrote: On 3/20/14 3:07 PM, Eric Jacoboni wrote: With Arch-Linux, python is python3... Yes, and they have been told many times that this was foolish and wrong, but it persists, much to our pain. I've read that 2.7 is the defacto std for

Re: File Path/Global name issue

2014-03-20 Thread John Gordon
In 2089d20b-aa60-462f-aad0-51109849c...@googlegroups.com roy.snuff...@gmail.com writes: I am currently running code for a program called HotNet (https://github.com/raphael-group/hotnet) In its simpleRun.py file, there is a place to insert a file path to be run. parser.add_argument('-mf',

Re: running python 2 vs 3

2014-03-20 Thread Mark Lawrence
On 20/03/2014 20:50, Marko Rauhamaa wrote: Mark Lawrence breamore...@yahoo.co.uk: On 20/03/2014 20:30, Marko Rauhamaa wrote: I must say, though, that Python3 destroyed print forever for me. To avoid nausea, I write sys.stdout.write() in all Python3 code. Not for me, I was using from

Re: running python 2 vs 3

2014-03-20 Thread Mark H Harris
On 3/20/14 4:28 PM, notbob wrote: No wonder the latest O'Reilly book, Learning Python, 5th ed, is 1600 pgs. I coulda swore someone sed python is easy. ;) nb Python is easy, but its not simple. Python is elegant, and full of art, but it has no paucity of constructs, types, and

Re: running python 2 vs 3

2014-03-20 Thread Terry Reedy
On 3/20/2014 1:23 PM, notbob wrote: What the heck is a .pyc file and how are they created? .pyc contained compiled bytecode. They are created when, and only when, you import a module. Imported library files are often big and stable, so their compiled forms get cached. Top-level scripts are

Re: running python 2 vs 3

2014-03-20 Thread Terry Reedy
On 3/20/2014 3:07 PM, John Gordon wrote: There are two ways (at least!) to run a python script: 1. Execute the python interpreter manually, supplying the python script name as an arugment, like so: python myscript.py python2 otherscript.py python3 yetanotherscript.py

Re: running python 2 vs 3

2014-03-20 Thread Michael Torrie
On 03/20/2014 11:10 AM, notbob wrote: On 2014-03-20, Zachary Ware zachary.ware+pyl...@gmail.com wrote: If you're specifying the interpreter in your command (by calling python scriptname.py, etc), the shebang won't mean anything anyway. DOH! I was following you, fine, until that last

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
notbob not...@nothome.com: Weeping Chryst on the cross!!. No wonder the latest O'Reilly book, Learning Python, 5th ed, is 1600 pgs. I coulda swore someone sed python is easy. ;) It's not that bad. There are two principal dialects: python2 and python3. Take the oldest python version you have

Re: Question about Source Control

2014-03-20 Thread Gregory Ewing
Chris Angelico wrote: You can then offer a non-source-control means of downloading that specific revision. Just keep in mind the downside that you can't then push or pull your changes directly back into the main repository. You can generate a patch file for the project maintainer to apply,

Re: running python 2 vs 3

2014-03-20 Thread notbob
On 2014-03-20, Terry Reedy tjre...@udel.edu wrote: That must be the only one you imported. So it is. Thank you. nb -- https://mail.python.org/mailman/listinfo/python-list

Re: running python 2 vs 3

2014-03-20 Thread Marko Rauhamaa
Ned Batchelder n...@nedbatchelder.com: On 3/20/14 4:59 PM, Marko Rauhamaa wrote: Well, with proper care, I suppose the same code base could support perl as well. ;) I'm not sure how to take this comment. I feel like you are mocking my choice. I wanted to make coverage.py available to as

Re: Question about Source Control

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 9:19 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: You can then offer a non-source-control means of downloading that specific revision. Just keep in mind the downside that you can't then push or pull your changes directly back into the

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 22:30:57 +0200, Marko Rauhamaa wrote: To avoid nausea, I write sys.stdout.write() in all Python3 code. Now that's funny. I-know-I-shouldn't-respond-to-obvious-trolling-but-I-can't-help-myself-ly yrs, -- Steven D'Aprano --

Re: running python 2 vs 3

2014-03-20 Thread Mark Lawrence
On 20/03/2014 22:23, Marko Rauhamaa wrote: Ned Batchelder n...@nedbatchelder.com: On 3/20/14 4:59 PM, Marko Rauhamaa wrote: Well, with proper care, I suppose the same code base could support perl as well. ;) I'm not sure how to take this comment. I feel like you are mocking my choice. I

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 7:08 AM, Marko Rauhamaa ma...@pacujo.net wrote: Alan Meyer amey...@yahoo.com: I presume it would still be a good idea to test both python interpreters against any script that you didn't knowingly write with a feature that will only work in one of the two python

CallBack function in C Libraries.

2014-03-20 Thread fiensproto
Hello. I want to use a c library. It is a complete graphic widget set. Here code working. But i have problem with the callback function. The callback is executed while ClikOnForm is executed but i get a error message (see after code )

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 9:23 AM, Marko Rauhamaa ma...@pacujo.net wrote: Ned Batchelder n...@nedbatchelder.com: On 3/20/14 4:59 PM, Marko Rauhamaa wrote: Well, with proper care, I suppose the same code base could support perl as well. ;) I'm not sure how to take this comment. I feel like you

Re: CallBack function in C Libraries.

2014-03-20 Thread Mark H Harris
On 3/20/14 6:16 PM, fienspr...@gmail.com wrote: def TheProc(c_int): fpgui.fpgFormWindowTitle(0, 'Boum') return 0 TheProcF = CMPFUNC(TheProc) Traceback (most recent call last): File _ctypes/callbacks.c, line 314, in 'calling callback function' TypeError: TheProc() takes exactly 1 argument

Re: CallBack function in C Libraries.

2014-03-20 Thread fiensproto
Give the function call its required argument and the error will go away... well, at least that one. Yep, many thanks for the answer. But... im totally beginner with Python. I develop in Pascal and C and want to understand the basics of Python. In concrete, what must i change in the code ?

Re: CallBack function in C Libraries.

2014-03-20 Thread 88888 Dihedral
On Friday, March 21, 2014 7:56:43 AM UTC+8, fiens...@gmail.com wrote: Give the function call its required argument and the error will go away... well, at least that one. Yep, many thanks for the answer. But... im totally beginner with Python. I develop in Pascal and C and

Installing ssdeep on Portable Python /advice

2014-03-20 Thread laguna-mc
Portable Python 2.7 for Windows, the Python application have dependency on ssdeep-2.10, which is a binary exe. The ssdeep (libfuzzy) installation example was shown for Linux platform only: a) libfuzzy can be installed via apt-get:    $ sudo apt-get install libfuzzy2 b) to install

Re: Installing ssdeep on Portable Python /advice

2014-03-20 Thread Mark Lawrence
On 21/03/2014 00:16, laguna...@mail.com wrote: Portable Python 2.7 for Windows, the Python application have dependency on ssdeep-2.10, which is a binary exe. The ssdeep (libfuzzy) installation example was shown for Linux platform only: a) libfuzzy can be installed via apt-get: $

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 21:28:43 +, notbob wrote: On 2014-03-20, Mark H Harris harrismh...@gmail.com wrote: When I call python2 that means python2.7.6 / When I call python3 that means python3.3.4 / I can also call python2.7, which is 2.7.2 / You get the idea. There is no one set rule,

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 16:26:39 -0400, Ned Batchelder wrote: On 3/20/14 3:07 PM, Eric Jacoboni wrote: Le 20/03/2014 16:21, Marko Rauhamaa a écrit : All tutorials will tell you to start it with #!/usr/bin/env python which will start python2 on all (?) existing linux distros, but is

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 16:53:25 -0400, Ned Batchelder wrote: On 3/20/14 4:42 PM, Marko Rauhamaa wrote: Ned Batchelder n...@nedbatchelder.com: Plenty of people have adopted a dual-support strategy, with one code base that supports both Python 2 and Python 3. The six module can help a great deal

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 22:50:45 +0200, Marko Rauhamaa wrote: Mark Lawrence breamore...@yahoo.co.uk: On 20/03/2014 20:30, Marko Rauhamaa wrote: I must say, though, that Python3 destroyed print forever for me. To avoid nausea, I write sys.stdout.write() in all Python3 code. Not for me, I was

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 8:32 PM, Steven D'Aprano wrote: On Thu, 20 Mar 2014 16:26:39 -0400, Ned Batchelder wrote: On 3/20/14 3:07 PM, Eric Jacoboni wrote: Le 20/03/2014 16:21, Marko Rauhamaa a écrit : All tutorials will tell you to start it with #!/usr/bin/env python which will start python2 on

Re: running python 2 vs 3

2014-03-20 Thread Roy Smith
In article 532b8f0d$0$29994$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The rule of three applies here: anything you do in three different places ought to be managed by a function. I prefer the rule of two :-) --

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 11:32 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Perhaps Arch-Linux is guilty of being prematurely Python 3... I have no idea what our pain you are referring to, or who our refers to. In the three or five years or so since Arch-Linux moved to Python

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 11:59 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The rule of three applies here: anything you do in three different places ought to be managed by a function. Printing a newline at the end of a line of output is *incredibly* common. Any language which

Re: running python 2 vs 3

2014-03-20 Thread Ned Batchelder
On 3/20/14 9:06 PM, Ned Batchelder wrote: On 3/20/14 8:32 PM, Steven D'Aprano wrote: On Thu, 20 Mar 2014 16:26:39 -0400, Ned Batchelder wrote: On 3/20/14 3:07 PM, Eric Jacoboni wrote: Le 20/03/2014 16:21, Marko Rauhamaa a écrit : All tutorials will tell you to start it with

Re: running python 2 vs 3

2014-03-20 Thread Ethan Furman
On 03/20/2014 05:37 PM, Steven D'Aprano wrote: In my experience, such as it is, the hard part about writing code that works from 2.4 to 3.4 is not the 3 versions but the 2.4 and 2.5 versions. +1000! (yes, that's factorial ;) -- ~Ethan~ --

Re: Question about Source Control

2014-03-20 Thread Cameron Simpson
On 21Mar2014 09:34, Chris Angelico ros...@gmail.com wrote: On Fri, Mar 21, 2014 at 9:19 AM, Gregory Ewing Also, unless the project is truly ancient, the whole history might not be as big as you expect. The code presumably grew to its present size incrementally, in an approximately

Re: CallBack function in C Libraries.

2014-03-20 Thread Rhodri James
On Thu, 20 Mar 2014 23:56:43 -, fienspr...@gmail.com wrote: Give the function call its required argument and the error will go away... well, at least that one. Yep, many thanks for the answer. But... im totally beginner with Python. I develop in Pascal and C and want to understand the

Re: Question about Source Control

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 12:33 PM, Cameron Simpson c...@zip.com.au wrote: Regarding having Mercurial installed, that is very easy, and after you've gone (eg): hg clone https://bitbucket.org/cameron_simpson/css my-copy-of-cameron's-css (or wherever the public repository is published), you

Re: running python 2 vs 3

2014-03-20 Thread Chris Angelico
On Fri, Mar 21, 2014 at 12:06 PM, Roy Smith r...@panix.com wrote: In article 532b8f0d$0$29994$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The rule of three applies here: anything you do in three different places ought to be managed by a

Re: running python 2 vs 3

2014-03-20 Thread Rustom Mody
On Friday, March 21, 2014 2:23:25 AM UTC+5:30, Ned Batchelder wrote: On 3/20/14 4:42 PM, Marko Rauhamaa wrote: Ned Batchelder : Plenty of people have adopted a dual-support strategy, with one code base that supports both Python 2 and Python 3. The six module can help a great deal with

Re: running python 2 vs 3

2014-03-20 Thread alex23
On 3/20/2014 3:07 PM, John Gordon wrote: There are two ways (at least!) to run a python script: On 21/03/2014 8:05 AM, Terry Reedy wrote: 3. [...] Our chief weapon is... -- https://mail.python.org/mailman/listinfo/python-list

Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread dtran . ru
Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: 1. two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so far: def chartonum(ch): return ord(ch) -

Re:Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Dave Angel
dtran...@gmail.com Wrote in message: Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: 1. two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so

Re: running python 2 vs 3

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 21:06:24 -0400, Ned Batchelder wrote: In the #python IRC channel, there's a steady flow of people who run programs they find online, and they get a syntax error on print, and we say, Arch? and they say, yup. When you install random programs you find online without going

  1   2   3   >