Re: New syntax for blocks

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 23:00:09 -0800, r wrote: > I think what has escaped everyone (including myself until my second > post) is the fact that what really needs to happen Why? > is for variable > *assignments* to return a boolean to any "statements" that evaluate the > assignment -- like in an "i

Re: New syntax for blocks

2009-11-10 Thread r
On Nov 10, 2:49 pm, steve wrote: (..snip..) > However, the same 'effect' can be obtained with the 'with' statement: (..snip..) Hardly!,Here is an interactive session with your test case #--# >>> class something_that_returns_value: def

Authentication session with urllib2

2009-11-10 Thread Ken Seehart
I'm having some difficulty implementing a client that needs to maintain an authenticated https: session. I'd like to avoid the approach of receiving a 401 and resubmit with authentication, for two reasons: 1. I control the server, and it was easy for me to make a url that receives a POST wit

Re: DHT for Python 3.x?

2009-11-10 Thread Martin v. Löwis
Terry Reedy wrote: > Salim Fadhley wrote: >> There are plenty of good DHT > distributed hash table? I think it's that one. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: is None or == None ?

2009-11-10 Thread Vincent Manis
On 2009-11-10, at 22:07, Vincent Manis wrote: > On 2009-11-10, at 19:07, Steven D'Aprano wrote: >> In fact, in Inside Mac Vol II, Apple explicitly gives the format of >> pointers: the low-order three bytes are the address, the high-order byte >> is used for flags: bit 7 was the lock bit, bit 6 t

Re: Calendar Stuff

2009-11-10 Thread Simon Forman
On Tue, Nov 10, 2009 at 12:53 PM, Victor Subervi wrote: > Hi; > I have the following code: > > import calendar, datetime > > def cal(): >   ... >   myCal = calendar.Calendar(calendar.SUNDAY) >   today = datetime.date.today() >   day = today.day >   mo = today.month >   yr = today.year > #  month =

Re: is None or == None ?

2009-11-10 Thread Vincent Manis
On 2009-11-10, at 19:07, Steven D'Aprano wrote: > On Tue, 10 Nov 2009 16:05:01 -0800, Vincent Manis wrote: > That is incorrect. The original Inside Mac Volume 1 (published in 1985) > didn't look anything like a phone book. The original Macintosh's CPU (the > Motorola 68000) already used 32-bit a

Re: DHT for Python 3.x?

2009-11-10 Thread Terry Reedy
Salim Fadhley wrote: There are plenty of good DHT dihydrotestosterone? distributed hash table? DHT Maritime Inc.? DHT routing algorithm? D.H.T. the music group? digital home theater? (from first 20 Google hits) tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: New syntax for blocks

2009-11-10 Thread Terry Reedy
Carl Banks wrote: r didn't actually give a good example. Here is case where it's actually useful. (Pretend the regexps are too complicated to be parsed with string method.) if re.match(r'go\s+(north|south|east|west)',cmd) as m: hero.move(m.group(1)) elif re.match(r'take\s+(\w+)',cmd) as m

Re: New syntax for blocks

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 20:13:21 -0800, Carl Banks wrote: > On Nov 10, 7:12 pm, Steven D'Aprano > wrote: >> On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote: >> > r: >> >> >> i think the following syntax would be quite beneficial to replace >> >> some redundant "if's" in python code. >> >> >http:

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-10 Thread SD_V897
Rhodri James wrote: On Tue, 10 Nov 2009 15:39:46 -, SD_V897 wrote: No, I'm asking you -- or rather your admin user -- to invoke the program that is giving you grief from the command line, i.e. "python myscript.py", and tell me what happens. "It doesn't work" won't be considered at all

Re: how to create a pip package

2009-11-10 Thread Phlip
> > -e git+git://example.com/repo.git#egg=rep Okay. -e is an argument to pip install. If anyone said that, I overlooked it. So, yes I can rip from github, just with a longer command line, for now. Tx! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to create a pip package

2009-11-10 Thread Phlip
On Nov 10, 3:11 pm, Wolodja Wentland wrote: > The pip requirement file would contain the following line: > > -e git+git://example.com/repo.git#egg=rep > > I hope this answers your questions :-D Let me ask it like this. What happens when a user types..? sudo pip install repo Is github one of

Re: New syntax for blocks

2009-11-10 Thread r
On Nov 10, 9:12 pm, Steven D'Aprano wrote: (..snip..) > Hint to would-be language designers: if you start off by claiming that a > new feature will save an indent level, when in fact it *doesn't* save an > indent level, you can save yourself from embarrassment by pressing Close > on your post inst

Re: New syntax for blocks

2009-11-10 Thread Carl Banks
On Nov 10, 7:12 pm, Steven D'Aprano wrote: > On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote: > > r: > > >> i think the following syntax would be quite beneficial to replace some > >> redundant "if's" in python code. > > >http://python.org/dev/peps/pep-3003/ > > I knew it wouldn't take long f

Re: New syntax for blocks

2009-11-10 Thread Carl Banks
On Nov 10, 11:23 am, r wrote: > if something_that_returns_value() as value: >     #do something with value Been proposed before. No one has bothered to write a PEP for it, so I can't say for sure how the Python gods would react, but I suspect a "meh, don't think it's important enough". This, ev

Re: how to create a pip package

2009-11-10 Thread Phlip
On Nov 10, 3:11 pm, Wolodja Wentland wrote: > The pip requirement file would contain the following line: > > -e git+git://example.com/repo.git#egg=rep I thought pip didn't do eggs. did I read a stale blog? > I hope this answers your questions :-D we are so close! Pages like this... htt

Re: is None or == None ?

2009-11-10 Thread Grant Edwards
On 2009-11-11, Steven D'Aprano wrote: > By all means criticize Apple for failing to foresee 32-bit > apps, but criticizing them for hypocrisy (in this matter) is > unfair. By the time they recognized the need for 32-bit clean > applications, they were stuck with a lot of legacy code that > were n

Re: New syntax for blocks

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 12:45:13 -0800, Bearophile wrote: > r: > >> i think the following syntax would be quite beneficial to replace some >> redundant "if's" in python code. > > http://python.org/dev/peps/pep-3003/ I knew it wouldn't take long for people to start responding to any proposal with "

Re: is None or == None ?

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 16:05:01 -0800, Vincent Manis wrote: > At the time the 32-bit Macs were about to come on the market, I saw an > internal confidential document that estimated that at least over 80% of > the applications that the investigators had looked at (including many > from that company na

LinkedIn Messages, 11/10/2009

2009-11-10 Thread LinkedIn Communication
LinkedIn REMINDERS: Invitation Reminders: * View Invitation from Frank Pan http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhFAfhMPPF/blk/I379833192_3/0PnP8VcjcPe3ATcQALqnpPbOYWrSlI/svi/ PENDING MESSAGES: There are a total of 4 messages awaiting your res

Re: Choosing GUI Module for Python

2009-11-10 Thread Antony
On Nov 11, 3:08 am, Simon Hibbs wrote: > On 10 Nov, 10:40, Lorenzo Gatti wrote: > > > I also would like to use PySide, but unlike PyQt and Qt itself it > > doesn't seem likely to support Windows in the foreseeable future. A > > pity, to put it mildly. > > It's not been ruled out. They don't offic

Re: My own accounting python euler problem

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 14:46:49 -0800, John Machin wrote: > The problems that you mention are only a SUBSET of the total problem. > Example: oustanding invoices are for 300, 200, and 100 and the cheque is > for 450 -- in general the total of the cheque amounts does not equal the > total of any possib

Re: is None or == None ?

2009-11-10 Thread Vincent Manis
On 2009-11-10, at 07:46, Grant Edwards wrote: > MacOS applications made the same mistake on the 68K. They > reserved the high-end bits At the time the 32-bit Macs were about to come on the market, I saw an internal confidential document that estimated that at least over 80% of the applications

Re: Python as network protocol

2009-11-10 Thread geremy condra
On Tue, Nov 10, 2009 at 2:08 PM, Steven D'Aprano wrote: > On Tue, 10 Nov 2009 12:28:49 -0500, geremy condra wrote: > >> Steven, remember a few weeks ago when you tried to explain to me that >> the person who was storing windows administrative passwords using a 40 >> byte xor cipher with the hardco

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Carl Banks
On Nov 10, 3:32 am, Ognjen Bezanov wrote: > Hey, > > Thanks for all the responses guys. In hindsight I probably should have > explained why on earth I'd need the physical address from an interpreted > language. > > I'm trying to see if there is any way I can make Python share data > between two ho

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-10 Thread Rhodri James
On Tue, 10 Nov 2009 15:39:46 -, SD_V897 wrote: Rhodri James wrote: On Fri, 06 Nov 2009 21:19:44 -, SD_V897 wrote: Rhodri James wrote: On Tue, 03 Nov 2009 16:00:16 -, SD_V897 wrote: I have a perplexing issue, I have four users set up on a W7 computer. The program runs fi

Re: futures - a new package for asynchronous execution

2009-11-10 Thread Aahz
In article , Brian Quinlan wrote: > >I recently implemented a package that I'd like to have include in the >Python 3.x standard library (and maybe Python 2.x) and I'd love to >have the feedback of this list. Any recently implemented library has an extremely high bar before it gets adopted in

Re: is None or == None ?

2009-11-10 Thread Rhodri James
On Tue, 10 Nov 2009 18:55:25 -, Steven D'Aprano wrote: On Tue, 10 Nov 2009 15:46:10 +, Grant Edwards wrote: On 2009-11-10, Rhodri James wrote: On Sun, 08 Nov 2009 19:45:31 -, Terry Reedy wrote: I believe the use of tagged pointers has been considered and so far rejected by

Re: how to create a pip package

2009-11-10 Thread Wolodja Wentland
On Tue, Nov 10, 2009 at 13:09 -0800, Phlip wrote: > will pip pull from a simple GitHub repo? or do I need to package > something up and put it in a pythonic repository somewhere? I don't quite understand, but would say: both ;-) You can't tell pip to pull from arbitrary git repositories, but only

Re: CGI vs mod_python

2009-11-10 Thread John Nagle
sstein...@gmail.com wrote: On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what "CGI is enabled" means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specif

Re: My own accounting python euler problem

2009-11-10 Thread John Machin
On Nov 8, 8:39 am, vsoler wrote: > In the accounting department I am working for we are from time to time > confronted to the following problem: [snip] > My second question is: > 2. this time there are also credit notes outstanding, that is, > invoices with negative amounts. For example,  I=[500,

Re: on "Namespaces"

2009-11-10 Thread Ben Finney
Steven D'Aprano writes: > Modules are namespaces. So are packages. > > Classes and class instances are namespaces. > > Even function scopes are namespaces. Steven implies it with his wording, but to make it explicit: When you have a module, package, class, or instance-of-a-class object, those o

Re: Threaded import hang in cPickle.dumps

2009-11-10 Thread Benjamin Peterson
Zac Burns gmail.com> writes: > What can I do about this? Not run it in a thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C api: create a new object class

2009-11-10 Thread Benjamin Peterson
lallous lgwm.org> writes: > Is there is a one line syntax to instantiate an instance? You can't instantiate an instance; it's already instantiated. > > Any other ways than this: > o = new.classobj('object', (), {}) class x: pass > How can I, similarly, create an object "o" in C api: Use PyOb

Re: Python C api: create a new object class

2009-11-10 Thread Martin v. Löwis
> How can I create an instance class in Python, currently I do: > > class empty: > pass > > Then anytime I want that class (which I treat like a dictionary): > > o = empty() > o.myattr = 1 > etc > > Is there is a one line syntax to instantiate an instance? > > Any other ways than this: >

Re: DHT for Python 3.x?

2009-11-10 Thread Martin v. Löwis
Salim Fadhley wrote: > There are plenty of good DHT projects for Python 2.x, however from > what I can tell none of them have made the jump to 3.x yet. > > I'm really keen to support Python 3.x for a project I'm working on. I > know that many developers (correctly) consider switching to Python 3 >

Re: Choosing GUI Module for Python

2009-11-10 Thread Simon Hibbs
On 10 Nov, 10:40, Lorenzo Gatti wrote: > I also would like to use PySide, but unlike PyQt and Qt itself it > doesn't seem likely to support Windows in the foreseeable future. A > pity, to put it mildly. It's not been ruled out. They don't officialy support the Mac either, but according to posts

Re: can i configure IDLE to use python 3.2 on fedora?

2009-11-10 Thread Aahz
In article , Robert P. J. Day wrote: > > on fedora 11 system, there is no python 3 package so i downloaded >and manually installed (svn checkout) python pre-3.2 in >/usr/local/bin. works fine, but if i install the python-tools >package, "idle" that comes with it is hard-coded(?) to still refer t

Re: New syntax for blocks

2009-11-10 Thread r
On Nov 10, 2:08 pm, Robert Latest wrote: (..snip..) > Also it's not the "if" that is (if at all) redundant here but the assignment. Not exactly. The assignment happens only once just as the boolean check of "if " happens once. The redundancy is in validating the existence of a truthful value cont

Python-URL! - weekly Python news and links (Nov 10)

2009-11-10 Thread Cameron Laird
QOTW: "Don't get me wrong - innovation often comes from scratching ones personal itch. But you seem to be suffering from a rather bad case of neurodermatitis." - Diez B. Roggisch, on ... well, personal style in problem-solving http://groups.google.com/group/comp.lang.python/msg/4cf102bdd3a3267

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
Steven D'Aprano wrote: I can only repeat what I said to Daniel: can you guarantee that the nice safe, low-risk environment will never change? If not, then choose a more realistic threat model, and build the walls of your locked box accordingly. Seems to me you can't really *guarentee* anythin

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
Daniel Fetchinson wrote: I'm the king in my castle, although I'm fully aware of the fact that my castle might be ugly from the outside :) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't Write File

2009-11-10 Thread Dave Angel
Victor Subervi wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I doing wrong? TIA, Victor Wrong? 1) you

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>> My point is that hacking can still be a fun and easy-going activity >> when one writes code for himself (almost) without regards to security >> and nasty things like that creeping in from the outside. I'm the king >> in my castle, although I'm fully aware of the fact that my castle >> might be u

Re: module imports and st_mtime

2009-11-10 Thread Aahz
In article , tow wrote: > >Does anyone have any ideas what might be going on, or where further to >look? I'm at a bit of a loss. Try asking on pythonmac-...@python.org -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ [on old computer technologies and programmers

RE: New to Python need on advice on this script

2009-11-10 Thread Valentina Boycheva
Jim, In Python 2.5 under ArcMap 9.3 domains can be only listed. To get to the domain values, they need to be converted to tables. Also, the default value cannot be obtained from the existing GP API. Very annoying! The workaround is to use VBA ArcObjects or connect to the database directly, if

Re: how to create a pip package

2009-11-10 Thread Phlip
except... will pip pull from a simple GitHub repo? or do I need to package something up and put it in a pythonic repository somewhere? -- http://mail.python.org/mailman/listinfo/python-list

Re: Calendar Stuff

2009-11-10 Thread Dave Angel
(Comments inline, and at end) Victor Subervi wrote: On Tue, Nov 10, 2009 at 2:02 PM, MRAB wrote: Victor Subervi wrote: Hi; I have the following code: import calendar, datetime def cal(): ... myCal = calendar.Calendar(calendar.SUNDAY) today = datetime.date.today() day = today.d

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 12:57:30 -0800, Victor Subervi wrote: On Tue, Nov 10, 2009 at 3:41 PM, Rami Chowdhury wrote: On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi < victorsube...@gmail.com> wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script =

Re: Can't Write File

2009-11-10 Thread Victor Subervi
On Tue, Nov 10, 2009 at 3:41 PM, Rami Chowdhury wrote: > On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script = open(getpic, "w") # where getpic is already define

ANN: eGenix pyOpenSSL Distribution 0.9.0-0.9.8l

2009-11-10 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.9.0-0.9.8l An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface fo

Re: New syntax for blocks

2009-11-10 Thread Bearophile
r: > i think the following syntax would be quite beneficial > to replace some redundant "if's" in python code. http://python.org/dev/peps/pep-3003/ bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: New syntax for blocks

2009-11-10 Thread steve
Hi, On 11/11/2009 12:53 AM, r wrote: Forgive me if i don't properly explain the problem but i think the following syntax would be quite beneficial to replace some redundant "if's" in python code. if something_that_returns_value() as value: #do something with value # Which can replace the

Re: New syntax for blocks

2009-11-10 Thread steve
On 11/11/2009 02:05 AM, steve wrote: Hi, On 11/11/2009 12:53 AM, r wrote: [...snip...] i dunno, just seems to make good sense. You save one line of code but more importantly one indention level. However i have no idea how much trouble the implementation would be? I guess the problem would b

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi wrote: Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I do

Can't Write File

2009-11-10 Thread Victor Subervi
Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I doing wrong? TIA, Victor -- http://mail.python.org/mailman/listinfo/

DHT for Python 3.x?

2009-11-10 Thread Salim Fadhley
There are plenty of good DHT projects for Python 2.x, however from what I can tell none of them have made the jump to 3.x yet. I'm really keen to support Python 3.x for a project I'm working on. I know that many developers (correctly) consider switching to Python 3 foolish since it is less support

Re: New syntax for blocks

2009-11-10 Thread Robert Latest
r wrote: > Forgive me if i don't properly explain the problem but i think the > following syntax would be quite beneficial to replace some redundant > "if's" in python code. > > if something_that_returns_value() as value: > #do something with value > > # Which can replace the following syntacti

Re: New to Python need on advice on this script

2009-11-10 Thread MRAB
Jim Valenza wrote: Hello all - I'm new to the world of Python as I am a GIS guy who would like to broaden his horizons. I have a question about a script that we've been working on: The purpose of the code is to *Syncronize SDE DropBox with Regulatory Project working files. * I am looking for

Re: Python as network protocol

2009-11-10 Thread Robert Latest
Grant Edwards wrote: > On 2009-11-10, Steven D'Aprano wrote: >>> How do you know for sure? Maybe the OP wants to use this thing >>> with 3 known researchers working on a cluster that is not even >>> visible to the outside world. > > And those three researchers are perfect? They've never even > ma

Re: Python as network protocol

2009-11-10 Thread Diez B. Roggisch
My point is that hacking can still be a fun and easy-going activity when one writes code for himself (almost) without regards to security and nasty things like that creeping in from the outside. I'm the king in my castle, although I'm fully aware of the fact that my castle might be ugly from the o

Re: Calendar Stuff

2009-11-10 Thread Victor Subervi
On Tue, Nov 10, 2009 at 2:02 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >> import calendar, datetime >> >> def cal(): >> ... >> myCal = calendar.Calendar(calendar.SUNDAY) >> today = datetime.date.today() >> day = today.day >> mo = today.month >> yr = t

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-10 Thread Dave Angel
Ognjen Bezanov wrote: Hey, Thanks for all the responses guys. In hindsight I probably should have explained why on earth I'd need the physical address from an interpreted language. I'm trying to see if there is any way I can make Python share data between two hosts using DMA transfers over

New to Python need on advice on this script

2009-11-10 Thread Jim Valenza
Hello all - I'm new to the world of Python as I am a GIS guy who would like to broaden his horizons. I have a question about a script that we've been working on: The purpose of the code is to *Syncronize SDE DropBox with Regulatory Project working files. I am looking for where the script dumps the

New syntax for blocks

2009-11-10 Thread r
Forgive me if i don't properly explain the problem but i think the following syntax would be quite beneficial to replace some redundant "if's" in python code. if something_that_returns_value() as value: #do something with value # Which can replace the following syntactical construct... value

Re: advice needed for lazy evaluation mechanism

2009-11-10 Thread Steven D'Aprano
On Sun, 08 Nov 2009 14:41:27 -0800, markolopa wrote: > Hi, > > Could you please give me some advice on the piece of code I am writing? > > My system has several possible outputs, some of them are not always > needed. I started to get confused with the code flow conditions needed > to avoid doing

Python C api: create a new object class

2009-11-10 Thread lallous
Hello I have 3 questions, hope someone can help: 1) How can I create an instance class in Python, currently I do: class empty: pass Then anytime I want that class (which I treat like a dictionary): o = empty() o.myattr = 1 etc Is there is a one line syntax to instantiate an instance? A

Re: Python as network protocol

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 12:28:49 -0500, geremy condra wrote: > Steven, remember a few weeks ago when you tried to explain to me that > the person who was storing windows administrative passwords using a 40 > byte xor cipher with the hardcoded password might not be doing something > stupid because I di

Re: Calendar Stuff

2009-11-10 Thread MRAB
Victor Subervi wrote: Hi; I have the following code: import calendar, datetime def cal(): ... myCal = calendar.Calendar(calendar.SUNDAY) today = datetime.date.today() day = today.day mo = today.month yr = today.year # month = myCal.monthdayscalendar(int(time.strftime("%Y")) month

Re: is None or == None ?

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 15:46:10 +, Grant Edwards wrote: > On 2009-11-10, Rhodri James wrote: >> On Sun, 08 Nov 2009 19:45:31 -, Terry Reedy >> wrote: >> >>> I believe the use of tagged pointers has been considered and so far >>> rejected by the CPython developers. And no one else that I kno

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing with 3 >> known researchers working on a cluster that is not even visible to the >> outside world. In such a setup the model the OP suggested is a perfectly >> reasonable one. I say this because I

Re: Threaded import hang in cPickle.dumps

2009-11-10 Thread Zac Burns
Oh, I'm pickling an NotImplementedError and it's importing exceptions. -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer (Digital Overlord) Zindagi Games On Tue, Nov 10, 2009 at 10:50 AM, Zac Burns wrote: > Using python 2.6 > > cPickle.dumps has an import which is causing my app

Threaded import hang in cPickle.dumps

2009-11-10 Thread Zac Burns
Using python 2.6 cPickle.dumps has an import which is causing my application to hang. (figured out by overriding builtin.__import__ with a print and seeing that this is the last line of code being run. I'm running cPickle.dumps in a thread, which leads me to believe that the first restriction here

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing with 3 >> known researchers working on a cluster that is not even visible to the >> outside world. In such a setup the model the OP suggested is a >> perfectly reasonable one. I say this because I

Python-URL! - weekly Python news and links (Nov 10)

2009-11-10 Thread Gabriel Genellina
QOTW: "Don't get me wrong - innovation often comes from scratching ones personal itch. But you seem to be suffering from a rather bad case of neurodermatitis." - Diez B. Roggisch, on ... well, personal style in problem-solving http://groups.google.com/group/comp.lang.python/msg/4cf102bdd3a326

Calendar Stuff

2009-11-10 Thread Victor Subervi
Hi; I have the following code: import calendar, datetime def cal(): ... myCal = calendar.Calendar(calendar.SUNDAY) today = datetime.date.today() day = today.day mo = today.month yr = today.year # month = myCal.monthdayscalendar(int(time.strftime("%Y")) month = myCal.monthdayscalend

Re: list vs tuple for a dict key- why aren't both hashable?

2009-11-10 Thread Syeberman
On Nov 8, 3:42 pm, Mick Krippendorf wrote: > Wells wrote: > > I'm not quite understanding why a tuple is hashable but a list is not. > > The short answer has already been given. > The short answer isn't entirely correct, however. Tuples are only hashable so long as their elements are all hashable

Re: Python as network protocol

2009-11-10 Thread geremy condra
On Tue, Nov 10, 2009 at 10:56 AM, Steven D'Aprano wrote: > On Tue, 10 Nov 2009 16:31:13 +0100, Daniel Fetchinson wrote about using > exec: > >>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing with 3 >> known researchers working on a cluster that i

Re: Python as network protocol

2009-11-10 Thread Diez B. Roggisch
Daniel Fetchinson schrieb: I want to implement such specific feature: I have a server written in Python. I have a client written in C++. I want to use Python as network protocol between them. I mean: client send to server such string: "a = MyObject()", so object of this type will appear in server

Re: how to create a pip package

2009-11-10 Thread Phlip
> >     from setuptools import setup, find_packages > > It will be enough to use the method outlined in the distutils > documentation. Setuptools is a third-party library that used to be the > de-facto standard for Python packaging. I don't want to go into detail > why setuptools might not be the b

Re: how to create a pip package

2009-11-10 Thread Wolodja Wentland
On Tue, Nov 10, 2009 at 06:30 -0800, Phlip wrote: > On Nov 10, 1:54 am, Wolodja Wentland > wrote: > > > http://docs.python.org/library/distutils.html#module-distutils > > http://packages.python.org/distribute/ > > ktx... now some utterly retarded questions to prevent false starts. > the distuti

Re: Python as network protocol

2009-11-10 Thread Grant Edwards
On 2009-11-10, Steven D'Aprano wrote: > On Tue, 10 Nov 2009 16:31:13 +0100, Daniel Fetchinson wrote about using > exec: > >>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing >> with 3 known researchers working on a cluster that is not even >> vis

Re: is None or == None ?

2009-11-10 Thread Grant Edwards
On 2009-11-10, Marco Mariani wrote: > Grant Edwards wrote: > >> MacOS applications made the same mistake on the 68K. > And and awful lot of the Amiga software, with the same 24/32 > bit CPU. > > I did it too, every pointer came with 8 free bits so why not > use them? TANSTAFB ;) I should prob

Re: is None or == None ?

2009-11-10 Thread Chris Kaynor
On Tue, Nov 10, 2009 at 7:56 AM, Marco Mariani wrote: > Grant Edwards wrote: > > MacOS applications made the same mistake on the 68K. >> > > And and awful lot of the Amiga software, with the same 24/32 bit CPU. > > I did it too, every pointer came with 8 free bits so why not use them? > > > > I

Re: My own accounting python euler problem

2009-11-10 Thread Mel
Gerry wrote: > On Nov 8, 2:42 pm, Ozz wrote: >> vsoler schreef: >> > And, of course, you'd want to take a look a this: http://xkcd.com/287/ :) I remember that. mwil...@tecumseth:~/sandbox$ python xkcd_complete.py [1, 0, 0, 2, 0, 1] 1505 [7] 1505 Mel. -- http://mail.python.org/mailma

Re: Create object from variable indirect reference?

2009-11-10 Thread Hrvoje Niksic
NickC writes: > moon2 = ephem.${!options.body}() moon2 = getattr(ephem, options.body)() -- http://mail.python.org/mailman/listinfo/python-list

Re: how to create a pip package

2009-11-10 Thread Floris Bruynooghe
On Nov 10, 2:30 pm, Phlip wrote: > On Nov 10, 1:54 am, Wolodja Wentland > wrote: > > >http://docs.python.org/library/distutils.html#module-distutils > >http://packages.python.org/distribute/ > > ktx... now some utterly retarded questions to prevent false starts. > > the distutils page starts with

Re: My own accounting python euler problem

2009-11-10 Thread MRAB
Gerry wrote: On Nov 8, 2:42 pm, Ozz wrote: vsoler schreef: And, of course, you'd want to take a look a this: http://xkcd.com/287/ I've found 2 solutions. (And I really should get back to what I was doing...) Gerry Instead of subsets, do you mean permutations/combinations? Since 2 invo

Re: Create object from variable indirect reference?

2009-11-10 Thread NickC
Many thanks for the replies. getattr() works great: >>> name='Moon' >>> m2 = getattr(ephem,name)() >>> m2.compute(home) >>> print ephem.localtime(m2.rise_time) 2009-11-11 01:30:36.02 shows the moon will rise at 1:30am localtime tonight at my home location. Excellent. -- NickC -- http://

Re: Python as network protocol

2009-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2009 16:31:13 +0100, Daniel Fetchinson wrote about using exec: >> This is a *really* bad idea. > > How do you know for sure? Maybe the OP wants to use this thing with 3 > known researchers working on a cluster that is not even visible to the > outside world. In such a setup the mo

Re: is None or == None ?

2009-11-10 Thread Marco Mariani
Grant Edwards wrote: MacOS applications made the same mistake on the 68K. And and awful lot of the Amiga software, with the same 24/32 bit CPU. I did it too, every pointer came with 8 free bits so why not use them? It wasn't the decades-long global debacle that was the MS-DOS memory model,

Re: is None or == None ?

2009-11-10 Thread Grant Edwards
On 2009-11-10, Rhodri James wrote: > On Sun, 08 Nov 2009 19:45:31 -, Terry Reedy wrote: > >> I believe the use of tagged pointers has been considered and so far >> rejected by the CPython developers. And no one else that I know of has >> developed a fork for that. It would seem more feasi

Re: Python as network protocol

2009-11-10 Thread Martin
On Tue, Nov 10, 2009 at 16:31, Daniel Fetchinson wrote: >> This is a *really* bad idea. > > How do you know for sure? Maybe the OP wants to use this thing with 3 > known researchers working on a cluster that is not even visible to the > outside world. In such a setup the model the OP suggested is

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-10 Thread SD_V897
Rhodri James wrote: On Fri, 06 Nov 2009 21:19:44 -, SD_V897 wrote: Rhodri James wrote: On Tue, 03 Nov 2009 16:00:16 -, SD_V897 wrote: I have a perplexing issue, I have four users set up on a W7 computer. The program runs fine for all users except the admin user who needs it for s

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>> I want to implement such specific feature: >> I have a server written in Python. I have a client written in C++. I >> want to use Python as network protocol between them. I mean: client >> send to server such string: "a = MyObject()", so object of this type >> will appear in server. Any ideas ho

Re: Create object from variable indirect reference?

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 06:59:25 -0800, NickC wrote: I can't seem to find a way to do something that seems straighforward, so I must have a mental block. I want to reference an object indirectly through a variable's value. Using a library that returns all sorts of information about "something

Re: Create object from variable indirect reference?

2009-11-10 Thread Jon Clements
On Nov 10, 2:59 pm, NickC wrote: > I can't seem to find a way to do something that seems straighforward, so I > must have a mental block.  I want to reference an object indirectly > through a variable's value. > > Using a library that returns all sorts of information about "something", I > want to

Create object from variable indirect reference?

2009-11-10 Thread NickC
I can't seem to find a way to do something that seems straighforward, so I must have a mental block. I want to reference an object indirectly through a variable's value. Using a library that returns all sorts of information about "something", I want to provide the name of the "something" via

Re: Serious Privileges Problem: Please Help

2009-11-10 Thread Scott David Daniels
Dave Angel wrote: Victor Subervi wrote: On Mon, Nov 9, 2009 at 2:30 PM, Victor Subervi wrote: On Mon, Nov 9, 2009 at 2:27 PM, Rami Chowdhury wrote: Hold everything. Apparently line-endings got mangled. What I don't ... What I've diagnosed as happening when a python script with Windows li

  1   2   >