Re: Checking for the status of a device (before connection)... -- (John McCormick)

2005-04-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hello, ... I am John McCormick (Systems Programmer ) and I am currently > working on a python program which will connect (user) specified inputs > and connect them to (user) selected outputs (like screen or > video/audio-recording devices) and would like to know if ther

RE: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Tony Meyer
[Nemesis] > OK, so the python installer _does_ ship this dll. So also the > win installer has the redistribution problem, or does they > pay for redistributing msvcr71.dll? If you have a legal copy of one of the commercial MS compilers that includes msvcr71.dll, you get the right to redistribut

RE: Python 2.4 killing commercial Windows Python development ?

2005-04-12 Thread Tony Meyer
> installs it where? the MS docs seem to indicate that they > want you to install it in the program directory, rather than > in a "shared" location: > > http://support.microsoft.com/default.aspx?scid=kb;en-us;326922 From

RE: os.path.walk

2005-04-12 Thread Tony Meyer
> If I have os.path.walk(name, processDirectory, None) and > processDirectory needs three arguments how can I ass them > because walk only takes 3? Assuming that processDirectory is a function of yours that returns a bool, then you'd do something like: os.path.walk(name, processDirectory(a,b,

Re: exporting imports to reduce exe size?

2005-04-13 Thread Mike Meyer
Ron_Adam <[EMAIL PROTECTED]> writes: > In looking at ways to reduce the size of exe's created with py2exe, > I've noticed that it will include a whole library or module even if I > only need one function or value from it. > > What I would like to do is to import individual functions and then > e

Re: permission

2005-04-13 Thread Mike Meyer
Skip Montanaro <[EMAIL PROTECTED]> writes: > James> Is it possible to check if you have permission to access and or > James> change a directory or file? > > Yes, but it's generally much easier to try, then recover from any errors: Especially since the answer to the question may change bet

RE: os.path.walk

2005-04-13 Thread Tony Meyer
> I think if you try this you will find that it doesn't work because > os.path.walk will try to call the *result* of processDirectory(a,b,c) > for each directory in the path. Opps. I missed the "path", so gave an answer for os.walk. Apologies. The actual answer, then, I guess is that the OP c

Re: Using a python web client behind a proxy (urllib and twisted.web)

2005-04-13 Thread Mike Meyer
Matthijs <[EMAIL PROTECTED]> writes: > I have been trying to make a script that will download several rss > feeds to my computer. The only problem I have is that I have to go > through a proxy. > > First I tried using urllib (python 2.4, win32) but I found that the > http_proxy and no_proxy code w

Re: A little request about spam

2005-04-16 Thread Mike Meyer
Ivan Van Laningham <[EMAIL PROTECTED]> writes: > Of course I wouldn't base decisions _only_ on whether or not [PYTHON] > appears in the subject. But I ordinarily do base decisions on the whole > subject line, and I think that's perfectly reasonable. There's nothing > else to go on without opening

Re: pre-PEP: Simple Thunks

2005-04-20 Thread Mike Meyer
Ron_Adam <[EMAIL PROTECTED]> writes: > Here's yet another way to do it, but it has some limitations as well. > > import pickle > def pickle_it(filename, obj, commands): > try: > f = open(filename, 'r') > obj = pickle.load(f) > f.close() > except IOError: >

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-04-20, Torsten Bronger schreef <[EMAIL PROTECTED]>: >> Hallöchen! >> >> [EMAIL PROTECTED] (Nick Efford) writes: >> >>> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Many people I know ask why Python does slicing the way it does. >>>

Re: Embedding & Extending Python &other scripting languages

2005-04-20 Thread Mike Meyer
Tommy Nordgren <[EMAIL PROTECTED]> writes: > I'm interested in doing a rather ambitious project concerning compiler > construction tools. > My tools will parse specification files containing for example lalr > parser specifications. > The specifications will contain embedded semantic actions whic

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > Greg Ewing <[EMAIL PROTECTED]> wrote: >> Also, everyone, please keep in mind that you always have >> the option of using a *dictionary*, in which case your >> indices can start wherever you want. >> >> You can't slice them, true, but you can't have everythi

Re: python LEX

2005-04-21 Thread Mike Meyer
Miki Tebeka <[EMAIL PROTECTED]> writes: > Hello jozo, > >> I have to work on python lexical definition in Lex. I spent lots of my >> time to find regular expresions written for Lex of Python language but >> nothing. >> Can somebody help me? > http://www.antlr.org/grammar/list (search for Python) >

Re: goto statement

2005-04-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-04-21, Roy Smith <[EMAIL PROTECTED]> wrote: >> Grant Edwards <[EMAIL PROTECTED]> wrote: >>>Sure, but what about the case where his program is on paper >>>tape and all he has for an editor is an ice pick? >> >> Can't you emulate that in emacs wit

Re: regarding system function

2005-04-21 Thread Mike Meyer
praba kar <[EMAIL PROTECTED]> writes: > Dear All, > > In Php If I send a command to system function > then It will return 1 on success and 0 on failure. So > based upon that value I can to further work. > > But In Python If I send a command to system > function then It will return 0 onl

Re: trying to read from dying disk

2005-04-22 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have a python file that is trying to read raw data from a raw > partition on a dying dist, eg > > f = file('/dev/sda') > f.seek(SOMEWHERE) > s = f.read(SOMEBYTES) > > On some blocks, the read succeeds, on others it fails and an IOError is > thrown, and on others

Re: PDF Printing support from Python

2005-04-23 Thread Mike Meyer
"dcrespo" <[EMAIL PROTECTED]> writes: > Hi Grant Edwards... > > Your solution requires a previous installation of Acrobat. Internally, > the OS is sending the pdf file to the Acrobat PDF Driver and then it is > sent to the printer. So you have to have Acrobat installed. Don't you? No, you don't.

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
"Simon John" <[EMAIL PROTECTED]> writes: > I still love Perl, it's a bit of an art form, as "there's more than one > way to do it", whereas Python usually only allows one way to do it, > which may or may not be a better mantra The Python mantra leads to 1) less programmer overhead, and 2) fas

Re: PDF Printing support from Python

2005-04-23 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Fri, 22 Apr 2005 17:41:22 -0500, Mike Meyer <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> No, you don't. My print system does that, and I don't have acrobat >> installed. I

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> "Simon John" <[EMAIL PROTECTED]> writes: >> >>> I still love Perl, it's a bit of an art form, as "there's more than >>> one way to do it", whereas Pyt

Re: Python or PHP?

2005-04-23 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: >> >>> Mike Meyer wrote: >>> >>>> "Simon John" <[EMAIL PROTECTED]> writes: >>>> >>>>&g

Re: Variables

2005-04-23 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > Robert Kern wrote: >> Richard Blackwood wrote: >>> To All: >>> >>>Folks, I need your help. I have a friend who claims that if I write: >>> >>> foo = 5 >>> >>> then foo is NOT a variable, necessarily. If you guys can define for >>> me what a varia

Re: Variables

2005-04-24 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>First, new disciplines often redefine words to mean something >>different than the disciplines they were derived from. Variable is a >>good example of that. In math, a variable is a placeholder in an

Re: Variables

2005-04-24 Thread Mike Meyer
Richard Blackwood <[EMAIL PROTECTED]> writes: > In any event, he would likely (passionately) > disagree considering his notion that programming is an off-shoot of > math and thus at the fundamental level has identical concepts and > rules. My formal training is as a mathematician, but my professio

Re: Variables

2005-04-24 Thread Mike Meyer
Robert Kern <[EMAIL PROTECTED]> writes: >> Could I honestly argue this to him? From what basis do I argue that >> it is not an equation? > > It's his responsibility to show that it *is* an equation. > > x = x + 1 > > Equation? I think not. I think it is. One equation in one unknown. The solution s

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Depends on the problem. If it's one of the things for which Python has >> an obvious solution (sort a list; split a string on whitespace; pull >> select list elements based on a criteria of some kind; s

Re: Getting into Python, comming from Perl.

2005-04-24 Thread Mike Meyer
Miguel Manso <[EMAIL PROTECTED]> writes: > I've tryed to use python some times but I get frustrated very quick. I > get myself many times needing to figure out how to loop through a > list, declare an associative array, checking how to pass named > parameters to functions, and simple things like t

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> John Bokma <[EMAIL PROTECTED]> writes: >>> Mike Meyer wrote: >>>> Depends on the problem. If it's one of the things for which Python >>>> has an obvious solution (sort

Re: Python or PHP?

2005-04-24 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> John Bokma <[EMAIL PROTECTED]> writes: >>> Mike Meyer wrote: >>>> John Bokma <[EMAIL PROTECTED]> writes: >>>>> Mike Meyer wrote: >>>>>> Depends on the p

Re: cross platform printing

2005-04-24 Thread Mike Meyer
"David Isaac" <[EMAIL PROTECTED]> writes: >> Alan Isaac wrote: > I meant something that application users on different platforms can print > with, not something > that they could coerce a platform into supporting given enough energy (e.g., > via Cygwin). > The closest to an option so far seems to

What's do list comprehensions do that generator expressions don't?

2005-04-24 Thread Mike Meyer
Ok, we've added list comprehensions to the language, and seen that they were good. We've added generator expressions to the language, and seen that they were good as well. I'm left a bit confused, though - when would I use a list comp instead of a generator expression if I'm going to require 2.4 a

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Mike Meyer
jfj <[EMAIL PROTECTED]> writes: > I think a better question would be "What do *generator expressions* do > that list comprehensions don't?". And always use list comprehensions > unless you want the extra bit. As the OP, I can say why I didn't ask those questions. Generator expressions don't bui

Re: Python, Perl & PDF files

2005-04-25 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > Are there any plans in the near future to support PDF files in Python > as thoroughly and completely as Perl does? > > http://cpan.uwinnipeg.ca/search?query=pdf&mode=dist Claiming that CPAN represents Perl "supporting" something isn't really accurate. Those are

Re: what is the best way to determine system OS?

2005-04-25 Thread Mike Meyer
"googleboy" <[EMAIL PROTECTED]> writes: > Hi there. > > I am writing a little app tha tI would like to make cross-platform > (debian, RH, Fedora, Solaris, AIX, etc) > > Originally I decided to check what uname returned, as I didn't think it > mattered beyond the detail of Linux or SunOS etc. > > R

Re: what is the best way to determine system OS?

2005-04-25 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >>What you should do instead is check on how to use the features you >>want. If you watch a typical autoconf script, you'll see it groveling >>

Re: Python or PHP?

2005-04-25 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: >>> Mike Meyer wrote: > > [ snip ] > >>> do you really think that for / foreach and things like if / unless >>> bloat a language pr

RE: Quote-aware string splitting

2005-04-25 Thread Tony Meyer
> I need to split a string as per string.strip(), but with a > modification: > I want it to recognize quoted strings and return them as one > list item, > regardless of any whitespace within the quoted string. See the recent python-tutor thread starting here:

Re: Python or PHP?

2005-04-25 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: > [ unless ] >> Yeah - unless is a bad idea. > LOL, because you don't like it? Oh, come on. You say something, I agree with it, so you remove your

Re: Python or PHP?

2005-04-25 Thread Mike Meyer
Jeremy Bowers <[EMAIL PROTECTED]> writes: > On Mon, 25 Apr 2005 23:26:56 +, John Bokma wrote: > >> Mike Meyer wrote: >> >>> John Bokma <[EMAIL PROTECTED]> writes: > > Nobody ever changed their mind as a result of a 20-thread endless > reply-f

Re: What's do list comprehensions do that generator expressions don't?

2005-04-25 Thread Mike Meyer
Jeremy Bowers <[EMAIL PROTECTED]> writes: > On Mon, 25 Apr 2005 16:48:46 -0400, Bill Mill wrote: > generalizing anyways, which is the right approach. I doubt that Python 3.0 > would have two radically different implementations; they'll just have the > genexp implementation, and an optimization for

Re: Pythonic way to do static local variables?

2005-04-25 Thread Mike Meyer
Charles Krug <[EMAIL PROTECTED]> writes: > I've a function that needs to maintain an ordered sequence between > calls. > > In C or C++, I'd declare the pointer (or collection object) static at > the function scope. > > What's the Pythonic way to do this? > > Is there a better solution than putting

Re: What's do list comprehensions do that generator expressions don't?

2005-04-26 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On Mon, 25 Apr 2005 16:48:46 -0400, Bill Mill <[EMAIL PROTECTED]> wrote: >>+1 . I think that we should still have the form [genexp] , but without >>the dangling variable, and implemented with generator expressions. It >>seems to me that it is inconsisten

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: > I find this part of the story a nuisance, C components in 3rd party > modules... What are the C components compiled into? What are actually > "so" files? Shared object files. They're executable code that can be linked into a program at runtime. Like DLL'

Re: Python or PHP?

2005-04-26 Thread Mike Meyer
John Bokma <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> John Bokma <[EMAIL PROTECTED]> writes: >>> You already showed code like: >> Actually, I never showed you this code. > hence *like*, and yes you did, in a footnote. Yes, but *I* didn't s

Re: create python process

2005-04-26 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hello, > > I would like to create python processes instead of thread. > Can anyone give me an example or site which shows a tutorial about how > to create processes ? See the os.fork documentation. http://www.mired.org/home/

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: >> All you have to do is convince the developers to declare the set of >> bytecodes fixed, and they'd be stable. I don't think that will be >> easy, as it removes one of the methods used to improve the performance >> of Python. Since rebuilding the bytecode

Re: what is the best way to determine system OS?

2005-04-26 Thread Mike Meyer
Roel Schroeven <[EMAIL PROTECTED]> writes: > googleboy wrote: > >> What this script does is use take the output of vmstat to report idle >> cpu cycles (or memory stuff, etc.) over a period specified by a >> parameter, all the better to be a plugin for a monitoring service. >> Basically it parses

Re: delete will assure file is deleted?

2005-04-26 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hello, > > If I use os.remove(fileName), does it always assure that the code will > move to the next code only if the fileName is deleted completely? Hmm. The documdentation doesn't say. A quick test on FreeBSD shows that if you don't have permiss

Re: Python documentation moronicities (continued)

2005-04-26 Thread Mike Meyer
"Claudio Grondi" <[EMAIL PROTECTED]> writes: > From my point of view both, the existing and > the proposed documentation assume some > knowledge about regular expressions as > such, so doesn't really explain, beeing > limited to showing the syntax of usage. It's not clear that this belongs in the

Re: delete will assure file is deleted?

2005-04-26 Thread Mike Meyer
Jeremy Bowers <[EMAIL PROTECTED]> writes: > On Tue, 26 Apr 2005 03:40:16 -0700, [EMAIL PROTECTED] wrote: > os.remove, as the module name implies, tells the OS to do something. I > would consider an OS that returned from a "remove" call, but still let you > access that file, highly broken. Um - n

Re: delete will assure file is deleted?

2005-04-26 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On 26 Apr 2005 03:40:16 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Hello Mike, >> I have to know this topic otherwise my program has to check whether the >> file / files are already deleted and

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: >>>5. Unstable bytecodes makes updating to a newer version of Python very >>>tedious and risk breaking old scripts, if they uses C modules. >> Unstable bytecodes have nothing to do with these problems. The >> current CPython installation process puts the py

Re: bytecode non-backcompatibility

2005-04-26 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: > The idea of having to release the program or library as source files > does ring alarms in many executives in corporate world. Less freezing > the modules (which renders it platform dependent) or using Jython > (which is not possible when C extensions are

Re: what is the best way to determine system OS?

2005-04-26 Thread Mike Meyer
Roel Schroeven <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>In that case, it seems to be a better idea to check the version of >>>vmstat that's on the system. At least, I presume that such differences >>>in behaviour can be deduced from the vmstat

Re: python equivalent of php implode

2005-04-26 Thread Mike Meyer
Jeff Epler <[EMAIL PROTECTED]> writes: > items = query_param.items() > keys = [item[0] for item in items] > values = [item[1] for item in items] Is there some reason not to do: keys = query_params.keys() values = query_params.values() That would seem to be a lot more obvious a

Re: Can .py be complied?

2005-04-30 Thread Mike Meyer
jfj <[EMAIL PROTECTED]> writes: > /* small program in C in self extracting archive > */ > if (have_application ("Python")) { >have_python: >system ("python.exe my_application.py") > } else { >printf ("This software requires python. Wait until all the > necessary components are being

Re: bytecode non-backcompatibility

2005-04-30 Thread Mike Meyer
Maurice LING <[EMAIL PROTECTED]> writes: >>>Python can then have a built-in mechanism to read the description file >>>and download the source codes and do the standard "sudo python >>>setup.py install" to install the library into site-package. >> I don't like this - it would make Python depend on

Re: Python 3 virtualenvs

2015-11-30 Thread Carl Meyer
Hi Laura, On 11/29/2015 07:12 AM, Laura Creighton wrote: > pyenv is going away. python -m venv is the preferred way to get a venv > > https://bugs.python.org/issue25154 > > Of course if you try it, you may get: > > Error: Command '['/bin/python3.4', '-Im', 'ensurepip', > '--upgrade', '--def

Re: Python 3 virtualenvs

2015-11-30 Thread Carl Meyer
On 11/30/2015 10:20 AM, Laura Creighton wrote: > In a message of Mon, 30 Nov 2015 09:32:27 -0700, Carl Meyer writes: >>> I think it is only meant to be used by people who want to install >>> packages but not site-wide, but I am not sure about that. >> >> I don&#x

Re: does the order in which the modules are placed in a file matters ?

2015-12-16 Thread Carl Meyer
Hi Ganesh, On 12/16/2015 09:09 AM, Ganesh Pal wrote: > Iam on python 2.7 and linux .I need to know if we need to place the > modules in a particular or it doesn't matter at all > > order while writing the program As you've probably already noticed, it usually doesn't matter to Python (though it

Re: Importing two modules of same name

2016-02-09 Thread Carl Meyer
Hi Tim, On 02/09/2016 04:23 PM, Tim Johnson wrote: > Before proceding, let me state that this is to satisfy my > curiousity, not to solve any problem I am having. > > Scenario : > Web application developed at /some/dir/sites/flask/ > > If I have a package - let us call it app and in my > /some/d

Re: Continuing indentation

2016-03-02 Thread Carl Meyer
On 03/02/2016 04:54 PM, Chris Angelico wrote: > On Thu, Mar 3, 2016 at 10:46 AM, wrote: >> On Wednesday, March 2, 2016 at 3:44:07 PM UTC-5, Skip Montanaro wrote: >>> >>> if (some_condition and >>> some_other_condition and >>> some_final_condition): >>> play_bingo() >>

Re: Missing something about timezones

2016-03-14 Thread Carl Meyer
Hi Skip, On 03/14/2016 09:32 AM, Skip Montanaro wrote: > On Mon, Mar 14, 2016 at 10:26 AM, Ian Kelly wrote: >> Why should it? You only asked pytz for the Chicago timezone. You >> didn't ask for it relative to any specific time. > > Thanks. I thought using America/Chicago was supposed to automagi

Installling ADODB on an offline computer

2015-01-29 Thread Alan Meyer
I work on an application that uses the ActivePython compilation of Python from ActiveState. It uses three Microsoft COM libraries that are needed for talking to SQL Server. The libraries are: Microsoft Activex Data Objects Microsoft Activex Data Objects Recordset Microsoft ADO Ext

Re: Installling ADODB on an offline computer

2015-01-30 Thread Alan Meyer
On 01/30/2015 09:45 AM, [email protected] wrote: On Thursday, January 29, 2015 at 8:35:50 PM UTC-5, Alan Meyer wrote: I work on an application that uses the ActivePython compilation of Python from ActiveState. It uses three Microsoft COM libraries that are needed for talking to SQL Server

Re: Python programming

2014-02-11 Thread Alan Meyer
On 2/11/2014 7:21 PM, ngangsia akumbo wrote: > Please i have a silly question to ask. > > How long did it take you to learn how to write programs? > > What is the best way i can master thinker? > I know the syntax but using it to write a program is a problem Here's one way to learn: Start with

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 sta

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
On 03/24/2015 04:56 PM, Chris Angelico wrote: > On Wed, Mar 25, 2015 at 9:24 AM, Dan Stromberg wrote: >> Is there a way of "adding" 4 hours and getting a jump of 5 hours on >> March 8th, 2015 (due to Daylight Savings Time), without hardcoding >> when to spring forward and when to fall back? I'd l

Re: Daylight savings time question

2015-03-25 Thread Carl Meyer
Hi Dan, On 03/24/2015 04:24 PM, Dan Stromberg wrote: > Is there a way of "adding" 4 hours and getting a jump of 5 hours on > March 8th, 2015 (due to Daylight Savings Time), without hardcoding > when to spring forward and when to fall back? I'd love it if there's > some library that'll do this for

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-29 Thread Carl Meyer
On 03/29/2015 09:30 PM, Michael Torrie wrote: > What does this have to do with Python itself? I'm not completely sure, > but maybe it's about the Python community. What's the way forward? I > have no idea. At the very least John is frustrated by the community's > lack of apparent interest in fi

Re: mixing set and list operations

2015-04-30 Thread Carl Meyer
Hi Tim, On 04/30/2015 10:07 AM, Tim wrote: > I noticed this today, using Python2.7 or 3.4, and wondered if it is > implementation dependent: > > You can use 'extend' to add set elements to a list and use 'update' to add > list elements to a set. > m = ['one', 'two'] p = set(['three',

Re: Using a particular python binary with venv

2015-06-01 Thread Carl Meyer
On 06/01/2015 03:33 PM, [email protected] wrote: > According to this > https://docs.python.org/3.4/library/venv.html#module-venv 'Each > virtual environment has its own Python binary (allowing creation of > environments with various Python versions)' > > So how would I create a virtual e

Re: Using a particular python binary with venv

2015-06-01 Thread Carl Meyer
On 06/01/2015 04:07 PM, [email protected] wrote: > On Tuesday, 2 June 2015 09:43:37 UTC+12, Carl Meyer wrote: >> On 06/01/2015 03:33 PM, orotau wrote: >>> According to this >>> https://docs.python.org/3.4/library/venv.html#module-venv 'Each >>&g

Re: Searching for a usable X509 implementation

2015-07-03 Thread Carl Meyer
Hi Dennis, On 07/03/2015 06:11 PM, Dennis Jacobfeuerborn wrote: > Hi, I'm trying to implement certificate functionality in a python app > but after fighting with pyOpenSSL and M2Crypto I'm thinking about > writing wrapper functions for the OpenSSL command line tool instead > or switching the app t

Re: Are there any "correct" implementations of tzinfo?

2015-09-12 Thread Carl Meyer
On 09/12/2015 12:23 PM, Random832 wrote: > I was trying to find out how arithmetic on aware datetimes is "supposed > to" work, and tested with pytz. When I posted asking why it behaves this > way I was told that pytz doesn't behave correctly according to the way > the API was designed. The tzlocal

Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo?

2015-09-14 Thread Carl Meyer
Can we please stop cross-posting this thread to python-list and move it to datetime-sig only? I think anyone here on python-list who is sufficiently interested in it can subscribe to datetime-sig. Or the other way around, whatever. I'd just like to stop getting all the messages twice. Carl sig

Re: True == 1 weirdness

2015-09-16 Thread Carl Meyer
On 09/16/2015 02:29 PM, Mark Lawrence wrote: > On 16/09/2015 18:53, Sven R. Kunze wrote: >> On 16.09.2015 19:39, Steven D'Aprano wrote: >>> node = left <= ptr => right >> >> Wow. I have absolutely no idea what this is supposed to mean. Do you >> care to elaborate? >> >> >> Best, >> Sven > > Simple

Re: Understanding WSGI together with Apache

2015-10-12 Thread Carl Meyer
Hi Johannes, On 10/10/2015 08:24 AM, Johannes Bauer wrote: > I'm running an Apache 2.4 webserver using mod_wsgi 4.3.0. There are two > different applications running in there running on two completely > separate vhosts. > > I'm seeing some weird crosstalk between them which I do not understand. >

Re: List comprehension with if-else

2015-10-28 Thread Carl Meyer
Hi Larry, On 10/28/2015 10:25 AM, Larry Martell wrote: > I'm trying to do a list comprehension with an if and that requires an > else, but in the else case I do not want anything added to the list. > > For example, if I do this: > > white_list = [l.control_hub.serial_number if l.wblist == > wbli

Re: Is it possible to create C-style "main" function in Python? (for teaching purposes)

2011-10-04 Thread Alan Meyer
On 10/3/2011 12:26 PM, Alec Taylor wrote: ... On Tue, Oct 4, 2011 at 3:21 AM, Aivar Annamaa wrote: ... I'm looking for a trick or hidden feature to make Python 3 automatically call a "main" function but without programmers writing `if __name__ == "__main__": ...` ... Here's why I want such a

Re: Need A script to open a excel file and extract the data using autofilter

2011-10-04 Thread Alan Meyer
On 10/4/2011 5:12 PM, David Monaghan wrote: On Tue, 04 Oct 2011 19:42:06 +0100, Chris Withers wrote: On 01/10/2011 23:00, David Monaghan wrote: after opening the text.xls file i need to filter all the rows in which the status column is passed and copy the whole sheet to another sheet I don't

Re: Is it possible to create C-style "main" function in Python? (for teaching purposes)

2011-10-04 Thread Alan Meyer
On 10/4/2011 9:07 PM, Alan Meyer wrote: ... and to write up a comparison of the pros and cons of the global and no-global approaches. ... Of course you'll need to be fair in evaluating the students comparisons. Some bright students are likely to come up with good reasons for using gl

Re: how to call java methods in python

2011-10-04 Thread Alan Meyer
On 10/4/2011 2:39 AM, masood shaik wrote: Hi I am trying to import java method in python. But i am getting the following error. error: ImportError: No module named Calculator Calculator is the name of the class written in java. I am trying to access the methods of that class. Plea

Re: How to isolate a constant?

2011-10-25 Thread Alan Meyer
On 10/22/2011 8:46 PM, MRAB wrote: On 23/10/2011 01:26, Gnarlodious wrote: Say this: class tester(): _someList = [0, 1] def __call__(self): someList = self._someList someList += "X" return someList test = tester() But guess what, every call adds to the variable that I am trying to copy each t

Re: suppressing import errors

2011-11-15 Thread Alan Meyer
On 11/15/2011 4:20 PM, David Riley wrote: ... None was set to some other value. The other value might have a type (such as a container) that could be false in a boolean context! Obviously, that last bit doesn't apply to modules; they're not going to evaluate as False in general.

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-15 Thread Alan Meyer
On 11/15/2011 3:37 PM, Passiday wrote: Hello, I am looking for a way how to bring Python interpreter to JavaScript, in order to provide a web-based application with python scripting capabilities. The app would have basic IDE for writing and debugging the python code, but the interpretation, o

Re: Both Python 2.5.2 and 2.7.2 flop the same way under Win 7

2011-11-21 Thread Alan Meyer
On 11/17/2011 3:43 PM, Chris Angelico wrote: ... If you're having issues, grab a spare computer, throw Linux on it (I recommend Ubuntu or Debian, others will have other preferred distros), and see if the issues remain. Or if you're having trouble with the GUI, try things from the command line (Wi

Re: Using the Python Interpreter as a Reference

2011-11-22 Thread Alan Meyer
On 11/20/2011 7:46 PM, Travis Parks wrote: Hello: I am currently working on designing a new programming language. ... I have great respect for people who take on projects like this. Your chances of popularizing the language are small. There must be thousands of projects like this for every

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/21/2011 11:39 AM, W. eWatson wrote: My criterion for success is that it puts IDLE as a choice for editor on the menu produced with a right-click on a py file. So far no response on this has solved the problem. ... I don't know what responses you're referring to since this is the first

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\Python26\Lib\site-packages\pythonwin\Pythonwin.exe Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 3:05 PM, Dennis Lee Bieber wrote: On Tue, 22 Nov 2011 14:29:18 -0500, Alan Meyer declaimed the following in gmane.comp.python.general: On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-23 Thread Alan Meyer
On 11/23/2011 12:38 PM, W. eWatson wrote: So unless Alan Meyer has further interest in this, it looks like it's at an end. It may be time to move on to c++. C++ is a ton of fun. You haven't lived until you've made a syntax error in a template instantiation and seen a hu

Re: suitability of python

2011-11-24 Thread Alan Meyer
On 11/24/2011 07:31 AM, Rudra Banerjee wrote: Dear friends, I am a newbie in python and basically i use python for postprocessing like plotting, data manipulation etc. Based on ease of programming on python I am wondering if I can consider it for the main development as well. My jobs (written on

Re: Does py2app improves speed?

2011-11-28 Thread Alan Meyer
On 11/24/2011 9:27 AM, Dave Angel wrote: ... Several ways to speed up code. 1) use language features to best advantage 2) use 3rd party libraries that do certain things well 3) use best algorithms, subject to #1 and #2 4) have someone else review the code (perhaps on the list, perhaps within you

Re: Cannot run a single MySQLdb execute....

2013-03-28 Thread Alan Meyer
On 3/27/2013 11:50 PM, Νίκος Γκρ33κ wrote: I'am about to go nuts with python 3.2.3 Do you see somehtign wrong with the following statement? cur.execute( '''SELECT hits FROM counters WHERE url = ?''', (page,) ) data = cur.fetchone() because as you can see by visiting my webpage at http://superh

Re: Cannot run a single MySQLdb execute....

2013-03-29 Thread Alan Meyer
On 03/29/2013 03:40 AM, Νίκος Γκρ33κ wrote: ... So, just to make sure that MySQLdb isnt causeing the probkem can someone, perhaps you that is familiar with linxu conenct to my jailed shell account and install manually the 'pymysql' module because i dont know how to do it and i cannot afford to pa

Re: Cannot run a single MySQLdb execute....

2013-03-29 Thread Alan Meyer
On 03/29/2013 01:32 PM, Alan Meyer wrote: However, MySQLdb is a well established module and what you're asking it to do is very simple and very standard. Oh, sorry, I see that you already said that mysqldb won't work with python 3. My comments in the last message are irrelevan

Re: Another newbie question

2005-12-10 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >... >> Well, the hard-core solution is to note that your class doesn't really >> deal with the type Bar, but deals with a subtype of Bar for which x > >> 23 in all cases.

Re: Another newbie question

2005-12-10 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> > "In addition to the full set of methods which operate on the coordinate as >> > a whole, you can operate on the individual ordinates via instance.x and >> > instance.y

<    6   7   8   9   10   11   12   13   14   15   >