Top 10 Things To Look For In A Web Host

2008-08-23 Thread best_hosting
Top 10 Things To Look For In A Web Host http://hosting-top10.blogspot.com/2008/07/top-10-things-to-look-for-in-web-host.html 5 Tips To Choose A Domain Name For An Internet Business http://hosting-top10.blogspot.com/2008/07/5-tips-to-choose-domain-name-for.html Domain Name Registration - Investments

Re: dropwhile question

2008-08-23 Thread Rajanikanth Jammalamadaka
Thanks for the explanations. Regards, Raj On Sat, Aug 23, 2008 at 3:41 PM, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Rajanikanth Jammalamadaka wrote: > > list(itertools.dropwhile(lambda x: x<5,range(10))) >> >> [5, 6, 7, 8, 9] >> >> Why doesn't this work? > > list(itertool

Re: Regex on a huge text

2008-08-23 Thread Gabriel Genellina
En Fri, 22 Aug 2008 18:56:51 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Aug 23, 6:19 am, "Medardo Rodriguez" <[EMAIL PROTECTED]> wrote: >> On Fri, Aug 22, 2008 at 11:24 AM, Dan <[EMAIL PROTECTED]> wrote: >> > I'm looking on how to apply a regex on a pretty huge input text (a file >> > th

Re: iterparse and unicode

2008-08-23 Thread Stefan Behnel
George Sakkis wrote: > It seems xml.etree.cElementTree.iterparse() is not unicode aware: > from StringIO import StringIO from xml.etree.cElementTree import iterparse s = u'\u03a0\u03b1\u03bd\u03b1\u03b3\u03b9\u03ce\u03c4\u03b7\u03c2' for event,elem in iterparse(StringIO(s

Re: two's complement bytes

2008-08-23 Thread Adam W.
On Aug 24, 1:11 am, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 23, 11:52 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > > > > > > > On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > > > > Try this out.  Does it come close to what you want? > > > > import struct > > > struct.pack( 'i', ~1

Re: Imports visibility in imported modules problem

2008-08-23 Thread Terry Reedy
Mohamed Yousef wrote: 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 If you want to use module A in both B and C, B and C should both import A. No problem. > (avoiding importing problems and Consic

Re: A variables variables

2008-08-23 Thread Gandalf
OK thank you all ! sometimes you just getting use to somethings... -- http://mail.python.org/mailman/listinfo/python-list

Re: Launch an application and continue the script's execution

2008-08-23 Thread M�ta-MCI (MVP)
Hi! More easy: os.system('cmd /c c:\\temp.bat') @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: iterparse and unicode

2008-08-23 Thread Stefan Behnel
George Sakkis wrote: > On Aug 21, 1:48 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >> George Sakkis wrote: >>> It's interesting that the element text attributes after a successful >>> parse do not necessarily have the same type, i.e. all be str or all >>> unicode. I ported some text extraction

Re: Python 3000 C API Changes

2008-08-23 Thread Stefan Behnel
rahul 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 know. Check out what Cython does in i

Re: Usual practice: running/testing modules in a package

2008-08-23 Thread Gabriel Genellina
En Fri, 22 Aug 2008 17:31:58 -0300, Medardo Rodriguez (Merchise Group) <[EMAIL PROTECTED]> escribió: > On Fri, Aug 22, 2008 at 1:25 PM, Gabriel Genellina > <[EMAIL PROTECTED]> wrote: >> what if __init__.py contains code? > > Thats what I usually do to solve the "problem", but for my taste it's >

Re: simple Question about using BeautifulSoup

2008-08-23 Thread Aahz
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >On Wed, 20 Aug 2008 07:33:32 -0700 (PDT), Alexnb <[EMAIL PROTECTED]> wrote: >> >>Okay, I have used BeautifulSoup a lot lately, but I am wondering, how do you >>open a local html file? >> >>Usually I do something like t

Re: two's complement bytes

2008-08-23 Thread castironpi
On Aug 23, 11:52 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > > > Try this out.  Does it come close to what you want? > > > import struct > > struct.pack( 'i', ~10 ) > > ~struct.unpack( 'i', _ )[ 0 ] > > > >>> import struct > > >>> struct.p

Re: Launch an application and continue the script's execution

2008-08-23 Thread M�ta-MCI (MVP)
Hi ! Replace: os.startfile("launch_trace.bat") by os.startfile('start "" cmd /c launch_trace.bat') and "le tour est joué". @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: two's complement bytes

2008-08-23 Thread Adam W.
On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > Try this out.  Does it come close to what you want? > > import struct > struct.pack( 'i', ~10 ) > ~struct.unpack( 'i', _ )[ 0 ] > > > > > > >>> import struct > >>> struct.pack( 'i', ~10 ) > '\xf5\xff\xff\xff' > >>> ~struct.unpack( 'i', _

Re: Psyco == tracing optimization?

2008-08-23 Thread Banibrata Dutta
AFAIK, the same logic used in runtime optimization of several other dynamic languages or shell-scripting languages (including Perl), for quite a while. On 8/23/08, Paddy <[EMAIL PROTECTED]> wrote: > > Just wondered if this: > > http://arstechnica.com/news.ars/post/20080822-firefox-to-get-massive-j

Re: I am trying to install the mechanize lib so I can use python to do webbrowseing

2008-08-23 Thread Gabriel Genellina
En Fri, 22 Aug 2008 09:23:46 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > Hi, > I am trying to install the mechanize lib so I can use python to do > webbrowseing. > > First I set up easy_install > > When I ran the script, it download the files ok, then I got these > error messages > s

Re: two's complement bytes

2008-08-23 Thread castironpi
On Aug 23, 10:51 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > 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. > >

Re: __eq__ problem with subclasses

2008-08-23 Thread Daniel Israel
Scott David Daniels wrote: 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

Re: Launch an application and continue the script's execution

2008-08-23 Thread Gabriel Genellina
En Fri, 22 Aug 2008 07:16:40 -0300, Marian Popa <[EMAIL PROTECTED]> escribió: > 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 foll

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 two'

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 p

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 module

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 sys

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 module

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.

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 al

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 comple

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

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

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, http://wiki.pytho

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

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 war

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: 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

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: 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 open

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

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 t

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: 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 * clas

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: 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 th

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 profile

Re: dropwhile question

2008-08-23 Thread Scott David Daniels
Rajanikanth Jammalamadaka wrote: list(itertools.dropwhile(lambda x: x<5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? list(itertools.dropwhile(lambda x: 2 [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 the sequence).

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: 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 os.p

Re: dropwhile question

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

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: x<5,range(10))) > [5, 6, 7, 8, 9] > > Why doesn't this work? list(itertools.dropwhile(lambda x: 2 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] It *does* work. `dropwhile()` drops as long as the c

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., Nevad

dropwhile question

2008-08-23 Thread Rajanikanth Jammalamadaka
>>> list(itertools.dropwhile(lambda x: x<5,range(10))) [5, 6, 7, 8, 9] Why doesn't this work? >>> list(itertools.dropwhile(lambda x: 2http://mail.python.org/mailman/listinfo/python-list

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 obstacle

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

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 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

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: 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. If

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: 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> wro

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 inste

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 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 t

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 li

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 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 fil

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, 39

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

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 version

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 differ

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 loo

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 = open('c:\tmp\junkpyth

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 lamb

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 h

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. -- http://mail.python.org/mailman/listinfo/python-lis

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 argume

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 (mos

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

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,

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) 'a,b,c,d,e,f,g,h,i,j,k,

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 mea

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 *single

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 junk

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 (*), t

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 sim

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_=

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

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 #te

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 > exec

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 os.chdir("D

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 Murph

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 classe

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 it'

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 usi

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

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 imp

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"

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'[EMAI

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 exe

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]

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? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >