Pyro 3.8 released

2008-08-23 Thread Irmen de Jong
I'm happy to announce Pyro 3.8 -- Python's own powerful remote method invocation technology! You can get it via http://pyro.sourceforge.net, then go to the SF project homepage download area. While 3.8 is a bug-fix release there are quite a lot of improvements since the previous version.

Pygments 0.11 Straußenei released

2008-08-23 Thread Georg Brandl
I've just uploaded the Pygments 0.11 packages to CheeseShop. Pygments is a generic syntax highlighter written in Python. Download it from http://pypi.python.org/pypi/Pygments, or look at the demonstration at http://pygments.org/demo. Many thanks go to Tim Hatch for writing or integrating most of

ANN: mpmath 0.9 released

2008-08-23 Thread Fredrik Johansson
Hi, Mpmath version 0.9 is now available from the website: http://code.google.com/p/mpmath/ It can also be downloaded from the Python Package Index: http://pypi.python.org/pypi/mpmath/0.9 Mpmath is a pure-Python library for arbitrary-precision floating-point arithmetic that implements an

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
Maric Michaud wrote: Le Saturday 23 August 2008 01:12:48 W. eWatson, vous avez écrit : The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again)

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
Carl Banks wrote: On Aug 22, 7:12 pm, W. eWatson [EMAIL PROTECTED] wrote: Is there some simple operational device in Python that would allow me to create an array (vector) of 360 points from my data by interpolating between azimuth points when necessary? All my data I rounded to the nearest

Error accessing the system registery

2008-08-23 Thread SaqibKhan
Hello members ! a message box is appearing when I goto 'Tools References' in VBA or VB6. I have tried many options but issue is not resolved yet. I have no administrator's rights in PC. can anybody resolve my problem ??? Best Regards M. Saqib Khan --

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread Steven D'Aprano
On Fri, 22 Aug 2008 20:37:09 -0700, Carl Banks wrote: On Aug 22, 10:42 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: Sometimes it seems that barely a day goes by without some newbie, or not- so-newbie, getting confused by the behaviour of functions with mutable default

Re: setattr and getattr, when to use?

2008-08-23 Thread Steven D'Aprano
On Fri, 22 Aug 2008 20:50:17 -0700, maestro wrote: Why are these functions there? Is it somehow more idiomatic to use than to do obj.field ? Heavens no!!! Using setattr and getattr is *less* idiomatic. Is there something you can with them that you can't by obj.field reference?

Re: 'While' question

2008-08-23 Thread Ben Keshet
Wojtek Walczak wrote: On Fri, 22 Aug 2008 10:42:13 -0400, Ben Keshet wrote: Thanks. I tried to use 'for' instead of 'while' as both of you suggested. It's running well as my previous version but breaks completely instead of just skipping the empty file. I suspect the reason is that this

Re: Error accessing the system registery

2008-08-23 Thread Steven D'Aprano
On Fri, 22 Aug 2008 23:33:32 -0700, SaqibKhan wrote: Hello members ! a message box is appearing when I goto 'Tools References' in VBA or VB6. I have tried many options but issue is not resolved yet. I have no administrator's rights in PC. can anybody resolve my problem ??? To solve your

problems debugging python script on server

2008-08-23 Thread Yansky
I'm having some problems debugging a python script on my server. I'm getting a 500 Internal Server Error. What the script does is take a link and then scrape a page and store some info from the page into a database. It seemed to be working fine until I changed one line of code from:

Re: problems debugging python script on server

2008-08-23 Thread [EMAIL PROTECTED]
cgitb.enable() to try to find the error, but with no success. I'm really at a loss as to why it's generating this error. Apache's error_log and access_log are your friends. In this particular case your script breaks something http-server related: premature end of headers, incorrect

Re: def X(l=[]): weirdness. Python bug ?

2008-08-23 Thread Fredrik Lundh
Bart van Deenen wrote: I've stumbled onto a python behavior that I don't understand at all. http://effbot.org/zone/default-values.htm Is this correct behavior or is it a Python bug? Python's been out there for nearly 20 years. I think you safely can assume that if this really was a bug,

Re: Tkinter, toplevel and images

2008-08-23 Thread Fredrik Lundh
Pedro wrote: and I just can see a grey window with a close button... However, when I try the same code with the root I can see both images... Can anyone give me a tip? this was cross-posted to the tkinter mailing list; in case someone stumbles upon this via a search engine, here's a link

Pyro 3.8 released

2008-08-23 Thread Irmen de Jong
I'm happy to announce Pyro 3.8 -- Python's own powerful remote method invocation technology! You can get it via http://pyro.sourceforge.net, then go to the SF project homepage download area. While 3.8 is a bug-fix release there are quite a lot of improvements since the previous version.

Re: Is my thinking Pythonic?

2008-08-23 Thread Fredrik Lundh
Bruno Desthuilliers wrote: Given the lack of proper support for the descriptor protocol in old-style classes and a couple other diverging behaviors, I wouldn't say that advising newcomers to use new-style classes is so pointless. Yeah, but if you don't need descriptors, new-style classes

Re: The Importance of Terminology's Quality

2008-08-23 Thread Martin Gregorie
On Sat, 23 Aug 2008 00:06:28 -0400, John W Kennedy wrote: Martin Gregorie wrote: Not necessarily. An awful lot of CPU cycles were used before microcode was introduced. Mainframes and minis designed before about 1970 didn't use or need it No, most S/360s used microcode. I never used an

How to know a top directory?

2008-08-23 Thread Grigory Temchenko
Hey there, Help me please. How to know a top directory? I mean I have path /this/ is/path and I wanna get /this/is. Also I want to use it as platform independent. If I want to pass c: \that\path then I need to get c:\that. Does anyone have ideas? --

Re: How to know a top directory?

2008-08-23 Thread Wojtek Walczak
On Sat, 23 Aug 2008 04:15:25 -0700 (PDT), Grigory Temchenko wrote: Help me please. How to know a top directory? I mean I have path /this/ is/path and I wanna get /this/is. Also I want to use it as platform independent. If I want to pass c: \that\path then I need to get c:\that. Does anyone

xpath questions...

2008-08-23 Thread bruce
Hi... playing around with xpath and the html dom... i've got a sample: html body form action='foo' name='cat' /form /body /html i can create a test xpath: //form/[action and get the form stuff... i'm curious, is there a way to select an attribute, only if another attribute in the

Re: xpath questions...

2008-08-23 Thread Fredrik Lundh
bruce wrote: playing around with xpath and the html dom... are you sure this question belongs on a Python forum? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: How to know a top directory?

2008-08-23 Thread Michiel Overtoom
Grigory wrote... I have path /this/is/path and I wanna get /this/is. Also I want to use it as platform independent. If I want to pass c: \that\path then I need to get c:\that. import os print os.path.split(/home/user/motoom)[0] print os.path.split(c:\\prj\\techniques\\python)[0] -- The

Odd behaviour on importing variable from module

2008-08-23 Thread rs387
Hi, I've found the following behaviour on importing a variable from a module somewhat odd. The behaviour is identical in Python 2.5 and 3.0b2. In summary, here's what happens. I have a module, oddmodule.py (below), that defines a variable, OddVariable, by assigning a value A to it. The file I

Re: xpath questions...

2008-08-23 Thread Stefan Behnel
Hi, this is totally not Python related, so this is the wrong list. bruce wrote: form action='foo' name='cat' i'm curious, is there a way to select an attribute, only if another attribute in the element is set to a given value?? something like //form/[EMAIL PROTECTED]'foo'[EMAIL

Re: How to know a top directory?

2008-08-23 Thread Fredrik Lundh
Michiel Overtoom wrote: I have path /this/is/path and I wanna get /this/is. Also I want to use it as platform independent. If I want to pass c: \that\path then I need to get c:\that. import os print os.path.split(/home/user/motoom)[0] print os.path.split(c:\\prj\\techniques\\python)[0] in

Re: Odd behaviour on importing variable from module

2008-08-23 Thread Fredrik Lundh
rs387 wrote: I've found the following behaviour on importing a variable from a module somewhat odd. The behaviour is identical in Python 2.5 and 3.0b2. the construct from oddmodule import OddVariable, OddFunction assigns the *values* of the given module names to new variables in the

Re: Odd behaviour on importing variable from module

2008-08-23 Thread Peter Otten
rs387 wrote: I've found the following behaviour on importing a variable from a module somewhat odd. The behaviour is identical in Python 2.5 and 3.0b2. In summary, here's what happens. I have a module, oddmodule.py (below), that defines a variable, OddVariable, by assigning a value A to

RE: xpath questions...

2008-08-23 Thread bruce
Hi guys.. Regarding the xpath question I've posed, some have said that it shouldn't be here on the mailing list. Give that I'm writing the test scripts/apps in python, using the python libs, where else should it be posted? I mean, I could post the entire sample script so you can see that it's

Re: xpath questions...

2008-08-23 Thread Fredrik Lundh
bruce wrote: Regarding the xpath question I've posed, some have said that it shouldn't be here on the mailing list. Give that I'm writing the test scripts/apps in python, using the python libs, where else should it be posted? I mean, I could post the entire sample script so you can see that

Re: __eq__ problem with subclasses

2008-08-23 Thread D'Arcy J.M. Cain
On Fri, 22 Aug 2008 14:37:06 -0600 Daniel Israel [EMAIL PROTECTED] wrote: I am very confused by the following behavior. I have a base class which defines __eq__. I then have a subclass which does not. When I evaluate the expression a==b, where a and b are elements of these classes,

RE: xpath questions...

2008-08-23 Thread bruce
valid point...!! here's the test python.. ugly as it is!! Lodge It New All About ? Paste #83093 Paste Details posted on 2008-08-23 @ 15:22 reply to this paste download paste compare with paste select different colorscheme Autumn Borland Bw Colorful Default Emacs Friendly Fruity Manni

Problems calling batch files (*.bat) from Python???

2008-08-23 Thread Marian Popa
Hello,   I am new in Python programming and I have the following problem: I have a script in which I need to open an application (called from a batch file - trace.bat). For this purpuse, I'm executing the following piece of code:   import os, win32process from win32api import Sleep

Re: Odd behaviour on importing variable from module

2008-08-23 Thread rs387
the construct from oddmodule import OddVariable, OddFunction assigns the *values* of the given module names to new variables in the importing module's namespace. that is, you're binding new names to the values the variables happen to have when the from-import statement is executed.

RE: xpath questions...

2008-08-23 Thread bruce
valid point...!! here's the test python.. ugly as it is!! #!/usr/bin/python # # test.py # # scrapes/extracts the basic data for the college # # # the app gets/stores # name # url # address (street/city/state # phone # ##3

Python open of c:\ path Problem

2008-08-23 Thread Wayne Watson
Title: Signature.html Python doesn't like this: junkfile = open('c:\tmp\junkpythonfile','w') I get junkfile = open('c:\tmp\junkpythonfile','w') IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile' This problematic segment is just a hack of a similar statement which

ctypes: loading .so file on Linux

2008-08-23 Thread Paddy
Hi, I am am falling at the first hurdle when trying to access a library using ctypes. I have a file libucdb.so which the file command says is shared object, but I cannot get it to load: Any help would be appreciated: dmccarthy: file /opt/questasim_6.4/questasim/linux/libucdb.a /opt/ questasim_=

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread BJörn Lindqvist
2008/8/22 Peter Otten [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: DrScheme is an implementation of Scheme that is very newbie-friendly. It has several limited sub-languages, etc. So maybe a command line option can be added to Python3 ( - newbie ? :-) ) that just switches on similar

Re: Using Tkinter

2008-08-23 Thread Scott David Daniels
J-Burns wrote: Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. OK, looks like you are getting direct answers, but I thought I'd mention an easy way to experiment with Tkinter programming. If you start Idle with the -n switch (*),

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread Scott David Daniels
W. eWatson wrote: ... I'm working on this now, but my knowledge of python needs refreshing. Right now I have a file of all the az,el data I've collected, and I'd like to open it with Python for XP. However, Python doesn't like this: junkfile = open('c:\tmp\junkpythonfile','w') I get

Re: Python open of c:\ path Problem

2008-08-23 Thread Tim Golden
Wayne Watson wrote: Python doesn't like this: junkfile = open('c:\tmp\junkpythonfile','w') I get junkfile = open('c:\tmp\junkpythonfile','w') IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile' The clue, if you needed one, is there in that traceback. Notice the

Re: Python open of c:\ path Problem

2008-08-23 Thread Fredrik Lundh
Wayne Watson wrote: Python doesn't like this: junkfile = open('c:\tmp\junkpythonfile','w') I get junkfile = open('c:\tmp\junkpythonfile','w') IOError: [Errno 2] No such file or directory: 'c:\tmp\\junkpythonfile' \ is used as an escape character in string literals, so \t doesn't mean

Re: Generate alphabet?

2008-08-23 Thread Leo Jay
On Sat, Aug 23, 2008 at 6:02 AM, ssecorp [EMAIL PROTECTED] wrote: In Haskell I can do [1..10] for range(1,11) and ['a'..'z'] for a list of the alphabet. Is there a way in Python to generate chars? how about: import string ','.join(string.ascii_lowercase)

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread Carl Banks
On Aug 23, 4:09 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 22 Aug 2008 20:37:09 -0700, Carl Banks wrote: On Aug 22, 10:42 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: Sometimes it seems that barely a day goes by without some newbie, or not-

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread Lie
On Aug 22, 10:32 pm, Peter Otten [EMAIL PROTECTED] wrote: Christian Heimes wrote: Steven D'Aprano wrote: I suggest that Python should raise warnings.RuntimeWarning (or similar?) when a function is defined with a default argument consisting of a list, dict or set. (This is not meant as an

Re: Generators can only yield ints?

2008-08-23 Thread Lie
On Aug 23, 5:44 am, defn noob [EMAIL PROTECTED] wrote: def letters():         a = xrange(ord('a'), ord('z')+1)         B = xrange(ord('A'), ord('Z')+1)         while True:                 yield chr(a)                 yield chr(B) l = letters() l.next() Traceback (most recent call

Re: __eq__ problem with subclasses

2008-08-23 Thread Scott David Daniels
Daniel Israel wrote: I am very confused by the following behavior. I have a base class which defines __eq__. I then have a subclass which does not. When I evaluate the expression a==b, where a and b are elements of these classes, __eq__ is always called with the subclass as the first

Python 3000 C API Changes

2008-08-23 Thread rahul
I am trying to find out what Python C APIs are changing from Python 2.5 to Python 3.0 but there does not seem to be a single list of changes (or at least google is not finding one). If someone knows about where I should look, please let me know. --

Re: Using Tkinter

2008-08-23 Thread Cameron Laird
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: On Aug 22, 7:20 am, J-Burns [EMAIL PROTECTED] wrote: . . . If I have a drop down box in Pythons tkinter, is it possible that the entities that the drop down has are

Re: rules of thumb for cross os code

2008-08-23 Thread Cameron Laird
In article [EMAIL PROTECTED], DwBear75 [EMAIL PROTECTED] wrote: I am considering using python as a replacement for a lot of bash scripting that I have been doing. I would like to be as cross platform . . . 2) nifty lambda's

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
Scott David Daniels wrote: W. eWatson wrote: ... I'm working on this now, but my knowledge of python needs refreshing. Right now I have a file of all the az,el data I've collected, and I'd like to open it with Python for XP. However, Python doesn't like this: junkfile =

Re: Python 3000 C API Changes

2008-08-23 Thread Benjamin Kaplan
On Sat, Aug 23, 2008 at 11:34 AM, rahul [EMAIL PROTECTED] wrote: I am trying to find out what Python C APIs are changing from Python 2.5 to Python 3.0 but there does not seem to be a single list of changes (or at least google is not finding one). If someone knows about where I should look,

Re: Suggestion for improved ImportError message

2008-08-23 Thread Lie
On Aug 15, 7:42 pm, [EMAIL PROTECTED] wrote: Lie: I'm not sure there are any reason to test for failed import in doctest) I have code that uses numpy if available, otherwise uses slower normal Python code. Inside the doctests I'd like to test both situations... Why? Is there a difference in

Re: Suggestion for improved ImportError message

2008-08-23 Thread Fredrik Lundh
Lie wrote: I have code that uses numpy if available, otherwise uses slower normal Python code. Inside the doctests I'd like to test both situations... Why? Is there a difference in result if you have used numpy and python code? If that is, I smell a bad code. What numpy and python code

Re: Psycho question

2008-08-23 Thread arigo+google
On Aug 8, 7:18 pm, David C. Ullrich [EMAIL PROTECTED] wrote: The one thing that puzzles me about all the results is why // is so much slower than / inside that Psyco loop. Just an oversight. The optimization about '/' between integers was not copied for the case of '//' between integers.

Total No. of Records in a File?

2008-08-23 Thread W. eWatson
I have an ordinary text file with a CR at the end of a line, and two numbers in each line. Is there some way to determine the number of lines (records) in the file before I begin reading it? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W,

Re: Total No. of Records in a File?

2008-08-23 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Err...you want to know what is in a file before you open it? This could be done if you keep some external database documenting changes made to the file. But unless I misunderstand what you're saying, then it's not possible to know the contents of a

Re: Total No. of Records in a File?

2008-08-23 Thread Grant Edwards
On 2008-08-23, W. eWatson [EMAIL PROTECTED] wrote: I have an ordinary text file with a CR at the end of a line, and two numbers in each line. Is there some way to determine the number of lines (records) in the file before I begin reading it? If the lines are fixed lengh (e.g. always 12

Re: Total No. of Records in a File?

2008-08-23 Thread Fredrik Lundh
W. eWatson wrote: I have an ordinary text file with a CR at the end of a line, and two numbers in each line. Is there some way to determine the number of lines (records) in the file before I begin reading it? In the general case, no. A file is just a bunch of bytes. If you know that all

Re: Total No. of Records in a File?

2008-08-23 Thread W. eWatson
Nick Dumas wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Err...you want to know what is in a file before you open it? This could be done if you keep some external database documenting changes made to the file. But unless I misunderstand what you're saying, then it's not possible to know

Re: 'While' question

2008-08-23 Thread Scott David Daniels
Ben Keshet wrote: ... I ended up using another method as someone suggested to me. I am still not sure why the previous version got stuck on empty files, while this one doesn't: receptors = ['A' 'B'] *** Alarm bells *** Do you mean ['AB'], or do you mean ['A', 'B']? ...(more code one way)

Re: Total No. of Records in a File?

2008-08-23 Thread Grzegorz Staniak
On 23.08.2008, W. eWatson [EMAIL PROTECTED] wroted: Maybe. I could see it if the file were truly in a record format. The # of records might be kept by the OS. It's conceivable that Python or the OS might see a file with a CR as recordized. Isn't it much easier to use a database instead?

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread castironpi
On Aug 23, 9:40 am, Carl Banks [EMAIL PROTECTED] wrote: On Aug 23, 4:09 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Fri, 22 Aug 2008 20:37:09 -0700, Carl Banks wrote: On Aug 22, 10:42 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: Sometimes

Re: Problems calling batch files (*.bat) from Python???

2008-08-23 Thread Algirdas Brazas
I haven't tested Your code, so can't tell You why it is working as You say. But to open batch file in my script I use simple: subprocess.Popen(c:\VerrLongPath\AnotherPath\mybatch.bat).communicate() You can also play with pipes for Popen... Algirdas Brazas - Original Message - From:

Re: Total No. of Records in a File?

2008-08-23 Thread W. eWatson
Fredrik Lundh wrote: W. eWatson wrote: I have an ordinary text file with a CR at the end of a line, and two numbers in each line. Is there some way to determine the number of lines (records) in the file before I begin reading it? In the general case, no. A file is just a bunch of bytes.

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread Cousin Stanley
Question: what is real warning? Don't MAKE ME have to tell you AGAIN -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: How to search the Python manuals

2008-08-23 Thread JBW
On Fri, 22 Aug 2008 16:17:16 -0400, Terry Reedy instructs a procedure for locating the behavior of default function arguments: -- For WinXP (I have no idea of how the manuals works elsewhere): Windows is against my religion, so I may be completely off base

ctypes initializer

2008-08-23 Thread castironpi
Is there a way to initialize a ctypes Structure to point to an offset into a buffer? I don't know if the way I'm doing it is supported. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to search the Python manuals

2008-08-23 Thread Marc 'BlackJack' Rintsch
On Sat, 23 Aug 2008 21:00:57 +, JBW wrote: It is much easier to find where to look if the documentation corpus has a proper index. Since indexing is hard work that's effectively impossible to automate, I suspect Python's documentation is no better than many other open-source software

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread tom
W. eWatson wrote: The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstacles, trees. My purpose was to feed this profile of

dropwhile question

2008-08-23 Thread Rajanikanth Jammalamadaka
list(itertools.dropwhile(lambda x: x5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? list(itertools.dropwhile(lambda x: 2x5,range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Thanks, Raj -- For him who has conquered the mind, the mind is the best of friends; but for one who has failed to do so,

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
I completed a Win Python program and it has generated the necessary data, which I have in turn used successfully with the telescope software. Is there some way to turn this into an executable program for people who do not have Python? -- Wayne Watson (Watson Adventures, Prop.,

Re: dropwhile question

2008-08-23 Thread Marc 'BlackJack' Rintsch
On Sat, 23 Aug 2008 14:54:09 -0700, Rajanikanth Jammalamadaka wrote: list(itertools.dropwhile(lambda x: x5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? list(itertools.dropwhile(lambda x: 2x5,range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] It *does* work. `dropwhile()` drops as long as

Re: dropwhile question

2008-08-23 Thread Fredrik Lundh
Rajanikanth Jammalamadaka wrote: list(itertools.dropwhile(lambda x: x5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? list(itertools.dropwhile(lambda x: 2x5,range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] it works exactly as specified: help(itertools.dropwhile) Help on class dropwhile

Re: How to know a top directory?

2008-08-23 Thread Grigory Temchenko
On Aug 23, 5:24 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Michiel Overtoom wrote: I have path /this/is/path and I wanna get /this/is. Also I want to use it as platform independent. If I want to pass c: \that\path then I need to get c:\that. import os print

Re: dropwhile question

2008-08-23 Thread Fredrik Lundh
Fredrik Lundh wrote: maybe you meant to use itertools.ifilter? help(itertools.ifilter) Help on class ifilter in module itertools: class ifilter(__builtin__.object) | ifilter(function or None, sequence) -- ifilter object | | Return those items of sequence for which function(item) is

Re: dropwhile question

2008-08-23 Thread Scott David Daniels
Rajanikanth Jammalamadaka wrote: list(itertools.dropwhile(lambda x: x5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? list(itertools.dropwhile(lambda x: 2x5,range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Because it drops _while_ the condition is True (which it is for the first 0 entries in

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
tom wrote: W. eWatson wrote: The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstacles, trees. My purpose was to feed this

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
Dennis Lee Bieber wrote: On Fri, 22 Aug 2008 23:18:17 -0700, W. eWatson [EMAIL PROTECTED] declaimed the following in comp.lang.python: I'll take a look. I just posted above yours with a more insightful set of data than the first three pointer. Yes, some way of bisecting, or chopping is the

Turning py into an Executable Program for Win?

2008-08-23 Thread W. eWatson
How do I get my py code into some executable form so that Win users who don't have python can execute it? -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W,

Re: ctypes initializer

2008-08-23 Thread marek . rocki
castironpi napisał(a): Is there a way to initialize a ctypes Structure to point to an offset into a buffer? I don't know if the way I'm doing it is supported. There is a high probability you're abusing ctypes too much, but it's possible. The following seems to work: from ctypes import * class

Re: Turning py into an Executable Program for Win?

2008-08-23 Thread imre . kerr
On 24 Aug, 01:28, W. eWatson [EMAIL PROTECTED] wrote: How do I get my py code into some executable form so that Win users who don't have python can execute it? Py2exe: http://www.py2exe.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread tom
W. eWatson wrote: tom wrote: W. eWatson wrote: The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstacles, trees. My purpose was

Re: ctypes initializer

2008-08-23 Thread castironpi
On Aug 23, 6:43 pm, [EMAIL PROTECTED] wrote: castironpi napisa³(a): Is there a way to initialize a ctypes Structure to point to an offset into a buffer? I don't know if the way I'm doing it is supported. There is a high probability you're abusing ctypes too much, but it's possible. The

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread Ken Starks
tom wrote: Both scipy and matplotlib are not part of the standard Python distribution so they would need to be installed separately. Scipy is useful for scientific data analysis, and matplotlib is useful for making plots. For a review of a really nice looking wrapper around lots of

A variables variables

2008-08-23 Thread Gandalf
how can I declare a variable with another variable name? for example I will use PHP: $a= hello; $a_hello=baybay; print ${'a_'.$a) //output: baybay how can i do it with no Arrays using python thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: A variables variables

2008-08-23 Thread castironpi
On Aug 23, 7:25 pm, Gandalf [EMAIL PROTECTED] wrote: how can I declare a variable with another variable  name? for example  I will use PHP: $a= hello; $a_hello=baybay; print ${'a_'.$a)  //output: baybay how can i do it with no Arrays using  python thanks! Here's one idea. a=

Re: A variables variables

2008-08-23 Thread Mohamed Yousef
i don't know if this volatiles array condition or not but any way q='asd' asdasd=20 print globals()[q+'asd'] -- http://mail.python.org/mailman/listinfo/python-list

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread castironpi
On Aug 23, 2:57 pm, Cousin Stanley [EMAIL PROTECTED] wrote: Question: what is real warning?   Don't  MAKE ME  have to tell you  AGAIN -- Stanley C. Kitching Human Being Phoenix, Arizona Two black eyes. Haa haa. My question comes from: less likely to notice if a real warning is

Re: property() usage - is this as good as it gets?

2008-08-23 Thread castironpi
On Aug 22, 11:18 am, David Moss [EMAIL PROTECTED] wrote: Hi, I want to manage and control access to several important attributes in a class and override the behaviour of some of them in various subclasses. Below is a stripped version of how I've implemented this in my current bit of work.

Re: Turning py into an Executable Program for Win?

2008-08-23 Thread Cameron Laird
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: On 24 Aug, 01:28, W. eWatson [EMAIL PROTECTED] wrote: How do I get my py code into some executable form so that Win users who don't have python can execute it? Py2exe: http://www.py2exe.org/ More generally, URL:

Re: A variables variables

2008-08-23 Thread Benjamin
On Aug 23, 7:25 pm, Gandalf [EMAIL PROTECTED] wrote: how can I declare a variable with another variable  name? for example  I will use PHP: $a= hello; $a_hello=baybay; print ${'a_'.$a)  //output: baybay Doing this sort of thing in Python is very anti idiom. how can i do it with no

Re: Python 3000 C API Changes

2008-08-23 Thread Benjamin
On Aug 23, 10:34 am, rahul [EMAIL PROTECTED] wrote: I am trying to find out what Python C APIs are changing from Python 2.5 to Python 3.0 but there does not seem to be a single list of changes (or at least google is not finding one). If someone knows about where I should look, please let me

Re: How to search the Python manuals

2008-08-23 Thread Terry Reedy
JBW wrote: On Fri, 22 Aug 2008 16:17:16 -0400, Terry Reedy instructs a procedure for locating the behavior of default function arguments: -- For WinXP (I have no idea of how the manuals works elsewhere): Windows is against my religion, so I may be

Re: A variables variables

2008-08-23 Thread Terry Reedy
Gandalf wrote: how can I declare a variable with another variable name? for example I will use PHP: $a= hello; $a_hello=baybay; print ${'a_'.$a) //output: baybay how can i do it with no Arrays using python Others have given you the direct answer. But using lists or dicts is

Re: The Importance of Terminology's Quality

2008-08-23 Thread John W Kennedy
Martin Gregorie wrote: On Sat, 23 Aug 2008 00:06:28 -0400, John W Kennedy wrote: Martin Gregorie wrote: Not necessarily. An awful lot of CPU cycles were used before microcode was introduced. Mainframes and minis designed before about 1970 didn't use or need it No, most S/360s used microcode.

Imports visibility in imported modules problem

2008-08-23 Thread Mohamed Yousef
Hello , The problem I'm asking about is how can imported modules be aware of other imported modules so they don't have to re-import them (avoiding importing problems and Consicing code and imports ) Take Example :- in A.py :- import B print dir() # no problems we can see B which contain re

Re: Imports visibility in imported modules problem

2008-08-23 Thread Patrick Maupin
On Aug 23, 7:27 pm, Mohamed Yousef [EMAIL PROTECTED] wrote: The problem I'm asking about is how can imported modules be aware of other imported modules so they don't have to re-import them (avoiding importing problems and Consicing code and imports ) You could import sys and look at

Imports awareness in Imported modules problem

2008-08-23 Thread Mohamed Yousef
Hello , The problem I'm asking about is how can imported modules be aware of other imported modules so they don't have to re-import them (avoiding importing problems and Consicing code and imports ) Take Example :- in A.py :- import B print dir() # no problems we can see B which contain re

Re: Filling in Degrees in a Circle (Astronomy)

2008-08-23 Thread W. eWatson
tom wrote: W. eWatson wrote: tom wrote: W. eWatson wrote: The other night I surveyed a site for astronomical use by measuring the altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north clockwise around the site to 360 degrees, almost north again) of obstacles, trees. My

two's complement bytes

2008-08-23 Thread Adam W.
I'm dabbling with AVR's for a project I have and that means I have to use C (ageist my will). Because my AVR will be tethered to my laptop, I am writing most of my logic in python, in the hopes of using at little C as possible. In my quest I came across a need to pass a pair of sign extended

  1   2   >