Re: How Micro-pump will change the future of computer/ mobile chips.
Jim Granville wrote: > [EMAIL PROTECTED] wrote: > >> How Micro-pump will change the future of computer/ mobile chips. > > > FAR more hype than practical solution > Sorry guys, this will not "change the future of computer/ mobile chips." > >> Engineers at Purdue University have developed a tiny "micro-pump" >> cooling device small enough to fit on a computer chip that circulates >> coolant through channels etched into the chip. . For >> detail >> http://www.studyandjobs.com/Micro_pump.html >> >> or http://www.studyandjobs.com/IT_study.htm > > > ..ahh, up goes the spam-meter > > -jg > -- http://mail.python.org/mailman/listinfo/python-list
Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Arne Vajhøj wrote: Google does not accept spam complaints. Go ahead, try it. That's why they've been the #1 Usenet spamming tool for years now. What you're seeing is the spam slowly expanding into the software development groups. uk.railway is probably a random group added to confuse spam filters. Some groups, like rec.photo.digital, have been getting hundreds of Google spams a day for about a year. Ask your news service for a Google UDP (Usenet Death Penalty) or configure your reader to drop everything with "googlegroups.com" in the Message-ID. Some real users do use GG. This is true, however there are acceptable losses. donald Arne -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a unique method in python to unique a list?
If you don't need to retain order you can just use a set, set([1, 1, 2, 3, 4]) = set([1, 2, 3, 4]) But set's don't retain order. On Sunday, September 9, 2012 at 1:43 AM, Token Type wrote: > Is there a unique method in python to unique a list? thanks > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a unique method in python to unique a list?
For a short list the difference is going to be negligible. For a long list the difference is that checking if an item in a list requires iterating over the list internally to find it but checking if an item is inside of a set uses a faster method that doesn't require iterating over the list. This doesn't matter if you have 20 or 30 items, but imagine if instead you have 50 million items. Your going to be iterating over the list a lot and that can introduce significant slow dow. On the other hand using a set is faster in that case, but because you are storing an additional copy of the data you are using more memory to store extra copies of everything. On Sunday, September 9, 2012 at 2:31 AM, John H. Li wrote: > Thanks first, I could understand the second approach easily. The first > approach is a bit puzzling. Why are seen=set() and seen.add(x) still > necessary there if we can use unique.append(x) alone? Thanks for your > enlightenment. > > On Sun, Sep 9, 2012 at 1:59 PM, Donald Stufft (mailto:donald.stu...@gmail.com)> wrote: > > seen = set() > > uniqued = [] > > for x in original: > > if not x in seen: > > seen.add(x) > > uniqued.append(x) > > > > or > > > > uniqued = [] > > for x in oriignal: > > if not x in uniqued: > > uniqued.append(x) > > > > The difference between is option #1 is more efficient speed wise, but uses > > more memory (extraneous set hanging around), whereas the second is slower > > (``in`` is slower in lists than in sets) but uses less memory. > > > > On Sunday, September 9, 2012 at 1:56 AM, John H. Li wrote: > > > > > Many thanks. If I want keep the order, how can I deal with it? > > > or we can list(set([1, 1, 2, 3, 4])) = [1,2,3,4] > > > > > > > > > On Sun, Sep 9, 2012 at 1:47 PM, Donald Stufft > > (mailto:donald.stu...@gmail.com)> wrote: > > > > If you don't need to retain order you can just use a set, > > > > > > > > set([1, 1, 2, 3, 4]) = set([1, 2, 3, 4]) > > > > > > > > But set's don't retain order. > > > > > > > > On Sunday, September 9, 2012 at 1:43 AM, Token Type wrote: > > > > > > > > > Is there a unique method in python to unique a list? thanks > > > > > -- > > > > > http://mail.python.org/mailman/listinfo/python-list > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Article on the future of Python
On Thu, Sep 27, 2012 at 10:14 PM, Littlefield, Tyler wrote: > I know this isn't the list for database discussions, but I've never gotten a > decent answer. I don't know much about either, so I'm kind of curious why > postgresql over mysql? MySQL is an open-source PRODUCT owned by a for-profit company. PostgreSQL is an open-source PROJECT and is unowned. A lot of the major technical differences are outlined here: http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Article on the future of Python
On Thu, Sep 27, 2012 at 10:37 PM, Wayne Werner wrote: > the only advice I can give on that is > just learn to use both. I find there's little to lose in having experience with both. Most every good web framework out there supports lots of different databases through generic ORM layers.. so flipping back and forth to see which database is better for your particular app and workload is trivial. -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: strptime - dates formatted differently on different computers
On Mon, Dec 10, 2012 at 10:34:31PM -0700, Michael Torrie wrote: > I use a module I got from pypi called dateutil. It has a nice submodule > called parser that can handle a variety of date formats with good > accuracy. Not sure how it works, but it handles all the common American > date formats I've thrown at it. from dateutil.parser import parse dt = parse( whatever ) I've throw all kind of date and timestamps at it.. have yet to see anything it won't parse. -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: strptime - dates formatted differently on different computers
On Tue, Dec 11, 2012 at 2:18 PM, Marc Christiansen wrote: >>>> parse('1. Januar 2013') > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib64/python3.3/site-packages/dateutil/parser.py", line 720, in > parse > return DEFAULTPARSER.parse(timestr, **kwargs) > File "/usr/lib64/python3.3/site-packages/dateutil/parser.py", line 310, in > parse > raise ValueError("unknown string format") > ValueError: unknown string format A parserinfo class can be passed to parse() for unknown locale strings. >>>> parse('1.2.2013') # ambiguous, I know > datetime.datetime(2013, 1, 2, 0, 0) # should be datetime.datetime(2013, 2, 1, > 0, 0) In [2]: parse('1.2.2013', dayfirst=True) Out[2]: datetime.datetime(2013, 2, 1, 0, 0) -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: strptime - dates formatted differently on different computers
On Tue, Dec 11, 2012 at 11:05 PM, Steven D'Aprano wrote: > The question is not "will it parse", but will it parse CORRECTLY? > > What will it parse 11/12/10 as, and how do you know that is the intended > date? If it were me I'd look at more of the source dates I was tasked with parsing and dial it in using the appropriate dayfirst, yearfirst, etc. options. -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: What are the minimum requirements to get a job in?
On Thu, Dec 13, 2012 at 8:49 PM, wrote: > My aim is to get a job into google or cisco or facebok. I made it to the 4th interview with Google. When they say they want a "developer" they really mean they want a developer/sysadmin/kernel hacker/c/c++ guru. I nailed all the Python questions in interviews #2 and #3, but then at interview #4 they started asking inode questions, how to implement a compiler, how to design my own version of memcopy(), etc. It didn't really matter to them that I had 2M downloads on Google Play, or that I knew Ruby, Rails, Python, Django, PHP, iOS and Java.. I didn't know how to move 2GBs of memory from here to there without using memcopy(), so that was that :( > I have basic knowledge in python,c,java and good in javascript,html,css, > database concepts. My story above was a preface to the fact that "basic knowledge" usually isn't enough for hot tech companies like Google. From what I understand Facebook is becoming more C and less PHP all the time. And I imagine they use a lot of C and assembly at Cisco since that's mostly embedded device work. > If i learn django and python. Shall I get my dream job? Doubt it, but good luck all the same :) > Please suggest me Visit their job boards. -- Greg Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Looking for PyPi 2.0...
On Wednesday, February 15, 2012 at 4:24 PM, John Nagle wrote: > On 2/8/2012 9:47 AM, Chris Rebert wrote: > > On Wed, Feb 8, 2012 at 8:54 AM, Nathan Rice > > mailto:nathan.alexander.r...@gmail.com)> > > wrote: > > > As a user: > > > * Finding the right module in PyPi is a pain because there is limited, > > > low quality semantic information, and there is no code indexing. > > > > > > > > > > CPAN does it right. They host the code. (PyPi is just a > collection of links). They have packaging standards (PyPi > does not.) CPAN tends not to be full of low-quality modules > that do roughly the same thing. > > If you want to find a Python module, Google is more useful > than PyPi. > > Hopefully soon crate.io will be useful for finding modules ;) I have plans for it to try and, encourage people to host their code and encourage following packaging standards. I'm currently focused mostly on the backend stability (e.g. getting it stable) but emphasizing things that are generally good for the packaging ecosystem is something I hope to do. > > John Nagle > -- > http://mail.python.org/mailman/listinfo/python-list > > Donald Stufft -- http://mail.python.org/mailman/listinfo/python-list
Re: pypi and dependencies
packaging (in 3.3) and distutils2 (2.x-3.2) is a new metadata format for python packages. It gets rid of setup.py and it includes a way to specify the requirements that your package needs. This will show up on PyPI/Crate. On Tuesday, March 20, 2012 at 8:01 AM, Andrea Crotti wrote: > On 03/20/2012 11:18 AM, Ben Finney wrote: > > Andrea Crottimailto:andrea.crott...@gmail.com)> > > writes: > > > > > When I publish something on Pypi, is there a way to make it fetch the list > > > of dependencies needed by my project automatically? > > > > > > It would be nice to have it in the Pypi page, without having to look at > > > the > > > actual code.. > > > > > > > Sadly, no. The metadata available for packages on PyPI does not include > > information about the dependencies. > > > > (I'd love to be wrong about that, but I'm pretty certain that for most, > > if not all, packages that's the case.) > > > > > Any other possible solution? > > All the solutions I've seen involve fetching the full package in order > > to unpack it and *then* parse it for dependencies. > > > > This is very sub-optimal, and I believe people are working on it; but > > fixing it will at least require adjustment to all existing packages that > > don't have dependencies in their metadata. > > > > > Yes that's not so nice, many projects write clearly the dependencies in > the README file, > but that's annoying because it might get outdated. > > And it's also sad that it's not automatically fetched from setuptools, > because it's just > > python setup.py egg-info && cat package.egg-info/requirements.txt > > to actually extract them. > Should I file a bug maybe or is completely not feasible? > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org/mailman/listinfo/python-list
Re: Announcement: TLSv1.2 will become mandatory in the future for Python.org Sites
> On Jan 10, 2017, at 9:59 AM, Oleg Broytman wrote: > > On Tue, Jan 10, 2017 at 08:27:21AM -0500, Donald Stufft > wrote: >>python3 -c "import urllib.request,json; >> print(json.loads(urllib.request.urlopen('https://www.howsmyssl.com/a/check').read())['tls_version'])" > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python3.4/json/__init__.py", line 312, in loads >s.__class__.__name__)) > TypeError: the JSON object must be str, not ‘bytes' > Huh, just tested, my original snippet works on Python 3.6 but fails on Python 3.5. -- https://mail.python.org/mailman/listinfo/python-list
Help? How do i solve this problem with Python List Concept
In the traditional Yoruba tribal Set-Up in Nigeria,West Africa the tradition of inheritance is very important. Now, The relative position of a child in the family counts when the issue of inheritance is considered. Question: Now a farmer with 10 children died without leaving a will and the Family "Ebi"(Which consist of the extended family) decided that the property would be in proportion of their respective age. The Children were born with 3 years intervals except the second to last and the last born with the interval of 2 and 4 years respectively. Use the concept of list to write a simple python program to generate the individual children inheritance if the man left N230,000 Before his death -- https://mail.python.org/mailman/listinfo/python-list
NEWB: General purpose list iteration?
I'm a real Python NEWB and am intrigued by some of Python's features, so I'm starting to write code to do some things to see how it works. So far I really like the lists and dictionaries since I learned to love content addressability in MATLAB. I was wondering it there's a simple routine (I think I can write a recurisve routine to do this.) to scan all the elements of a list, descending to lowest level and change something. What I'd like to do today is to convert everything from string to float. So, if I had a list of lists that looked like: [['1.1', '1.2', '1.3'], [['2.1', '2.2'], [['3.1', '3.2'], ['4.1', '4.2' and I'd like it to be: [[1.1, 1.2, 1.3], [[2.1, 2.2], [[3.1, 3,2], [4.1, 4.2 is there just a library routine I can call to do this? Right now, I'm using 'for' loops nested to the maximum depth anticipated. for i in range(len(list)): for j in range(len(list[i])): for k in range(len(list[i][j])): etc list[i][j][...] = float(list[i][j][]) Which works but is not pretty. I was just looking for a way to say: listb = float(lista) However, the way I've started jamming everything into lists and dictionaries, I'm sure I'll be needing to do other in-place conversions similar to this in the future. -- Donald Newcomb DRNewcomb (at) attglobal (dot) net -- http://mail.python.org/mailman/listinfo/python-list
Re: NEWB: General purpose list iteration?
"Devan L" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This will just do_something(object) to anything that is not an > iterable. Only use it if all of your nested structures are of the same > depth. Cool! I'll try it. -- Donald Newcomb DRNewcomb (at) attglobal (dot) net -- http://mail.python.org/mailman/listinfo/python-list
Re: NEWB: General purpose list iteration?
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > A non-recursive approach: > > def enumerate_ex(items): > stack = [(enumerate(items), items)] > while stack: > en, seq = stack[-1] > for index, item in en: > if isinstance(item, list): > stack.append((enumerate(item), item)) > break > yield index, seq[index], seq > else: > stack.pop() It's going to take me a while to figure out exactly what that does but it sure does what I wanted it to. Thanks. -- Donald Newcomb DRNewcomb (at) attglobal (dot) net -- http://mail.python.org/mailman/listinfo/python-list
Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?
> On Nov 7, 2014, at 10:46 AM, Paul Moore wrote: > > I'm in the process of developing an automated solution to allow users > to quickly set up a Windows box so that it can be used to compile > Python extensions and build wheels. While it can obviously be used by > Windows developers who want to quickly set up a box, my main target is > Unix developers who want to provide wheels for Windows users. > > To that end, I'd like to get an idea of what sort of access to Windows > a typical Unix developer would have. I'm particularly interested in > whether Windows XP/Vista is still in use, and whether you're likely to > already have Python and/or any development tools installed. Ideally, a > clean Windows 7 or later virtual machine is the best environment, but > I don't know if it's reasonable to assume that. > > Another alternative is to have an Amazon EC2 AMI prebuilt, and users > can just create an instance based on it. That seems pretty easy to do > from my perspective but I don't know if the connectivity process > (remote desktop) is a problem for Unix developers. > > Any feedback would be extremely useful. I'm at a point where I can > pretty easily set up any of these options, but if they don't turn out > to actually be usable by the target audience, it's a bit of a waste of > time! :-) > > Thanks, > Paul > ___ > Distutils-SIG maillist - distutils-...@python.org > https://mail.python.org/mailman/listinfo/distutils-sig As an *nix user I have a Windows 7 VM on my OS X machine that I can also dual boot into which I mostly use for playing games that won’t play on my OS X box natively. It does not have Python or any development tooling installed on it. I also have access to the cloud(tm) which is where I normally spin up a whatever-the-most-recent-looking-name Windows Server. --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA -- https://mail.python.org/mailman/listinfo/python-list
Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition
> On Dec 10, 2014, at 11:59 AM, Bruno Cauet wrote: > > Hi all, > Last year a survey was conducted on python 2 and 3 usage. > Here is the 2014 edition, slightly updated (from 9 to 11 questions). > It should not take you more than 1 minute to fill. I would be pleased if you > took that time. > > Here's the url: http://goo.gl/forms/tDTcm8UzB3 > <http://goo.gl/forms/tDTcm8UzB3> > I'll publish the results around the end of the year. > > Last year results: https://wiki.python.org/moin/2.x-vs-3.x-survey > <https://wiki.python.org/moin/2.x-vs-3.x-survey> Just going to say http://d.stufft.io/image/0z1841112o0C <http://d.stufft.io/image/0z1841112o0C> is a hard question to answer, since most code I write is both. --- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA -- https://mail.python.org/mailman/listinfo/python-list
Instantiate all objects in a module?
I have my own module, called mystuff.py, which is to be imported for an app. The number of classes in the module will vary, so I need a subroutine that will instantiate all of them as objects, and assign a variable to each, regardless of what names the classes are. Then I need to be able to delete these objects from memory completely at times. Can someone recommend a subroutine for this? -- http://mail.python.org/mailman/listinfo/python-list
Best command for running shell command
I'm a little bit confused about what is the best way to run a shell command, if I want to run a command like xx -a -b > yy where I'm not interested in the output, I only want to make sure that the command was executed OK. How should I invoke this (in a Unix/linux environment)? The command module seem to give the resulting output and the various popen commands seem to be similar. -- http://mail.python.org/mailman/listinfo/python-list
Re: Using python with MySQL
On 1 May 2007 12:40:20 -0700, HMS Surprise <[EMAIL PROTECTED]> wrote: > I need to peform some simple queries via MySQL. Searching the list I > see that folks are accessing it with python. I am very new to python > and pretty new to MySQL too. Would appreciate it if you could point me > to some documentation for accessing MySQL via python. Something of the > "Python and MySQL for Dummies" caliber would be about my speed, but of > course I will be thankful for anything offered. http://mysql-python.sourceforge.net/ -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Installing Python in a path that contains a blank
On 5/21/07, John Machin <[EMAIL PROTECTED]> wrote: > Is there not a similar trick on MacOS X? It's called a symlink: ln -s /Users/gdonald /foo -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Wing IDE for Python v. 3.0 beta1 released
On 8/1/07, John K Masters <[EMAIL PROTECTED]> wrote: > If their support for paid customers is anything like their support for > prospective customers then I would leave well alone. I had no problems with their support whatsoever, really good in my opinion. They were very responsive and addressed all my questions over about a 3 or 4 day email conversation. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Emacs + python
On 8/1/07, hg <[EMAIL PROTECTED]> wrote: > Are there any cscope & ECB equivalent for Python ? ECB is not language specific. It works the same for browsing Python code as any other language. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: I am giving up perl because of assholes on clpm -- switching to Python
On 8/11/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > I had this very same problem with the doxygen mailing list... doxygen is > such a great tool but full of assholes in their mailing list. I'm not defending any assholes you may have ran into, but I find the thing to do is only ask questions in such a way that no one can possibly have a reason to be an asshole. http://catb.org/~esr/faqs/smart-questions.html -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: some problems with mod_python
On 8/27/07, Johan <[EMAIL PROTECTED]> wrote: > This I added to httpd.conf > > AllowOverride All > AddHandler mod_python .py > PythonHandler mptest > PythonDebug On > This is the syntax I have working locally: # mod_python AddHandler python-program .py PythonHandler test PythonDebug On In particular my AddHandler directive is different from yours. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: any better code to initalize a list of lists?
John wrote: > For my code of radix sort, I need to initialize 256 buckets. My code > looks a little clumsy: > > radix=[[]] > for i in range(255): >radix.append([]) > > any better code to initalize this list? radix = [[[]]*256][0] -- -- http://mail.python.org/mailman/listinfo/python-list
Re: Python shell on mac os x
On 15 Mar 2007 14:56:13 -0700, Bert Heymans <[EMAIL PROTECTED]> wrote: > >>> ^[OA^[OC^[OD Is your python built with readline support? Also, you might check out iPython. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Removing Python 2.4.4 on OSX
On 24 Mar 2007 10:30:28 -0700, Robert Hicks <[EMAIL PROTECTED]> wrote: > I want to upgrade to 2.5 but I don't see any unistall instructions > anywhere. You're not required to remove the old version before installing the new version. Just install the new version somewhere like /usr/local and put /usr/local/bin ahead of your other paths. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Removing Python 2.4.4 on OSX
On 24 Mar 2007 12:10:12 -0700, 7stud <[EMAIL PROTECTED]> wrote: > Can you explain how that works? If you install python in /usr/local, > doesn't that leave you with something like /usr/local/python? So what > does putting usr/local/bin ahead of your other paths do? ./configure --prefix=/usr/local Then python would be /usr/local/bin/python. For bash put this somewhere near the end of your .bashrc or /etc/bashrc: export PATH="/usr/local/bin:$PATH" Then when you attempt to run the python binary it will be found in the place you installed it first, not where the system version was installed. http://en.wikipedia.org/wiki/Path_%28computing%29 -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
smtplib startls() + quit()
When using starttls(), calling quit() throws an exception: -> server.quit() (Pdb) n send: 'quit\r\n' sslerror: (8, 'EOF occurred in violation of protocol') For the moment I and catching it like so: try: # this throws an exception when using tls server.quit() except: pass Is there some other way to tear down the connection besides calling quit() ? Thanks, -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
ipython env
Anyone know what's up with environment variables when using ipython? When I type 'env' and hit return I get a dictionary full of useful information (trimmed for brevity): In [1]: env Out[1]: {'EDITOR': '/usr/bin/vim', [...] '_': '/Library/Frameworks/Python.framework/Versions/Current/bin/ipython', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0'} But then when try to access the information in the dictionary it doesn't seem to exist: In [2]: env['EDITOR'] --- exceptions.NameError Traceback (most recent call last) /Users/destiney/ NameError: name 'env' is not defined Thanks, -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: ipython env
On 4/5/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > NameError: name 'env' is not defined > > Try os.environ Thanks. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Why NOT only one class per file?
On 4/6/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > For one liners, wouldn't > > ECHO the text line >the.file > > be more appropriate? # dd if=/dev/tty of=/dev/hda1 -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python editor/IDE on Linux?
On 13 Apr 2007 12:54:08 -0700, azrael <[EMAIL PROTECTED]> wrote: > try wing ide. i tried it and i love it. it's available for windows as > well for linux Good thing those are the only two operating system out there.. err.. I meant, good thing there's Emacs. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python editor/IDE on Linux?
On 4/13/07, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Thanks God No problem. > , there's no "PIDA for Emacs". Pet Industry Distributors Association ? -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python editor/IDE on Linux?
On 4/13/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Except for real programmers... That's correct. We use: # dd if=/dev/tty of=/dev/hda1 and such. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list
Python Help
To all, Just requesting Python Help - currently taking online courses for Computer Science degree. Is anyone willing to help on some issues. Please let me know, thank you. Donald Bozeman -- http://mail.python.org/mailman/listinfo/python-list
python-2.5.2 src rpm
Hello, I am trying to install python 2.5.2 onto enterprise linux, and would like to start with a source rpm package so that I can build the package locally and make sure I have all necessary dependencies. I have been unable to locate a source rpm package for python 2.5.2 or any version of 2.5 for that matter. Any pointers would be appreciated. Donald Raikes | Accessibility Specialist Phone: +1 602 824 6213 | Fax: +1 602 824 6213 | Mobile: +1 520 271 7608 Oracle JDeveloper QA "Please consider your environmental responsibility before printing this e-mail" -- http://mail.python.org/mailman/listinfo/python-list
Re: string find/replace
On Dec 1, 12:36 pm, Carlo wrote: > Hello, > > I want the Python equivalent of the Perl expression: > s/([a-z])([A-Z])/\1 \2/g > In plain language: place a space between a lowercase and uppercase > letter. I get lost in the RE module. Can someone help me? > > Thanks! This will also replace '_' with space:: recamelsub = re.compile(r"([a-z])([A-Z])").sub def spacify(string): """ Replace '_' with space & insert space between lower & upper case letters """ return recamelsub(r"\1 \2", string.replace('_',' ')) -- http://mail.python.org/mailman/listinfo/python-list
Re: Fwd: ftplib sending data out of order
dude, you're totally welcome. just make sure that you vote the current wiki admins out of office. THEY'RE FIRED ! -- https://mail.python.org/mailman/listinfo/python-list
Re: Fwd: ftplib sending data out of order
Charles , please look up the main python wiki here: https://practical-scheme.net/wiliki/wiliki.cgi?python -- https://mail.python.org/mailman/listinfo/python-list
Installing programs that depend on, or are, python extensions.
I have noticed that installing python programs tends to be hell, particularly under windows, and installing python programs that rely on, or in large part are, python extensions written in C++ tends to be hell on wheels with large spiky knobs and scythes on the wheels. Is this because such install are inherently hard to do and hard to write, or is it because Install tends to be done last, and therefore not done at all? Can anyone suggest any examples of such a program with a clean windows install that shows how it was done? By windows install, I mean you run setup.exe, and get a program group, file types registered, and an entry in the add/remove programs list, I do not mean fourteen pages of direly incomplete notes which do not actually work for versions later than 1.01, and do not work for version 1.01 unless one has already installed the complete developer environment. -- http://mail.python.org/mailman/listinfo/python-list
Re: Installing programs that depend on, or are, python extensions.
On Apr 30, 6:39 pm, David Cournapeau wrote: > On Sat, Apr 30, 2011 at 2:19 PM, James A. Donald > wrote: > > > I have noticed that installingpythonprograms tends to be hell, > > particularly underwindows, and installingpythonprograms that rely > > on, or in large part are,pythonextensionswritten in C++ tends to be > > hell on wheels with large spiky knobs and scythes on the wheels. > > > Is this because suchinstallare inherently hard to do and hard to > > write, or is it becauseInstalltends to be done last, and therefore > > not done at all? > > Most likely both. > > Packaging complex application is hard, and I think few programmers > like doing it, so it is rarely done correctly. > > > > > Can anyone suggest any examples of such a program with a cleanwindows > >installthat shows how it was done? > > > Bywindowsinstall, I mean you run setup.exe, and get a program group, > > file types registered, and an entry in the add/remove programs list, I > > do not mean fourteen pages of direly incomplete notes which do not > > actually work for versions later than 1.01, and do not work for > > version 1.01 unless one has already installed the complete developer > > environment. > > Well,pythonitself is a reasonably good example I think. But if you > are interested in having onepythonprogram which is a one clickinstallwithout > requiring the user to eveninstallpython, you will > need to look into tools like py2exe which can create all the files > necessary to do so from an existingpythonpackage. Then, you package > those files into a nice installer. I like nsis, which is open source > and relatively well documented, but there are other solutions as well. > > cheers, > > David py2exe would work, but a correct installer would install Python if not present, then install the program. -- http://mail.python.org/mailman/listinfo/python-list
Cannot import GDAL
I am new to Python and I am trying to utilize GDAL. I installed Python 3.6. The version I get when I activate IDLE is: MSC v.1900 32 bit (Intel)] on win32. In downloading the GDAL bindings the latest version I can find is release-1800-gdal-2-1-2-mapserver-7-0-2 so I installed the following: gdal-201-1800-core.msi and GDAL-2.1.2.win32-py3.4.msi. I added C:\Program Files\GDAL to my path and added the system variables GDAL_DATA = C:\Program Files\GDAL\gdal-data and\ GDAL_DRIVER_PATH = C:\Program Files\GDAL\gdalplugins When I open IDLE and type the following: from osgeo import gdal I get the following error >>> from osgeo import gdal Traceback (most recent call last): File "", line 1, in from osgeo import gdal ModuleNotFoundError: No module named 'osgeo' >>> I have been all over the internet looking for answer but have found none that work. Some real help here would be appreciated. Thanks, Don -- https://mail.python.org/mailman/listinfo/python-list
yum repository
What yum repository do you use to pick up python rpms? Don -- http://mail.python.org/mailman/listinfo/python-list
Pmw.ScrolledText
I am attempting to put together a "dumb terminal" using a Pmw.ScrolledText to communicate via a serial port with a box that does the echoing of characters it receives. How can I stop the ScrolledText from echoing characters typed to it? Or lacking that, how can I know when a character has been echoed so that I can write a backspace to the displayed text? Maybe there is a better widget for this application? Don -- http://mail.python.org/mailman/listinfo/python-list
Re: Ron Grossi: God is not a man
MC05 wrote: > "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> 4) I doubt seriously whether God plays a guitar, since guitars are >> made by men, for men. His Son could theoretically play a guitar. Perhaps >> He does. Perhaps He doesn't. Only the Father and His Holy >> Angels know. > > So then Lucifer was a wicked bass player whose sex and drugs and rock > n roll alientated the rest of the band and was fired? 1) Lucifer was an angel who rebelled against God, not a member of a human rock 'n roll band. 2) Since Lucifer is an angel, I doubt seriously whether he can play a bass guitar or other musical instrument. As I said in my last post, musical instruments are made by men for men, not angels. 3) Since Lucifer is an angel, he does not engage in sexual relations. (Christ tells us that angels don't engage in sexual relations by His Own Words.) 4) Drugs and rock 'n roll are created by men for men, not angels. And the green plants of the Earth were created by a Gracious God for His beloved creations, the men of the Earth. 5) Lucifer was not a member of a rock 'n roll band. He is a spirit, not a man. 6) While we are on the subject of rock 'n roll, any such band which contains horns is pure crap anyway (or seriously living in the dark ages). Horns don't belong in rock 'n roll bands. Rock 'n roll has advanced light-years beyond Elvis. It is the 21st Century, not the 20th. -- Donald L McDaniel Please reply to the original thread, so that the thread may be kept intact. == -- http://mail.python.org/mailman/listinfo/python-list
Re: Ron Grossi: God is not a man
MC05 wrote: > "sheltech" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> >> "MC05" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> >>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>>> >>>> 4) I doubt seriously whether God plays a guitar, since guitars are >>>> made by men, for men. His Son could theoretically play a guitar. >>>> Perhaps He does. Perhaps He doesn't. Only the Father and His Holy >>>> Angels know. >>> >>> So then Lucifer was a wicked bass player whose sex and drugs and >>> rock n roll alientated the rest of the band and was fired? >>> >>> >>> >> >> "Fired" good one > > Heh. Can't take credit for an accident. Your eye is better than > mine. :) The Devil has been fired...by God Himself. Read the Book of Revelation in the New Testament: Satan's end is clearly outlined by the Angel Jesus sent to St. John. This end is very clear: he will be cast alive into the Lake which burns with fire and brimstone, where he will be tormented day and night forever. Not only Satan and his angels will be cast into the Lake, but all those who follow him and his servants. I assure you, Satan won't be ruling anyone in the Fire. He will be in just as much torment as his followers. Neither will he have any sort of job. I strongly advise you to stop making fun of things you have no understanding of. Your eternal destiny depends on the way you treat others. -- Donald L McDaniel Please reply to the original thread, so that the thread may be kept intact. == -- http://mail.python.org/mailman/listinfo/python-list
Re: Ron Grossi: God is not a man
AKA wrote: > "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> MC05 wrote: >>> "sheltech" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>>> >>>> "MC05" <[EMAIL PROTECTED]> wrote in message >>>> news:[EMAIL PROTECTED] >>>>> >>>>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>>>> news:[EMAIL PROTECTED] >>>>>> >>>>>> 4) I doubt seriously whether God plays a guitar, since guitars >>>>>> are made by men, for men. His Son could theoretically play a >>>>>> guitar. Perhaps He does. Perhaps He doesn't. Only the Father >>>>>> and His Holy Angels know. >>>>> >>>>> So then Lucifer was a wicked bass player whose sex and drugs and >>>>> rock n roll alientated the rest of the band and was fired? >>>>> >>>>> >>>>> >>>> >>>> "Fired" good one >>> >>> Heh. Can't take credit for an accident. Your eye is better than >>> mine. :) >> >> The Devil has been fired...by God Himself. Read the Book of >> Revelation in the New Testament: Satan's end is clearly outlined by >> the Angel Jesus sent to St. John. This end is very clear: he will >> be cast alive into the Lake which burns with fire and brimstone, >> where he will be tormented day and night forever. >> >> Not only Satan and his angels will be cast into the Lake, but all >> those who follow him and his servants. I assure you, Satan won't be >> ruling anyone in the Fire. He will be in just as much torment as >> his followers. Neither will he have any sort of job. >> >> I strongly advise you to stop making fun of things you have no >> understanding of. Your eternal destiny depends on the way you treat >> others. >> >> -- >> Donald L McDaniel >> Please reply to the original thread, >> so that the thread may be kept intact. >> == >> > Just imagine if you actually had a coherent thought. My Bible tells me that the Truth sounds like foolishness to a perishing man. Are you perishing? God threw out a life-raft for you. Jesus is more than willing to rescue a drowning man. Go to the nearest church(Roman Catholic, Eastern Orthodox), and ask how you can be saved from your sin. -- Donald L McDaniel Please reply to the original thread, so that the thread may be kept intact. == -- http://mail.python.org/mailman/listinfo/python-list
Re: Ron Grossi: God is not a man
Johnny Gentile wrote: > Donald - go away. Far away. Now. > And, for the last time (hopefully), stop crossposting to > rec.music.beatles. > Go sell crazy somewhere else. We're all stocked up. > > Donald L McDaniel wrote: >> AKA wrote: >>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>>> MC05 wrote: >>>>> "sheltech" <[EMAIL PROTECTED]> wrote in message >>>>> news:[EMAIL PROTECTED] >>>>>> >>>>>> "MC05" <[EMAIL PROTECTED]> wrote in message >>>>>> news:[EMAIL PROTECTED] >>>>>>> >>>>>>> "Donald L McDaniel" <[EMAIL PROTECTED]> wrote in message >>>>>>> news:[EMAIL PROTECTED] >>>>>>>> >>>>>>>> 4) I doubt seriously whether God plays a guitar, since guitars >>>>>>>> are made by men, for men. His Son could theoretically play a >>>>>>>> guitar. Perhaps He does. Perhaps He doesn't. Only the Father >>>>>>>> and His Holy Angels know. >>>>>>> >>>>>>> So then Lucifer was a wicked bass player whose sex and drugs and >>>>>>> rock n roll alientated the rest of the band and was fired? >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> "Fired" good one >>>>> >>>>> Heh. Can't take credit for an accident. Your eye is better than >>>>> mine. :) >>>> >>>> The Devil has been fired...by God Himself. Read the Book of >>>> Revelation in the New Testament: Satan's end is clearly outlined >>>> by the Angel Jesus sent to St. John. This end is very clear: he >>>> will be cast alive into the Lake which burns with fire and >>>> brimstone, where he will be tormented day and night forever. >>>> >>>> Not only Satan and his angels will be cast into the Lake, but all >>>> those who follow him and his servants. I assure you, Satan won't >>>> be ruling anyone in the Fire. He will be in just as much torment >>>> as his followers. Neither will he have any sort of job. >>>> >>>> I strongly advise you to stop making fun of things you have no >>>> understanding of. Your eternal destiny depends on the way you >>>> treat others. >>>> >>>> -- >>>> Donald L McDaniel >>>> Please reply to the original thread, >>>> so that the thread may be kept intact. >>>> == >>>> >>> Just imagine if you actually had a coherent thought. >> >> My Bible tells me that the Truth sounds like foolishness to a >> perishing man. Are you perishing? God threw out a life-raft for >> you. Jesus is more than willing to rescue a drowning man. Go to >> the nearest church(Roman Catholic, Eastern Orthodox), and ask how >> you can be saved from your sin. >> >> -- >> Donald L McDaniel >> Please reply to the original thread, >> so that the thread may be kept intact. >> == 1) I am posting to a newsgroup on the Microsoft Usenet Server. It's not my fault the demon-lover who posted the original anti-Christian article cross-posted to so many newsgroups across so many servers. Talk to him about cross-posting. 1) I will go away, when Christ returns for me. I hope you are ready for His return, else you are in for a living Hell here on the Earth before the REAL Hell rises up to swallow you in its Flames. -- Donald L McDaniel Please reply to the original thread, so that the thread may be kept intact. == -- http://mail.python.org/mailman/listinfo/python-list
Re: Python not giving free memory back to the os get's me in real problems ...
[EMAIL PROTECTED] wrote: > So I read quite a few things about this phenomenon in Python 2.4.x but > I can hardly believe that there is really no solution to my problem. > > We use a commercial tool that has a macro functionality. These macros > are written in python. So far nothing extraordinary. > > Our (python-)macro uses massively nested loops which are unfortunately > necessary. These loops perform complex calculations in this commercial > tool. To give you a quick overview how long this macros runs: > > The outer loop takes 5-7 hours for one cycle. Each cycle creates one > outputfile. So we would like to perform 3-5 outer cycles en bloc. > Unfortunately one of our computers (768MB RAM) crashes after just ~10% > of the first cycle with the following error message: > > http://img2.freeimagehosting.net/uploads/7157b1dd7e.jpg > > while another computer (1GB RAM) crashes after ~10% of the fourth > loop. While the virtual memory on the 1gb machine was full to the > limit when it crashed the memory usage of the 768mb machine looked > this this: > > http://img2.freeimagehosting.net/uploads/dd15127b7a.jpg > > The moment I close the application that launched the macro, my > ressources get freed. > > So is there a way to free my memory inside my nested loops? > > thanks in advance, > tim > Could you split the program into one handling the outer loop and calling another program, with data transfer, to handle the inner loops? - Paddy. -- http://mail.python.org/mailman/listinfo/python-list
Re: Where did my post go?
[EMAIL PROTECTED] wrote: > I posted to this newsgroup earlier about my annoyances with python and > now I can't find the post. What did you do with it? > I notice a gmail address. Google groups was not updated for over a day and is still 'behind'. Try another news reader. - Paddy -- http://mail.python.org/mailman/listinfo/python-list
Re: EuroPython vs PyconUK
EuGeNe Van den Bulke wrote: > I do realize that the UK is not really part of Europe (no polemic :P) > but I am nevertheless curious about the logic behind creating another > major Python event in Europe. Wasn't EuroPython enough? > > Like many I am sure, I probably won't be able to attend both (and I > really enjoyed the Geneva experience so definitely want to renew "it"). > How would you go about selecting which conference to attend? > > They are only 2 months apart, 6 would have been easier for the > attendees! Could the organizers liaise one way or another to make > Pythoneers life as easy and fun as the language and give as much > information out as possible as early as possible (early bird early) for > people to make the best decision? > > I know marketing matters but ... > > EuGeNe -- http://www.3kwa.com Growth! -- http://mail.python.org/mailman/listinfo/python-list
Re: Is Python really a scripting language?
Doug Morse wrote: > although perhaps not a part of the definition of scripting languages per se, > one aspect of them is that they are often used to "glue" a wide variety of > other components together. perl's initial and continued success is in no > small part to all the wrappers and interfaces it has to all sorts of other > software components and applications. part of python's utility, IMHO, is the > ease with which it can be used, like perl, to glue together a lot of disparate > parts. > But here's my problem, most of my coworkers, when they see my apps and learn that they are written in Python ask questions like, "Why would you write that in a scripting language?" Whenever I hear a comment like that I can feel myself boiling inside. I'm with Doug on this. Python *is* a scripting language which is a *good* thing. It's their perceptions of what scripting languages are capable of that are out-of-date. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list
Re: alternating string replace: Extended input (Long).
cesco wrote: I created some more test strings and ran posters solutions against them. results attached. - Paddy. # alternating_replacements.py tests = " 1 2_ 3_4 5_6_ 7_8_9 10_11_12_ 13_14_15_16 17_18_19_20_" \ " _ _21 _22_ _23_24 _25_26_ _27_28_29 _30_31_32_ _33_34_35_36" \ " __ ___ _".split(" ") def altrep0(s): s1 = s.split("_") s1 = [s1[i]+":"+s1[i+1] for i in range(0,len(s1),2)] s1 = ",".join(s1) return s1 altrep0.author="Frederik Lundh" def altrep1(s): from re import sub def repl(o): repl.n = not repl.n return ":" if repl.n else "," repl.n = False return sub("_", repl, s) altrep1.author="bearophile" def altrep2(s): evenOrOdd = True s2 = "" for i in s: if i == '_': if evenOrOdd: s2 += ':' evenOrOdd = not evenOrOdd else: s2 += ',' evenOrOdd = not evenOrOdd else: s2 += i return s2 altrep2.author="cokofree" def altrep3(s): import re from itertools import cycle return re.sub("_", lambda m, c=cycle(":,").next: c(), s) altrep3.author="Peter Otten" def altrep4(s): from itertools import islice, cycle def interleave(*iterators): iterators = [ iter(i) for i in iterators ] while 1: for i in iterators: yield i.next() def punctuate(s): parts = s.split('_') punctuation = islice(cycle(':,'), len(parts)-1) return ''.join(interleave(parts, punctuation)) return punctuate(s) altrep4.author="Duncan Booth" def altrep5(s): import re return re.sub(r'([^_]+)_([^_]+)_?', r'\1:\2;', s) altrep5.author="Pablo Ziliani" progs = [ altrep0, altrep1, altrep2, altrep3, altrep4, altrep5] def testall(): ''' >>> testall() ## Program by: Frederik Lundh '' RETURNS '' '1' RETURNS '' '2_' RETURNS '2:' '3_4' RETURNS '3:4' '5_6_' RETURNS '' '7_8_9' RETURNS '' '10_11_12_' RETURNS '10:11,12:' '13_14_15_16' RETURNS '13:14,15:16' '17_18_19_20_' RETURNS '' '_' RETURNS ':' '_21' RETURNS ':21' '_22_' RETURNS '' '_23_24' RETURNS '' '_25_26_' RETURNS ':25,26:' '_27_28_29' RETURNS ':27,28:29' '_30_31_32_' RETURNS '' '_33_34_35_36' RETURNS '' '__' RETURNS '' '___' RETURNS ':,:' '' RETURNS '' '_' RETURNS ':,:,:' ## Program by: bearophile '' RETURNS '' '1' RETURNS '1' '2_' RETURNS '2:' '3_4' RETURNS '3:4' '5_6_' RETURNS '5:6,' '7_8_9' RETURNS '7:8,9' '10_11_12_' RETURNS '10:11,12:' '13_14_15_16' RETURNS '13:14,15:16' '17_18_19_20_' RETURNS '17:18,19:20,' '_' RETURNS ':' '_21' RETURNS ':21' '_22_' RETURNS ':22,' '_23_24' RETURNS ':23,24' '_25_26_' RETURNS ':25,26:' '_27_28_29' RETURNS ':27,28:29' '_30_31_32_' RETURNS ':30,31:32,' '_33_34_35_36' RETURNS ':33,34:35,36' '__' RETURNS ':,' '___' RETURNS ':,:' '' RETURNS ':,:,' '_' RETURNS ':,:,:' ## Program by: cokofree '' RETURNS '' '1' RETURNS '1' '2_' RETURNS '2:' '3_4' RETURNS '3:4' '5_6_' RETURNS '5:6,' '7_8_9' RETURNS '7:8,9' '10_11_12_' RETURNS '10:11,12:' '13_14_15_16' RETURNS '13:14,15:16' '17_18_19_20_' RETURNS '17:18,19:20,' '_' RETURNS ':' '_21' RETURNS ':21' '_22_' RETURNS ':22,' '_23_24' RETURNS ':23,24' '_25_26_' RETURNS ':25,26:' '_27_28_29' RETURNS ':27,28:29' '_30_31_32_' RETURNS ':30,31:32,' '_33_34_35_36' RETURNS ':33,34:35,36' '__' RETURNS ':,' '___' RETURNS ':,:' '' RETURNS ':,:,' '_' RETURNS ':,:,:' ## Program by: Peter Otten '' RETURNS '' '1' RETURNS '1' '2_' RETURNS '2:' '3_4' RETURNS '3:4' '5_6_' RETURNS '5:6,' '7_8_9' RETURNS '7:8,9' '10_11_12_' RETURNS '10:11,12:' '13_14_15_16' RETURNS '13:14,15:16' '17_18_19_20_' RETURNS '17:18,19:20,' '_' RETURNS ':' '_21' RETURNS ':21' '_22_' RETURNS ':22,' '_23_24' RETURNS ':23,24' '_25_26_' RETURNS ':25,26:' '_27_28_29' RETURNS ':27,28:29' '_30_31_32_' RETURNS ':30,31:32,' '_33_34_35_36' RETURNS ':33,34:35,36' '__' RETURNS ':,' '___' RETURNS ':,:' '' RETURNS ':,:,' '_' RETURNS ':,:,:' ## Program by: Duncan Booth '' RETURNS '' '1' RETURNS '1' '2_' RETURNS '2:' '3_4' RETURNS '3:4' '5_6_' RETURNS '5:6,' '7_8_9' RETURNS '7:8,9' '10_11_12_' RETURNS '10:11,12:' '13_14_15_16' RETURNS '13:14,15:16' '17_18_19_20_' RETURNS '17:18,19:20,' '_' RETURNS ':' '_
Re: Is their an expression to create a class?
Chris Rebert wrote: On Tue, Mar 17, 2009 at 2:24 PM, Robert Kern wrote: On 2009-03-17 16:13, Paddy wrote: We the def statement and the lambda expression. We have the class statement, but is their an expression to create a class? Or: def F(): pass type(F) # Is to: F2 = lambda : none type(F2) # As class O(object): pass type(O) # is to: # type('O', (object,), {}) Further detail from the docs (http://docs.python.org/library/functions.html): type(name, bases, dict) Return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the __name__ attribute; the bases tuple itemizes the base classes and becomes the __bases__ attribute; and the dict dictionary is the namespace containing definitions for class body and becomes the __dict__ attribute. For example, the following two statements create identical type objects: >>> class X(object): ... a = 1 ... >>> X = type('X', (object,), dict(a=1)) New in version 2.2. Cheers, Chris Thanks guys. Youve put my mind at rest! - Paddy. -- http://mail.python.org/mailman/listinfo/python-list
scaling problems
I am just getting into python, and know little about it, and am posting to ask on what beaches the salt water crocodiles hang out. 1. Looks to me that python will not scale to very large programs, partly because of the lack of static typing, but mostly because there is no distinction between creating a new variable and utilizing an existing variable, so the interpreter fails to catch typos and name collisions. I am inclined to suspect that when a successful small python program turns into a large python program, it rapidly reaches ninety percent complete, and remains ninety percent complete forever. 2. It is not clear to me how a python web application scales. Python is inherently single threaded, so one will need lots of python processes on lots of computers, with the database software handling parallel accesses to the same or related data. One could organize it as one python program for each url, and one python process for each http request, but that involves a lot of overhead starting up and shutting down python processes. Or one could organize it as one python program for each url, but if one gets a lot of http requests for one url, a small number of python processes will each sequentially handle a large number of those requests. What I am really asking is: Are there python web frameworks that scale with hardware and how do they handle scaling? Please don't read this as "Python sucks, everyone should program in machine language expressed as binary numbers". I am just asking where the problems are. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
> > 1. Looks to me that python will not scale to very large programs, > > partly because of the lack of static typing, but mostly because there > > is no distinction between creating a new variable and utilizing an > > existing variable, Ben Finney > This seems quite a non sequitur. How do you see a connection between > these properties and "will not scale to large programs"? The larger the program, the greater the likelihood of inadvertent name collisions creating rare and irreproducible interactions between different and supposedly independent parts of the program that each work fine on their own, and supposedly cannot possibly interact. > These errors are a small subset of possible errors. If writing a large > program, an automated testing suite is essential, and can catch far > more errors than the compiler can hope to catch. If you run a static > code analyser, you'll be notified of unused names and other simple > errors that are often caught by static-declaration compilers. That is handy, but the larger the program, the bigger the problem with names that are over used, rather than unused. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
> > 2. It is not clear to me how a python web application scales. Python > > is inherently single threaded, so one will need lots of python > > processes on lots of computers, with the database software handling > > parallel accesses to the same or related data. One could organize it > > as one python program for each url, and one python process for each > > http request, but that involves a lot of overhead starting up and > > shutting down python processes. Or one could organize it as one > > python program for each url, but if one gets a lot of http requests > > for one url, a small number of python processes will each sequentially > > handle a large number of those requests. What I am really asking is: > > Are there python web frameworks that scale with hardware and how do > > they handle scaling? Reid Priedhorsky > This sounds like a good match for Apache with mod_python. I would hope that it is, but the question that I would like to know is how does mod_python handle the problem - how do python programs and processes relate to web pages and http requests when one is using mod_python, and what happens when one has quite a lot of web pages and a very large number of http requests? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: scaling problems
On Mon, 19 May 2008 21:04:28 -0400, "David Stanek" <[EMAIL PROTECTED]> wrote: > What is the difference if you have a process with 10 threads or 10 > separate processes running in parallel? Apache is a good example of a > server that may be configured to use multiple processes to handle > requests. And from what I hear is scales just fine. > > I think you are looking at the problem wrong. The fundamentals are the > same between threads and processes. I am not planning to write a web server framework, but to use one. Doubtless a python framework could be written to have satisfactory scaling properties, but what are the scaling properties of the ones that have been written? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: writing python extensions in assembly
On Fri, 16 May 2008 11:21:39 -0400, "inhahe" <[EMAIL PROTECTED]> wrote: > They say that the C++ optimizer can usually optimize > better than a person coding in assembler by hand can, > but I just can't believe that, at least for me, > because when I code in assembler, if one hand compiles C++ into assembler, the result will doubtless be crap compared to what the compiler will generate. If, however, one expresses one's algorithm in assembler, rather than in C++, the result may well be dramatically more efficient than expressing one's algorithm in C++ and the compiler translating it into assembler. A factor of ten is quite common. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Wed, 21 May 2008 07:23:04 -0700 (PDT), Paul Boddie > MySQL appears to use "repeatable read" by default [1] as its > transaction isolation level, whereas PostgreSQL (for example) uses > "read committed" by default [2]. I would guess that if you were using > PostgreSQL, this particular problem would not have occurred, but there > are other reasons to be aware of the effects of long duration > transactions in PostgreSQL, and the practice of periodically > performing a rollback would still be worth considering with that > database system. If one has transactions open for a long time, or transactions that involve a great deal of data, this will result in poor performance or poor scalability. But one may have such large transactions without being aware of it. Is there any way to make transaction size salient to the developer? Any way to make sure one is committing as early and often as possible? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Mon, 02 Jun 2008 20:59:09 -0700, <[EMAIL PROTECTED]> wrote: James A. Donald > > If one has transactions open for a long time, or transactions that > > involve a great deal of data, this will result in poor performance or > > poor scalability. But one may have such large transactions without > > being aware of it. Is there any way to make transaction size salient > > to the developer? Any way to make sure one is committing as early and > > often as possible? Dennis Lee Bieber > I would tend to suggest that one code to collect all needed > information for a complete transaction /before/ even starting a > transaction; then one can start it and feed all the operations in short > order. > > Now, if the application requires doing something like: > > select set of data > repeat until user is done > display by record to user > wait for user response > issue update for record > commit transaction > > this becomes problematic. Well obviously one should do the former and not the latter, but one may well start out doing the former and gradually drift into doing the latter without entirely being aware of it. > A more complex method would be: > > select set of data; save in local storage; commit > repeat until user is done > display saved record to user > wait for user response > save modified record (second storage) > repeat until no conflicts > select original set again > repeat until done > if saved original <> reselected original > if saved original had been modified by user > User interaction: override other changes > or redisplay and get edits from > user > transaction begin > issue all updates > commit Having drifted into doing things the wrong way without being aware of it, one would then wait until ones application comes to a grinding halt due to scaling problems, figure out what was causing the problem, and then recode by the more complex method you describe. At that point, however, one would belatedly discover that one's schema made the more complex method hideously complex for the programmer and incomprehensible to the user, and that it was far too late to change the schema. I suppose there is no help for it but to be mindful of scaling and transactions from the beginning. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Database Query Contains Old Data
On Tue, 03 Jun 2008 12:07:07 +0200, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > As others have mentioned, in systems that have long running logical > transactions, it's usually best to collect the data until the very > end and then apply all changes in one go (and one database > transaction). I understand you to mean that one should arrange matters so that what is a lengthy transaction from the point of view of the user is a short transaction from the point of view of the database. -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: Question: How do I format printing in python
Lie wrote: On Jun 24, 12:12 am, [EMAIL PROTECTED] wrote: Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual:http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial:http://heather.cs.ucdavis.edu/~matloff/Python/PythonIntro.pdf For example, how do I turn this: 512 Jun 5 2004 X11r6 22 Jan 17 2005 a2p 22 Jan 17 2005 acctcom 5374 Sep 15 2002 acledit 5664 May 13 2004 aclget 12020 May 13 2004 aclput 115734 Jun 2 2004 adb 46518 Jun 4 2004 admin 66750 Sep 16 2002 ali 1453 Sep 15 2002 alias 28150 Jun 4 2004 alog 15 May 12 2005 alstat into this: 512Jun 5 2004X11r6 22 Jan 17 2005a2p 22 Jan 17 2005acctcom 5374 Sep 15 2002acledit 5664 May 13 2004aclget 12020 May 13 2004aclput 115734 Jun 2 2004adb 46518 Jun 4 2004admin 66750 Sep 16 2002ali 1453 Sep 15 2002alias 28150 Jun 4 2004alog 15 May 12 2005alstat Thank you There is string formatting print formatspecifier_string % data_sequence The format specifier is similar to the one used in C's printf, and data sequence may be tuple or list. Dictionary may also be used for data, but it has its own way to specify string formatting since dictionary is unordered but "indexed" by the dict key. I have attached a prog I wrote to answer someones elses similar problem. - Paddy. from StringIO import StringIO from pprint import pprint as pp left_justified = False debug = False textinfile = '''I$created$a$solution$for$a$program$I$am$writing$that makes$columns$line$up$when$outputted$to$the$command line.$I$am$new$to$Python,$and$am$hoping$I$might$get some$input$on$this$topic.$In$the$text$file$that$the program$reads,$the$fields$(columns)$are$delimited$by 'dollar'$and$the$records$(lines)$are$delimited$by newlines$'\\n'.$So$one$line$looks$like:$''' """ Solution to problem posed at: http://www.kbrandt.com/2008/06/getting-command-line-output-columns-to.html Output is the following if left-justified: # Column-aligned output: Icreated asolution for a program Iam writing that makescolumns line up when outputted tothe command line.I am new toPython, and am hoping I might get some input on this topic.Inthe text filethat the program reads, the fields (columns) are delimited by 'dollar' and the records (lines) are delimited by newlines '\n'. So one line looks like: And like this if not left-justified: # Column-aligned output: I createda solution for a programI am writing that makes columns line up when outputtedto the command line. I am newto Python, and am hoping I might get some input on thistopic.In the textfile that the program reads, the fields (columns) are delimited by 'dollar' and the records (lines) are delimited by newlines '\n'. So one line looks like: """ infile = StringIO(textinfile) fieldsbyrecord= [line.strip().split('$') for line in infile] if debug: print "fieldsbyrecord:"; print (fieldsbyrecord) # pad to same number of fields per record maxfields = max(len(record) for record in fieldsbyrecord) fieldsbyrecord = [fields + ['']*(maxfields - len(fields)) for fields in fieldsbyrecord] if debug: print "padded fieldsbyrecord:"; print (fieldsbyrecord) # rotate fieldsbycolumn = zip(*fieldsbyrecord) if debug: print "fieldsbycolumn:"; print (fieldsbycolumn) # calculate max fieldwidth per column colwidths = [max(len(field) for field in column) for column in fieldsbycolumn] if debug: print "colwidths:"; print (colwidths) # pad fields in columns to colwidth with spaces # (Use -width for left justification,) fieldsbycolumn = [ ["%*s" % (-width if left_justified else width, field) for field in column] for width, column in zip(colwidths, fieldsbycolumn) ] if debug: print "padded fieldsbycolumn:"; print (fieldsbycolumn) # rotate again fieldsbyrecord = zip(*fieldsbycolumn) if debug: print "padded rows and fields, fieldsbyrecord:"; print (fieldsbyrecord) # printit print "\n# Column-aligned output:" for record in fieldsbyrecord: print " ".join(record) -- http://mail.python.org/mailman/listinfo/python-list
pprint module and newer standard types
Hi, When I try and use pprint on standard types I get varying 'quality of output'. Lists will wrap nicely to multiple lines as will dicts, but sets and defaultdicts give one long unreadable line. Is their a chance to get this changed so that more built-in types look pretty when printed with pprint? I just did a small trial on an early version of Python 3 and sets don't seem to obey pprint.pprints width argument, the same way that lists do: Python 3.0a1 (py3k:57844, Aug 31 2007, 16:54:27) [MSC v.1310 32 bit (Intel)] on win32 >>> from pprint import pprint as pp >>> pp(list(range(3)), width=4) [0, 1, 2] >>> pp(set(range(3)), width=4) {0, 1, 2} - Paddy. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python 2.5 adoption
Joseph Turian wrote: > Basically, we're planning on releasing it as open-source, and don't > want to alienate a large percentage of potential users. Then develop for 2.5 with an eye on what is to come this year in 2.6 with regard to already planned deprecations. - Paddy. -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
On Tue, 9 Sep 2008 14:35:13 -0700 (PDT), icarus <[EMAIL PROTECTED]> wrote: > Oh ok. Thanks. In windows xp I just renamed the file extension to .pyw > That did it. > > one more question... > > how do I create a pythonw standalone executable that works on w32, > linux, mac, etc..? I have noticed that when applications are written in Python with the GUI created by PyGTK, it seems that to install the application on each slightly different version of unix is a fairly major task - although the creators of PyGTK proudly say that the code will run anywhere, it definitely will not install anywhere - the code will only run on a slightly different system after a massive and major rewrite of the install for that target system. Horrible installs are a chronic problem GUI programs driven by interpreted languages Installing visual basic programs that worked on one Windows machine to work on a very slightly different windows machine was also a nightmare. I have not attempted to create installable wxPython windows, but generally, "run anywhere" will bite you. Still looking for a good solution to "run anywhere". -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
James A. Donald > > Horrible installs are a chronic problem of GUI programs driven by > > interpreted languages Installing visual basic programs that worked on > > one Windows machine to work on a very slightly different windows > > machine was also a nightmare. > > > > I have not attempted to create installable wxPython windows, but > > generally, "run anywhere" will bite you. Still looking for a good > > solution to "run anywhere". Mike Driscoll > I haven't had much trouble getting wxPython applications to run in > Windows XP and Ubuntu Hardy Heron. Did you attempt to create proper install packages that show up in the Linux package managers, and the windows add/remove programs tool? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
Re: wxpython ms-dos black window popping up in background
James A. Donald > > > > Horrible installs are a chronic problem of GUI programs driven by > > > > interpreted languages Installing visual basic programs that worked on > > > > one Windows machine to work on a very slightly different windows > > > > machine was also a nightmare. > > > > > > > > I have not attempted to create installable wxPython windows, but > > > > generally, "run anywhere" will bite you. Still looking for a good > > > > solution to "run anywhere". Mike Driscoll > I used Inno Setup which creates an uninstaller, however I am not > seeing it in my Windows Add/Remove. Odd. However, you can uninstall it > from the Start menu entry and it works. Could anyone tell me their experiences with NSIS? Has anyone tried scripting msi (Windows Installer 3.0 Redistributable) with Orca and the Windows SDK Components for Windows Installer Developers. How did it go. I notice that Python 2.4 is distributed as an msi file. I suspect there is a reason for that. Was that constructed with Orca? -- -- We have the right to defend ourselves and our property, because of the kind of animals that we are. True law derives from this right, not from the arbitrary power of the omnipotent state. http://www.jim.com/ James A. Donald -- http://mail.python.org/mailman/listinfo/python-list
RE: [External] Unsubscribe to Python email list
Yeah, I think I'm going to bail on this list too. Thanks -Original Message- From: Python-list [mailto:python-list-bounces+falter_donald=bah@python.org] On Behalf Of Pablo Lozano Sent: Thursday, March 9, 2017 9:38 PM To: python-list@python.org Subject: [External] Unsubscribe to Python email list Good day, I would like to unsubscribe this e-mail to the Python e-mail list. Kind regards -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
trouble installing python
Hello, I'm trying to install the 3.5.1 of Python and am running windows 7. I keep getting an error about api-ms-win-crt-runtime-|1-1-0.dll not being installed. Any advice on what is wrong? -- https://mail.python.org/mailman/listinfo/python-list