Re: Interactive apps with Python

2008-02-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: Folks, I am trying to build an interactive test application. I would like to generate interactive commands to an existing server(ftpd) so commands like ftp 192.68.20.1 acelogin: ace password : I should be able to mimic human intervention. Is

Re: How to subclass a built-in int type and prevent comparisons

2008-03-01 Thread Michael Torrie
[EMAIL PROTECTED] wrote: Tell Wall. But why not [ 2, 3 ]= 2? Back to your question, another option is to not subclass. Umm, no. You need to actually read the posts before you respond to them. His question was whether or not to throw an exception in this case. He's *already* subclassed the

Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
I need to use a lambda expression to bind some extra contextual data (should be constant after it's computed) to a call to a function. I had originally thought I could use something like this demo (but useless) code: funcs=[] def testfunc(a,b): print %d, %d % (a,b) for x in xrange(10):

Re: Question about lambda and variable bindings

2008-03-01 Thread Michael Torrie
poof65 wrote: An idea, i don't know if it will work in your case. for x in xrange(10): funcs.append(lambda p,z=x: testfunc(z+2,p)) Good idea. I will try it. I also figured out a way to architecture my program differently to avoid this problem. But this idiom might be handy in certain

popening a process in a specific working directory

2008-03-04 Thread Michael Torrie
I have a small multi-threaded program that spawns a number of threads that each spawn a particular process in a particular temporary directory. My problem is that using os.chdir to change the working directory before popening the process doesn't always work because another thread might change the

Protocol for thread communication

2008-03-04 Thread Michael Torrie
Does anyone have any recommended ideas/ways of implementing a proper control and status protocol for communicating with threads? I have a program that spawns a few worker threads, and I'd like a good, clean way of communicating the status of these threads back to the main thread. Each thread

Re: Weird scope error

2008-04-05 Thread Michael Torrie
Rory McKinley wrote: Gary Herron wrote: snip Python has no such thing as this kind of a global scope. (True, each module has its own global scope, but that's not what you are talking about.) So you'll have to fix the import for *every* module that needs access to ElementTree.You

Re: appropriate python version

2008-04-06 Thread Michael Torrie
xamdam wrote: Sorry if this is a stupid q, I am trying to figure out the appropriate version of Python(2.4 or 2.5) for an XP 64 system running on an Intel Core2 Quad. Python.org has a to a 64bit build, but it specifies Itanium as the target. Should I just be using the regular build? Itanium

Re: Python Leopard DLL Hell

2008-04-08 Thread Michael Torrie
Brian Cole wrote: That appears to be working correctly at first glance. The argument to dlopen is the correct shared library. Unfortunately, either python or OS X is lying to me here. If I inspect the python process with OS X's Activity Monitor and look at the Open Files and Ports tab, it

Re: py3k s***s

2008-04-15 Thread Michael Torrie
Chris McAloney wrote: *Have* you tried the 2to3 tool? It might help to lessen your concerns a bit. Yes, Python 3 is different from 2.x, but we've known that it was going to be for years and, as has already been pointed out, the devs are being very careful to minimize the pain that the

Re: Java or C++?

2008-04-15 Thread Michael Torrie
egbert wrote: What is the role or position of C# in this context ? If I remember well, some people have said that C# is an improved C++ or Java. e I think C# is in a great position, and might be recommended. C# has the added advantage of being able to very easily work with IronPython. Thus

Re: Java or C++?

2008-04-15 Thread Michael Torrie
Ben Kaplan wrote: The fact that C# is a .NET language is also a major weakness, since you can only use it on Windows. Really? I have developed several C# .NET applications and I only use OS X and Linux. Guess I imagined it. Also, IronPython runs very well on Linux and OS X. If you'd said

Re: Finally had to plonk google gorups.

2008-04-16 Thread Michael Torrie
Mike Driscoll wrote: Steve, My workplace doesn't offer NNTP, so there is no good way to browse c.l.py here. And I haven't been able to get NNTP to work from my home either. I rarely use NNTP these days. I access c.l.py exclusively via e-mail, and that works very well. In some cases there

Re: Finally had to plonk google gorups.

2008-04-16 Thread Michael Torrie
Torsten Bronger wrote: The admistrative overhead of mailing lists is tedious. Fortunately, most important computer-related lists are on gmane.org. We could list c.l.py there, too. ;-) Running a few lists myself, I don't see this. How is administrative overhead tedious? Most open source

Re: Finally had to plonk google gorups.

2008-04-16 Thread Michael Torrie
On Wed, Apr 16, 2008 at 11:49 AM, Mike Driscoll [EMAIL PROTECTED] wrote: I don't think I like the email list idea all that much. I'm already on a number of them and they fill up my box like crazy. Besides that, in email format it's hard to follow the thread, so one moment I'm reading about

Re: py3k s***s

2008-04-17 Thread Michael Torrie
Aaron Watters wrote: What I'm saying is that, for example, there are a lot of cool tools out there for using Python to manipulate postscript and latex and such. Most of those tools require no maintenance, and the authors are not paying any attention to them, and they aren't interested in

Re: How to know if a module is thread-safe

2008-04-17 Thread Michael Torrie
Jérémy Wagner wrote: Hi, I recently tried to use the subprocess module within a threading.Thread class, but it appears the module is not thread-safe. http://bugs.python.org/issue1731717 Pretty bad bug, really, since subprocess is supposed to be the replacement for all the other mechanisms

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: code snipped There! That's the whole code. I guess the way you suggest is simpler and a bit more intuitive, but I was figuring that the way I suggested it is more stylish. Umm, doesn't defining all those members in the class lead to class variables, not instance

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: I do it with all the separate variables mainly for performance. If I had the headers in a dict, I'd be looking up a string in a list of strings (the keys of the dict) everytime I check for a header. Not that that's going to take more that 0.1 seconds, but the program

Re: Can't do a multiline assignment!

2008-04-17 Thread Michael Torrie
[EMAIL PROTECTED] wrote: You didn't really write that at the Python's interpreter, did you? It's wrong. The way that would really go at the interpreter is like I did actually run it through the interpreter, but I didn't copy and past it to the e-mail. Thought that I saw this behavior, but

Re: Finally had to plonk google gorups.

2008-04-17 Thread Michael Torrie
Mike Driscoll wrote: I'm confused. First you say Gmail is create for filtering and then you say it has a broken interface. I like Gmail for some things, but my inability to create folders is one thing that really bugs me. I can set up Thunderbird to accept mail from Gmail and do it that way

Re: close GUI and quit script?

2008-04-20 Thread Michael Torrie
globalrev wrote: how do i close a GUI and end the mainloop of the script? From a GUI callback, instruct the main loop to quit. -- http://mail.python.org/mailman/listinfo/python-list

Re: close GUI and quit script?

2008-04-20 Thread Michael Torrie
Michael Torrie wrote: globalrev wrote: how do i close a GUI and end the mainloop of the script? From a GUI callback, instruct the main loop to quit. In case you can't tell from my reply, I'm basically saying that none of us have any idea unless you actually tell us what GUI system you

Re: Lists: why is this behavior different for index and slice assignments?

2008-04-21 Thread Michael Torrie
John Salerno wrote: So the question is, when you assign an empty list to an index, why does it insert an empty list, but when you assign an empty list to a slice, it simply deletes the slice? I would say this is consistent behavior because a list slice is also a list itself. Whereas a list

Re: Problems replacing \ with \\

2008-04-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: Hi... Here's a weird problem...I'm trying to escape a bunch of data to put into a database. Is it possible to use the database API and prepared statements to avoid having to go through this exercise? Also, most database APIs work natively in unicode, so creating

library to do easy shell scripting in Python

2008-04-23 Thread Michael Torrie
Recently a post that mentioned a recipe that extended subprocess to allow killable processes caused me to do some thinking. Some of my larger bash scripts are starting to become a bit unwieldy (hundreds of lines of code). Yet for many things bash just works out so well because it is so close to

Re: Problem using copy.copy with my own class

2008-04-23 Thread Michael Torrie
Jeffrey Barish wrote: Marc 'BlackJack' Rintsch wrote: Please simplify the code to a minimal example that still has the problem and *show it to us*. It's hard to spot errors in code that nobody except you knows. Here it is: import copy class Test(int): def __new__(cls, arg1,

Re: Zope/DTML Infuriating...

2008-05-01 Thread Michael Torrie
Jens wrote: - Why is it, when primitive data types seem to be objects (similar to javascript), that type casting is done through build-in functions rather than methods, e.g. String.toInt('5') or '5'.toInt() or x = Integer.fromString('5'). Mainly because it's much cleaner to do it the python

Re: Zope/DTML Infuriating...

2008-05-01 Thread Michael Torrie
Michael Torrie wrote: The second example, x = Integer.fromString('5') demonstrates a huge weakness in Java. Ahem. Javascript. Sorry. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stream I/O to a java applet (os.popen?)

2008-05-01 Thread Michael Torrie
Cody Woolaver wrote: This is all done at the terminal though and i need to have it done through a python file. I'm aware that i will have to use os.popen but am unfamiliar with how it works. You'll probably want to look at the subprocess module, which replaces the old os.popen stuff. It's

Re: Finally had to plonk google gorups.

2008-05-02 Thread Michael Torrie
Shawn Milochik wrote: How does one plonk stuff from Google Groups? Specifically, how can this be done in Gmail? Set up a filter that looks for some phrase in the mail headers that identifies messages originating from google groups. Gmail's filters are fairly flexible. I'd probably just have

Re: Finally had to plonk google gorups.

2008-05-02 Thread Michael Torrie
Mensanator wrote: On May 2, 9:53 am, Michael Torrie [EMAIL PROTECTED] wrote: Shawn Milochik wrote: How does one plonk stuff from Google Groups? Specifically, how can this be done in Gmail? Set up a filter that looks for some phrase in the mail headers that identifies messages originating

Re: Why don't generators execute until first yield?

2008-05-07 Thread Michael Torrie
Martin Sand Christensen wrote: Why don't generators follow the usual eager evaluation semantics of Python and immediately execute up until right before the first yield instead? A great example of why this behavior would defeat some of the purpose of generators can be found in this amazing PDF

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
[EMAIL PROTECTED] wrote: Have a look at this: -123**0 -1 The result is not correct, because every number (positive or negative) raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). No python is correct. you're expression parses this way, when converted to a lisp-ish

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
Ahem... That should have been: (negate (pow 123 0)) Using parenthesis to indicate precedence order of ops: -(123 ^ 0) The - you are using is not part of the number. It's a unary operator that negates something. In normal order of operations, it has a much lower priority than power. Your

Re: The del statement

2008-05-09 Thread Michael Torrie
George Sakkis wrote: I think you're trying to imply that it is consistent with setting a value (same with getting). I guess what bugs me about del is that it's a keyword and not some universally well-known punctuation. Do you you feel that Python misses a pop keyword and respective

Re: Module python-magic on/for Windows?

2008-05-11 Thread Michael Torrie
Larry Hale wrote: Now I *presume* my problem (at this point) is that I need to have libmagic named as magic1.dll -wherever- this module is looking for it. I'm just not sure, let alone if this is true, WHERE Python/ modules expect to find such things. Also, which version(s)/file(s) should

Re: Module python-magic on/for Windows?

2008-05-11 Thread Michael Torrie
Larry Hale wrote: ALSO: I've even tried putting the 4 magic files INTO the .egg file... still no-go. :/ It's often the custom of programs ported from unix to windows to use the dll location as a key to find the other files that are typically in share, or etc. GTK, for example uses ../share

Re: Module python-magic on/for Windows?

2008-05-12 Thread Michael Torrie
Michael Torrie wrote: In this case I'd try making a folder in the Python25 folder called share and put the contents of the gnuwin32 share/file stuff in there. Should look something like this: c:/python25/share/file/magic.mime.mgc c:/python25/share/file/magic c:/python25/share/file

Re: Module python-magic on/for Windows?

2008-05-12 Thread Michael Torrie
Larry Hale wrote: Alternately, if one wishes to leave/place the magic files elsewhere, do like: test = magic.Magic( magic_file = 'C:\\Program Files\\GnuWin32\ \share\\file\\magic' ) # -- spec where/what the file is NOTE: Even if the magic_file location *is* specified, mime = True

Re: HASH TABLES IN PYTHON

2008-05-15 Thread Michael Torrie
Blubaugh, David A. wrote: I was wondering if anyone has ever worked with hash tables within the Python Programming language? I will need to utilize this ability for quick numerical calculations. Dictionaries are, by definition, hash tables with a very optimized algorithm to minimize

Re: Python AppStore / Marketplace

2009-02-23 Thread Michael Torrie
Steve Holden wrote: Unfortunately I have no idea what a souq is, so I suspect this may be linguistically biased against English speakers. Or perhaps I'm just ignorant. Nah. Not biased against English speakers. Just biased against the un-traveled. :) --

Re: Problems with threaded Hotkey application

2009-03-25 Thread Michael Torrie
Anita Whitney wrote: A window comes up saying hotkeyapp has stopped working. How do I get in there to move the RegisterHotKey line to within the thread's run method, etc.? Im trying to do this myself and not pay Acer tech support. Thanks, Anita Whitney Is this a wxPython application that you

Re: how to arrange classes in .py files?

2009-03-27 Thread Michael Torrie
Kent wrote: In java, usually a .java file contains One Class. I read some python codes, I found one py file can have many classes and functions. Is there any convention how to manage python classes into .py files? In python we have a real name space, the primary unit being the module. Think

Re: unpack the source tarball on Windows

2009-03-31 Thread Michael Torrie
Mensanator wrote: Thanks. Still had to untar the ball, but I also downloaded a trial version of Winzip which took care of that. Right. The proper command is: tar -xvjf tarball.tar.bz2 The recommended GUI for all things archival on Windows I think has to be 7zip. And it's not cursed

Re: is there a way to collect twitts with python?

2009-04-03 Thread Michael Torrie
'2+ wrote: i found a guy twittin supercollider code this means his followers can listen to a noiz by activating that 1 line (well if he has sc installed) if lots of sc users start twittin ... it would be no good to follow each collecting a sc related twitt can be done with python? if

Re: is there a way to collect twitts with python?

2009-04-03 Thread Michael Torrie
Tim Wintle wrote: On Fri, 2009-04-03 at 14:58 -0600, Michael Torrie wrote: Oh wow. If this is what Twitter does to one's ability to articulate clearly, I hope Twitter dies a horrible death and any APIs and Python bindings with it! Thank you, thank you, thank you everyone around me

Re: How to get the filename in the right case ?

2008-09-27 Thread Michael Torrie
Steven D'Aprano wrote: On Fri, 26 Sep 2008 01:46:15 +0200, Stef Mientki wrote: Secondly thoughtless copying of current behavior, doesn't bring any progress, and I think that's one of the reasons why we're still burdened by inventions done 20 years ago, e.g. do you want to save your changes

Re: OS.SYSTEM ERROR !!!

2008-09-30 Thread Michael Torrie
Blubaugh, David A. wrote: Thank You!! I am still new to Python!! David Blubaugh As you've already noticed, plenty of folks here on the list are ready help you out with issues the crop up as you learn python. So keep on asking questions as you need assistance. In the future, please

Re: XMLRPC - C Client / Python Server

2008-09-30 Thread Michael Torrie
[EMAIL PROTECTED] wrote: I have implemented a simple Python XMLRPC server and need to call it from a C/C++ client. What is the simplest way to do this? I need to pass numerical arrays from C/C++ to Python. Which do you need, C or C++? They are two different languages with different

Re: Time.sleep(0.0125) not available within Linux

2008-09-30 Thread Michael Torrie
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Grant Edwards wrote: On 2008-09-23, Blubaugh, David A. [EMAIL PROTECTED] wrote: I was wondering if anyone has come across the issue of not being allowed to have the following within a Python script operating under Linux:

Re: How to do regular BASH work in Python?

2008-10-10 Thread Michael Torrie
Frantisek Malina wrote: What is the best way to do the regular bash commands in native python? - create directory - create file - make a symlink - copy a file to another directory - move a file - set permissions I need to write a program that creates real application/FTP accounts and

Re: Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Michael Torrie
Carl K wrote: I need to convert pdf to png, which imagemagic convert does, I think by using ghostscript. a little over a year ago I tried with some imagemagic (there are at least 2 i think) and neither seemed close to working (for pdf that is.) any idea if pdf conversion is working?

Re: Python on iPhone actually rather good

2008-11-04 Thread Michael Torrie
Python Nutter wrote: I'll be giving iPhone Python 2.5.1 a workout on on of Mark Lutz's books and report any more gotchas that I come across. Are there any good books on python and objc? I doubt you'll be able to make any decent iPhone apps without having a good working knowledge of Objective C

Re: Red Hat 32 bit RPM for python 2.4+

2008-11-05 Thread Michael Torrie
James Prav wrote: Hi , Could anybody please point to any available Red Hat 32 bit RPM for python 2.4 or greater version on Net. I searched a lot but could find for other flavour and not Red hat. RPMS are distro-specific. What distribution are you looking for? Since python is an integral

Re: Red Hat 32 bit RPM for python 2.4+

2008-11-06 Thread Michael Torrie
Pravin Sinha wrote: Hi Michael , Actually my requirement is to use 32 bit version of pyOpenSSL on 64 bit linux machine, Python 64 bit is not able to load 32 bit pyOpenSSL, so I wanted to install 32 bit python on 64 bit Linux. Again building that locally is not straight forward as I guess

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Michael Torrie
sturlamolden wrote: Back in the 'old days' of Unix, programs tended not to be small, could only do one thing, and did it well. They had no gui, and all interaction came from command line options. The programs were invoked from the command line, and input and output were piped from one

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Michael Torrie
Michael Torrie wrote: And of course Python is perfect in this area. A great example is found here: ahem, http://www.dabeaz.com/generators/Generators.pdf -- http://mail.python.org/mailman/listinfo/python-list

Re: Good grid + calendar, etc.?

2008-06-01 Thread Michael Torrie
Gilles Ganault wrote: The grid can be quite advanced. Did you look at the wxPython demo? Or Dabo? Yes, but although the basic wigets are just fine, wxGrid looks a bit like the basic TStringGrid in Delphi, ie. it's pretty basic so that several vendors came up with enhanced alternatives. But

Re: Faster I/O in a script

2008-06-03 Thread Michael Torrie
kalakouentin wrote: I use python in order to analyze my data which are in a text form. The script is fairly simple. It reads a line form the input file, computes what it must compute and then write it it to a buffer/list. When the whole reading file is processed (essential all lines) then the

don't make it worse! - was Re: SPAM

2008-06-19 Thread Michael Torrie
Aspersieman wrote: SPAM Obviously. Please refrain from replying to the SPAM on this list. It just makes the problem worse. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast and easy GUI prototyping with Python

2008-06-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: 2) The Qt vs. .NET API. I have no experience with Qt's API and a rudimentary experience with the .NET API (seems powerfull but also big and complex). Qt's API is very very good. Easy to use and extremely powerful. Note that in Python a number of Qt's APIs are not

Re: Fast and easy GUI prototyping with Python

2008-06-22 Thread Michael Torrie
Pete Kirkham wrote: 2008/6/21 Val-Amart [EMAIL PROTECTED]: Use PyQt. You will gain great portability +all the functionality built in qt. You can try PyGTK also, though i wont recommend it. Why would you not recommend it? I've been using it for a mall project, and would like to know if

Re: Confused

2008-07-12 Thread Michael Torrie
eric.butteriss wrote: Please tell me why may mail is being returned. The message says I have been blacklisted...for what reason? I never open mail that I know is not expected and I never send junk or spam. I am trying to send important info to my cousin. Now I'm confused. Is the python

Re: Why is there no GUI-tools like this for Windows?

2008-07-15 Thread Michael Torrie
Marcus.CM wrote: So python for me is for anything except GUI. It becomes self rejecting notion to do GUI in python when you type in those stuff that could have been handled by an IDE, thus for linux project i just do the web interface + php and let python do all the other hard core work.

Re: bad recursion, still works

2008-07-15 Thread Michael Torrie
iu2 wrote: I still don't understand: In each recursive call to flatten, acc should be bound to a new [], shouldn't it? Why does the binding happen only on the first call to flatten? Nope. In each new call it's (re)bound to the same original list, which you've added to as your function

Re: Memory utilization (linux v. openbsd)

2007-07-28 Thread Michael Torrie
[EMAIL PROTECTED] wrote: My problem is that the two process under OpenBSD are going to fail with a MemoryError becaause the size just keeps getting larger and larger. ulimit -d is 1G for each process. The problem is that you can't get accurate memory use readings from top. The reality is

Re: Python Written in C?

2008-07-20 Thread Michael Torrie
Mensanator wrote: On Jul 20, 7:37�pm, Roy Smith [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], �Mensanator [EMAIL PROTECTED] wrote: C isn't a high level language, that's part of its problem. C is the highest level assembler language Isn't that like bragging about being the

Re: Python Written in C?

2008-07-20 Thread Michael Torrie
[EMAIL PROTECTED] wrote: I'm not dissing Python, here. Just noting that, if it is written in C, that throws a curve at me in trying to balance the value of learning Python vs. some other major language. Definitely one of the most non-sequitor statements I have ever heard. Actually your entire

Re: Doubt

2008-07-24 Thread Michael Torrie
You wrote: How to represent the loop for ($a = $b; $a=$c;$a++){ } in Python As other pointed out, iterating through a list or range is often a far more elegant way to do a loop than a C-style loop. But the C-style for loop is just syntactic sugar for a while loop. In some cases, C-style for

Re: Attack a sacred Python Cow

2008-07-27 Thread Michael Torrie
Derek Martin wrote: Regardless of how it's implementd, it's such a common idiom to use self to refer to object instances within a class in Python that it ought to be more automatic. Personally, I kind of like the idea of using @ and thinking of it more like an operator... Kind of like

Re: Attack a sacred Python Cow

2008-07-27 Thread Michael Torrie
Colin J. Williams wrote: def fun( ., cat): I don't see the need for the comma in fun. It (the entire first variable!) is needed because a method object is constructed from a normal function object: def method(self,a,b): pass class MyClass(object): pass

Re: write unsigned integer 32 bits to socket

2008-07-27 Thread Michael Torrie
[EMAIL PROTECTED] wrote: thanks a lot!!! re-read it again!!! from the struct doc! Standard size and alignment are as follows: no alignment is required for any type (so you have to use pad bytes); short is 2 bytes; int and long are 4 bytes; long long (__int64 on Windows) is 8 bytes; float

Re: Attack a sacred Python Cow

2008-07-28 Thread Michael Torrie
Nikolaus Rath wrote: No, but it could work like this: def a(x, y): self.x = x self.y = y Frankly this would make reading and debugging the code by a third party to be a nightmare. Rather than calling the variable self as I did in my example, I could it in a much better way:

Re: Agnostic fetching

2008-08-02 Thread Michael Torrie
jorpheus wrote: OK, that sounds stupid. Anyway, I've been learning Python for some time now, and am currently having fun with the urllib and urllib2 modules, but have run into a problem(?) - is there any way to fetch (urllib.retrieve) files from a server without knowing the filenames? For

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Dennis Lee Bieber wrote: Nasty code even for C... I've never used goto in C... Options: convert the statements of next into a function, and put in an else clause... I think the parent post's pseudocode example was too simple to show the real benefits and use cases of goto in C.

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Kurien Mathew wrote: Hello, Any suggestions on a good python equivalent for the following C code: while (loopCondition) { if (condition1) goto next; if (condition2) goto next; if (condition3) goto next; stmt1;

Re: Good python equivalent to C goto

2008-08-16 Thread Michael Torrie
Michael Torrie wrote: I think the most direct translation would be this: Nevermind I forgot about the while loop and continuing on after it. Guess the function doesn't quite fit this use case after all. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-13 Thread Michael Torrie
On Sun, 2007-05-13 at 21:01 +0200, Stefan Behnel wrote: For example, I could write def zieheDreiAbVon(wert): return zieheAb(wert, 3) and most people on earth would not have a clue what this is good for. However, someone who is fluent enough in German could guess from the names

Re: Python compared to other language

2007-05-19 Thread Michael Torrie
On Fri, 2007-05-18 at 22:28 -0400, Steve Holden wrote: Surely the fact that Python is available on so many platforms implies that C is a fairly portable language. I realise that you have to take platform specifics into account much more than you do in Python, but I do feel you are being

Re: How do I write to a CD?

2007-06-16 Thread Michael Torrie
On Sat, 2007-06-16 at 11:50 -0400, [EMAIL PROTECTED] wrote: Hello: I am looking for Python code to open, read, write, close, and make bootable the following: CD DVD USB Drive There will be no cross-platform way to do this. Certainly no python libraries. The closest thing you

Re: GUI apps in Windows with native widgets?

2007-06-18 Thread Michael Torrie
On Tue, 2007-06-19 at 04:13 +0200, Gilles Ganault wrote: Hello I'd like to write a GUI app in Python exclusively for Windows. Apparently, development of PythonWin has stopped a long time ago. Is there another thin wrapper to write apps in Windows? I'd rather not have to ship eg.

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sun, 2007-04-01 at 02:49 +, Dennis Lee Bieber wrote: Take that up with ACT... GNAT 3.15p was explicitly unencumbered, but the current version of GNAT, in the GPL (no-service contract) form has gone the other direction, claiming that executables must be released GPL. The

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: Michael Torrie [EMAIL PROTECTED] writes: The no-service contract version of the GPL is not the same as the standard GPLv2. I don't see how that can be--we're talking about a GCC-based compiler, right? Well, that's beside the point

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: Michael Torrie [EMAIL PROTECTED] writes: The no-service contract version of the GPL is not the same as the standard GPLv2. I don't see how that can be--we're talking about a GCC-based compiler, right? I found the real reason why

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread Michael Torrie
timw.google wrote: Hi I want to write a python script that runs rsync on a given directory and host. I build the command line string, but when I try to run subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),or os.system(cmd), I get prompted for my login password. I expected this,

Re: WebScraping

2006-11-04 Thread Michael Torrie
On Sun, 2006-11-05 at 13:40 +1100, Steven D'Aprano wrote: On Sun, 05 Nov 2006 08:09:52 +1000, Graham Feeley wrote: Can someone steer me to scripts / modules etc on webscraping please??? The definitive documentation on the built-in Python modules can be found here:

Re: Python v PHP: fair comparison?

2006-11-14 Thread Michael Torrie
On Tue, 2006-11-14 at 18:55 -0800, Luis M. González wrote: - Python is more readable, and more general purpose Yes, php is only for web. Absolutely false. Most of my standalone, command-line scripts for manipulating my unix users in LDAP are written in PHP, although we're rewriting them

Re: Why are slice indices the way they are in python?

2006-11-30 Thread Michael Torrie
On Thu, 2006-11-30 at 08:58 -0800, [EMAIL PROTECTED] wrote: And if talking about dates, then I suggest NEVER use 2006-12-31 23:59:59 in data, always 2007-01-01 00:00:00 instead. Forgive me for my ignorance, but isn't 2006-12-31 23:59:59 actually one entire second earlier than 2007-01-01

Re: just got the g1

2008-12-11 Thread Michael Torrie
garywood wrote: Hi Just got the G1, is their any way to get python running on the andriod platform ? Nope. But some day when other languages are supported, Python will be high on the list. In the meantime, Android is java only. And no you can't use Jython because Android statically

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Michael Torrie
r wrote: if 3.0 looks like... print( {0}={1}.format('this',99)) , WTF... thats retarded and looks like Ruby code. Thats not intuitive thats madness! What happens when you need a conversion to string from an integer, more code?? My faith is slipping. Have the python Gods gone mad??. Please

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Michael Torrie
walterbyrd wrote: On Dec 19, 9:13 am, Giampaolo Rodola' gne...@gmail.com wrote: You can use the old 2.x syntax also in Python 3.x: Yeah, but it's deprecated, and - as I understand it - may be removed completely in future versions. Also, in the future, if you are working with code from

Re: IMAP: How to implement GMail-like threaded conversations view

2008-12-19 Thread Michael Torrie
Martin wrote: Currently I am trying to get used to Python's imaplib and email modules. I'like to create a webmail client simmilar to GMail. This is off-topic, but why on earth would you want to emulate Gmail's conversation views? It's horrible and a very broken way of viewing e-mail threads.

Re: New Python 3.0 string formatting - really necessary?

2008-12-22 Thread Michael Torrie
r wrote: Steven, Would you like to elaborate on -why- escaped backslashes are needed in strings... i waiting??? Some character was needed. It just happens that backslashes have been used in this manner for composing nonprintable sequences, codes, etc. It's only in use because someone

Re: New Python 3.0 string formatting - really necessary?

2008-12-22 Thread Michael Torrie
r wrote: Thanks MRAB, except the float is not 2 decimal places, but its there Come on... They did this for the interpreter not us. It's easer to parse this string with positional arguments and a dict of format descriptions. Come on pydev, at least be honest about it! No. They did this for

Re: Work with Open Office

2009-01-08 Thread Michael Torrie
Dan Esch wrote: Have been browsing through this list and reading documentation and tutorials for python self-study. I have, apparently, teh stupid. Google is my friend. Off I go. Thanks. Let us know how it goes. Last time I tried to script OO, I found it to be much more difficult than

Re: Python 2.6.1 @executable_path

2009-01-10 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: Thanks for the link but I don't want to do a make a python script as an applicatin, I want to embedd python into a C++ app so thats the reason why I have to compile Python. If you are embedding python, then all you have to do is stick the python

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: Thank you, I found PySys_SetPythonHome() to set the path where the lib folder of Python is, but I guess they are not really implemented because they are fixed compiled with an absolute path, aren't they? I'm afraid I'm not following you here. What is

Re: Python 2.6.1 @executable_path

2009-01-11 Thread Michael Torrie
googler.1.webmas...@spamgourmet.com wrote: yeap, okay, its just the beginning so I didn't know that the framework is still the dylib file. Well, I only want to compile python and put the framework in the subdirectory. Thats all. And the current state is, that the framework is not found

Re: Dynamic methods and lambda functions

2009-01-24 Thread Michael Torrie
unine...@gmail.com wrote: The attributes are right, but the getter are not working. The problem is that the lambda function always execute the last parameter passed for all instances of the methods. How could it be done the right way? Basically, don't use a lambda. Create a real, local

  1   2   3   4   5   6   7   8   9   10   >