Re: OT: Entitlements [was Re: Python usage numbers]
On 2/18/2012 2:28 AM, Ian Kelly wrote: Here's a neat table: government spending as a percentage of GDP, by country. http://anepigone.blogspot.com/2008/03/government-spending-as-percentage-of.html The table is for "national government spending". That means spending by the national government. The US has a lot of spending by state, county, city, school, and special districts that is not included. Total government spending in the US is about 40% of measured GDP. I *suspect* that the US has a higher percentage of non-national government spending than most other countries. For instance, government education spending is about 6% of GDP and that is mostly non-national here but, I believe, more national in some other countries. There are also issues with the denominator. In the US, if someone works at home without pay other than from a spouse, the value of the work is *not* included in GDP. If the same person goes to work elsewhere and hires someone to do the the same work around the home, that same work *is* counted. So the movement of house-spouses into the paid workforce has artificially inflated US GDP relative to, say, 50 years ago. There are also issues of measuring and including the unofficial, off-government books, 'underground' economy. That is relatively larger in many countries than in the US. I have the strong impression that the US IRS is much more diligent about ferreting out taxable income than the equivalent in many other countries. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Feb 18, 1:28 am, Ian Kelly wrote: > On Fri, Feb 17, 2012 at 6:13 PM, Rick Johnson > If I were to [sum my tax burden], it would > probably come to around 30%, which still doesn't bother me, in part > because I know that it comes back to benefit the society I live in, > and by extension me, in one way or another.. But do you think you'll get a higher return for your investment? Is it possible to get a higher return on your investment in this type of system? NO! You better off just paying for your own damn healthcare. Well actually, there is a way to get a higher return by taking more than your "fair share". Any intelligent person would realize that public healthcare is advocated by degenerates or the bleeding heart "degenerate eugenics" supporters. Fine, YOU want to subsidize degeneracy? Then give to charity. The more you give the better you'll feel. BTW: How much money do you give to charity? Also, you mentioned Mitt paying 4 million dollars in taxes; that's more tax than you'll pay in a lifetime! > > I guess you never purchase > > ANYTHING or live under the tyranny of local jurisdictions ON TOP of > > the federal jurisdiction? > > Paying taxes to fund public schools, police departments, fire > departments, and road maintenance is "tyranny"? Read my comments and you will know that i support LIMITED infrastructure. Enough with the spin! > > Here is a list of taxes most everyone else will encounter: > > This list is awesome. I love how you include inflation and fines > imposed for breaking the law as "taxes". Do you think that ALL traffic tickets are based on reality? You don't think traffic cops are forced to meet ticket quotas? You don't believe that some people are wrongly accused? You don't think some police abuse their power? Have you heard of the many cases of death row inmates being proven innocent by DNA evidence? You are a FOOL to believe the justice system is perfect! > Also how you state that > "most everyone" will have to pay taxes for fishing licenses, hunting > licenses, CDL licenses, and even corporate income. Maybe you live in Amish country, but I have driven on many US highways and i know for a fact that there are many, MANY, large trucks. All those truck drivers require a CDL license. Maybe you just ignore the people you consider to be "beneath you"? > Marriage license > tax? Yeah, I remember paying that fee. Once. I believe it was > somewhere around $50. And why do we need the state involved in our love lives? > And cigarette tax? Correct me if I'm wrong, > but isn't that one mostly paid by those "degenerates" you keep whining > about, the ones who aren't pulling their own weight? I hope you can > understand that I find it a bit ironic that you're now complaining > about cigarette tax. It IS a tax nonetheless. Of course the sales pitch for cigarette tax is that the profit will help offset the medical expenses of cancers due to smoking, BUT, do you REALLY believe all that money is going towards healthcare. HA! That's just more money in some politicians pocket! > > Actually i think 10% income tax is a fair amount although i believe > > taxing income silly. If the government cannot provide national > > security, domestic security, and LIMITED infratructure on 10% of what > > we make, they are wasting too much of OUR money. > > Here's a neat table: government spending as a percentage of GDP, by country. Don't trust polls. Heck, some polls even show Python rising in popularity! > > People, THERE IS NO FREE LUNCH! Every product that is made and every > > service rendered was a result of someone's hard labor. Sleep on that > > you degenerates! > > No shit. I pay those taxes too, you know. I have no delusions about > where the money comes from. Great. Thanks for being a productive member of society. But why do you support measures that will increase your tax burden? You'll never get back what you put in unless you're a degenerate. Also, you are empowering the government with more money. They can't even manage the money they have now! Has history taught you NOTHING! How many revolutions is it going to take? How many billions of lives is is going to take? When are you going to realize that taxation is tyranny? When are you going to realize that degenerates deserve what they get? > I fail to see any connection whatsoever. Animal lovers who only care > about mammals are stealing money from taxpayers? Public healthcare is YOU robbing someone else so YOU can get a service that you don't deserve! That's the hypocrisy! > Yes, I am so selfish and immoral that I believe everybody should have > access to health care. Instead I should be more like you, and label > people who can't afford their own health care as "degenerates", I NEVER labeled people who can't afford healthcare degenerates. Enough with the spin cycle already. > > Because of people like YOU, we don't deserve the right to evolve! > > What does that even mean? Evolution is a natural process. Not for long m
Re: Python code file prototype
On 2012-02-17, Dennis Lee Bieber wrote: > On Fri, 17 Feb 2012 09:55:46 -0700, Ian Kelly > wrote: > >> >>The shebang has to be the first thing in the file to be useful. As it >>is above, it might as well not be there. I would suggest also >>including a doc string in the skeleton. >> > Of course, since the OP was talking Windows... the #! line is > ignored no matter where it was That depends. It always used to work for me, but I'm usually using bash and Cygwin. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On 18/02/2012 15:02, Rick Johnson wrote: But do you think you'll get a higher return for your investment? Is it possible to get a higher return on your investment in this type of system? NO! You better off just paying for your own damn healthcare. I guess you'd better get wikipedia to correct its incorrect data then. http://en.wikipedia.org/wiki/Health_care_in_the_United_States Specifically. http://en.wikipedia.org/wiki/File:International_Comparison_-_Healthcare_spending_as_%25_GDP.png -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
parse a profile
I have a file I use for shell scripts that looks like this:
export VAR1=/path/to/dir
export VAR2=7
export VAR3=${VAR1}/further/path
# comment
. /another/file
And a file /another/file:
export VAR4=database-name
Is there an existing package that will read such a file and return a
dictionary like this:
{
'VAR1': '/path/to/dir',
'VAR2': 7,
'VAR3': '/path/to/dir/further/path',
'VAR4': 'database-name',
}
--
http://mail.python.org/mailman/listinfo/python-list
Re: [OT]: Smartphones and Python?
On 02/18/2012 12:51 PM, Michael Torrie wrote: On 02/16/2012 10:25 PM, 8 Dihedral wrote: Android is a customized linux OS used in mobile phones. I don't think any linux systm has to be locked by JAVA or any JVM to run applications. Getting waaa off topic here, but... I guess you aren't familiar with what Android is (which is ironic, given that a lot of people on this list think you must be one!). Android is not simply a customized linux distribution. Strictly speaking, Android *is* a customized Linux distribution; what it is not is Android is not a GNU/Linux distribution. It's a special application environment (an OS in its own right) that is based on the Dalvik virtual machine. Dalvik does depend on the Linux kernel to talk to the hardware, but Linux very much is not a part of Android, at least from the developers' and end users' points of view. Linux is just not a part of the user experience at all. It is true that Dalvik can call into native linux code, but native linux applications typically aren't a part of the Android user experience. Android does have a full Linux experience; what it lacks is the GNU experience. Unlike "normal" Linux distros, Android does not use GNU userspace, instead it have its own userspace based on bionic, toolbox, and dalvik. Linux is a core part of Android's user and developer's experience. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Feb 18, 10:15 am, Mark Lawrence wrote: > On 18/02/2012 15:02, Rick Johnson wrote: > > > But do you think you'll get a higher return for your investment? Is it > > possible to get a higher return on your investment in this type of > > system? NO! You better off just paying for your own damn healthcare. > > I guess you'd better get wikipedia to correct its incorrect data then. Sure. I'll do that as soon as you show me mathematical evidence of how N people put X dollars each into a pot and then the same N people pull out MORE than X dollars each. If you can create a proof that creates money from nothing then we may find ourselves in the 1% tomorrow! Louie-the-loose-screw Said: "I'll give you $15 if you'll give me $15!" Okay Louie, but what is the point of that exercise besides money laundering? X + 0 = 0 -- http://mail.python.org/mailman/listinfo/python-list
Re: parse a profile
On 18/02/2012 16:34, Jason Friedman wrote:
I have a file I use for shell scripts that looks like this:
export VAR1=/path/to/dir
export VAR2=7
export VAR3=${VAR1}/further/path
# comment
. /another/file
And a file /another/file:
export VAR4=database-name
Is there an existing package that will read such a file and return a
dictionary like this:
{
'VAR1': '/path/to/dir',
'VAR2': 7,
'VAR3': '/path/to/dir/further/path',
'VAR4': 'database-name',
}
I would probably do something like this:
import re
# Parse the file into a dict.
with open(path) as f:
d = dict(re.findall(r"(?m)^export (VAR\d+)=(.*)", f.read()))
# Expand any references.
for key, value in d.items():
d[key] = re.sub(r"\$\{(VAR\d+)\}", lambda m: d[m.group(1)], value)
--
http://mail.python.org/mailman/listinfo/python-list
Re: OT: Entitlements [was Re: Python usage numbers]
On Feb 18, 12:34 pm, Rick Johnson wrote: > Louie-the-loose-screw Said: "I'll give you $15 if you'll give me $15!" $15 dolla too beau coup! 5 dolla each! -- http://mail.python.org/mailman/listinfo/python-list
Python as a default shell, replacement of bash, sh, cmd ?
Has it been considered to add shell features to python, such that it can be used as a default shell, as a replacement for bash, etc. I'm sure everyone would agree that doing this would make the terminal very powerful. What are your views on this? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python as a default shell, replacement of bash, sh, cmd ?
Have a look at IPython (http://ipython.org/). It can interact with the normal shell very well. Laszlo On Sat, Feb 18, 2012 at 19:58, SherjilOzair wrote: > Has it been considered to add shell features to python, such that it can be > used as a default shell, as a replacement for bash, etc. > > I'm sure everyone would agree that doing this would make the terminal very > powerful. > > What are your views on this? > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Python as a default shell, replacement of bash, sh, cmd ?
在 2012年2月19日星期日UTC+8上午3时21分53秒,Jabba Laci写道: > Have a look at IPython (http://ipython.org/). It can interact with the > normal shell very well. > > Laszlo > > On Sat, Feb 18, 2012 at 19:58, SherjilOzair wrote: > > Has it been considered to add shell features to python, such that it can be > > used as a default shell, as a replacement for bash, etc. > > > > I'm sure everyone would agree that doing this would make the terminal very > > powerful. > > > > What are your views on this? > > -- > > http://mail.python.org/mailman/listinfo/python-list Yeh, python could be used as a better shell in a text terminal box and with another text editor in another box to write scripts in developement. Also this is easy to test scripts found in the web by copy and paste. -- http://mail.python.org/mailman/listinfo/python-list
Re: parse a profile
On 18Feb2012 18:43, MRAB wrote:
| On 18/02/2012 16:34, Jason Friedman wrote:
| > I have a file I use for shell scripts that looks like this:
| >
| > export VAR1=/path/to/dir
| > export VAR2=7
| > export VAR3=${VAR1}/further/path
| > # comment
| > . /another/file
| >
| > And a file /another/file:
| > export VAR4=database-name
| >
| > Is there an existing package that will read such a file and return a
| > dictionary like this:
| > {
| > 'VAR1': '/path/to/dir',
| > 'VAR2': 7,
| > 'VAR3': '/path/to/dir/further/path',
| > 'VAR4': 'database-name',
| > }
|
| I would probably do something like this:
|
| import re
|
| # Parse the file into a dict.
| with open(path) as f:
| d = dict(re.findall(r"(?m)^export (VAR\d+)=(.*)", f.read()))
|
| # Expand any references.
| for key, value in d.items():
| d[key] = re.sub(r"\$\{(VAR\d+)\}", lambda m: d[m.group(1)], value)
Which fails on the ". /anther/file" step, alas. Jason's point is
probably that it may be arbitrary shell.
I suspect I would write a shell wrapper like this:
#!/bin/sh
exec 3>&1 1>&2
. /path/to/jason/s/file
exec 1>&3 3>&-
env
then from inside Python call the shell to run the wrapper.
Read the output of "env" and diff it against os.environ.
Populate the dictionary with the values that have changed.
Crude untested sketch:
newvars = {}
for envline in subprocess.blah(... run the wrapper script above ...):
if not envline.endswith('\n'):
raise ValueError("unexpected EOF")
envline = envline[:-1]
try:
var, value = line.split('=', 1)
except ValueError:
# ouch!
continue
oldvalue = os.environ.get(var)
if oldvalue is None or oldvalue != value:
newvars[var] = value
You can put the wrapper script as a single inline piece of shell to
avoid the separate file once debugged.
Just a thought. Cheers,
--
Cameron Simpson DoD#743
http://www.cskk.ezoshosting.com/cs/
[...] post-block actions should be allowed everywhere, not just on
subroutines. The ALWAYS keyword was agreed upon as a good way of doing
this, although POST was also suggested. This lead to the semi-inevitable
rehash of the try- catch exception handling debate. According to John
Porter, "There is no try, there is only do. :-)"
- from the perl6 development discussion
--
http://mail.python.org/mailman/listinfo/python-list
Re: [semi OT]: Smartphones and Python?
On 16.2.2012 16:22, Michael Torrie wrote: Android simply isn't going to run the JVM anytime soon. In reality yes, but just technically speaking there is the project IcedRobot (http://www.icedrobot.org/), which is a fork of Android over OpenJDK. Best, Matěj -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT]: Smartphones and Python?
For one I don't know of any sun-compatible JVM that has been ported to ARM. http://www.senecass.com/projects/OpenJDK-ARM/ "This work has been completed, and is now in OpenJDK HEAD. This page is now mostly for historical documentation." Also, http://openjdk.java.net/projects/zero/ (I know my colleagues from Red Hat are involved, because we are very interested in supporting more than just Intel chips well). Best, Matěj -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT]: Smartphones and Python?
On 02/18/2012 10:46 AM, Lie Ryan wrote: > Android does have a full Linux experience; what it lacks is the GNU > experience. Unlike "normal" Linux distros, Android does not use GNU > userspace, instead it have its own userspace based on bionic, toolbox, > and dalvik. Linux is a core part of Android's user and developer's > experience. The fact that RIM is porting Android to QNX would seem to contradict your assertion that Linux is a core part of Android's user and developer experience. Have you developed for Android? In what way do you interact with Linux in your apps and APIs? Can you make system calls? How is Linux a core part of Android's user and developer experience? I know that Android does allow some integration of native code, so that does meld Linux and Android somewhat. >From a user's pov (non-rooted), there is nothing of Linux exposed. I just install apps, run them, and manipulate my files which are stored in my sd card. The fact that it's in /mnt/sdcard is completely hidden, as are all files that support dalvik. The OS could be Windows, iOS, or whatever. It doesn't matter because the platform is not defined by the kernel but by the APIs that apps need to use to run on the platform, just like in Python! In fact in some ways calling Android "Linux" would be similar to calling Java and the Sun JVM "Linux" or Python, "Linux" just because it happens to run atop that kernel. I have mentioned those specifically because they are interpreted or virtual machines themselves; the "binaries" run regardless of underlying CPU type, or kernel type. In my mind, the fact that Android runs on the Linux kernel is almost entirely coincidental to Android's aims. Google could have developed their own kernel, but of course it's much cheaper to use Linux. And of course Dalvik is currently written to consume posix APIs from the kernel. In my mind, and in my experience with Android, Linux is irrelevant. In fact continuing to call Android "Linux" might just be doing ourselves a disservice. In any case, saying that since it's linux, you can install anything you want on it, such as a JVM, is neither useful or accurate. -- http://mail.python.org/mailman/listinfo/python-list
#line in python
The ast module shows that elements of the syntax tree have line and column numbers. Would it be sensible to attempt to revise them to achieve effects like the #line directive in C? Context: Using noweb, a literate programming tool, which from a source file foo.nw produces foo.py. The lines in the two files may be in completely different sequenes. For debugging, it is useful to receive error reports that refer to the original line number in foo.nw. I am not sure how such rewriting would interact with debugger commands that set a breakpoint at a file and line number. I'm also not sure it would change the reported line numbers of errors. The lack of a file name could be problematic if multiple sources contributed to the same .py file, but that is an unlikely scenario. As an extension or alternate, could there be a decorator like @source_line(lineno, filename) for classes and methods that could do the conversion on the fly? I don't know if there's a way to go from the function (or class) object the decorator receives to the AST. Comments? Ross Boylan -- http://mail.python.org/mailman/listinfo/python-list
[ANN] markup.py 1.8
A new release of markup.py is available at http://markup.sourceforge.net/ This new release is compatible with both python 2 and 3. What is markup.py? Markup.py is an intuitive, light weight, easy-to-use, customizable and pythonic HTML/XML generator. The only goal is quickly writing HTML/XML segments or whole documents programatically if you need anything more than that you probably want to look for a templating engine. -- interior | space | design | http://www.annazeibig.com | 3d | living | deco -- http://mail.python.org/mailman/listinfo/python-list
Re: entering unicode (was Python usage numbers)
On Sun, 12 Feb 2012 19:09:32 -0800, rusi wrote: > I have some bunch of sanskrit (devanagari) to type. It would be easiest > for me if I could have the English (roman) as well as the sanskrit > (devanagari). > > For example using the devanagari-itrans input method I can write the > gayatri mantra using > > OM bhUrbhuvaH suvaH > tatsaviturvarenyam > bhargo devasya dhImahi > dhiyo yonaH prachodayAt > > and emacs produces *on the fly* (ie I cant see/edit the above) > > ॐ भूर्भुवः सुवः तत्सवितुर्वरेण्यम् भर्गो देवस्य धीमहि धियो योनः > प्रचोदयात् > > Can I do it in batch mode? ie write the first in a file and run some > command on it to produce the second? What is the devanagari-itrans input method? Do you actually type the characters into a terminal? If so, you should be able to type the first into a file, copy it, then paste it into the input buffer to be processed. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Python as a default shell, replacement of bash, sh, cmd ?
SherjilOzair wrote: > Has it been considered to add shell features > to python, such that it can be used as a > default shell, as a replacement for bash, etc. I think yes, but rather than become a shell, Python makes easy programming a shell that can execute Python code. The tendency has been to excel as a scripting language, and prefer to add extra features to the standard library. To start, look at the built-in functions eval() and (raw_)input; and the library modules: subprocess, os and os.path, glob and re, shutil, and code. > I'm sure everyone would agree that doing this > would make the terminal very powerful. 'Cept of course that they already are. -- http://mail.python.org/mailman/listinfo/python-list
Re: tkinter.Toplevel
On 2012-02-17 16:48, Rick Johnson wrote: On Feb 16, 8:39 pm, [email protected] wrote: With a tkinter.Toplevel, how can I "disable" the parent windown and all its widget, in the same fashion as tkinter.messagebox? The answer lies within the tkSimpleDialog source code; which is pure python. Look in the __init__ method of Dialog class. My advice is to study the code until you understand every line. Look at the following references when you need more info: http://infohost.nmt.edu/tcc/help/pubs/tkinter/ http://effbot.org/tkinterbook/ ...grab_set() Thanks. -- Yves. http://www.SollerS.ca/ http://ipv6.SollerS.ca http://blog.zioup.org/ -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT]: Smartphones and Python?
在 2012年2月19日星期日UTC+8上午8时36分48秒,Michael Torrie写道: > On 02/18/2012 10:46 AM, Lie Ryan wrote: > > Android does have a full Linux experience; what it lacks is the GNU > > experience. Unlike "normal" Linux distros, Android does not use GNU > > userspace, instead it have its own userspace based on bionic, toolbox, > > and dalvik. Linux is a core part of Android's user and developer's > > experience. > > The fact that RIM is porting Android to QNX would seem to contradict > your assertion that Linux is a core part of Android's user and developer > experience. Have you developed for Android? In what way do you > interact with Linux in your apps and APIs? Can you make system calls? > How is Linux a core part of Android's user and developer experience? I > know that Android does allow some integration of native code, so that > does meld Linux and Android somewhat. > > >From a user's pov (non-rooted), there is nothing of Linux exposed. I > just install apps, run them, and manipulate my files which are stored in > my sd card. The fact that it's in /mnt/sdcard is completely hidden, as > are all files that support dalvik. The OS could be Windows, iOS, or > whatever. It doesn't matter because the platform is not defined by the > kernel but by the APIs that apps need to use to run on the platform, > just like in Python! In fact in some ways calling Android "Linux" would > be similar to calling Java and the Sun JVM "Linux" or Python, "Linux" > just because it happens to run atop that kernel. I have mentioned those > specifically because they are interpreted or virtual machines > themselves; the "binaries" run regardless of underlying CPU type, or > kernel type. > > In my mind, the fact that Android runs on the Linux kernel is almost > entirely coincidental to Android's aims. Google could have developed > their own kernel, but of course it's much cheaper to use Linux. And of > course Dalvik is currently written to consume posix APIs from the kernel. > > In my mind, and in my experience with Android, Linux is irrelevant. Do you have to write a touch screen device driver under any mobile phone requested by your boss? If the current one is not suitable in the market entangled with law suites from other big corps, do you have to chunk a clean implementation? > In > fact continuing to call Android "Linux" might just be doing ourselves a > disservice. In any case, saying that since it's linux, you can install > anything you want on it, such as a JVM, is neither useful or accurate. Check the Jython JRE lib. If it is not compatable under Android's system, then there are jobs to do in the JVM maintainer in Androids or some revised requests for the Jython JRE library group. -- http://mail.python.org/mailman/listinfo/python-list
