From jjinux at gmail.com Fri Aug 1 13:47:51 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 1 Aug 2008 04:47:51 -0700 Subject: [Baypiggies] Mike Cheponis at the Computer History Museum Message-ID: I stumbled across a great video of our own Mike Cheponis at the Computer History Museum: http://www.youtube.com/watch?v=BHTa3EfzrNE -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From kenobi at gmail.com Fri Aug 1 15:51:02 2008 From: kenobi at gmail.com (Rick Kwan) Date: Fri, 1 Aug 2008 06:51:02 -0700 Subject: [Baypiggies] Mike Cheponis at the Computer History Museum In-Reply-To: References: Message-ID: Ah, PDP-1 music! What a thing to wake up to in the morning. Completely brightened my day. :-) [Mike was good, too.] --Rick Kwan On Fri, Aug 1, 2008 at 4:47 AM, Shannon -jj Behrens wrote: > I stumbled across a great video of our own Mike Cheponis at the > Computer History Museum: > > http://www.youtube.com/watch?v=BHTa3EfzrNE > > -jj > > -- > Lisp programmers know the value of everything, but the cost of nothing... > On my Lisp, '() costs 4 bytes. > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From afife at untangle.com Fri Aug 1 23:20:23 2008 From: afife at untangle.com (Andrew Fife) Date: Fri, 1 Aug 2008 14:20:23 -0700 (PDT) Subject: [Baypiggies] Installfest for Schools (Next Week) Message-ID: <014301c8f41c$691f9c00$3b5ed400$@com> Hi Folks: This is a quick reminder that the Installfest for Schools in taking place on the expo floor at LinuxWorld next week (Tuesday, Wednesday & Thursday). We've got an ambitious goal of refurbishing 1,000 older/discarded computers with GNU/Linux for schools and we need all the help we can get. Here's how you can lend a hand: 1)Help install GNU/Linux (Ubuntu, Xubuntu, Edubuntu or gNewSense) 2)Help breakdown bad computers to identify reusable parts 3)Donate your old computer[1] -- ACCRC will have a collection booth and can provide tax deductable receipts 4)Know a school that needs computers and is willing to try GNU/Linux desktops? Please tell us here: http://www.untangle.com/index.php?option=com_collect&task=installfestNomin ate&Itemid=1426 Also, I'm pleased to announce a little help from our friends... Mozilla and Canonical/Ubuntu are donating schwag for installfest volunteers. Creative commons has packaged CC licensed and Ogg formatted multi-media content that will be placed on each system. And No Starch Press has made another extremely cool donation of a PDF copy of "Ubuntu for non-Geeks" for EVERY computer... What a great resource for newbies! Why the installfest is cool: 1)Digital Divide: Helps get computers to children/schools in need 2)F/OSS Outreach: Helps expose new users to Free & Open Source Software 3)Environment: Helps divert thousands of pounds of toxic electronic waste from the landfill 4)Community: Is a great cause to bring the community together around Lastly, don't forget to register for the LinuxWorld Expo. The passes are free if you register in advance, but $50 onsite. Register here: https://register.rcsreg.com/regos-1.0/lnsf2008/ga/index2.html Learn more about the installfest here: http://www.untangle.com/installfest Thanks so much for your help! -Andrew References & Notes: [1]PIII and newer systems will be refurbished with Ubuntu for schools. Older systems will be recycled properly by the ACCRC. Here is a writeup of the first event: http://lwn.net/Articles/273770/ and here are some pictures: http://www.untangle.com/index.php?option=com_content&task=view&id=355&Item id=139 -- Andrew Fife Untangle - The Open Source Network Gateway www.untangle.com/download 650.425.3327 desk 415.806.6028 cell -------------- next part -------------- An HTML attachment was scrubbed... URL: From spmcinerney at hotmail.com Fri Aug 1 23:53:40 2008 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Fri, 1 Aug 2008 14:53:40 -0700 Subject: [Baypiggies] =?windows-1256?q?_Carpooling/hotel_roomshare/BOF_arr?= =?windows-1256?q?angements_for_attending_SciPy_Conference=3F=FE?= Message-ID: Anyone who is attending SciPy Conference and wants to either: a) carpool (I plan to go down Mon 18th, daytime. Oneway only, don't need a ride back. I'm in Mtn View.) b) roomshare at the Marriott. I will be staying Mon 18th-Sat 23 Or at least roomshare for as many of those days as you're there. c) BOF: Matthew Turk wondered if anyone wanted to have a SF Bay Area SciPy BOF down at the conference (since many of us have South Bay folks have never met the Berkeley or Livermore folks). Sounds like a good idea, any interest, not sure if we have the numbers? Presumably we would schedule it to not conflict with other BOFs. Not sure which lunchtime or evening slot would work best? Regards, Stephen http://conference.scipy.org/Schedule:Tuesday-Wednesday, August 19-20: TutorialsThursday-Friday, August 21-22: ConferenceSaturday-Sunday, August 23-24: SprintsBOFs: evenings _________________________________________________________________ Use video conversation to talk face-to-face with Windows Live Messenger. http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_072008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at well.com Sat Aug 2 01:10:04 2008 From: jim at well.com (jim) Date: Fri, 01 Aug 2008 16:10:04 -0700 Subject: [Baypiggies] Help the LUG booth at LinuxWorld Message-ID: <1217632204.10905.570.camel@ubuntu> If you're coming to LinuxWorld, let me know if you can spend a little time at the common LUG booth in the .Org pavilion (booth #14). Coverage is still a little too light, we can use help on all days, Tuesday, Wednesday, and Thursday. Per Untangle's email re the installfest: Don't forget to register for the LinuxWorld Expo. The passes are free if you register in advance, but $50 onsite. Register here: https://register.rcsreg.com/regos-1.0/lnsf2008/ga/index2.html From john_re at fastmail.us Sat Aug 2 16:47:28 2008 From: john_re at fastmail.us (john_re) Date: Sat, 02 Aug 2008 07:47:28 -0700 Subject: [Baypiggies] Today Aug2 Sat Python at BerkeleyTIP - GNU(Linux)/BSD Talks Installfest Potluck ProgrammingParty Message-ID: <1217688448.28116.1266647649@webmail.messagingengine.com> Hi Fernando, Jerrod - I saw your posts on BayPiggies. IR Jarrod works at UCB & Fernando might have attended SciPy meetings at Berkeley. (StephenM who posted recently about carpools to SciPy informed me it wasn't he who works at UCB.) I think it would be a great fit to have SciPy people attend this global meeting. Not enough time to get word to your members this month, but perhaps you'd like to come by the meeting today & say "hi", if you are in the area. :) Hi BayPiggies - Or, any others interested in Python, come on by. 1130AM Painless Python Part 1 - Alex Martelli Feel free to also forward this to your members email list. ===== Join with us at the Free Speech cafe, 10AM-6PM. Further details at http://groups.google.com/group/berktip ===== VIDEO TALKS FOR AUGUST 2 MEETING ===== For this first meeting, today, Saturday, I've scheduled the following videos to watch (All times Pacific Daylight Savings Time, adjust for local time accordingly.): TENTATIVE SCHEDULE: 1000 AM-------------------------------------------------------------- Network1: Asterisk VOIP - Sameer Verma http://video.google.com/videoplay?docid=-2148055040572903738 http://www.penlug.org/twiki/bin/view/Home/MeetingAgenda20070628 Social: ? 1130 AM-------------------------------------------------------------- Network2: Debian - Setup A WiFi Repeater http://www.youtube.com/watch?v=EJKe_jXszFc Prog Lang: Painless Python Part 1 - Alex Martelli http://youtube.com/watch?v=bDgD9whDfEY http://mail.python.org/pipermail/baypiggies/2008-June/003629.html Database: A Googly MySQL Cluster http://youtube.com/watch?v=HJ930zMk96U 100 PM-------------------------------------------------------------- GUIs: ? Distros: git - Linus Torvalds http://video.google.com/videoplay?docid=-2199332044603874737 230 PM-------------------------------------------------------------- Business: Web 2.0 startups - David Weekly http://video.google.com/videoplay?docid=-2765503550413131030 http://www.penlug.org/twiki/bin/view/Home/MeetingAgenda20080626 Education: Python on the OLPC XO Laptop http://www.youtube.com/watch?v=IPabiIHgmBU From jjinux at gmail.com Sat Aug 2 21:59:08 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 2 Aug 2008 12:59:08 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern Message-ID: I'm have a program that intrinsically eats up a ton of memory. I often read lines from a file that are the same, so I end up with multiple copies of the same data in memory. I know that strings are immutable, so there's no need for me to have two pointers to different but equal data when I can have two pointers to the same data. I thought of a simple trick to fix this: >>> s1 = "foo" >>> s2 = ''.join(['f', 'o', 'o']) >>> s1 == s2 True >>> s1 is s2 False >>> identity_cache = {} >>> s1 = identity_cache.setdefault(s1, s1) >>> s2 = identity_cache.setdefault(s2, s2) >>> s1 == 'foo' True >>> s1 == s2 True >>> s1 is s2 True Of course, in a real library, I'd use lazy references. Can anyone comment on this trick? Does it already exist in the library? Is there a standard name for this besides the flywheel design pattern? Is that the correct name? I might go looking to see if it's in the Cookbook, but I'm not even sure if that's the right name. Thanks, -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From jim at well.com Sat Aug 2 22:13:07 2008 From: jim at well.com (jim) Date: Sat, 02 Aug 2008 13:13:07 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: References: Message-ID: <1217707987.10905.668.camel@ubuntu> i wonder if you have a newbie nugget here regardless of subsequent improvements: would you please explain what's going on in the two setdefault() statements that makes this work? what's being returned to s1 and then to s2? On Sat, 2008-08-02 at 12:59 -0700, Shannon -jj Behrens wrote: > I'm have a program that intrinsically eats up a ton of memory. I > often read lines from a file that are the same, so I end up with > multiple copies of the same data in memory. I know that strings are > immutable, so there's no need for me to have two pointers to different > but equal data when I can have two pointers to the same data. I > thought of a simple trick to fix this: > > >>> s1 = "foo" > >>> s2 = ''.join(['f', 'o', 'o']) > >>> s1 == s2 > True > >>> s1 is s2 > False > >>> identity_cache = {} > >>> s1 = identity_cache.setdefault(s1, s1) > >>> s2 = identity_cache.setdefault(s2, s2) > >>> s1 == 'foo' > True > >>> s1 == s2 > True > >>> s1 is s2 > True > > Of course, in a real library, I'd use lazy references. Can anyone > comment on this trick? Does it already exist in the library? Is > there a standard name for this besides the flywheel design pattern? > Is that the correct name? I might go looking to see if it's in the > Cookbook, but I'm not even sure if that's the right name. > > Thanks, > -jj > From drewp at bigasterisk.com Sat Aug 2 22:43:53 2008 From: drewp at bigasterisk.com (Drew Perttula) Date: Sat, 02 Aug 2008 13:43:53 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: References: Message-ID: <4894C709.3030808@bigasterisk.com> Shannon -jj Behrens wrote: > >>>> identity_cache = {} >>>> s1 = identity_cache.setdefault(s1, s1) >>>> s2 = identity_cache.setdefault(s2, s2) > Of course, in a real library, I'd use lazy references. Can anyone > comment on this trick? Does it already exist in the library? Is > there a standard name for this besides the flywheel design pattern? > Is that the correct name? I might go looking to see if it's in the > Cookbook, but I'm not even sure if that's the right name. > > Thanks, > -jj > > I think you've reinvented intern(), or something very close to it. BTW the pattern name is 'flyweight', although I'm not sure if it's appropriate here. You don't have part of the data in a per-instance object and the rest shared in a flyweight object; your entire object is sharable. (But maybe that's still flyweight, just a really simple form of it.) From davidoff56 at alluvialsw.com Sat Aug 2 22:15:09 2008 From: davidoff56 at alluvialsw.com (Monte Davidoff) Date: Sat, 02 Aug 2008 13:15:09 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: References: Message-ID: <4894C04D.1040406@alluvialsw.com> JJ, Shannon -jj Behrens wrote: > I'm have a program that intrinsically eats up a ton of memory. I > often read lines from a file that are the same, so I end up with > multiple copies of the same data in memory. It sounds like a job for the "intern" built-in function (from section 2.2, Non-essential Built-in Functions, in the Python Library Reference). >>> s1 = intern("foo") >>> s2 = intern(''.join(['f', 'o', 'o'])) >>> s1 == 'foo' True >>> s1 == s2 True >>> s1 is s2 True >>> Curious that your signature referred to Lisp, which has used the intern concept for decades! ;-) Monte From jjinux at gmail.com Sun Aug 3 03:57:23 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 2 Aug 2008 18:57:23 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: <4894C709.3030808@bigasterisk.com> References: <4894C709.3030808@bigasterisk.com> Message-ID: I've blogged about it here: http://jjinux.blogspot.com/2008/08/python-intern.html > i wonder if you have a newbie nugget here > regardless of subsequent improvements: would you please explain what's > going on in the two setdefault() statements that makes this work? > what's being returned to s1 and then to s2? The code is basically saying: if identity_cache.has_key(s2): s2 = identity_cache[s2] # Get the cached instance of the same value. else: identity_cache[s2] = s2 # Cache the instance. s2 always has the same "value", but the above code makes sure there's only *one copy* of that value. > It sounds like a job for the "intern" built-in function Bingo. Right you are! It makes the identity_cache completely unnecessary. > Curious that your signature referred to Lisp, which has used the > intern concept for decades! ;-) Proof positive that there's a lot about Lisp I don't know ;) > BTW the pattern name is 'flyweight' You know, when I read "flyweight" in the gang of four, I envisioned a flywheel, and I could never figure out why they picked that name ;) > But maybe that's still flyweight, just a really simple form of it. I remember the example in the book was using a flyweight for character objects. Hence, every 'a' would be the same instance. Thanks guys! From paul.lucas at rexandco.com Mon Aug 4 17:51:21 2008 From: paul.lucas at rexandco.com (Paul Lucas) Date: Mon, 4 Aug 2008 11:51:21 -0400 Subject: [Baypiggies] Software Engineer Position in San Francisco, CA Message-ID: <88907A2C0CDB224286CED657E2A5BD0F129073@BE160.mail.lan> REX&Co is looking for a motivated software developer with 3-5 years experience creating web based applications. You will be a crucial part of a small team, gaining exposure to a wide range of skills from databases to operating systems to virtualization. You will have the opportunity to work with a dynamically typed language (python), using the latest in agile web frameworks (django, prototype). You will have the freedom to explore new technologies and see how they could be applied here at REX. This is an excellent opportunity to unlock your potential. The ideal candidate should have experience with web application development, plus several or all of the following skills: * Web services * RDBMS (mysql preferred) * Reporting (query writing, web based reporting) * Linux * Experience building real estate applications * Experience in financial services * Build and release engineering * CSS/DHTML A partial telecommute option is available: 2 days a week, the rest onsite at the REX office in San Francisco's Financial District. To apply please send your resume, availability, and salary requirements to: paul.lucas at rexandco.com. Principals only. Paul Lucas Director, Engineering 101 California Street, Suite 1950 San Francisco, CA 94111 T (415)992-4200 D (415)992-4218 F (415)983-0577 paul.lucas at rexandco.com CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential, proprietary and/or trade secret information that is legally privileged. If you are not the intended recipient, or the person responsible for delivering it to the intended recipient, you are on notice of its status. Any disclosure, copying, distribution or use of any of the information contained in or attached to this transmission is STRICTLY PROHIBITED. If you have received this transmission in error, please notify us immediately by reply e-mail, by forwarding this to lisa.blanda at rexandco.com , or by telephone at (415) 992-4200. In addition, please destroy all records of the transmission and any attachments thereto without reading or saving in any manner. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/bmp Size: 11720 bytes Desc: rex_co_logo (for email signature).bmp URL: From job at salesinq.com Mon Aug 4 20:54:35 2008 From: job at salesinq.com (Emile van Sebille) Date: Mon, 04 Aug 2008 11:54:35 -0700 Subject: [Baypiggies] Looking for a do-it-all general practitioner for full time permanent position Message-ID: <4897506B.8030405@salesinq.com> I'm a one-man shop independent since '79 operating out of Burlingame looking for someone to work closely with me to support my customers and move forward on new applications. I've got 10 or so active accounts with a few monopolizing my time. I have work for someone who recognizes most of the terms below, has worked with half, and is comfortably up to speed with a third. Regular commuting to Fremont and Watsonville required with occasional visits to Petaluma, Sacramento and Fresno. Possibilities for working from home. Work includes pc and printer deployment as well as some customer and desktop support. Please indicate salary requirements when responding. This is a full time position for the next 5-7 years. Python is used extensively as glue interfacing various pieces together. There's a lot of technologies at play here, so if you're an independently minded developer, enjoy integrating existing technologies to provide new solutions, and doing rapid discovery and deployment of new technologies, this could be for you. activefax, apache, bash, bbx, bios, centOS, clam, CNC, courier, crontab, css, cups, df, dhcp, django, dns, dom, DPL, dtml, du, Excel, expect, ftp, gcode, ghostview, HPGL, html, IE, imap, ipadder, ipchains, iptables, javascript, kvm, ldap, lightning, links, lpd, mailman, mencoder, mnt, msched, msconfig, mysql, nat, nfs, nmap, OE, open office, osx, outlook, pcanywhere, perl, php, PIL, plone, pop, POST, postgresql, postscript, pro5, python, raid, rc.d, rdp, reportlab, redhat, rs232, rsync, samba, scp, sendmail, smtp, spamd, spybot, sql, squid, squidguard, squirrelmail, ssh, svn, tal, tales, tar, taskmgr, tcpdump, thunderbird, up2date, vi, vmware, vnc, webmin, wget, wiki, win2k, winpatrol, xpsp2, xxcopy, yum, zope, zwiki. Reply to job at salesinq.com From jeff at drinktomi.com Tue Aug 5 00:03:41 2008 From: jeff at drinktomi.com (Jeff Younker) Date: Mon, 4 Aug 2008 15:03:41 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: References: <4894C709.3030808@bigasterisk.com> Message-ID: <742F1E2E-0442-4BA1-920B-43BB882C70EA@drinktomi.com> JJ writes: > Bingo. Right you are! It makes the identity_cache completely > unnecessary. Assuming that you are caching strings and not some other data structure. -jeff From donnamsnow at gmail.com Tue Aug 5 00:36:19 2008 From: donnamsnow at gmail.com (Donna Snow) Date: Mon, 4 Aug 2008 15:36:19 -0700 Subject: [Baypiggies] Anyone near West San Jose driving up to LinuxWorld tomorrow? Message-ID: Hi, As I mentioned I'm helping to (wo)man the Plone booth for the next three days. Anyone else driving up from San Jose to San Fran tomorrow morning (somewhat early) willing to give me a ride up. I'm not expected there til 1pm but would like to get there a bit earlier so I can walk around. Or even if you are driving to the train station and taking the train up (either way). Let me know, I'd love the company. Donna M Snow -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Tue Aug 5 02:17:43 2008 From: aleax at google.com (Alex Martelli) Date: Mon, 4 Aug 2008 17:17:43 -0700 Subject: [Baypiggies] identity cache / flywheel design pattern In-Reply-To: <742F1E2E-0442-4BA1-920B-43BB882C70EA@drinktomi.com> References: <4894C709.3030808@bigasterisk.com> <742F1E2E-0442-4BA1-920B-43BB882C70EA@drinktomi.com> Message-ID: <55dc209b0808041717j3383cb75q973bf62712bd45ae@mail.gmail.com> On Mon, Aug 4, 2008 at 3:03 PM, Jeff Younker wrote: > JJ writes: > >> Bingo. Right you are! It makes the identity_cache completely >> unnecessary. > > Assuming that you are caching strings and not some other data > structure. Also, by using an explicit dict as a cache you potentially gain control over cache-purging behavior (when memory gets low). Alex From donnamsnow at gmail.com Tue Aug 5 05:57:18 2008 From: donnamsnow at gmail.com (Donna Snow) Date: Mon, 4 Aug 2008 20:57:18 -0700 Subject: [Baypiggies] Anyone near West San Jose driving up to LinuxWorld tomorrow? In-Reply-To: References: Message-ID: I have a ride for tomorrow and Wednesday :-) (thank you very much guys!) I'll be there bright and early tomorrow and will be available to help where needed. Hope to see some of you there! Donna M. Snow (who is printing flyers for tomorrow) On Mon, Aug 4, 2008 at 3:36 PM, Donna Snow wrote: > Hi, > > As I mentioned I'm helping to (wo)man the Plone booth for the next three > days. > > Anyone else driving up from San Jose to San Fran tomorrow morning (somewhat > early) willing to give me a ride up. > I'm not expected there til 1pm but would like to get there a bit earlier so > I can walk around. > > Or even if you are driving to the train station and taking the train up > (either way). > > Let me know, I'd love the company. > > Donna M Snow > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjtoi at comcast.net Wed Aug 6 06:05:09 2008 From: hjtoi at comcast.net (Heikki Toivonen) Date: Tue, 05 Aug 2008 21:05:09 -0700 Subject: [Baypiggies] CaltrainPy Message-ID: <489922F5.3000509@comcast.net> I have had this little Python script for over a year, but it didn't occur to me until today that there might be some interest on this list. CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a Python program that I originally wrote for my Windows Mobile device to help me figure out when the next train runs. It turned out Python didn't work out so great on Windows Mobile, but it works fine on desktops, and maybe it would work well in some other device where Python is a first class citizen. It uses Tkinter for UI. I then added a little functionality to scrape the Caltrain HTML schedule and provide it in more machine friendly formats. You can get the latest version by doing "easy_install caltrain". -- Heikki Toivonen From cuba at well.com Wed Aug 6 06:23:28 2008 From: cuba at well.com (Larry Cuba) Date: Tue, 05 Aug 2008 21:23:28 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <489922F5.3000509@comcast.net> References: <489922F5.3000509@comcast.net> Message-ID: <6.2.5.6.2.20080805211722.03f37e28@well.com> At 09:16 PM 8/5/2008, Heikki Toivonen wrote: >It turned out Python didn't >work out so great on Windows Mobile, ... what was the problem with it? something i should know before i buy a windows mobile device? Larry C. From hjtoi at comcast.net Wed Aug 6 06:38:44 2008 From: hjtoi at comcast.net (Heikki Toivonen) Date: Tue, 05 Aug 2008 21:38:44 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <6.2.5.6.2.20080805211722.03f37e28@well.com> References: <489922F5.3000509@comcast.net> <6.2.5.6.2.20080805211722.03f37e28@well.com> Message-ID: <48992AD4.7040907@comcast.net> Larry Cuba wrote: > At 09:16 PM 8/5/2008, Heikki Toivonen wrote: >> It turned out Python didn't >> work out so great on Windows Mobile, ... > > what was the problem with it? Most of the time importing tkinter failed. Doing a reset was required to get that working. After a few successful imports, Python itself would fail to start. Again reset was required. And even when everything was working, it took 10-30 seconds (it has been a while since I tried) to start python and for it to start my application. (Once everything was up the performance was ok, though.) I should point out that I tried only one specific Python binary on my device. I know other people have built their own versions, some come with wxPython etc. so there might actually be a Python version that works ok on a Windows Mobile device. I think the Venster project (http://venster.sourceforge.net/htdocs/index.html) supposedly also works on WM. -- Heikki Toivonen From guido at python.org Wed Aug 6 17:02:36 2008 From: guido at python.org (Guido van Rossum) Date: Wed, 6 Aug 2008 08:02:36 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <489922F5.3000509@comcast.net> References: <489922F5.3000509@comcast.net> Message-ID: Neat! I'd be interested in a port to Python for the Nokia S60 platform. On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen wrote: > I have had this little Python script for over a year, but it didn't > occur to me until today that there might be some interest on this list. > > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a > Python program that I originally wrote for my Windows Mobile device to > help me figure out when the next train runs. It turned out Python didn't > work out so great on Windows Mobile, but it works fine on desktops, and > maybe it would work well in some other device where Python is a first > class citizen. It uses Tkinter for UI. I then added a little > functionality to scrape the Caltrain HTML schedule and provide it in > more machine friendly formats. You can get the latest version by doing > "easy_install caltrain". -- --Guido van Rossum (home page: http://www.python.org/~guido/) From sfseth at gmail.com Wed Aug 6 21:13:33 2008 From: sfseth at gmail.com (Seth Friedman) Date: Wed, 6 Aug 2008 12:13:33 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: References: <489922F5.3000509@comcast.net> Message-ID: <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> I was just thinking about Python on S60. In a bit of anti-Apple closed-platform ire, i've been thinking of replacing my phone with something I could code for, ideally in Python. Not that I really understand how locked down Apple is keeping the iphone, but the marketing folks at Nokia knew how to push my buttons when they build the website of the N96 and all the homebrew applications people could write on them... can't seem to locate the url this moment, but they were cute videos where... for example, one couple, the wife had written a lie detector program on the N96 that she built for her husband.. But at some level I agree with Nokia that these are really mobile computers - in this case with ~125x the cpu power of my first device called a computer. In a sense it's a little archaic to call them phones. Sorta like if we were calling desktops 'word processors'. O'course, moving the mobile phone to mobile computer requires development community to build enough different apps, at some point chicken / egg situation applies. Anyway, can anyone comment about how far away from a port of Python to Symbian we might be, if there's the seed of a project anyplace? ~seth On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum wrote: > Neat! I'd be interested in a port to Python for the Nokia S60 platform. > > On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen wrote: > > I have had this little Python script for over a year, but it didn't > > occur to me until today that there might be some interest on this list. > > > > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a > > Python program that I originally wrote for my Windows Mobile device to > > help me figure out when the next train runs. It turned out Python didn't > > work out so great on Windows Mobile, but it works fine on desktops, and > > maybe it would work well in some other device where Python is a first > > class citizen. It uses Tkinter for UI. I then added a little > > functionality to scrape the Caltrain HTML schedule and provide it in > > more machine friendly formats. You can get the latest version by doing > > "easy_install caltrain". > > -- > --Guido van Rossum (home page: http://www.python.org/~guido/ > ) > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guido at python.org Wed Aug 6 21:19:25 2008 From: guido at python.org (Guido van Rossum) Date: Wed, 6 Aug 2008 12:19:25 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> Message-ID: Um, Python has been ported to Symbian S60 for years now. http://opensource.nokia.com/projects/pythonfors60/ On Wed, Aug 6, 2008 at 12:13 PM, Seth Friedman wrote: > I was just thinking about Python on S60. In a bit of anti-Apple > closed-platform ire, i've been thinking of replacing my phone with something > I could code for, ideally in Python. Not that I really understand how > locked down Apple is keeping the iphone, but the marketing folks at Nokia > knew how to push my buttons when they build the website of the N96 and all > the homebrew applications people could write on them... can't seem to locate > the url this moment, but they were cute videos where... for example, one > couple, the wife had written a lie detector program on the N96 that she > built for her husband.. > > But at some level I agree with Nokia that these are really mobile computers > - in this case with ~125x the cpu power of my first device called a > computer. In a sense it's a little archaic to call them phones. Sorta > like if we were calling desktops 'word processors'. O'course, moving the > mobile phone to mobile computer requires development community to build > enough different apps, at some point chicken / egg situation applies. > > Anyway, can anyone comment about how far away from a port of Python to > Symbian we might be, if there's the seed of a project anyplace? > > ~seth > > On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum wrote: >> >> Neat! I'd be interested in a port to Python for the Nokia S60 platform. >> >> On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen wrote: >> > I have had this little Python script for over a year, but it didn't >> > occur to me until today that there might be some interest on this list. >> > >> > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a >> > Python program that I originally wrote for my Windows Mobile device to >> > help me figure out when the next train runs. It turned out Python didn't >> > work out so great on Windows Mobile, but it works fine on desktops, and >> > maybe it would work well in some other device where Python is a first >> > class citizen. It uses Tkinter for UI. I then added a little >> > functionality to scrape the Caltrain HTML schedule and provide it in >> > more machine friendly formats. You can get the latest version by doing >> > "easy_install caltrain". >> >> -- >> --Guido van Rossum (home page: http://www.python.org/~guido/) >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From sfseth at gmail.com Wed Aug 6 21:26:06 2008 From: sfseth at gmail.com (Seth Friedman) Date: Wed, 6 Aug 2008 12:26:06 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <103658708543925348956703704061218665618-Webmail2@me.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> <103658708543925348956703704061218665618-Webmail2@me.com> Message-ID: <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> Sweet. I did a search for python on S60 a few weeks ago and didn't see this for some reason. On Wed, Aug 6, 2008 at 12:23 PM, Bjorn Tipling wrote: > I think it's not about Apple locking down and being anti-python, it's just > that they haven't had time to make it all work. I think Apple has been very > supportive of python and has worked hard to bridge objective-c and python in > its Cocoa framework. > > > On Wednesday, August 06, 2008, at 12:20PM, "Guido van Rossum" < > guido at python.org> wrote: > >Um, Python has been ported to Symbian S60 for years now. > >http://opensource.nokia.com/projects/pythonfors60/ > > > >On Wed, Aug 6, 2008 at 12:13 PM, Seth Friedman wrote: > >> I was just thinking about Python on S60. In a bit of anti-Apple > >> closed-platform ire, i've been thinking of replacing my phone with > something > >> I could code for, ideally in Python. Not that I really understand how > >> locked down Apple is keeping the iphone, but the marketing folks at > Nokia > >> knew how to push my buttons when they build the website of the N96 and > all > >> the homebrew applications people could write on them... can't seem to > locate > >> the url this moment, but they were cute videos where... for example, one > >> couple, the wife had written a lie detector program on the N96 that she > >> built for her husband.. > >> > >> But at some level I agree with Nokia that these are really mobile > computers > >> - in this case with ~125x the cpu power of my first device called a > >> computer. In a sense it's a little archaic to call them phones. > Sorta > >> like if we were calling desktops 'word processors'. O'course, moving > the > >> mobile phone to mobile computer requires development community to build > >> enough different apps, at some point chicken / egg situation applies. > >> > >> Anyway, can anyone comment about how far away from a port of Python to > >> Symbian we might be, if there's the seed of a project anyplace? > >> > >> ~seth > >> > >> On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum > wrote: > >>> > >>> Neat! I'd be interested in a port to Python for the Nokia S60 platform. > >>> > >>> On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen > wrote: > >>> > I have had this little Python script for over a year, but it didn't > >>> > occur to me until today that there might be some interest on this > list. > >>> > > >>> > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a > >>> > Python program that I originally wrote for my Windows Mobile device > to > >>> > help me figure out when the next train runs. It turned out Python > didn't > >>> > work out so great on Windows Mobile, but it works fine on desktops, > and > >>> > maybe it would work well in some other device where Python is a first > >>> > class citizen. It uses Tkinter for UI. I then added a little > >>> > functionality to scrape the Caltrain HTML schedule and provide it in > >>> > more machine friendly formats. You can get the latest version by > doing > >>> > "easy_install caltrain". > >>> > >>> -- > >>> --Guido van Rossum (home page: http://www.python.org/~guido/ > ) > >>> _______________________________________________ > >>> Baypiggies mailing list > >>> Baypiggies at python.org > >>> To change your subscription options or unsubscribe: > >>> http://mail.python.org/mailman/listinfo/baypiggies > >> > >> > > > > > > > >-- > >--Guido van Rossum (home page: http://www.python.org/~guido/ > ) > >_______________________________________________ > >Baypiggies mailing list > >Baypiggies at python.org > >To change your subscription options or unsubscribe: > >http://mail.python.org/mailman/listinfo/baypiggies > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.merriam at gmail.com Wed Aug 6 21:41:31 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Wed, 6 Aug 2008 12:41:31 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> <103658708543925348956703704061218665618-Webmail2@me.com> <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> Message-ID: Hmm.. Well, I reading this at a Nokia forum in SF. Next up is "Rapidly Prototyping Mobile Phone Applications with Python" followed by "Python Demos". Likely you can work on Nokia phones. Catch me at the next meeting for a summary. -- Charles On Wed, Aug 6, 2008 at 12:26 PM, Seth Friedman wrote: > Sweet. I did a search for python on S60 a few weeks ago and didn't see > this for some reason. > > On Wed, Aug 6, 2008 at 12:23 PM, Bjorn Tipling wrote: >> >> I think it's not about Apple locking down and being anti-python, it's just >> that they haven't had time to make it all work. I think Apple has been very >> supportive of python and has worked hard to bridge objective-c and python in >> its Cocoa framework. >> >> >> On Wednesday, August 06, 2008, at 12:20PM, "Guido van Rossum" >> wrote: >> >Um, Python has been ported to Symbian S60 for years now. >> >http://opensource.nokia.com/projects/pythonfors60/ >> > >> >On Wed, Aug 6, 2008 at 12:13 PM, Seth Friedman wrote: >> >> I was just thinking about Python on S60. In a bit of anti-Apple >> >> closed-platform ire, i've been thinking of replacing my phone with >> >> something >> >> I could code for, ideally in Python. Not that I really understand how >> >> locked down Apple is keeping the iphone, but the marketing folks at >> >> Nokia >> >> knew how to push my buttons when they build the website of the N96 and >> >> all >> >> the homebrew applications people could write on them... can't seem to >> >> locate >> >> the url this moment, but they were cute videos where... for example, >> >> one >> >> couple, the wife had written a lie detector program on the N96 that she >> >> built for her husband.. >> >> >> >> But at some level I agree with Nokia that these are really mobile >> >> computers >> >> - in this case with ~125x the cpu power of my first device called a >> >> computer. In a sense it's a little archaic to call them phones. >> >> Sorta >> >> like if we were calling desktops 'word processors'. O'course, moving >> >> the >> >> mobile phone to mobile computer requires development community to build >> >> enough different apps, at some point chicken / egg situation applies. >> >> >> >> Anyway, can anyone comment about how far away from a port of Python to >> >> Symbian we might be, if there's the seed of a project anyplace? >> >> >> >> ~seth >> >> >> >> On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum >> >> wrote: >> >>> >> >>> Neat! I'd be interested in a port to Python for the Nokia S60 >> >>> platform. >> >>> >> >>> On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen >> >>> wrote: >> >>> > I have had this little Python script for over a year, but it didn't >> >>> > occur to me until today that there might be some interest on this >> >>> > list. >> >>> > >> >>> > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is a >> >>> > Python program that I originally wrote for my Windows Mobile device >> >>> > to >> >>> > help me figure out when the next train runs. It turned out Python >> >>> > didn't >> >>> > work out so great on Windows Mobile, but it works fine on desktops, >> >>> > and >> >>> > maybe it would work well in some other device where Python is a >> >>> > first >> >>> > class citizen. It uses Tkinter for UI. I then added a little >> >>> > functionality to scrape the Caltrain HTML schedule and provide it in >> >>> > more machine friendly formats. You can get the latest version by >> >>> > doing >> >>> > "easy_install caltrain". >> >>> >> >>> -- >> >>> --Guido van Rossum (home page: http://www.python.org/~guido/) >> >>> _______________________________________________ >> >>> Baypiggies mailing list >> >>> Baypiggies at python.org >> >>> To change your subscription options or unsubscribe: >> >>> http://mail.python.org/mailman/listinfo/baypiggies >> >> >> >> >> > >> > >> > >> >-- >> >--Guido van Rossum (home page: http://www.python.org/~guido/) >> >_______________________________________________ >> >Baypiggies mailing list >> >Baypiggies at python.org >> >To change your subscription options or unsubscribe: >> >http://mail.python.org/mailman/listinfo/baypiggies >> > >> > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From aldenm at gmail.com Wed Aug 6 21:46:33 2008 From: aldenm at gmail.com (Alden Meneses) Date: Wed, 6 Aug 2008 12:46:33 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> <103658708543925348956703704061218665618-Webmail2@me.com> <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> Message-ID: <221610dc0808061246u518f9702ga8a36c06bf9342af@mail.gmail.com> This thread had me looking for a S60 phone for AT&T but no luck. Curious what carriers people have for their S60 phones and if they are using AT&T what they had to do to get it working. Also I was at LinuxWorld yesterday and stopped by OpenMoko booth and got to look at the Neo Freerunner. Not as sexy as the Nokia or Samsung phones and will also provide a debug board to allow you to tinker with the phone. On 8/6/08, Seth Friedman wrote: > > Sweet. I did a search for python on S60 a few weeks ago and didn't see > this for some reason. > > On Wed, Aug 6, 2008 at 12:23 PM, Bjorn Tipling wrote: > >> I think it's not about Apple locking down and being anti-python, it's just >> that they haven't had time to make it all work. I think Apple has been very >> supportive of python and has worked hard to bridge objective-c and python in >> its Cocoa framework. >> >> >> On Wednesday, August 06, 2008, at 12:20PM, "Guido van Rossum" < >> guido at python.org> wrote: >> >Um, Python has been ported to Symbian S60 for years now. >> >http://opensource.nokia.com/projects/pythonfors60/ >> > >> >On Wed, Aug 6, 2008 at 12:13 PM, Seth Friedman wrote: >> >> I was just thinking about Python on S60. In a bit of anti-Apple >> >> closed-platform ire, i've been thinking of replacing my phone with >> something >> >> I could code for, ideally in Python. Not that I really understand how >> >> locked down Apple is keeping the iphone, but the marketing folks at >> Nokia >> >> knew how to push my buttons when they build the website of the N96 and >> all >> >> the homebrew applications people could write on them... can't seem to >> locate >> >> the url this moment, but they were cute videos where... for example, >> one >> >> couple, the wife had written a lie detector program on the N96 that she >> >> built for her husband.. >> >> >> >> But at some level I agree with Nokia that these are really mobile >> computers >> >> - in this case with ~125x the cpu power of my first device called a >> >> computer. In a sense it's a little archaic to call them phones. >> Sorta >> >> like if we were calling desktops 'word processors'. O'course, moving >> the >> >> mobile phone to mobile computer requires development community to build >> >> enough different apps, at some point chicken / egg situation applies. >> >> >> >> Anyway, can anyone comment about how far away from a port of Python to >> >> Symbian we might be, if there's the seed of a project anyplace? >> >> >> >> ~seth >> >> >> >> On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum >> wrote: >> >>> >> >>> Neat! I'd be interested in a port to Python for the Nokia S60 >> platform. >> >>> >> >>> On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen >> wrote: >> >>> > I have had this little Python script for over a year, but it didn't >> >>> > occur to me until today that there might be some interest on this >> list. >> >>> > >> >>> > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is >> a >> >>> > Python program that I originally wrote for my Windows Mobile device >> to >> >>> > help me figure out when the next train runs. It turned out Python >> didn't >> >>> > work out so great on Windows Mobile, but it works fine on desktops, >> and >> >>> > maybe it would work well in some other device where Python is a >> first >> >>> > class citizen. It uses Tkinter for UI. I then added a little >> >>> > functionality to scrape the Caltrain HTML schedule and provide it in >> >>> > more machine friendly formats. You can get the latest version by >> doing >> >>> > "easy_install caltrain". >> >>> >> >>> -- >> >>> --Guido van Rossum (home page: http://www.python.org/~guido/ >> ) >> >>> _______________________________________________ >> >>> Baypiggies mailing list >> >>> Baypiggies at python.org >> >>> To change your subscription options or unsubscribe: >> >>> http://mail.python.org/mailman/listinfo/baypiggies >> >> >> >> >> > >> > >> > >> >-- >> >--Guido van Rossum (home page: http://www.python.org/~guido/ >> ) >> >_______________________________________________ >> >Baypiggies mailing list >> >Baypiggies at python.org >> >To change your subscription options or unsubscribe: >> >http://mail.python.org/mailman/listinfo/baypiggies >> > >> > >> >> > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan at yergler.net Wed Aug 6 22:01:04 2008 From: nathan at yergler.net (Nathan Yergler) Date: Wed, 6 Aug 2008 13:01:04 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <221610dc0808061246u518f9702ga8a36c06bf9342af@mail.gmail.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> <103658708543925348956703704061218665618-Webmail2@me.com> <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> <221610dc0808061246u518f9702ga8a36c06bf9342af@mail.gmail.com> Message-ID: <53039e7b0808061301n4e93f4c0se35cc600a7aa4cc8@mail.gmail.com> On Wed, Aug 6, 2008 at 12:46 PM, Alden Meneses wrote: > This thread had me looking for a S60 phone for AT&T but no luck. Curious > what carriers people have for their S60 phones and if they are using AT&T > what they had to do to get it working. I use AT&T; purchased an unlocked Nokia N95 from Amazon.com. Just popped in the SIM from my Blackberry, called AT&T to switch my data plan over to the general purpose unlimited plan. Took about 10 minutes on the phone. > > Also I was at LinuxWorld yesterday and stopped by OpenMoko booth and got to > look at the Neo Freerunner. Not as sexy as the Nokia or Samsung phones and > will also provide a debug board to allow you to tinker with the phone. > > > On 8/6/08, Seth Friedman wrote: >> >> Sweet. I did a search for python on S60 a few weeks ago and didn't see >> this for some reason. >> >> On Wed, Aug 6, 2008 at 12:23 PM, Bjorn Tipling wrote: >>> >>> I think it's not about Apple locking down and being anti-python, it's >>> just that they haven't had time to make it all work. I think Apple has been >>> very supportive of python and has worked hard to bridge objective-c and >>> python in its Cocoa framework. >>> >>> >>> On Wednesday, August 06, 2008, at 12:20PM, "Guido van Rossum" >>> wrote: >>> >Um, Python has been ported to Symbian S60 for years now. >>> >http://opensource.nokia.com/projects/pythonfors60/ >>> > >>> >On Wed, Aug 6, 2008 at 12:13 PM, Seth Friedman wrote: >>> >> I was just thinking about Python on S60. In a bit of anti-Apple >>> >> closed-platform ire, i've been thinking of replacing my phone with >>> >> something >>> >> I could code for, ideally in Python. Not that I really understand >>> >> how >>> >> locked down Apple is keeping the iphone, but the marketing folks at >>> >> Nokia >>> >> knew how to push my buttons when they build the website of the N96 and >>> >> all >>> >> the homebrew applications people could write on them... can't seem to >>> >> locate >>> >> the url this moment, but they were cute videos where... for example, >>> >> one >>> >> couple, the wife had written a lie detector program on the N96 that >>> >> she >>> >> built for her husband.. >>> >> >>> >> But at some level I agree with Nokia that these are really mobile >>> >> computers >>> >> - in this case with ~125x the cpu power of my first device called a >>> >> computer. In a sense it's a little archaic to call them phones. >>> >> Sorta >>> >> like if we were calling desktops 'word processors'. O'course, >>> >> moving the >>> >> mobile phone to mobile computer requires development community to >>> >> build >>> >> enough different apps, at some point chicken / egg situation applies. >>> >> >>> >> Anyway, can anyone comment about how far away from a port of Python to >>> >> Symbian we might be, if there's the seed of a project anyplace? >>> >> >>> >> ~seth >>> >> >>> >> On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum >>> >> wrote: >>> >>> >>> >>> Neat! I'd be interested in a port to Python for the Nokia S60 >>> >>> platform. >>> >>> >>> >>> On Tue, Aug 5, 2008 at 9:05 PM, Heikki Toivonen >>> >>> wrote: >>> >>> > I have had this little Python script for over a year, but it didn't >>> >>> > occur to me until today that there might be some interest on this >>> >>> > list. >>> >>> > >>> >>> > CaltrainPy (http://caltrain.heikkitoivonen.net/developers.html) is >>> >>> > a >>> >>> > Python program that I originally wrote for my Windows Mobile device >>> >>> > to >>> >>> > help me figure out when the next train runs. It turned out Python >>> >>> > didn't >>> >>> > work out so great on Windows Mobile, but it works fine on desktops, >>> >>> > and >>> >>> > maybe it would work well in some other device where Python is a >>> >>> > first >>> >>> > class citizen. It uses Tkinter for UI. I then added a little >>> >>> > functionality to scrape the Caltrain HTML schedule and provide it >>> >>> > in >>> >>> > more machine friendly formats. You can get the latest version by >>> >>> > doing >>> >>> > "easy_install caltrain". >>> >>> >>> >>> -- >>> >>> --Guido van Rossum (home page: http://www.python.org/~guido/) >>> >>> _______________________________________________ >>> >>> Baypiggies mailing list >>> >>> Baypiggies at python.org >>> >>> To change your subscription options or unsubscribe: >>> >>> http://mail.python.org/mailman/listinfo/baypiggies >>> >> >>> >> >>> > >>> > >>> > >>> >-- >>> >--Guido van Rossum (home page: http://www.python.org/~guido/) >>> >_______________________________________________ >>> >Baypiggies mailing list >>> >Baypiggies at python.org >>> >To change your subscription options or unsubscribe: >>> >http://mail.python.org/mailman/listinfo/baypiggies >>> > >>> > >>> >> >> >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From jjinux at gmail.com Wed Aug 6 22:01:51 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 6 Aug 2008 13:01:51 -0700 Subject: [Baypiggies] len(iterable) Message-ID: I have an iterable, and I want to find out how long it is. I don't care if it consumes the iterable. Furthermore, I know the iterable is not infinite. Consider: >>> len((i for i in xrange(10))) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'generator' has no len() It makes sense that len() not be defined, but I can't seem to find a simple count function. Of course, I can write one, but it seems like it should exist in itertools or something. (By the way, the count function in itertools is something completely different.) Thanks, -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From guido at python.org Wed Aug 6 22:08:30 2008 From: guido at python.org (Guido van Rossum) Date: Wed, 6 Aug 2008 13:08:30 -0700 Subject: [Baypiggies] len(iterable) In-Reply-To: References: Message-ID: sum(1 for x in it) On Wed, Aug 6, 2008 at 1:01 PM, Shannon -jj Behrens wrote: > I have an iterable, and I want to find out how long it is. I don't > care if it consumes the iterable. Furthermore, I know the iterable is > not infinite. Consider: > >>>> len((i for i in xrange(10))) > Traceback (most recent call last): > File "", line 1, in > TypeError: object of type 'generator' has no len() > > It makes sense that len() not be defined, but I can't seem to find a > simple count function. Of course, I can write one, but it seems like > it should exist in itertools or something. (By the way, the count > function in itertools is something completely different.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) From tungwaiyip at yahoo.com Wed Aug 6 22:11:38 2008 From: tungwaiyip at yahoo.com (Tung Wai Yip) Date: Wed, 6 Aug 2008 13:11:38 -0700 (PDT) Subject: [Baypiggies] len(iterable) Message-ID: <746252.47077.qm@web56415.mail.re3.yahoo.com> I can think of 2 ways, >>> it = xrange(10) >>> len(list(it)) 10 >>> it = xrange(10) >>> sum(1 for i in it) 10 Wai Yip > I have an iterable, and I want to find out how long it is. I don't > care if it consumes the iterable. Furthermore, I know the iterable is > not infinite. Consider: > >>>> len((i for i in xrange(10))) > Traceback (most recent call last): > File "", line 1, in > TypeError: object of type 'generator' has no len() > > It makes sense that len() not be defined, but I can't seem to find a > simple count function. Of course, I can write one, but it seems like > it should exist in itertools or something. (By the way, the count > function in itertools is something completely different.) > > Thanks, > -jj > From brianz at gmail.com Wed Aug 6 22:31:59 2008 From: brianz at gmail.com (Brian Zambrano) Date: Wed, 6 Aug 2008 13:31:59 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: References: <489922F5.3000509@comcast.net> Message-ID: <5db256250808061331o7fc4bfeavefc91f973b8222c5@mail.gmail.com> You can also use iCaltrain.....I use it on my iPhone and it works like a charm: http://icaltrain.com/blog/. Along the same lines, the coolest public transportation tracker IMO is munitime.com. It'll give you real-time arrival times of MUNI busses and trains which are GPS-equiped. BZ On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum wrote: > Neat! I'd be interested in a port to Python for the Nokia S60 platform. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjinux at gmail.com Wed Aug 6 22:34:07 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 6 Aug 2008 13:34:07 -0700 Subject: [Baypiggies] len(iterable) In-Reply-To: <746252.47077.qm@web56415.mail.re3.yahoo.com> References: <746252.47077.qm@web56415.mail.re3.yahoo.com> Message-ID: On Wed, Aug 6, 2008 at 1:11 PM, Tung Wai Yip wrote: > I can think of 2 ways, > >>>> it = xrange(10) >>>> len(list(it)) > 10 > >>>> it = xrange(10) >>>> sum(1 for i in it) > 10 > > Wai Yip > > >> I have an iterable, and I want to find out how long it is. I don't >> care if it consumes the iterable. Furthermore, I know the iterable is >> not infinite. Consider: >> >>>>> len((i for i in xrange(10))) >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: object of type 'generator' has no len() >> >> It makes sense that len() not be defined, but I can't seem to find a >> simple count function. Of course, I can write one, but it seems like >> it should exist in itertools or something. (By the way, the count >> function in itertools is something completely different.) >> >> Thanks, >> -jj I can't do len(list(iter)) because I don't have enough RAM ;) Guido and Wai Yip's idea was the most elegant. It seems strange that this isn't in the standard library. -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From jjinux at gmail.com Wed Aug 6 22:35:58 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 6 Aug 2008 13:35:58 -0700 Subject: [Baypiggies] len(iterable) In-Reply-To: References: <746252.47077.qm@web56415.mail.re3.yahoo.com> Message-ID: On Wed, Aug 6, 2008 at 1:34 PM, Shannon -jj Behrens wrote: > On Wed, Aug 6, 2008 at 1:11 PM, Tung Wai Yip wrote: >> I can think of 2 ways, >> >>>>> it = xrange(10) >>>>> len(list(it)) >> 10 >> >>>>> it = xrange(10) >>>>> sum(1 for i in it) >> 10 >> >> Wai Yip >> >> >>> I have an iterable, and I want to find out how long it is. I don't >>> care if it consumes the iterable. Furthermore, I know the iterable is >>> not infinite. Consider: >>> >>>>>> len((i for i in xrange(10))) >>> Traceback (most recent call last): >>> File "", line 1, in >>> TypeError: object of type 'generator' has no len() >>> >>> It makes sense that len() not be defined, but I can't seem to find a >>> simple count function. Of course, I can write one, but it seems like >>> it should exist in itertools or something. (By the way, the count >>> function in itertools is something completely different.) >>> >>> Thanks, >>> -jj > > I can't do len(list(iter)) because I don't have enough RAM ;) Guido > and Wai Yip's idea was the most elegant. It seems strange that this > isn't in the standard library. By the way, my rather boring solution was: def iter_len(iter): """Return the length of the given iterator. len(iter) doesn't work in cases such as:: len((i for i in xrange(10))) I can't find anything for this in the standard library. """ count = 0 for i in iter: count += 1 return count def test_iter_len(): assert_equal(iter_len(xrange(5)), 5) Gees, I'm so boring sometimes! -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From hjtoi at comcast.net Wed Aug 6 22:51:40 2008 From: hjtoi at comcast.net (Heikki Toivonen) Date: Wed, 06 Aug 2008 13:51:40 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <221610dc0808061246u518f9702ga8a36c06bf9342af@mail.gmail.com> References: <489922F5.3000509@comcast.net> <64e45fca0808061213s20e76e85o2c84f492f2d2df88@mail.gmail.com> <103658708543925348956703704061218665618-Webmail2@me.com> <64e45fca0808061226l1056d763pf8dd9ea43c120781@mail.gmail.com> <221610dc0808061246u518f9702ga8a36c06bf9342af@mail.gmail.com> Message-ID: <489A0EDC.6080208@comcast.net> Alden Meneses wrote: > This thread had me looking for a S60 phone for AT&T but no luck. Curious > what carriers people have for their S60 phones and if they are using > AT&T what they had to do to get it working. I can see that they are selling at least the Nokia N75, which has S60: http://www.forum.nokia.com/devices/N75. I have access to N71 but I don't know when I'd be able to try Python on that. > Also I was at LinuxWorld yesterday and stopped by OpenMoko booth and got > to look at the Neo Freerunner. Not as sexy as the Nokia or Samsung > phones and will also provide a debug board to allow you to tinker with > the phone. I stopped by the OpenMoko booth today. I wanted to see how Python works on that device, but unfortunately the booth staff were not sure which applications were written in Python although I did try something they were pretty sure was written in Python and the performance was ok. OpenMoko seems like a nice platform to develop Python applications for, but getting the emulators etc. setup is quite a hassle. -- Heikki Toivonen From annaraven at gmail.com Thu Aug 7 02:05:55 2008 From: annaraven at gmail.com (anna) Date: Wed, 6 Aug 2008 17:05:55 -0700 Subject: [Baypiggies] CaltrainPy In-Reply-To: <5db256250808061331o7fc4bfeavefc91f973b8222c5@mail.gmail.com> References: <489922F5.3000509@comcast.net> <5db256250808061331o7fc4bfeavefc91f973b8222c5@mail.gmail.com> Message-ID: <8B7F2603-B40F-4D9F-849D-3C29B8D277B7@gmail.com> Icaltrain wpuld be better if it was location aware. Sent from my iPhone On Aug 6, 2008, at 1:31 PM, "Brian Zambrano" wrote: > You can also use iCaltrain.....I use it on my iPhone and it works > like a charm: http://icaltrain.com/blog/. > > Along the same lines, the coolest public transportation tracker IMO > is munitime.com. It'll give you real-time arrival times of MUNI > busses and trains which are GPS-equiped. > > BZ > > On Wed, Aug 6, 2008 at 8:02 AM, Guido van Rossum > wrote: > Neat! I'd be interested in a port to Python for the Nokia S60 > platform. > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From javarobert at yahoo.com Thu Aug 7 03:57:10 2008 From: javarobert at yahoo.com (Robert Schultheis) Date: Wed, 6 Aug 2008 18:57:10 -0700 (PDT) Subject: [Baypiggies] Python available on Nokia Devices since 2005 Message-ID: <705380.90957.qm@web56510.mail.re3.yahoo.com> Hi, Some questions on the list about PyS60. Python for S60 is available for the latest and older Nokia S60 devices. N95-3 and N95 8GB are available unlocked for the US. Get PyS60 here: http://sourceforge.net/project/showfiles.php?group_id=154155&package_id=171153 There are many PyS60 code samples available. Google PyS60 and see the Forum Nokia Wiki pages at: http://wiki.opensource.nokia.com/projects/PyS60_applications PyS60 Wiki main page: http://wiki.opensource.nokia.com/projects/Python_for_S60 Cheers, Robert Forum Nokia From charles.merriam at gmail.com Thu Aug 7 04:08:02 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Wed, 6 Aug 2008 19:08:02 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: <705380.90957.qm@web56510.mail.re3.yahoo.com> References: <705380.90957.qm@web56510.mail.re3.yahoo.com> Message-ID: >From my the little bit I've been able to sit through earlier. PyS60 is built on a Python 2.2 base. You can run a bluetooth console (like Screen on the Mac) to interact with your phone in real time. There some some emulator options as well. One imports specialized packages for access to the S60 app etc. Deploying on the phone is a bit tricky. You need to sign the app to access certain features. If you want to deploy on more than some enumerated number of phones, you join the developer program. The line of what is 'free and open source', 'free to make only GPL applications', 'closed but gratis', and 'not free' is a bit blurry and perhaps intentionally confusing. There are various bundling options, such as an equivalent of Py2exe, and these options each have their own challenges (read bugs). There is also a specialized version of C/C++ called Open C/C++. Apprently, some features are only avaliable in Python and some are only available in Open C/C++. It's an odd world. Charles On Wed, Aug 6, 2008 at 6:57 PM, Robert Schultheis wrote: > Hi, > > Some questions on the list about PyS60. > > Python for S60 is available for the latest and older Nokia S60 devices. N95-3 and N95 8GB are available unlocked for the US. > > Get PyS60 here: > http://sourceforge.net/project/showfilers.php?group_id=154155&package_id=171153 > > There are many PyS60 code samples available. Google PyS60 and see the Forum Nokia Wiki pages at: > > http://wiki.opensource.nokia.com/projects/PyS60_applications > > PyS60 Wiki main page: > http://wiki.opensource.nokia.com/projects/Python_for_S60 > > Cheers, > Robert > Forum Nokia > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From drewp at bigasterisk.com Thu Aug 7 04:29:46 2008 From: drewp at bigasterisk.com (Drew Perttula) Date: Wed, 06 Aug 2008 19:29:46 -0700 Subject: [Baypiggies] len(iterable) In-Reply-To: References: <746252.47077.qm@web56415.mail.re3.yahoo.com> Message-ID: <489A5E1A.8070904@bigasterisk.com> Shannon -jj Behrens wrote: > def test_iter_len(): > assert_equal(iter_len(xrange(5)), 5) > > > Gees, I'm so boring sometimes! > BTW, did you ever notice that the result of xrange has a __len__ already? len(xrange(5)) -> 5 Maybe your iter_len should try that first, in case the incoming object has thoughtfully provided a __len__ method. From sfseth at gmail.com Thu Aug 7 22:28:13 2008 From: sfseth at gmail.com (Seth Friedman) Date: Thu, 7 Aug 2008 13:28:13 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> Message-ID: <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Hi, Thanks for all the info. I'm thinking of a N96 when it's out and this thread is helping me understand what the options are. Just as a platform for personal development, I'm curious what the features that will be limited if I don't get into the developer program or go through signing my app. For instance, one little app I was thinking of writing was to check the GPS to see if the phone was at my home, and if I accepted a call at home, to have the phone poke my SlimServer and if music was playing, to mute it for the duration of the call. I'm not sure if SlimServer has the capability to handle that out of the box, but being open source I figure I can tackle whatever's missing there. Is the line about what features are locked for unsigned apps blurry, or is there a list someplace? Specifically I'm curious about: GPS, network, file system, accelerometer, and camera. ~seth On Wed, Aug 6, 2008 at 7:08 PM, Charles Merriam wrote: > >From my the little bit I've been able to sit through earlier. > > PyS60 is built on a Python 2.2 base. You can run a bluetooth console > (like Screen on the Mac) to interact with your phone in real time. > There some some emulator options as well. One imports specialized > packages for access to the S60 app etc. > > Deploying on the phone is a bit tricky. You need to sign the app to > access certain features. If you want to deploy on more than some > enumerated number of phones, you join the developer program. The line > of what is 'free and open source', 'free to make only GPL > applications', 'closed but gratis', and 'not free' is a bit blurry and > perhaps intentionally confusing. There are various bundling options, > such as an equivalent of Py2exe, and these options each have their own > challenges (read bugs). > > There is also a specialized version of C/C++ called Open C/C++. > Apprently, some features are only avaliable in Python and some are > only available in Open C/C++. > > It's an odd world. > > Charles > > On Wed, Aug 6, 2008 at 6:57 PM, Robert Schultheis > wrote: > > Hi, > > > > Some questions on the list about PyS60. > > > > Python for S60 is available for the latest and older Nokia S60 devices. > N95-3 and N95 8GB are available unlocked for the US. > > > > Get PyS60 here: > > > http://sourceforge.net/project/showfilers.php?group_id=154155&package_id=171153 > > > > There are many PyS60 code samples available. Google PyS60 and see the > Forum Nokia Wiki pages at: > > > > http://wiki.opensource.nokia.com/projects/PyS60_applications > > > > PyS60 Wiki main page: > > http://wiki.opensource.nokia.com/projects/Python_for_S60 > > > > Cheers, > > Robert > > Forum Nokia > > > > > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.merriam at gmail.com Fri Aug 8 00:45:53 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Thu, 7 Aug 2008 15:45:53 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Message-ID: I remember the GPS being specifically locked to a 'higher' level. I haven't found a cheat sheet; you need to look through http://forum.nokia.com. Fundamentally, it seems like a developer program run on bailing wire with too many paranoid lawyers. On Thu, Aug 7, 2008 at 1:28 PM, Seth Friedman wrote: > Hi, > > Thanks for all the info. I'm thinking of a N96 when it's out and this > thread is helping me understand what the options are. > > Just as a platform for personal development, I'm curious what the features > that will be limited if I don't get into the developer program or go through > signing my app. > > For instance, one little app I was thinking of writing was to check the GPS > to see if the phone was at my home, and if I accepted a call at home, to > have the phone poke my SlimServer and if music was playing, to mute it for > the duration of the call. I'm not sure if SlimServer has the capability > to handle that out of the box, but being open source I figure I can tackle > whatever's missing there. > > Is the line about what features are locked for unsigned apps blurry, or is > there a list someplace? Specifically I'm curious about: GPS, network, file > system, accelerometer, and camera. > > ~seth > On Wed, Aug 6, 2008 at 7:08 PM, Charles Merriam > wrote: >> >> >From my the little bit I've been able to sit through earlier. >> >> PyS60 is built on a Python 2.2 base. You can run a bluetooth console >> (like Screen on the Mac) to interact with your phone in real time. >> There some some emulator options as well. One imports specialized >> packages for access to the S60 app etc. >> >> Deploying on the phone is a bit tricky. You need to sign the app to >> access certain features. If you want to deploy on more than some >> enumerated number of phones, you join the developer program. The line >> of what is 'free and open source', 'free to make only GPL >> applications', 'closed but gratis', and 'not free' is a bit blurry and >> perhaps intentionally confusing. There are various bundling options, >> such as an equivalent of Py2exe, and these options each have their own >> challenges (read bugs). >> >> There is also a specialized version of C/C++ called Open C/C++. >> Apprently, some features are only avaliable in Python and some are >> only available in Open C/C++. >> >> It's an odd world. >> >> Charles >> >> On Wed, Aug 6, 2008 at 6:57 PM, Robert Schultheis >> wrote: >> > Hi, >> > >> > Some questions on the list about PyS60. >> > >> > Python for S60 is available for the latest and older Nokia S60 devices. >> > N95-3 and N95 8GB are available unlocked for the US. >> > >> > Get PyS60 here: >> > >> > http://sourceforge.net/project/showfilers.php?group_id=154155&package_id=171153 >> > >> > There are many PyS60 code samples available. Google PyS60 and see the >> > Forum Nokia Wiki pages at: >> > >> > http://wiki.opensource.nokia.com/projects/PyS60_applications >> > >> > PyS60 Wiki main page: >> > http://wiki.opensource.nokia.com/projects/Python_for_S60 >> > >> > Cheers, >> > Robert >> > Forum Nokia >> > >> > >> > >> > _______________________________________________ >> > Baypiggies mailing list >> > Baypiggies at python.org >> > To change your subscription options or unsubscribe: >> > http://mail.python.org/mailman/listinfo/baypiggies >> > >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > From p at ulmcnett.com Fri Aug 8 04:56:28 2008 From: p at ulmcnett.com (Paul McNett) Date: Thu, 07 Aug 2008 19:56:28 -0700 Subject: [Baypiggies] Python on OpenMoko (was:Re: Python available on Nokia Devices since 2005) In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Message-ID: <489BB5DC.2030007@ulmcnett.com> What about OpenMoko? Anyone have experience with Python on that ostensibly more open platform? Any experience at all? http://www.openmoko.com/ I'm in the market for a new phone. My wife wants an iPhone; I want something that I can hack to my heart's delight. But of course I want it to still work reliably. So I was thinking of trying openmoko and getting the iPhone for my wife, and finding some sort of AT&T GSM family account that makes sense. Paul From hjtoi at comcast.net Fri Aug 8 05:37:31 2008 From: hjtoi at comcast.net (Heikki Toivonen) Date: Thu, 07 Aug 2008 20:37:31 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: <489BB5DC.2030007@ulmcnett.com> References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> Message-ID: <489BBF7B.8020809@comcast.net> Paul McNett wrote: > What about OpenMoko? Anyone have experience with Python on that > ostensibly more open platform? Any experience at all? I tested an OpenMoko device at LinuxWorld, with an app the staff at the booth thought was written in Python, and the experience was pretty good (a little slower than I would expect, but since I don't know how responive OpenMoko is in general it is hard to compare). There was nothing that I could see that would even tell what language was used to implement the application. > I'm in the market for a new phone. My wife wants an iPhone; I want > something that I can hack to my heart's delight. But of course I want it > to still work reliably. OpenMoko is not yet usable/reliable enough for normal use. -- Heikki Toivonen From kim.hawtin at adelaide.edu.au Fri Aug 8 05:45:26 2008 From: kim.hawtin at adelaide.edu.au (Kim Hawtin) Date: Fri, 08 Aug 2008 13:15:26 +0930 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: <489BB5DC.2030007@ulmcnett.com> References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> Message-ID: <489BC156.5080807@adelaide.edu.au> Paul McNett wrote: > What about OpenMoko? Anyone have experience with Python on that > ostensibly more open platform? Any experience at all? > > http://www.openmoko.com/ > > I'm in the market for a new phone. My wife wants an iPhone; I want > something that I can hack to my heart's delight. But of course I want it > to still work reliably. > > So I was thinking of trying openmoko and getting the iPhone for my wife, > and finding some sort of AT&T GSM family account that makes sense. I had a look at one last weekend when a large batch arrived for the local FOSS type geezers that ordered them... yes python 2.5 and maybe 2.4 is installed, from memory. gtk seems to be the default environment, IIRR, so pygtk type apps could make sense to develop, and develop them on your desktop, as openmoko just runs X cheers, kim -- Operating Systems, Services and Operations Information Technology Services, The University of Adelaide kim.hawtin at adelaide.edu.au From slander at unworkable.org Fri Aug 8 18:38:43 2008 From: slander at unworkable.org (Harry Tormey) Date: Fri, 8 Aug 2008 09:38:43 -0700 Subject: [Baypiggies] PyGameSF meetup Tuesday August 12th 7pm @ Metreon San Francisco Message-ID: <20080808163843.GA19552@unworkable.org> Hi All, just writing to say that this months PyGameSF meet up is on Tuesday August 12th from 7pm at the Metreon food court in San Francisco. This month's presentations are: - Casey Duncan/Harry Tormey: Particle engines for fun and profit About:py-lepton (http://code.google.com/p/py-lepton/) is a high-performance, pluggable particle engine and API for Python. The talk will be an overview of the engine which is written in python/c followed by a demo of an example game which uses it. The main focus of this months meet up will be to discuss preparations for the pyweek competition. PyGame SF is an informal group meet up in San Francisco for Software engineers interested in python, OpenGL, audio, pygame, SDL, programming and generally anything to do with multimedia development. The format of our meetings typically involve several people giving presentations on projects they are developing followed by group discussion and feedback. If anyone else would like to give a micro presentation, show demos or just talk about what they are doing or generally give examples of any relevant software they are working on please feel free to head along. To subscribe to the pygamesf mailing list simply email pygame-sf+subscribe at unworkable.org -- Harry Tormey From jjinux at gmail.com Sat Aug 9 09:51:07 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 9 Aug 2008 00:51:07 -0700 Subject: [Baypiggies] len(iterable) In-Reply-To: <489A5E1A.8070904@bigasterisk.com> References: <746252.47077.qm@web56415.mail.re3.yahoo.com> <489A5E1A.8070904@bigasterisk.com> Message-ID: On Wed, Aug 6, 2008 at 7:29 PM, Drew Perttula wrote: > Shannon -jj Behrens wrote: >> >> def test_iter_len(): >> assert_equal(iter_len(xrange(5)), 5) >> >> >> Gees, I'm so boring sometimes! >> > > BTW, did you ever notice that the result of xrange has a __len__ already? > > len(xrange(5)) -> 5 > > Maybe your iter_len should try that first, in case the incoming object has > thoughtfully provided a __len__ method. In this case, I know for certain that I'm trying to find out the length of some stuff streaming from a generator. -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From jjinux at gmail.com Sat Aug 9 09:48:12 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 9 Aug 2008 00:48:12 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Message-ID: On Thu, Aug 7, 2008 at 3:45 PM, Charles Merriam wrote: > I remember the GPS being specifically locked to a 'higher' level. > > I haven't found a cheat sheet; you need to look through http://forum.nokia.com. > > Fundamentally, it seems like a developer program run on bailing wire > with too many paranoid lawyers. To be fair, the engineers themselves seemed smart, helpful, and passionate about Python. I think it's tough for Nokia to get too excited about Python since they're really trying to sell the Symbian C++ thing. -jj -- Lisp programmers know the value of everything, but the cost of nothing... On my Lisp, '() costs 4 bytes. http://jjinux.blogspot.com/ From guido at python.org Sat Aug 9 18:18:52 2008 From: guido at python.org (Guido van Rossum) Date: Sat, 9 Aug 2008 09:18:52 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Message-ID: On Sat, Aug 9, 2008 at 12:48 AM, Shannon -jj Behrens wrote: > On Thu, Aug 7, 2008 at 3:45 PM, Charles Merriam > wrote: >> I remember the GPS being specifically locked to a 'higher' level. >> >> I haven't found a cheat sheet; you need to look through http://forum.nokia.com. >> >> Fundamentally, it seems like a developer program run on bailing wire >> with too many paranoid lawyers. > > To be fair, the engineers themselves seemed smart, helpful, and > passionate about Python. I think it's tough for Nokia to get too > excited about Python since they're really trying to sell the Symbian > C++ thing. Having met with these people a few times, I would say there's definite tension between Nokia as a company and the engineering group that developed the Python release. I think we can support them by contributing, promoting, and other community activities, without paying too much attention to the rest of Nokia's developer programs. Maybe it'll educate others inside Nokia about the value of open source. See also mobilenin.com... --Guido > > -jj > > -- > Lisp programmers know the value of everything, but the cost of nothing... > On my Lisp, '() costs 4 bytes. > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From annaraven at gmail.com Sun Aug 10 00:01:50 2008 From: annaraven at gmail.com (Anna Ravenscroft) Date: Sat, 9 Aug 2008 15:01:50 -0700 Subject: [Baypiggies] Python available on Nokia Devices since 2005 In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> Message-ID: On Sat, Aug 9, 2008 at 9:18 AM, Guido van Rossum wrote: > On Sat, Aug 9, 2008 at 12:48 AM, Shannon -jj Behrens > wrote: > > On Thu, Aug 7, 2008 at 3:45 PM, Charles Merriam > > wrote: > >> I remember the GPS being specifically locked to a 'higher' level. > >> > >> I haven't found a cheat sheet; you need to look through > http://forum.nokia.com. > >> > >> Fundamentally, it seems like a developer program run on bailing wire > >> with too many paranoid lawyers. > > > > To be fair, the engineers themselves seemed smart, helpful, and > > passionate about Python. I think it's tough for Nokia to get too > > excited about Python since they're really trying to sell the Symbian > > C++ thing. > > Having met with these people a few times, I would say there's definite > tension between Nokia as a company and the engineering group that > developed the Python release. I think we can support them by > contributing, promoting, and other community activities, without > paying too much attention to the rest of Nokia's developer programs. > Maybe it'll educate others inside Nokia about the value of open > source. > > See also mobilenin.com... Yes - the Python folks at Nokia are very nice and helpful people. -- cordially, Anna -- Walking through the water. Trying to get across. Just like everybody else. -------------- next part -------------- An HTML attachment was scrubbed... URL: From glen at glenjarvis.com Sun Aug 10 02:29:48 2008 From: glen at glenjarvis.com (Glen Jarvis) Date: Sat, 9 Aug 2008 17:29:48 -0700 Subject: [Baypiggies] Free three month PDF subscription to Python Magazine In-Reply-To: References: <85E05848-B115-451C-8846-9661F22D2C18@glenjarvis.com> <47c890dc0807281609i2a56d6c0ke4dc8224b04946c4@mail.gmail.com> <8249c4ac0807281815n64c67358nc2818ee5c97241ed@mail.gmail.com> <8B33B414-991E-4650-84AB-58FC3C55F8A0@pythonmagazine.com> Message-ID: I have 18 email addresses ready to be submitted to Python Magazine for the free subscription. You should have just received a private email from me if you're on the list (you may need to check your SPAM/Junk mail folder). I will be submitting these names this weekend. So, speak now or forever hold your peace -- hmmm I've heard those famous last words somewhere.. now where was that? ;) Cheers, Glen -- glen at glenjarvis.com http://www.glenjarvis.com "You must be the change you wish to see in the world." -M. Gandhi On Jul 29, 2008, at 11:57 AM, Glen Jarvis wrote: > I'm forwarding Doug's email regarding how to take advantage of the > BayPIGgies free three month subscription. My only concern is, since > BayPIGgies is an archived and public list, this may be a bit more > public than Doug wants (please see below). If we have the option of > not archiving this message, that would be great. Otherwise, I'll > have to be gatekeeper to those who see this and who aren't members > of BayPIGgies (although I'm actually way too busy for such things > and would rather not). > > In general: > 1) Go to http://www.pythonmagazine.com/ > 2) Sign up (free) with your email address (this does not get you the > subscription), > 3) Send me the email address you used to sign up > 4) I will forward all of the email addresses to Doug. He will > activate the free PDF subscription from the list I send him. > > > For details, please read below my signature. > > > Warmest Regards, > > > Glen Jarvis > -- > 415-680-3964 > glen at glenjarvis.com > http://www.glenjarvis.com > > "You must be the change you wish to see in the world." -M. Gandhi > > > On Jul 29, 2008, at 4:37 AM, Doug Hellmann wrote: > >> Hi, Glen, >> >> On Jul 28, 2008, at 10:03 PM, Glen Jarvis wrote: >> >>> Doug, >>> I believe we spoke a few times about articles in Python magazine. >>> I'm writing today >> >> Yes, I finally have the draft of that AppEngine article. Let me >> get back to you about the direction the author is taking. >> >>> regarding a special promotion for the BayPIGgies listserv group. I >>> personally would like to purchase a paper subscription to the >>> magazine. However, I am a member of BayPIGgies >> >> Excellent! >> >>> and have heard several other members who were very interested in >>> the offer previously mentioned (three month free PDF subscription >>> to the magazine). If we can work out the details of this >>> agreement, I'd like to order the magazine but make certain members >>> of BayPIGgies can also get the three month PDF subscription. >> >> To take advantage of the offer, each member of the group should go >> to our web site (http://www.pythonmagazine.com) and set up an >> account (that's already free). When they register, the site will >> ask them for an email address to identify the account. If a single >> member of the group (you or someone you nominate) sends me a list >> of all the email addresses used (no names, just email addresses), >> I'll make sure we enable the subscriptions. >> >> You can announce the offer at your next meeting, or right away if >> your group has a private communication channel like a mailing list >> (i.e., please don't post the offer on your blog). >> >> I've received a few requests for details, so I'll refer them to you >> as my point of contact. Give the group a couple of weeks to sign >> up, and then send me the list of addresses. >> >> Thanks, >> Doug >> -- >> Doug Hellmann >> Editor in Chief >> Python Magazine >> > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies From charles.merriam at gmail.com Mon Aug 11 19:45:07 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Mon, 11 Aug 2008 10:45:07 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: <489BC156.5080807@adelaide.edu.au> References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: It seems like a lot of folks are wanting to touch/play with these devices. Would people be up for a 'scripting night'? This could either be a regular BayPiggies event, or I could host a kid-friendly event at the Santa Clara Round-table Pizza. It's a low key pizza joint with a play space for kids, wi-fi, and free meeting rooms. I would envision some OLPC XOs to hack Python on, a Nokia S60 or two, an OpenMoko, and Python on the myrid little devices people have hacked. What's the interest level 1-10? For a scripting/beer thing 1-10? Charles On Thu, Aug 7, 2008 at 8:45 PM, Kim Hawtin wrote: > Paul McNett wrote: >> What about OpenMoko? Anyone have experience with Python on that >> ostensibly more open platform? Any experience at all? >> >> http://www.openmoko.com/ >> >> I'm in the market for a new phone. My wife wants an iPhone; I want >> something that I can hack to my heart's delight. But of course I want it >> to still work reliably. >> >> So I was thinking of trying openmoko and getting the iPhone for my wife, >> and finding some sort of AT&T GSM family account that makes sense. > > I had a look at one last weekend when a large batch arrived for the local > FOSS type geezers that ordered them... > > yes python 2.5 and maybe 2.4 is installed, from memory. > gtk seems to be the default environment, IIRR, so pygtk type apps could make > sense to develop, and develop them on your desktop, as openmoko just runs X > > cheers, > > kim > -- > Operating Systems, Services and Operations > Information Technology Services, The University of Adelaide > kim.hawtin at adelaide.edu.au > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From afife at untangle.com Mon Aug 11 19:49:15 2008 From: afife at untangle.com (Andrew Fife) Date: Mon, 11 Aug 2008 10:49:15 -0700 (PDT) Subject: [Baypiggies] Chris Dibona @ BALUG (8/19) Message-ID: <019d01c8fbda$97d3edb0$c77bc910$@com> Hi Folks: Chris Dibona will be speaking at BALUG next Tuesday (8/19). Chris DiBona is the open source programs manager at Mountain View, Ca. based Google, where his team oversees license compliance, promotes developer outreach, supports the open source community through programs such as the Google Summer of Code and oversees OSS releases on Google Code. (full bio below) So, if you'd like to join us please RSVP: RSVP at balug.org **Why RSVP??** Well, don't worry we won't turn you away, but the RSVPs really help the Four Seas Restaurant plan the meal and they ensure that we're able to eat upstairs in the private banquet room. Meeting Details... 6:30pm August 19th, 2008 (Next Tuesday) Four Seas Restaurant 731 Grant Ave. San Francisco, CA 94108 Easy $5 PARKING: Portsmouth Square Garage at 733 Kearny Cost: The meetings are always free, but dinner is $13 Chris Dibona's full bio: Chris DiBona is the open source programs manager at Mountain View, Ca. based Google, where his team oversees license compliance, promotes developer outreach, supports the open source community through programs such as the Google Summer of Code and oversees OSS releases on Google Code. Mr. DiBona is an internationally known advocate of open source software and related methodologies. He occasionally appears on the This Week in Tech and Cranky Geeks podcasts. He is a visiting scholar at the MIT Sloan School of Management and has a masters in software engineering from Carnegie Mellon University. Additionally, he serves on the advisory board of imeem, a San Francisco, Ca. based social networking firm. Before joining Google, Mr. DiBona was an editor and author for the website Slashdot.org . Additionally, he coedited the award-winning essay compilations "Open Sources" and "Open Sources 2.0" and writes for several publications. He was the host of Floss Weekly with Leo Laporte and made a number of appearances on TechTV's "The Screensavers" His personal blog can be found at http://dibona.com and he can be reached via email via chris at dibona.com -- Andrew Fife Untangle - The Open Source Network Gateway www.untangle.com/download 650.425.3327 desk 415.806.6028 cell -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric at ericwalstad.com Mon Aug 11 21:16:25 2008 From: eric at ericwalstad.com (Eric Walstad) Date: Mon, 11 Aug 2008 12:16:25 -0700 Subject: [Baypiggies] Meeting Registration page changes Message-ID: Hi all, I just made a large change to the registration page[0] and wanted to raise a red flag about it just in case my change was in error... I went to register for the upcoming meeting and saw that the registration page still said it was for the July meeting. Looking at the diffs[1] for that page I saw what appeared to be only a couple registration additions that were made after last month's meeting. So, I changed[2] the meeting date to match this month's meeting and sliced the list of registrants down to those that have registered after last month's meeting. Eric Walstad. [0] http://wiki.python.org/moin/BayPiggiesGoogleMeetings [2] http://wiki.python.org/moin/BayPiggiesGoogleMeetings?action=diff&rev2=1229&rev1=1225 [2] http://wiki.python.org/moin/BayPiggiesGoogleMeetings?action=diff&rev2=1230&rev1=1225 From cappy2112 at gmail.com Mon Aug 11 21:48:19 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Mon, 11 Aug 2008 12:48:19 -0700 Subject: [Baypiggies] ACCU: Software development with Nokia's Maemo platform Message-ID: <8249c4ac0808111248l7af7db98wd53d5d07381ac6fc@mail.gmail.com> With all the talk about the Nokia platforms, I thought this would be interesting to some. When: Wednesday, August 13, 2008 Topic: Software development with Nokia's Maemo platform Speaker: Tapio Tolvanen Time: 6:30pm doors open 7:00pm meeting begins Where: Symantec VCAFE building 350 Ellis Street (near E. Middlefield Road) Mountain View, CA 94043 Map: Directions: VCAFE is accessible from the semicircular courtyard between Symantec buildings Cost: Free More Info: In this talk you will learn the essentials of developing software with Maemo platform. You will be introduced to Maemo platform in technical terms and you will get to look into the development environment from different viewpoints. In addition to that you will learn how to use the platform components and how to deploy your work when it is polished. Tapio Tolvanen is currently a Technology Manager for Linux Computers in Nokia. He has also been defining architectures and guiding the development of several applications creating engaging and compelling Internet Experience on Nokia's Linux platform - Maemo. Prior to this, Tapio has been developing several applications and products on Nokia's platforms, including Series 40, S60 and Maemo in Europe, Asia and the U.S.A. ---- The ACCU meets monthly. Meetings are always open to the public and are free of charge. To suggest topics and speakers please email Walter Vannini via walterv at gbbservices.com From glen at glenjarvis.com Mon Aug 11 20:06:49 2008 From: glen at glenjarvis.com (Glen Jarvis) Date: Mon, 11 Aug 2008 11:06:49 -0700 Subject: [Baypiggies] BayPIGies Free 3 month PDF subscription In-Reply-To: <0CABA2E4-EB4E-4CB2-A0F3-D98B06B28403@pythonmagazine.com> References: <6BBC63C4-A379-469A-A894-F6DF5C122829@glenjarvis.com> <0CABA2E4-EB4E-4CB2-A0F3-D98B06B28403@pythonmagazine.com> Message-ID: <8537DE20-BCE8-4695-B875-AFBD64358B75@glenjarvis.com> Please see Doug's email below. Also, I have officially stopped taking requests for this now. Glen On Aug 11, 2008, at 10:56 AM, Doug Hellmann wrote: > I've sent these over to the person who activates the accounts. It > may take a few days, but each person will receive an email when the > subscriptions are activated. > > Doug > > On Aug 11, 2008, at 1:54 PM, Glen Jarvis wrote: > >> Doug, >> ...Here is the list of BayPIGgies email addresses (as they >> registered on the Python Magazine site) that would like a free 3- >> month PDF subscription. ... From jim at well.com Mon Aug 11 23:27:51 2008 From: jim at well.com (jim) Date: Mon, 11 Aug 2008 14:27:51 -0700 Subject: [Baypiggies] BayPIGies Free 3 month PDF subscription In-Reply-To: <8537DE20-BCE8-4695-B875-AFBD64358B75@glenjarvis.com> References: <6BBC63C4-A379-469A-A894-F6DF5C122829@glenjarvis.com> <0CABA2E4-EB4E-4CB2-A0F3-D98B06B28403@pythonmagazine.com> <8537DE20-BCE8-4695-B875-AFBD64358B75@glenjarvis.com> Message-ID: <1218490071.10905.1044.camel@ubuntu> thank you, glen. On Mon, 2008-08-11 at 11:06 -0700, Glen Jarvis wrote: > Please see Doug's email below. Also, I have officially stopped taking > requests for this now. > > Glen > > On Aug 11, 2008, at 10:56 AM, Doug Hellmann wrote: > > > I've sent these over to the person who activates the accounts. It > > may take a few days, but each person will receive an email when the > > subscriptions are activated. > > > > Doug > > > > On Aug 11, 2008, at 1:54 PM, Glen Jarvis wrote: > > > >> Doug, > >> ...Here is the list of BayPIGgies email addresses (as they > >> registered on the Python Magazine site) that would like a free 3- > >> month PDF subscription. ... > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From mrbmahoney at gmail.com Tue Aug 12 15:31:55 2008 From: mrbmahoney at gmail.com (Brian Mahoney) Date: Tue, 12 Aug 2008 06:31:55 -0700 Subject: [Baypiggies] Dinner Announcement - Thursday, August 14, 6 pm Message-ID: <5538c19b0808120631g22e87bfege39e7ce5664ad74f@mail.gmail.com> For Thursday, August 14, I can coordinate a pre-meeting dinner in Mountain View, before the BayPIGgies meeting at Google . Restaurant reservations may be sent to my email until Thursday afternoon (earlier is better). We eat family-style, there are vegetarian and non-vegetarian dishes. Cost around $10 per person, including tax and tip. Bring cash, please. Start dinner at 6pm and I will keep things moving so that we finish and get everyone headed towards Google to complete sign-in before the 7:30 meeting start. The restaurant is Cafe Yulong in downtown Mountain View (650) 960-1677 743 W Dana Street, 1/2 block from Castro where Books, Inc is on the corner. Parking lots all around, but downtown Mountain View parking can be difficult. It is a slightly out of the ordinary Chinese restaurant. This link has a downtown map and additional information. http://www.mountainviewca.net/restaurants/cafeyulong.html I've made reservations under "Python" for 6pm Thursday. If you wish to join us for dinner please e-mail me by 3 pm Thursday (earlier is better) so I may confirm the headcount. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at well.com Tue Aug 12 16:18:01 2008 From: jim at well.com (jim) Date: Tue, 12 Aug 2008 07:18:01 -0700 Subject: [Baypiggies] [Fwd: [sf-lug] Think Python...] Message-ID: <1218550681.10905.1103.camel@ubuntu> as seen on the sf-lug mailing list per the link below: This book is a substantially revised version of How to Think Like a Computer Scientist: Learning with Python. ---------------------------------- Think Python An Introduction to Software Design Think Python is a free textbook available under the GNU Free Documentation License. Readers are free to copy and distribute the text;they are also free to modify it, which allows them to adapt the book todifferent needs, and to help develop new material. http://greenteapress.com/thinkpython/ Thanks to Jason Stone for the tip. cheers, Sameer From asheesh at asheesh.org Tue Aug 12 18:43:58 2008 From: asheesh at asheesh.org (Asheesh Laroia) Date: Tue, 12 Aug 2008 13:43:58 -0300 (ART) Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: On Mon, 11 Aug 2008, Charles Merriam wrote: > It seems like a lot of folks are wanting to touch/play with these > devices. Would people be up for a 'scripting night'? > > This could either be a regular BayPiggies event, or I could host a > kid-friendly event at the Santa Clara Round-table Pizza. It's a low > key pizza joint with a play space for kids, wi-fi, and free meeting > rooms. I'd like this. I'd like to say public transit accessibility (plus bike if necessary) (or carpool-ability in case that doesn't work) is a major factor for my attendance. Google HQ is okay for public transit + bike, and also has lots of carpooling by people on this list. That's my two cents. Hopefully this event happens, and in a way that can get the most people (hopefully including myself) there! > What's the interest level 1-10? For a scripting/beer thing 1-10? I'd say 7 to both, so long as the latter is easy enough to get to. For OM though, it might make more sense to give an overview of the current state of the platform. To that end, Michael Shiloh might want to present at a BayPiggies meeting.... -- Asheesh. -- Linus? Whose that? -- clueless newbie on #Linux From guido at python.org Tue Aug 12 20:10:00 2008 From: guido at python.org (Guido van Rossum) Date: Tue, 12 Aug 2008 11:10:00 -0700 Subject: [Baypiggies] Please help answering these 10 FAQs about Python Message-ID: There's an effort under way to answer a list of 10 questions that were chosen somewhat arbitrarily as representing what everyone wants to know about Python. Please help! http://wiki.python.org/moin/Ten_things_people_want_to_know_about_Python -- --Guido van Rossum (home page: http://www.python.org/~guido/) From slander at unworkable.org Tue Aug 12 22:51:31 2008 From: slander at unworkable.org (Harry Tormey) Date: Tue, 12 Aug 2008 13:51:31 -0700 Subject: [Baypiggies] Reminder: PyGameSF meetup Tonight 7pm @ Metreon San Francisco Message-ID: <20080812205131.GB4766@unworkable.org> Hi All, just writing to say that this months PyGameSF meet up is on Tonight August 12th from 7pm at the Metreon food court in San Francisco. This month's presentations are: - Casey Duncan/Harry Tormey: Particle engines for fun and profit About: A high-performance, pluggable particle engine and API for Python. The talk will be an overview of the engine which is written in python/c and then an example game which uses it. The main focus of this months meet up will be to discuss preparations for the pyweek competition. -- Harry Tormey From lhawthorn at google.com Wed Aug 13 00:54:40 2008 From: lhawthorn at google.com (Leslie Hawthorn) Date: Tue, 12 Aug 2008 15:54:40 -0700 Subject: [Baypiggies] Meeting Registration page changes In-Reply-To: References: Message-ID: <4869cee70808121554l5d2ca1eao6fb406b1b9b13a78@mail.gmail.com> That's awesome - thanks for your help Eric. :) On Mon, Aug 11, 2008 at 12:16 PM, Eric Walstad wrote: > Hi all, > > I just made a large change to the registration page[0] and wanted to > raise a red flag about it just in case my change was in error... > > I went to register for the upcoming meeting and saw that the > registration page still said it was for the July meeting. Looking at > the diffs[1] for that page I saw what appeared to be only a couple > registration additions that were made after last month's meeting. So, > I changed[2] the meeting date to match this month's meeting and sliced > the list of registrants down to those that have registered after last > month's meeting. > > Eric Walstad. > [0] http://wiki.python.org/moin/BayPiggiesGoogleMeetings > [2] > http://wiki.python.org/moin/BayPiggiesGoogleMeetings?action=diff&rev2=1229&rev1=1225 > [2] > http://wiki.python.org/moin/BayPiggiesGoogleMeetings?action=diff&rev2=1230&rev1=1225 > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Leslie Hawthorn Program Manager - Open Source Google Inc. http://code.google.com/opensource/ I blog here: http://google-opensource.blogspot.com - http://www.hawthornlandings.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at well.com Wed Aug 13 02:14:18 2008 From: jim at well.com (jim) Date: Tue, 12 Aug 2008 17:14:18 -0700 Subject: [Baypiggies] BayPIGgies meeting Thursday August 14, 2008: Scons by Steven Knight Message-ID: <1218586458.10905.1150.camel@ubuntu> BayPIGgies meeting Thursday August 14, 2008: Scons by Steven Knight SCons is a next-generation software build tool (that is, a replacement for Make) written in Python, with build configuration written as a Python API. Since the SCons Project was founded in 2001, it's grown into a successful project with about 7000 downloads / month and an especially strong following among software developers and build engineers working on large-scale, enterprise-quality software projects, including production use at VMware, Intel, Oracle, id Software, and Google. This talk will give a summary of the history and growth of the SCons project and an overview of SCons configuration. It will also discuss some of the more interesting aspects of SCons as a Python-based project, including why (and how) SCons still runs on Python 1.5.2, its rather distinctive approach to stringent software testing, and some of its ad-hoc solutions to the problem of trying to ship a stand-alone application that happens to be written in Python (as opposed to the distutils-installed-module model of most Python software). The talk will also include some frank discussion of SCons' limitations and problem areas, and what you (yes, you!) can do to help. About the speaker: Steven Knight has been a software engineer, executive, and would-be entrepreneur for more than 25 years at companies such as Cray Research, The MathWorks, and more networking-related startups than he can unashamedly admit. He founded the SCons Project in 2001 after its design won the Software Carpentry build tool competition the previous year. He recently transplanted to the Bay Area to work on software build issues for Google. The meeting starts with a Newbie Nugget, a short discussion of an essential Python feature, specially for those new to Python. Tonight's Newbie Nugget is... The Google App Engine: Magic Cars versus Taxis A look at what the Google App Engine delivers and how it fits into the ecosystem; getting up and running; the process of writing an application, GQL code; and some analogies, presented by Charles Merriam. Location: Google Campus Building 40, the Seville room (check in at the lobby in bldg 43) bayPIGgies meeting information: http://baypiggies.net/new/plone * Please sign up in advance to have your google access badge ready: http://wiki.python.org/moin/BayPiggiesGoogleMeetings (no later than close of business on Wednesday.) Agenda ..... 7:30 PM ........................... General hubbub, inventory end-of-meeting announcements, any first-minute announcements. ..... 7:35 PM to 7:45 PM ................ Newbie Nugget Google App Engine by Charles Merriam ..... 7:45 PM to 8:45 PM ................ Scons by Steven Knight ..... 8:45 PM to 9:00 PM -- After The Talk ................ Mapping and Random Access Mapping is a rapid-fire audience announcement of topics the announcers are interested in. Random Access follows immediately to allow follow up individually on the announcements and other topics of interest. ..... Thursday, September 11 ................ 7:30 PM BayPIGgies Tim Thompson on Bay Area Computer Music Technology presentation on Finger Painting with Planets From l at lucasvo.com Wed Aug 13 14:08:34 2008 From: l at lucasvo.com (Lucas Vogelsang) Date: Wed, 13 Aug 2008 14:08:34 +0200 Subject: [Baypiggies] Looking for a Ride to DjangoCon Message-ID: <48A2CEC2.6010004@lucasvo.com> Hi, A friend and me are moving from Switzerland to San Francisco in 3 weeks and one of the fist things we'll do is to attend DjangoCon. Because we only arrive on Sep. 4, we won't have a car at this point to go the Google Plex. Is there anyone attending DjangoCon who could give either both of us or one of us a ride? cheers, Lucas From jbarcelona at gmail.com Wed Aug 13 20:31:58 2008 From: jbarcelona at gmail.com (Jim Barcelona) Date: Wed, 13 Aug 2008 11:31:58 -0700 Subject: [Baypiggies] looking for speakers for the august 19th python meetup at loomia.com in San Francisco Message-ID: Hey Folks, Is there anybody on this list interested in giving a talk on a python project they're working on at loomia.com in San Francisco for the next Python meetup? At the last meetup, we went over the basics of getting Python installed on a computer, and doing some really super basic code, but now that the audience has shifted over to more advanced coders, we'd definitely love to hear about some cool projects. There will be free pizza and booze. Details are here: http://python.meetup.com/189/ Cheers, Barce Please let me know if ya want to -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Thu Aug 14 23:23:07 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 14 Aug 2008 14:23:07 -0700 Subject: [Baypiggies] Input in hex format Message-ID: Greetings all, One very simple question please. I want to assign hex value to one of my class field. Can someone please tell me how can give hex and binary input to one of my class field? By default, it is taking in decimal and that is expected. After all code should be for human not for machines. thanks, david -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvrebert at gmail.com Thu Aug 14 23:30:59 2008 From: cvrebert at gmail.com (Chris Rebert) Date: Thu, 14 Aug 2008 14:30:59 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: References: Message-ID: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> hex_num = int(raw_input("prompt here"), 16) #allows optional leading 0X or 0x binary_num = int(raw_input("prompt here"),2) Or generally: num = int("number as string", base) - Chris ======== Follow the path of the Iguana... Rebertia: http://rebertia.com Blog: http://blog.rebertia.com On Thu, Aug 14, 2008 at 2:23 PM, David Elsen wrote: > > Greetings all, > > One very simple question please. > > I want to assign hex value to one of my class field. > > Can someone please tell me how can give hex and binary input to one of my > class field? > > By default, it is taking in decimal and that is expected. After all code > should be for human not for machines. > > thanks, > david > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From elsen.david08 at gmail.com Fri Aug 15 00:45:17 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 14 Aug 2008 15:45:17 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> References: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> Message-ID: Thanks Chris. I tried following: #reg_offset = int(raw_input("enter offset",16)) reg_offset = int("enter offset",16) print reg_offset and got the following error with "raw input" option: Traceback (most recent call last): File "testclass.py", line 33, in reg_offset = int(raw_input("enter offset",16)) TypeError: [raw_]input expected at most 1 arguments, got 2 Without raw input, I got following error: Traceback (most recent call last): File "testclass.py", line 34, in reg_offset = int("enter offset",16) ValueError: invalid literal for int() with base 16: 'enter offset' I want to use it in a class like following: class Reg: def __init__(self, name, offset, val): self.name = name self.offset = offset self.val = val *reg1 = Reg("Address Register", 0, 50000000)* ** *Here the offset and val fields are in HEX which I want to pass them to my class REG.* print 'reg name = %s'%reg1.name print 'reg offset =%x'%reg1.offset print 'reg reset val =%d'%reg1.val Thanks, David On Thu, Aug 14, 2008 at 2:30 PM, Chris Rebert wrote: > hex_num = int(raw_input("prompt here"), 16) #allows optional leading 0X or > 0x > binary_num = int(raw_input("prompt here"),2) > > Or generally: > num = int("number as string", base) > > - Chris > > ======== > Follow the path of the Iguana... > Rebertia: http://rebertia.com > Blog: http://blog.rebertia.com > > > On Thu, Aug 14, 2008 at 2:23 PM, David Elsen > wrote: > > > > Greetings all, > > > > One very simple question please. > > > > I want to assign hex value to one of my class field. > > > > Can someone please tell me how can give hex and binary input to one of my > > class field? > > > > By default, it is taking in decimal and that is expected. After all code > > should be for human not for machines. > > > > thanks, > > david > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spmcinerney at hotmail.com Fri Aug 15 01:26:26 2008 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Thu, 14 Aug 2008 16:26:26 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> References: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> Message-ID: David, I did this a while back, it's not as trivial as it looks. Two subtle points: a) In general the result could be 64bits or greater (although your case is probably 32b). int(...,16) may sometimes return the full 64b result, but is better to explicitly write long(...,16). (And for anyone wanting to convert hex values >64b, I am not aware of any automatic way other than first chunking the result into 16-hex-digit subsequences (and see the next point), and returning say a tuple-of-longs). b) I was parsing Verilog syntax which also allows optional underscores inside hex numbers, usually by convention placed every four or eight hex characters from the RHS for human readability, e.g. "0xa_bcde_1234" For things like that you must first make a regex or string substitution (re.sub or the deprecated string.replace or string.translate) For constants >64b long, must do padding-character removal (b) before chunking it to do conversion (a). Best, Stephen _________________________________________________________________ Your PC, mobile phone, and online services work together like never before. http://clk.atdmt.com/MRT/go/108587394/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From spmcinerney at hotmail.com Fri Aug 15 01:28:05 2008 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Thu, 14 Aug 2008 16:28:05 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: References: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> Message-ID: The 16 is the second arg of (int,..16), not the second arg of raw_input("prompt here") Date: Thu, 14 Aug 2008 15:45:17 -0700From: elsen.david08 at gmail.comTo: cvrebert at gmail.comCC: baypiggies at python.orgSubject: Re: [Baypiggies] Input in hex format Thanks Chris. I tried following: #reg_offset = int(raw_input("enter offset",16))reg_offset = int("enter offset",16)print reg_offset and got the following error with "raw input" option: Traceback (most recent call last): File "testclass.py", line 33, in reg_offset = int(raw_input("enter offset",16))TypeError: [raw_]input expected at most 1 arguments, got 2 Without raw input, I got following error: Traceback (most recent call last): File "testclass.py", line 34, in reg_offset = int("enter offset",16)ValueError: invalid literal for int() with base 16: 'enter offset' I want to use it in a class like following: class Reg: def __init__(self, name, offset, val): self.name = name self.offset = offset self.val = val reg1 = Reg("Address Register", 0, 50000000) Here the offset and val fields are in HEX which I want to pass them to my class REG. print 'reg name = %s'%reg1.nameprint 'reg offset =%x'%reg1.offsetprint 'reg reset val =%d'%reg1.val Thanks, David On Thu, Aug 14, 2008 at 2:30 PM, Chris Rebert wrote: hex_num = int(raw_input("prompt here"), 16) #allows optional leading 0X or 0xbinary_num = int(raw_input("prompt here"),2)Or generally:num = int("number as string", base)- Chris========Follow the path of the Iguana...Rebertia: http://rebertia.comBlog: http://blog.rebertia.com On Thu, Aug 14, 2008 at 2:23 PM, David Elsen wrote:>> Greetings all,>> One very simple question please.>> I want to assign hex value to one of my class field.>> Can someone please tell me how can give hex and binary input to one of my> class field?>> By default, it is taking in decimal and that is expected. After all code> should be for human not for machines.>> thanks,> david> _______________________________________________> Baypiggies mailing list> Baypiggies at python.org> To change your subscription options or unsubscribe:> http://mail.python.org/mailman/listinfo/baypiggies> _________________________________________________________________ Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia Contest http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Fri Aug 15 01:46:05 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 14 Aug 2008 16:46:05 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: <74e7428a0808141625t30b19c09w5f292ccd849abb4d@mail.gmail.com> References: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> <74e7428a0808141600n2a40c6ffr71eba9a04e3d8d95@mail.gmail.com> <74e7428a0808141625t30b19c09w5f292ccd849abb4d@mail.gmail.com> Message-ID: thanks for the help. It works. On Thu, Aug 14, 2008 at 4:25 PM, Andy Wiggin wrote: > No problem. I replied off-list accidentally. Maybe you could let them > know you've got your answer. -Andy > > On Thu, Aug 14, 2008 at 4:08 PM, David Elsen > wrote: > > Yes, that works. Ton of Thanks for your help. > > > > On Thu, Aug 14, 2008 at 4:00 PM, Andy Wiggin > wrote: > >> > >> I think maybe you just need to use a hex-format literal. E.g.: > >> > >> reg1 = Reg("Address Register", 0, 0x50000000) > >> > >> -Andy > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Fri Aug 15 01:50:15 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 14 Aug 2008 16:50:15 -0700 Subject: [Baypiggies] Input in hex format In-Reply-To: References: <47c890dc0808141430p112f142dnc418ea4d15b0e5d3@mail.gmail.com> Message-ID: Stephen, I also want to parse the verilog syntax. I will work on your suggestion. For now, Chris suggestion got me going. I can pass the hex input just with 0x..... to my class. Thanks a lot for suggestion. David On Thu, Aug 14, 2008 at 4:26 PM, Stephen McInerney wrote: > David, > > I did this a while back, it's not as trivial as it looks. > Two subtle points: > > a) In general the result could be 64bits or greater (although your case is > probably 32b). > int(...,16) may sometimes return the full 64b result, but is better to > explicitly > write long(...,16). > (And for anyone wanting to convert hex values >64b, I am not aware of any > automatic way other than first chunking the result into 16-hex-digit > subsequences (and see the next point), and returning say a tuple-of-longs). > > b) I was parsing Verilog syntax which also allows optional underscores > inside hex numbers, > usually by convention placed every four or eight hex characters from > the RHS for human readability, e.g. "0xa_bcde_1234" > For things like that you must first make a regex or string substitution > (re.sub > or the deprecated string.replace or string.translate) > For constants >64b long, must do padding-character removal (b) before > chunking it to do conversion (a). > > Best, > Stephen > > ------------------------------ > Your PC, mobile phone, and online services work together like never before. > See how Windows(R) fits your life > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.merriam at gmail.com Fri Aug 15 12:51:49 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Fri, 15 Aug 2008 03:51:49 -0700 Subject: [Baypiggies] Google App Engine - 7 minute talk Message-ID: Here's the write-up of my 7-minute talk on the Google Application Engine. http://www.charlesmerriam.com/blog/?p=155 From jjinux at gmail.com Fri Aug 15 14:07:01 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 15 Aug 2008 05:07:01 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: On Tue, Aug 12, 2008 at 9:43 AM, Asheesh Laroia wrote: > On Mon, 11 Aug 2008, Charles Merriam wrote: > >> It seems like a lot of folks are wanting to touch/play with these >> devices. Would people be up for a 'scripting night'? >> >> This could either be a regular BayPiggies event, or I could host a >> kid-friendly event at the Santa Clara Round-table Pizza. It's a low >> key pizza joint with a play space for kids, wi-fi, and free meeting >> rooms. > > I'd like this. I'd like to say public transit accessibility (plus bike if > necessary) (or carpool-ability in case that doesn't work) is a major factor > for my attendance. Google HQ is okay for public transit + bike, and also > has lots of carpooling by people on this list. > > That's my two cents. Hopefully this event happens, and in a way that can > get the most people (hopefully including myself) there! > >> What's the interest level 1-10? For a scripting/beer thing 1-10? > > I'd say 7 to both, so long as the latter is easy enough to get to. > > For OM though, it might make more sense to give an overview of the current > state of the platform. To that end, Michael Shiloh might want to present at > a BayPiggies meeting.... > > -- Asheesh. > > -- > Linus? Whose that? > -- clueless newbie on #Linux Why don't we ask the Nokia guys to come give a talk at BayPiggies? They gave a talk at SDForum a few years back. Best Regards, -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From guido at python.org Fri Aug 15 20:03:37 2008 From: guido at python.org (Guido van Rossum) Date: Fri, 15 Aug 2008 11:03:37 -0700 Subject: [Baypiggies] Google App Engine - 7 minute talk In-Reply-To: References: Message-ID: Neat write-up! One tiny correction: App Engine's datastore has nothing to do with Google Base. The underlying datastore is called Bigtable (and if you Google for it you'll find several good papers about it). On Fri, Aug 15, 2008 at 3:51 AM, Charles Merriam wrote: > Here's the write-up of my 7-minute talk on the Google Application Engine. > > http://www.charlesmerriam.com/blog/?p=155 -- --Guido van Rossum (home page: http://www.python.org/~guido/) From charles.merriam at gmail.com Fri Aug 15 21:23:41 2008 From: charles.merriam at gmail.com (Charles Merriam) Date: Fri, 15 Aug 2008 12:23:41 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: Great point! In a perfect world, we could get OpenMoko, Nokia, and Andriod to talk. It may be easier to get three "20 minute talk" commitments than one long one. Charles On Fri, Aug 15, 2008 at 5:07 AM, Shannon -jj Behrens wrote: > On Tue, Aug 12, 2008 at 9:43 AM, Asheesh Laroia wrote: >> On Mon, 11 Aug 2008, Charles Merriam wrote: >> >>> It seems like a lot of folks are wanting to touch/play with these >>> devices. Would people be up for a 'scripting night'? >>> >>> This could either be a regular BayPiggies event, or I could host a >>> kid-friendly event at the Santa Clara Round-table Pizza. It's a low >>> key pizza joint with a play space for kids, wi-fi, and free meeting >>> rooms. >> >> I'd like this. I'd like to say public transit accessibility (plus bike if >> necessary) (or carpool-ability in case that doesn't work) is a major factor >> for my attendance. Google HQ is okay for public transit + bike, and also >> has lots of carpooling by people on this list. >> >> That's my two cents. Hopefully this event happens, and in a way that can >> get the most people (hopefully including myself) there! >> >>> What's the interest level 1-10? For a scripting/beer thing 1-10? >> >> I'd say 7 to both, so long as the latter is easy enough to get to. >> >> For OM though, it might make more sense to give an overview of the current >> state of the platform. To that end, Michael Shiloh might want to present at >> a BayPiggies meeting.... >> >> -- Asheesh. >> >> -- >> Linus? Whose that? >> -- clueless newbie on #Linux > > Why don't we ask the Nokia guys to come give a talk at BayPiggies? > They gave a talk at SDForum a few years back. > > Best Regards, > -jj > > -- > Don't you wish you had a really clever sig like mine? > http://jjinux.blogspot.com/ > From daryl.spitzer at gmail.com Fri Aug 15 22:32:29 2008 From: daryl.spitzer at gmail.com (Daryl Spitzer) Date: Fri, 15 Aug 2008 13:32:29 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: > In a perfect world, we could get OpenMoko, Nokia, and Andriod... Is there any support for Python on Android? -- Daryl On Fri, Aug 15, 2008 at 12:23 PM, Charles Merriam wrote: > Great point! > > In a perfect world, we could get OpenMoko, Nokia, and Andriod to talk. > It may be easier to get three "20 minute talk" commitments than one > long one. > > Charles > > > On Fri, Aug 15, 2008 at 5:07 AM, Shannon -jj Behrens wrote: >> On Tue, Aug 12, 2008 at 9:43 AM, Asheesh Laroia wrote: >>> On Mon, 11 Aug 2008, Charles Merriam wrote: >>> >>>> It seems like a lot of folks are wanting to touch/play with these >>>> devices. Would people be up for a 'scripting night'? >>>> >>>> This could either be a regular BayPiggies event, or I could host a >>>> kid-friendly event at the Santa Clara Round-table Pizza. It's a low >>>> key pizza joint with a play space for kids, wi-fi, and free meeting >>>> rooms. >>> >>> I'd like this. I'd like to say public transit accessibility (plus bike if >>> necessary) (or carpool-ability in case that doesn't work) is a major factor >>> for my attendance. Google HQ is okay for public transit + bike, and also >>> has lots of carpooling by people on this list. >>> >>> That's my two cents. Hopefully this event happens, and in a way that can >>> get the most people (hopefully including myself) there! >>> >>>> What's the interest level 1-10? For a scripting/beer thing 1-10? >>> >>> I'd say 7 to both, so long as the latter is easy enough to get to. >>> >>> For OM though, it might make more sense to give an overview of the current >>> state of the platform. To that end, Michael Shiloh might want to present at >>> a BayPiggies meeting.... >>> >>> -- Asheesh. >>> >>> -- >>> Linus? Whose that? >>> -- clueless newbie on #Linux >> >> Why don't we ask the Nokia guys to come give a talk at BayPiggies? >> They gave a talk at SDForum a few years back. >> >> Best Regards, >> -jj >> >> -- >> Don't you wish you had a really clever sig like mine? >> http://jjinux.blogspot.com/ >> > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From matt at matt-good.net Sat Aug 16 00:39:49 2008 From: matt at matt-good.net (Matt Good) Date: Fri, 15 Aug 2008 15:39:49 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <64e45fca0808071328m64484f70j4baf51c0221fc062@mail.gmail.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: On Aug 15, 2008, at 1:32 PM, Daryl Spitzer wrote: >> In a perfect world, we could get OpenMoko, Nokia, and Andriod... > > Is there any support for Python on Android? I haven't seen any evidence that someone's gotten it working, but at least in theory you could use Jython: http://groups.google.com/group/android-developers/browse_thread/thread/89a92e114f3df423 -- Matt From jjinux at gmail.com Sat Aug 16 10:01:46 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Sat, 16 Aug 2008 01:01:46 -0700 Subject: [Baypiggies] Python on OpenMoko In-Reply-To: References: <705380.90957.qm@web56510.mail.re3.yahoo.com> <489BB5DC.2030007@ulmcnett.com> <489BC156.5080807@adelaide.edu.au> Message-ID: (Going off topic even further:) By the way, I talked to a guy at the Openmoko booth at LinuxExpo. I told him that I'd be very interested in running Openmoko hardware, which is fully open, with Android, which I'm guessing will be relatively polished by the end of the year. He said that they had been talking to Google about it, but it's still up to Google to decide on a timetable. Unfortunately, Openmoko still isn't ready for everyday use yet. I'm waiting hopefully. -jj From afife at untangle.com Mon Aug 18 20:48:18 2008 From: afife at untangle.com (Andrew Fife) Date: Mon, 18 Aug 2008 11:48:18 -0700 (PDT) Subject: [Baypiggies] BALUG Tomorrow = Chris Dibona Message-ID: <01a201c90162$fb2a83a0$f17f8ae0$@com> Hi Folks: This is a quick reminder that Chris Dibona, the open source programs manager at Google, will be speaking at BALUG tomorrow. (full bio below) So, if you'd like to join us please RSVP: rsvp at balug.org **Why RSVP??** Well, don't worry we won't turn you away, but the RSVPs really help the Four Seas Restaurant plan the meal and they ensure that we're able to eat upstairs in the private banquet room. Meeting Details... 6:30pm August 19th, 2008 (Tomorrow!) Four Seas Restaurant 731 Grant Ave. San Francisco, CA 94108 Easy $5 PARKING: Portsmouth Square Garage at 733 Kearny Cost: The meetings are always free, but dinner is $13 Chris DiBona's full bio: Chris DiBona is the open source programs manager at Mountain View, CA based Google, where his team oversees license compliance, promotes developer outreach, supports the open source community through programs such as the Google Summer of Code and oversees OSS releases on Google Code. Mr. DiBona is an internationally known advocate of open source software and related methodologies. He occasionally appears on the This Week in Tech and Cranky Geeks podcasts. He is a visiting scholar at the MIT Sloan School of Management and has a masters in software engineering from Carnegie Mellon University. Additionally, he serves on the advisory board of imeem, a San Francisco, CA based social networking firm. Before joining Google, Mr. DiBona was an editor and author for the website Slashdot.org. Additionally, he coedited the award-winning essay compilations "Open Sources" and "Open Sources 2.0" and writes for several publications. He was the host of Floss Weekly with Leo Laporte and made a number of appearances on TechTV's "The Screensavers". -- Andrew Fife Untangle - The Open Source Network Gateway www.untangle.com/download 650.425.3327 desk 415.806.6028 cell -------------- next part -------------- An HTML attachment was scrubbed... URL: From javarobert at yahoo.com Wed Aug 20 20:32:20 2008 From: javarobert at yahoo.com (Robert Schultheis) Date: Wed, 20 Aug 2008 11:32:20 -0700 (PDT) Subject: [Baypiggies] Nokia and Python Talks, Devices and Demos Message-ID: <335799.25215.qm@web56506.mail.re3.yahoo.com> Hi, I represent Forum Nokia in Mountain View, California and would be happy to speak to the Bay Area Python Interest Group. If there is some interest in seeing some Nokia devices and trying some Python hacking, I can provide some devices for a pizza and hacking event. I recently joined the BayPIGies group and looking forward to meeting other group members. My background is in Unix (Solaris) and Linux. Pys60 is pretty cool way to use my skills on mobile devices. Cheers, Robert Schultheis Forum Nokia Mountain View, CA From cappy2112 at gmail.com Wed Aug 20 22:55:15 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Wed, 20 Aug 2008 13:55:15 -0700 Subject: [Baypiggies] Erlang Erloung @ Yahoo Message-ID: <8249c4ac0808201355g7cf1e1adqe0b58aa43f918039@mail.gmail.com> A few people have talked about Erlang at the meetings (casually, not in a presentation per-se) so ... http://groups.google.com/group/bayfp/browse_thread/thread/47f3c8224cb77047?hl=en (This was posted in the Bay Area Functional Programmers list) From jjinux at gmail.com Thu Aug 21 00:49:05 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 20 Aug 2008 15:49:05 -0700 Subject: [Baypiggies] Erlang Erloung @ Yahoo In-Reply-To: <8249c4ac0808201355g7cf1e1adqe0b58aa43f918039@mail.gmail.com> References: <8249c4ac0808201355g7cf1e1adqe0b58aa43f918039@mail.gmail.com> Message-ID: On Wed, Aug 20, 2008 at 1:55 PM, Tony Cappellini wrote: > A few people have talked about Erlang at the meetings (casually, not > in a presentation per-se) so ... > > http://groups.google.com/group/bayfp/browse_thread/thread/47f3c8224cb77047?hl=en > (This was posted in the Bay Area Functional Programmers list) By the way, I'm keeping my eye on http://wiki.reia-lang.org/wiki/Main_Page: "Reia (pronounced RAY-uh) is a Python/Ruby-like scripting language for the Erlang virtual machine (BEAM). Reia aims to expose all the features and functionality of Erlang in a language more familiar to programmers of scripting languages, while improving string handling, regular expressions, linking with external libraries, and other tasks which are generally considered outside the scope of Erlang." -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From elsen.david08 at gmail.com Thu Aug 21 02:53:47 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Wed, 20 Aug 2008 17:53:47 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? Message-ID: Hello all, I have defined a class as following: class reg: def __init__ (self, offset): self.offset = offset def reg_read(self, offset): print 'Read the reg conten specified by offset' import os read_cmd = './testtool 0x50' read_content = os.popen(read_cmd).read() reg1 = reg (0x50) reg1.reg_read(0x50) The above code calls my c executable with offset 0x50 and gives me the content of 0x50 offset. I wanted to change the above code as following: class reg: def __init__ (self, offset): self.offset = offset def reg_read(self, offset): print 'Read the reg conten specified by offset' import os read_cmd = './testtool *offset*' read_content = os.popen(read_cmd).read() reg1 = reg (0x50) reg1.reg_read(0x50) Basically I wanted to pass the offset as input parameter to my executable "testtool" and run the testtool for offset. But looks like it does not allow me to change my offset. Is there a way to do this in python? Thanks in advance, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjinux at gmail.com Thu Aug 21 02:59:02 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Wed, 20 Aug 2008 17:59:02 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: On Wed, Aug 20, 2008 at 5:53 PM, David Elsen wrote: > Hello all, > > I have defined a class as following: > > class reg: > def __init__ (self, offset): > self.offset = offset > > def reg_read(self, offset): > print 'Read the reg conten specified by offset' > import os > read_cmd = './testtool 0x50' > read_content = os.popen(read_cmd).read() > > reg1 = reg (0x50) > > reg1.reg_read(0x50) > > > The above code calls my c executable with offset 0x50 and gives me the > content of 0x50 offset. > > I wanted to change the above code as following: > > class reg: > def __init__ (self, offset): > self.offset = offset > > def reg_read(self, offset): > print 'Read the reg conten specified by offset' > import os > read_cmd = './testtool offset' > read_content = os.popen(read_cmd).read() > > reg1 = reg (0x50) > > reg1.reg_read(0x50) > > Basically I wanted to pass the offset as input parameter to my executable > "testtool" and run the testtool for offset. > > But looks like it does not allow me to change my offset. > > Is there a way to do this in python? > > Thanks in advance, > David Have a peek at http://docs.python.org/lib/module-subprocess.html. This has the additional benefit that you can pass a list of args instead of a single string. -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From eric at ericwalstad.com Thu Aug 21 04:31:41 2008 From: eric at ericwalstad.com (Eric Walstad) Date: Wed, 20 Aug 2008 19:31:41 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: Hi David On Wed, Aug 20, 2008 at 5:53 PM, David Elsen wrote: ... > read_cmd = './testtool offset' > read_content = os.popen(read_cmd).read() > > reg1 = reg (0x50) > > reg1.reg_read(0x50) > > Basically I wanted to pass the offset as input parameter to my executable > "testtool" and run the testtool for offset. Will this work for you? >>> for offset in range(75, 86): ... read_cmd = './testtool %#x' % offset ... print read_cmd ... ./testtool 0x4b ./testtool 0x4c ./testtool 0x4d ./testtool 0x4e ./testtool 0x4f ./testtool 0x50 ./testtool 0x51 ./testtool 0x52 ./testtool 0x53 ./testtool 0x54 ./testtool 0x55 >>> See also: http://docs.python.org/lib/typesseq-strings.html hth, Eric. From elsen.david08 at gmail.com Thu Aug 21 18:31:12 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 21 Aug 2008 09:31:12 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: Eric, Thanks. It should work, I guess. I will check and trouble you again if it does not work. David On Wed, Aug 20, 2008 at 7:31 PM, Eric Walstad wrote: > Hi David > > On Wed, Aug 20, 2008 at 5:53 PM, David Elsen > wrote: > ... > > read_cmd = './testtool offset' > > read_content = os.popen(read_cmd).read() > > > > reg1 = reg (0x50) > > > > reg1.reg_read(0x50) > > > > Basically I wanted to pass the offset as input parameter to my executable > > "testtool" and run the testtool for offset. > > Will this work for you? > >>> for offset in range(75, 86): > ... read_cmd = './testtool %#x' % offset > ... print read_cmd > ... > ./testtool 0x4b > ./testtool 0x4c > ./testtool 0x4d > ./testtool 0x4e > ./testtool 0x4f > ./testtool 0x50 > ./testtool 0x51 > ./testtool 0x52 > ./testtool 0x53 > ./testtool 0x54 > ./testtool 0x55 > >>> > > See also: > http://docs.python.org/lib/typesseq-strings.html > > hth, Eric. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Thu Aug 21 18:30:18 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 21 Aug 2008 09:30:18 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: Shannon, It is a very big reference for a very small question. I tried to glance and could not get my solution. Thanks a lot for the reference though, David On Wed, Aug 20, 2008 at 5:59 PM, Shannon -jj Behrens wrote: > On Wed, Aug 20, 2008 at 5:53 PM, David Elsen > wrote: > > Hello all, > > > > I have defined a class as following: > > > > class reg: > > def __init__ (self, offset): > > self.offset = offset > > > > def reg_read(self, offset): > > print 'Read the reg conten specified by offset' > > import os > > read_cmd = './testtool 0x50' > > read_content = os.popen(read_cmd).read() > > > > reg1 = reg (0x50) > > > > reg1.reg_read(0x50) > > > > > > The above code calls my c executable with offset 0x50 and gives me the > > content of 0x50 offset. > > > > I wanted to change the above code as following: > > > > class reg: > > def __init__ (self, offset): > > self.offset = offset > > > > def reg_read(self, offset): > > print 'Read the reg conten specified by offset' > > import os > > read_cmd = './testtool offset' > > read_content = os.popen(read_cmd).read() > > > > reg1 = reg (0x50) > > > > reg1.reg_read(0x50) > > > > Basically I wanted to pass the offset as input parameter to my executable > > "testtool" and run the testtool for offset. > > > > But looks like it does not allow me to change my offset. > > > > Is there a way to do this in python? > > > > Thanks in advance, > > David > > Have a peek at http://docs.python.org/lib/module-subprocess.html. > This has the additional benefit that you can pass a list of args > instead of a single string. > > -jj > > -- > Don't you wish you had a really clever sig like mine? > http://jjinux.blogspot.com/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.gallagher at gmail.com Thu Aug 21 19:01:20 2008 From: joshua.gallagher at gmail.com (Joshua Gallagher) Date: Thu, 21 Aug 2008 10:01:20 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: <9bb4e5be0808211001y44509f31te050ed5bf5f1b946@mail.gmail.com> There may be another, and better, way of doing it, but I usually use Popen like this: cmd = p_obj = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = p_obj.stdout.read() In your example, it would look something like this: import subprocess class reg: def __init__ (self, offset): self.offset = offset def reg_read(self): print 'Read the reg content specified by offset' read_cmd = './testtool %s' %self.offset p_obj = subprocess.Popen(read_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = p_obj.stdout.read() reg1 = reg(0x50) reg1.reg_read() I'd be happy to hear of a better way to do this. Joshua On Thu, Aug 21, 2008 at 9:30 AM, David Elsen wrote: > Shannon, > It is a very big reference for a very small question. I tried to glance and > could not get my solution. > > Thanks a lot for the reference though, > David > > On Wed, Aug 20, 2008 at 5:59 PM, Shannon -jj Behrens > wrote: >> >> On Wed, Aug 20, 2008 at 5:53 PM, David Elsen >> wrote: >> > Hello all, >> > >> > I have defined a class as following: >> > >> > class reg: >> > def __init__ (self, offset): >> > self.offset = offset >> > >> > def reg_read(self, offset): >> > print 'Read the reg conten specified by offset' >> > import os >> > read_cmd = './testtool 0x50' >> > read_content = os.popen(read_cmd).read() >> > >> > reg1 = reg (0x50) >> > >> > reg1.reg_read(0x50) >> > >> > >> > The above code calls my c executable with offset 0x50 and gives me the >> > content of 0x50 offset. >> > >> > I wanted to change the above code as following: >> > >> > class reg: >> > def __init__ (self, offset): >> > self.offset = offset >> > >> > def reg_read(self, offset): >> > print 'Read the reg conten specified by offset' >> > import os >> > read_cmd = './testtool offset' >> > read_content = os.popen(read_cmd).read() >> > >> > reg1 = reg (0x50) >> > >> > reg1.reg_read(0x50) >> > >> > Basically I wanted to pass the offset as input parameter to my >> > executable >> > "testtool" and run the testtool for offset. >> > >> > But looks like it does not allow me to change my offset. >> > >> > Is there a way to do this in python? >> > >> > Thanks in advance, >> > David >> >> Have a peek at http://docs.python.org/lib/module-subprocess.html. >> This has the additional benefit that you can pass a list of args >> instead of a single string. >> >> -jj >> >> -- >> Don't you wish you had a really clever sig like mine? >> http://jjinux.blogspot.com/ > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From eric at ericwalstad.com Thu Aug 21 19:12:53 2008 From: eric at ericwalstad.com (Eric Walstad) Date: Thu, 21 Aug 2008 10:12:53 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: On Thu, Aug 21, 2008 at 9:30 AM, David Elsen wrote: > Shannon, > It is a very big reference for a very small question. I tried to glance and > could not get my solution. > > Thanks a lot for the reference though, > David > > On Wed, Aug 20, 2008 at 5:59 PM, Shannon -jj Behrens > wrote: >> Have a peek at http://docs.python.org/lib/module-subprocess.html. >> This has the additional benefit that you can pass a list of args >> instead of a single string. Consider: def reg_read(self, offset): import subprocess read_cmd = './testtool' args = (read_cmd, offset) process = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) return_code = process.wait() read_content = process.stdout.read() This stuffs the read_cmd and the offset into a tuple which is then used as the first argument to create a Popen object. Doing it this way means that you don't have to worry about formatting the read_cmd into something that includes the arguments passed into the testtool executable - Popen handles that for you. From elsen.david08 at gmail.com Thu Aug 21 20:59:11 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 21 Aug 2008 11:59:11 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: References: Message-ID: Yes, it works fine for me. Not sure if there is a better way to do this. I am happy for now. Ton of thanks to everyone for help. You guys are great. David On Thu, Aug 21, 2008 at 10:12 AM, Eric Walstad wrote: > On Thu, Aug 21, 2008 at 9:30 AM, David Elsen > wrote: > > Shannon, > > It is a very big reference for a very small question. I tried to glance > and > > could not get my solution. > > > > Thanks a lot for the reference though, > > David > > > > On Wed, Aug 20, 2008 at 5:59 PM, Shannon -jj Behrens > > wrote: > >> Have a peek at http://docs.python.org/lib/module-subprocess.html. > >> This has the additional benefit that you can pass a list of args > >> instead of a single string. > > Consider: > def reg_read(self, offset): > import subprocess > read_cmd = './testtool' > args = (read_cmd, offset) > process = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) > return_code = process.wait() > read_content = process.stdout.read() > > This stuffs the read_cmd and the offset into a tuple which is then > used as the first argument to create a Popen object. Doing it this > way means that you don't have to worry about formatting the read_cmd > into something that includes the arguments passed into the testtool > executable - Popen handles that for you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at matt-good.net Thu Aug 21 22:39:11 2008 From: matt at matt-good.net (Matt Good) Date: Thu, 21 Aug 2008 13:39:11 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: <9bb4e5be0808211001y44509f31te050ed5bf5f1b946@mail.gmail.com> References: <9bb4e5be0808211001y44509f31te050ed5bf5f1b946@mail.gmail.com> Message-ID: <844FD955-5366-44B5-A73B-E99FF9B77E95@matt-good.net> On Aug 21, 2008, at 10:01 AM, Joshua Gallagher wrote: > There may be another, and better, way of doing it, but I usually use > Popen like this: > cmd = > p_obj = subprocess.Popen(cmd, shell=True, > stdout=subprocess.PIPE, > stderr=subprocess.STDOUT) > output = p_obj.stdout.read() Using the std* streams directly is prone to deadlock. If you can, stick to using popen.communicate() proc = subprocess.Popen([cmd, arg1, arg2], stdout=subprocess.PIPE, stderr=subprocess.PIPE) pout, perr = subprocess.communicate() http://docs.python.org/lib/node532.html -- Matt From spmcinerney at hotmail.com Fri Aug 22 00:22:39 2008 From: spmcinerney at hotmail.com (Stephen McInerney) Date: Thu, 21 Aug 2008 15:22:39 -0700 Subject: [Baypiggies] Erlang Erloung @ Yahoo In-Reply-To: <8249c4ac0808201355g7cf1e1adqe0b58aa43f918039@mail.gmail.com> References: <8249c4ac0808201355g7cf1e1adqe0b58aa43f918039@mail.gmail.com> Message-ID: FYI I'm down here at SciPy conference and it seems there is also some emerging but scattered interest in Erlang, Haskell. Stephen > Date: Wed, 20 Aug 2008 13:55:15 -0700 > From: cappy2112 at gmail.com > To: baypiggies at python.org > Subject: [Baypiggies] Erlang Erloung @ Yahoo > > A few people have talked about Erlang at the meetings (casually, not > in a presentation per-se) so ... > > http://groups.google.com/group/bayfp/browse_thread/thread/47f3c8224cb77047?hl=en > (This was posted in the Bay Area Functional Programmers list) _________________________________________________________________ Talk to your Yahoo! Friends via Windows Live Messenger. Find out how. http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Fri Aug 22 01:26:38 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Thu, 21 Aug 2008 16:26:38 -0700 Subject: [Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls? In-Reply-To: <844FD955-5366-44B5-A73B-E99FF9B77E95@matt-good.net> References: <9bb4e5be0808211001y44509f31te050ed5bf5f1b946@mail.gmail.com> <844FD955-5366-44B5-A73B-E99FF9B77E95@matt-good.net> Message-ID: thanks. On Thu, Aug 21, 2008 at 1:39 PM, Matt Good wrote: > On Aug 21, 2008, at 10:01 AM, Joshua Gallagher wrote: > > There may be another, and better, way of doing it, but I usually use >> Popen like this: >> cmd = >> p_obj = subprocess.Popen(cmd, shell=True, >> stdout=subprocess.PIPE, >> stderr=subprocess.STDOUT) >> output = p_obj.stdout.read() >> > > > Using the std* streams directly is prone to deadlock. If you can, stick to > using popen.communicate() > > proc = subprocess.Popen([cmd, arg1, arg2], stdout=subprocess.PIPE, > stderr=subprocess.PIPE) > pout, perr = subprocess.communicate() > > http://docs.python.org/lib/node532.html > > -- Matt > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdm at cfcl.com Mon Aug 25 00:43:21 2008 From: rdm at cfcl.com (Rich Morin) Date: Sun, 24 Aug 2008 15:43:21 -0700 Subject: [Baypiggies] BASS Meeting (SF), Wed. August 27 Message-ID: The Beer and Scripting SIG rides again! If you'd like to eat good Italian food, chat with other local scripters, and possibly take a look at laptop-demoed scripting hacks, this is the place to do it! For your convenience, here are the critical details: Date: Wednesday, August 27, 2008 (4th. Wed.) Time: 8:00 pm Place: Pasquales Pizzeria 701 Irving St. (At 8th. Ave.) San Francisco, California, USA 415/661-2140 See the BASS web page for more information: http://cfcl.com/rdm/bass/ We now have two (2) mailing lists, which you are welcome to join: * http://groups.google.com/group/bass-announce This will be used mostly for BASS announcements, though I may send an occasional notice about other events that look nifty. Expect 1-2 messages per month. * http://groups.google.com/group/bass-discuss This should have relatively little traffic, but no guarantees. The basic idea is that it gives BASS attendees (etc) a place to discuss scripting (and topics of interest to scripters). Like BASS, but more than one evening a month... -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From brent.tubbs at gmail.com Mon Aug 25 22:46:42 2008 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Mon, 25 Aug 2008 13:46:42 -0700 Subject: [Baypiggies] charsets in email headers Message-ID: <769bb4300808251346v3909d8b3td603fd7463f32e1d@mail.gmail.com> I'm writing a Google App Engine app that accepts incoming emails using the free smtp2web.com service. Things are generally working, but some (not all) subject lines in the emails look like this (this one's a Google Calendar event invitation): =?windows-1252?Q?=5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?= =?windows-1252?Q?30pm_=28=22Schmobag=5FHogfather=22=29?= I've learned that that's got something to do with the subject being in the windows-1252 charset, but I'm mystified as to how to turn that into human-readable ASCII. The python email module has a charset class that's supposed to help with this I think, but I don't know how to make it do what I need. Any suggestions on the best way to turn the ugly string above into something nicer? Thanks, Brent From jason at mischievous.org Mon Aug 25 23:20:30 2008 From: jason at mischievous.org (Jason Culverhouse) Date: Mon, 25 Aug 2008 14:20:30 -0700 Subject: [Baypiggies] charsets in email headers In-Reply-To: <769bb4300808251346v3909d8b3td603fd7463f32e1d@mail.gmail.com> References: <769bb4300808251346v3909d8b3td603fd7463f32e1d@mail.gmail.com> Message-ID: Right here... http://docs.python.org/lib/module-email.header.html from email.header import decode_header decode_header('=?windows-1252?Q? =5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?=') [('[Invitation] dummy event 4 @ Tue Aug 26 10pm \x96 11:', 'windows-1252')] Jason On Aug 25, 2008, at 1:46 PM, Brent Tubbs wrote: > I'm writing a Google App Engine app that accepts incoming emails using > the free smtp2web.com service. Things are generally working, but some > (not all) subject lines in the emails look like this (this one's a > Google Calendar event invitation): > > =?windows-1252?Q? > =5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?= > =?windows-1252?Q?30pm_=28=22Schmobag=5FHogfather=22=29?= > > I've learned that that's got something to do with the subject being in > the windows-1252 charset, but I'm mystified as to how to turn that > into human-readable ASCII. The python email module has a charset > class that's supposed to help with this I think, but I don't know how > to make it do what I need. > > Any suggestions on the best way to turn the ugly string above into > something nicer? > > Thanks, > Brent > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2425 bytes Desc: not available URL: From brent.tubbs at gmail.com Mon Aug 25 23:52:28 2008 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Mon, 25 Aug 2008 14:52:28 -0700 Subject: [Baypiggies] charsets in email headers In-Reply-To: References: <769bb4300808251346v3909d8b3td603fd7463f32e1d@mail.gmail.com> Message-ID: <769bb4300808251452h7d3bb881u206124fe7bf9078@mail.gmail.com> Thank you for the link, Jason. I'd been staring at that page (as well as http://docs.python.org/lib/module-email.charset.html) for a while before emailing the group, but it's over my head and there is no example for converting from one charset to another. An example from someone who's done it would be most welcome. Thanks again, Brent On Mon, Aug 25, 2008 at 2:20 PM, Jason Culverhouse wrote: > Right here... > http://docs.python.org/lib/module-email.header.html > > from email.header import decode_header > decode_header('=?windows-1252?Q?=5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?=') > > [('[Invitation] dummy event 4 @ Tue Aug 26 10pm \x96 11:', 'windows-1252')] > > Jason > > On Aug 25, 2008, at 1:46 PM, Brent Tubbs wrote: > >> I'm writing a Google App Engine app that accepts incoming emails using >> the free smtp2web.com service. Things are generally working, but some >> (not all) subject lines in the emails look like this (this one's a >> Google Calendar event invitation): >> >> >> =?windows-1252?Q?=5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?= >> =?windows-1252?Q?30pm_=28=22Schmobag=5FHogfather=22=29?= >> >> I've learned that that's got something to do with the subject being in >> the windows-1252 charset, but I'm mystified as to how to turn that >> into human-readable ASCII. The python email module has a charset >> class that's supposed to help with this I think, but I don't know how >> to make it do what I need. >> >> Any suggestions on the best way to turn the ugly string above into >> something nicer? >> >> Thanks, >> Brent >> _______________________________________________ >> Baypiggies mailing list >> Baypiggies at python.org >> To change your subscription options or unsubscribe: >> http://mail.python.org/mailman/listinfo/baypiggies > > From brent.tubbs at gmail.com Mon Aug 25 23:54:01 2008 From: brent.tubbs at gmail.com (Brent Tubbs) Date: Mon, 25 Aug 2008 14:54:01 -0700 Subject: [Baypiggies] charsets in email headers In-Reply-To: <769bb4300808251452h7d3bb881u206124fe7bf9078@mail.gmail.com> References: <769bb4300808251346v3909d8b3td603fd7463f32e1d@mail.gmail.com> <769bb4300808251452h7d3bb881u206124fe7bf9078@mail.gmail.com> Message-ID: <769bb4300808251454y472d6610p7b4f8372f0612b7d@mail.gmail.com> Erg I should have read more carefully. Disregard my complaint about not having an example. Thanks again, Brent On Mon, Aug 25, 2008 at 2:52 PM, Brent Tubbs wrote: > Thank you for the link, Jason. I'd been staring at that page (as > well as http://docs.python.org/lib/module-email.charset.html) for a > while before emailing the group, but it's over my head and there is no > example for converting from one charset to another. An example from > someone who's done it would be most welcome. > > Thanks again, > Brent > > On Mon, Aug 25, 2008 at 2:20 PM, Jason Culverhouse > wrote: >> Right here... >> http://docs.python.org/lib/module-email.header.html >> >> from email.header import decode_header >> decode_header('=?windows-1252?Q?=5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?=') >> >> [('[Invitation] dummy event 4 @ Tue Aug 26 10pm \x96 11:', 'windows-1252')] >> >> Jason >> >> On Aug 25, 2008, at 1:46 PM, Brent Tubbs wrote: >> >>> I'm writing a Google App Engine app that accepts incoming emails using >>> the free smtp2web.com service. Things are generally working, but some >>> (not all) subject lines in the emails look like this (this one's a >>> Google Calendar event invitation): >>> >>> >>> =?windows-1252?Q?=5BInvitation=5D_dummy_event_4_=40_Tue_Aug_26_10pm_=96_11=3A?= >>> =?windows-1252?Q?30pm_=28=22Schmobag=5FHogfather=22=29?= >>> >>> I've learned that that's got something to do with the subject being in >>> the windows-1252 charset, but I'm mystified as to how to turn that >>> into human-readable ASCII. The python email module has a charset >>> class that's supposed to help with this I think, but I don't know how >>> to make it do what I need. >>> >>> Any suggestions on the best way to turn the ugly string above into >>> something nicer? >>> >>> Thanks, >>> Brent >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> http://mail.python.org/mailman/listinfo/baypiggies >> >> > From elsen.david08 at gmail.com Tue Aug 26 01:49:34 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Mon, 25 Aug 2008 16:49:34 -0700 Subject: [Baypiggies] One and two dim arrays in Python Message-ID: Hi all, I would like to do something like following in Python: for i in range(0,10): a[i] = something just to initialize some values for 1d array. I am getting the error message 'a' is not defined. Is there a way to declare 1d or 2d arrays in Python? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Tue Aug 26 01:53:49 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Mon, 25 Aug 2008 16:53:49 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: I have declared 'a' as : a=[] before the for loop. But it does not seem to help. On Mon, Aug 25, 2008 at 4:49 PM, David Elsen wrote: > Hi all, > > I would like to do something like following in Python: > > for i in range(0,10): > a[i] = something > > just to initialize some values for 1d array. > > I am getting the error message 'a' is not defined. > > Is there a way to declare 1d or 2d arrays in Python? > > Thanks, > David > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Tue Aug 26 02:05:11 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Mon, 25 Aug 2008 17:05:11 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: Thanks Sherman but how does it work if I want to change my "something" for each index of i. On Mon, Aug 25, 2008 at 5:00 PM, Shiqi Yang wrote: > maybe you can try this: > a = [ something for i in range(10)] > > hope it helps > > :) > > On Mon, Aug 25, 2008 at 4:53 PM, David Elsen > wrote: > > I have declared 'a' as : > > a=[] before the for loop. But it does not seem to help. > > > > On Mon, Aug 25, 2008 at 4:49 PM, David Elsen > > wrote: > >> > >> Hi all, > >> > >> I would like to do something like following in Python: > >> > >> for i in range(0,10): > >> a[i] = something > >> > >> just to initialize some values for 1d array. > >> > >> I am getting the error message 'a' is not defined. > >> > >> Is there a way to declare 1d or 2d arrays in Python? > >> > >> Thanks, > >> David > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > > > > -- > Sherman Yang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From python at dylanreinhardt.com Tue Aug 26 02:05:26 2008 From: python at dylanreinhardt.com (Dylan Reinhardt) Date: Mon, 25 Aug 2008 17:05:26 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: <4c645a720808251705u3f2ce3dbh7aafeb4998612c92@mail.gmail.com> There's not much need to dimension arrays in Python. But if you want to anyway, what about: a = [None] * 10 HTH, Dylan On Mon, Aug 25, 2008 at 4:49 PM, David Elsen wrote: > Hi all, > > I would like to do something like following in Python: > > for i in range(0,10): > a[i] = something > > just to initialize some values for 1d array. > > I am getting the error message 'a' is not defined. > > Is there a way to declare 1d or 2d arrays in Python? > > Thanks, > David > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From cvrebert at gmail.com Tue Aug 26 02:06:05 2008 From: cvrebert at gmail.com (Chris Rebert) Date: Mon, 25 Aug 2008 17:06:05 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: <47c890dc0808251706l7d8f1ae2h47e88e2e18a7bf1a@mail.gmail.com> Your attempt doesn't work because you can't assign to indices of an empty list (which is of length/size 0). You would need to instead use .append() to add items on to the end of the list, e.g.: a = [] for i in xrange(list_size): a.append(something) And just to clarify, Python doesn't have any sort of declaration. You can use Python's handy list comprehension syntax to abbreviate the previous code as: a = [something for i in xrange(list_size)] Or it your placeholder values are immutable (e.g. numbers), you can use the simpler shortcut: a = [something] * list_size For multidimensional lists, you need to be a bit careful. The pattern (for a 2D list) is: a = [[something for y in xrange(dimension_y_size) ] for x in xrange(dimension_x_size)] and you can continue the pattern in the obvious way for higher dimensional lists. Note that you can still use the aforementioned shortcut for the innermost list when constructing multidimensional ones, again assuming the placeholder value is immutable. Hope that clears things up. - Chris ======== Follow the path of the Iguana... Rebertia: http://rebertia.com Blog: http://blog.rebertia.com On Mon, Aug 25, 2008 at 4:49 PM, David Elsen wrote: > Hi all, > > I would like to do something like following in Python: > > for i in range(0,10): > a[i] = something > > just to initialize some values for 1d array. > > I am getting the error message 'a' is not defined. > > Is there a way to declare 1d or 2d arrays in Python? > > Thanks, > David > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From n8pease at yahoo.com Tue Aug 26 02:00:22 2008 From: n8pease at yahoo.com (Nathan Pease) Date: Mon, 25 Aug 2008 17:00:22 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: this seems to work: a = {} for i in range(0, 10): a[i] = 'foo' n On Aug 25, 2008, at 4:53 PM, David Elsen wrote: > I have declared 'a' as : > a=[] before the for loop. But it does not seem to help. > > On Mon, Aug 25, 2008 at 4:49 PM, David Elsen > wrote: > Hi all, > > I would like to do something like following in Python: > > for i in range(0,10): > a[i] = something > > just to initialize some values for 1d array. > > I am getting the error message 'a' is not defined. > > Is there a way to declare 1d or 2d arrays in Python? > > Thanks, > David > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies -------------- next part -------------- An HTML attachment was scrubbed... URL: From cvrebert at gmail.com Tue Aug 26 02:44:17 2008 From: cvrebert at gmail.com (Chris Rebert) Date: Mon, 25 Aug 2008 17:44:17 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: <47c890dc0808251744s723fea60h7b21912fb0a6064c@mail.gmail.com> That's because you're using a dictionary rather than a list. The dictionary doesn't care too much about the type of its keys and has no concept of ordering or contiguousness, so you can add items to it arbitrarily. This is why another way to implement multidimensional arrays in Python is to use a dictionary and tuples for the coordinates, e.g.: a = {} for x in range(x_size): for y in range(y_size): for z in range(z_size): coords = (x,y,z) a[coords] = something - Chris ======== Follow the path of the Iguana... Rebertia: http://rebertia.com Blog: http://blog.rebertia.com On Mon, Aug 25, 2008 at 5:00 PM, Nathan Pease wrote: > this seems to work: > a = {} > for i in range(0, 10): a[i] = 'foo' > n > On Aug 25, 2008, at 4:53 PM, David Elsen wrote: > > I have declared 'a' as : > a=[] before the for loop. But it does not seem to help. > > On Mon, Aug 25, 2008 at 4:49 PM, David Elsen > wrote: >> >> Hi all, >> >> I would like to do something like following in Python: >> >> for i in range(0,10): >> a[i] = something >> >> just to initialize some values for 1d array. >> >> I am getting the error message 'a' is not defined. >> >> Is there a way to declare 1d or 2d arrays in Python? >> >> Thanks, >> David > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From aleax at google.com Tue Aug 26 02:52:39 2008 From: aleax at google.com (Alex Martelli) Date: Mon, 25 Aug 2008 17:52:39 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: References: Message-ID: <55dc209b0808251752m183b762fx3aa0648f3dcdf38d@mail.gmail.com> On Mon, Aug 25, 2008 at 5:00 PM, Nathan Pease wrote: > this seems to work: > a = {} > for i in range(0, 10): a[i] = 'foo' Yep, but it builds a *dict* (Pythonese for hashtable), NOT a *list* (Pythonese for vector/array, more or less) -- so for example the order of a's items is not guaranteed, etc. To build a list, the list-comprehension syntax already repeatedly suggested is generally best -- and the 'something' given in those examples can perfectly well be an expression, so for example squares = [i*i for i in range(10)] works just fine. If each item needs to be computed in some complicated way, it can be sometimes more readable to use the more ancient syntax: a = [] for i in range(10): a.append(...whatever complicated thing you need...) The boundary between where it's best to use a list comprehension, where the more ancient syntax based on .append, is an issue of style, and more or less spelled out in the Python style guide. However, net of purely stylistical issues, all of this is spelled out quite extensively in books such as "Python in a Nutshell" -- I'm biased, of course, but I would not recommend programming in Python without having read it (skipping the chapters not of immediate interest;-). Alex From Chris.Clark at ingres.com Tue Aug 26 20:07:23 2008 From: Chris.Clark at ingres.com (Chris Clark) Date: Tue, 26 Aug 2008 11:07:23 -0700 Subject: [Baypiggies] One and two dim arrays in Python In-Reply-To: <47c890dc0808251744s723fea60h7b21912fb0a6064c@mail.gmail.com> References: <47c890dc0808251744s723fea60h7b21912fb0a6064c@mail.gmail.com> Message-ID: <48B4465B.7080806@ingres.com> On 8/25/2008 5:44 PM, Chris Rebert wrote: > .... > This is why another way to implement multidimensional arrays in Python > is to use a dictionary and tuples for the coordinates, e.g.: > > a = {} > for x in range(x_size): > for y in range(y_size): > for z in range(z_size): > coords = (x,y,z) > a[coords] = something > Interesting side topic; JJ had an interesting blog post in this area where he found a memory difference between tuples as the index and nested dicts. http://jjinux.blogspot.com/2008/08/python-memory-conservation-tip.html Chris From elsen.david08 at gmail.com Tue Aug 26 22:02:42 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 13:02:42 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? Message-ID: Hi all, I have a test script as follows: import os import string cmd = './testtool dump' res = os.popen(cmd).read() #print res *#fout = open("ask_it.txt", "w") #fout.write(res) #fout.close* reg_reset_val = [] reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) reg_reset_val.append(0xdeadfeed) print 'reg default values' for index, item in enumerate(reg_reset_val): print index, item fin = open ("ask_it.txt", "r") i = 0 reg = [] linelist = fin.readlines() lines = len(linelist) for line in linelist: i = i +1 if (i >= 5): # First four lines are bogus datas = line.split() reg.append(datas) if i == lines: break print 'the reg list is' for j, item in enumerate(reg): print j, item print 'reg[0]' print reg[0] print 'reg_reset_val[0]0x%x'%reg_reset_val[0] #print reg_reset_val[0] if (reg[0] == reg_reset_val[0]): print 'test passed' else: print 'test failed' Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. Returned from calling driver via IOCTL. IOCTL CTL Mem Dump char count Control Memory Dump: Address 0xf8812000 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed 0xdeadfeed I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has 0xdeadfeed in it. How can I convert the reg[0] to make it normal 0xdeadfeed. Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Tue Aug 26 22:24:44 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 13:24:44 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: Message-ID: On Tue, Aug 26, 2008 at 1:02 PM, David Elsen wrote: > Hi all, > > I have a test script as follows: > > import os > import string > cmd = './testtool dump' > res = os.popen(cmd).read() > #print res > *#fout = open("ask_it.txt", "w") > #fout.write(res) > #fout.close* > reg_reset_val = [] > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > > print 'reg default values' > for index, item in enumerate(reg_reset_val): > print index, item > > fin = open ("ask_it.txt", "r") > i = 0 > reg = [] > linelist = fin.readlines() > lines = len(linelist) > for line in linelist: > i = i +1 > if (i >= 5): # First four lines are bogus > datas = line.split() > reg.append(datas) > if i == lines: > break > print 'the reg list is' > for j, item in enumerate(reg): > print j, item > print 'reg[0]' > print reg[0] > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] > #print reg_reset_val[0] > if (reg[0] == reg_reset_val[0]): > print 'test passed' > else: > print 'test failed' > > The file "ask_it.txt" is as follows: > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. > Returned from calling driver via IOCTL. > IOCTL CTL Mem Dump char count > Control Memory Dump: Address 0xf8812000 > 0xdeadfeed > 0xdeadfeed > I have initialized the reg_reset_val[0] = 0xdeadfeed and reg[0] = ['oxdeadfeed']. How can I convert reg[0] to be same as reg_reset_val[0]? > > > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has > 0xdeadfeed in it. How can I convert the reg[0] to make it normal 0xdeadfeed. > > Thanks, > David > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleax at google.com Tue Aug 26 22:26:32 2008 From: aleax at google.com (Alex Martelli) Date: Tue, 26 Aug 2008 13:26:32 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: Message-ID: <55dc209b0808261326j11bf7457v33373c1e20575b2b@mail.gmail.com> You should really study some of the basics of Python -- e.g. via the mailing list http://mail.python.org/mailman/listinfo/tutor or any of the other resources listed at http://wiki.python.org/moin/BeginnersGuide -- this mailing list is for the Bay Area Python Interest Group and not particularly suitable for your questions. In this case, you're appending to your list reg items that are lists of strings (with one item only in each sublist, apparently) and you apparently want to convert that list of lists of strings to a list of integers -- and give no indication whatsoever about what you mean to happen when one of the sublists has more than one item (i.e. any of the text lines in file ask_it.txt [apart from the first four] has more than one word), or any of the words are not a correct representation for an integer, and so forth. If you know the "more than one word in a line" can never happen, then it makes no sense to have that "datas = line.split()" call -- why are you splitting unless >1 word is possible?! http://www.catb.org/~esr/faqs/smart-questions.html is a document really worth studying (quite apart from Python, ANY time you need to ask technical questions) and it includes worthy quotes such as "What we are, unapologetically, is hostile to people who seem to be unwilling to think or to do their own homework before asking questions. People like that are time sinks ? they take without giving back, and they waste time we could have spent on another question more interesting and another person more worthy of an answer." Alex On Tue, Aug 26, 2008 at 1:02 PM, David Elsen wrote: > Hi all, > > I have a test script as follows: > > import os > import string > cmd = './testtool dump' > res = os.popen(cmd).read() > #print res > #fout = open("ask_it.txt", "w") > #fout.write(res) > #fout.close > reg_reset_val = [] > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > reg_reset_val.append(0xdeadfeed) > > print 'reg default values' > for index, item in enumerate(reg_reset_val): > print index, item > > fin = open ("ask_it.txt", "r") > i = 0 > reg = [] > linelist = fin.readlines() > lines = len(linelist) > for line in linelist: > i = i +1 > if (i >= 5): # First four lines are bogus > datas = line.split() > reg.append(datas) > if i == lines: > break > print 'the reg list is' > for j, item in enumerate(reg): > print j, item > print 'reg[0]' > print reg[0] > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] > #print reg_reset_val[0] > if (reg[0] == reg_reset_val[0]): > print 'test passed' > else: > print 'test failed' > > > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. > Returned from calling driver via IOCTL. > IOCTL CTL Mem Dump char count > Control Memory Dump: Address 0xf8812000 > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > 0xdeadfeed > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has > 0xdeadfeed in it. How can I convert the reg[0] to make it normal 0xdeadfeed. > > Thanks, > David > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From elsen.david08 at gmail.com Tue Aug 26 22:28:45 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 13:28:45 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: Message-ID: Hi Sherman, With int(reg[0],16), I get the error message "TypeError: int() can't convert non-string with explicit base." On Tue, Aug 26, 2008 at 1:23 PM, Shiqi Yang wrote: > Hi, David, > > you can give int(reg[0], 16) a try to see if that's what you want. > > > > > On Tue, Aug 26, 2008 at 1:02 PM, David Elsen > wrote: > > Hi all, > > > > I have a test script as follows: > > > > import os > > import string > > cmd = './testtool dump' > > res = os.popen(cmd).read() > > #print res > > #fout = open("ask_it.txt", "w") > > #fout.write(res) > > #fout.close > > reg_reset_val = [] > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > > > print 'reg default values' > > for index, item in enumerate(reg_reset_val): > > print index, item > > > > fin = open ("ask_it.txt", "r") > > i = 0 > > reg = [] > > linelist = fin.readlines() > > lines = len(linelist) > > for line in linelist: > > i = i +1 > > if (i >= 5): # First four lines are bogus > > datas = line.split() > > reg.append(datas) > > if i == lines: > > break > > print 'the reg list is' > > for j, item in enumerate(reg): > > print j, item > > print 'reg[0]' > > print reg[0] > > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] > > #print reg_reset_val[0] > > if (reg[0] == reg_reset_val[0]): > > print 'test passed' > > else: > > print 'test failed' > > > > > > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. > > Returned from calling driver via IOCTL. > > IOCTL CTL Mem Dump char count > > Control Memory Dump: Address 0xf8812000 > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But > > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has > > 0xdeadfeed in it. How can I convert the reg[0] to make it normal > 0xdeadfeed. > > > > Thanks, > > David > > > > > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > > > > -- > Sherman Yang > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Wed Aug 27 00:56:47 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 15:56:47 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: <55dc209b0808261326j11bf7457v33373c1e20575b2b@mail.gmail.com> References: <55dc209b0808261326j11bf7457v33373c1e20575b2b@mail.gmail.com> Message-ID: Alex, Thank you for your reply. Actually I had modified the text file before posting. It has four words in one line seperated by space. I was using the split with space to get all four words from a line. I was appending one word to my list (list of strings). I was wondering once I am using split function whether it converts the "numbers" from my text file to some particular formats. I was trying to cast the split output with "map", "long" etc, but it gives the error message that for it can not accept the non-string input. I tried to look around for split reference, but nowhere got its return type format information. It seems like string ['0xdeadfeed']. But it does not seem to be. If it is really string type, why cast from "map", "int", or "long" is giving me error message. I apologize for becoming the time sink. I am ready to become the time source. I have one more question though related to my same script. Please forgive me about this. If I am trying to write my text file in the same script and then tring to read back. For some reason, read file handle does not have any data. But if I have written to the text file and saved it and then trying to open it in read mode, I am able to read the data. Is there any delay required after writing the data to a file? Thanks, David Thanks again, David On Tue, Aug 26, 2008 at 1:26 PM, Alex Martelli wrote: > You should really study some of the basics of Python -- e.g. via the > mailing list http://mail.python.org/mailman/listinfo/tutor or any of > the other resources listed at > http://wiki.python.org/moin/BeginnersGuide -- this mailing list is for > the Bay Area Python Interest Group and not particularly suitable for > your questions. In this case, you're appending to your list reg items > that are lists of strings (with one item only in each sublist, > apparently) and you apparently want to convert that list of lists of > strings to a list of integers -- and give no indication whatsoever > about what you mean to happen when one of the sublists has more than > one item (i.e. any of the text lines in file ask_it.txt [apart from > the first four] has more than one word), or any of the words are not a > correct representation for an integer, and so forth. If you know the > "more than one word in a line" can never happen, then it makes no > sense to have that "datas = line.split()" call -- why are you > splitting unless >1 word is possible?! > > http://www.catb.org/~esr/faqs/smart-questions.html is a document > really worth studying (quite apart from Python, ANY time you need to > ask technical questions) and it includes worthy quotes such as "What > we are, unapologetically, is hostile to people who seem to be > unwilling to think or to do their own homework before asking > questions. People like that are time sinks ? they take without giving > back, and they waste time we could have spent on another question more > interesting and another person more worthy of an answer." > > > Alex > > On Tue, Aug 26, 2008 at 1:02 PM, David Elsen > wrote: > > Hi all, > > > > I have a test script as follows: > > > > import os > > import string > > cmd = './testtool dump' > > res = os.popen(cmd).read() > > #print res > > #fout = open("ask_it.txt", "w") > > #fout.write(res) > > #fout.close > > reg_reset_val = [] > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > reg_reset_val.append(0xdeadfeed) > > > > print 'reg default values' > > for index, item in enumerate(reg_reset_val): > > print index, item > > > > fin = open ("ask_it.txt", "r") > > i = 0 > > reg = [] > > linelist = fin.readlines() > > lines = len(linelist) > > for line in linelist: > > i = i +1 > > if (i >= 5): # First four lines are bogus > > datas = line.split() > > reg.append(datas) > > if i == lines: > > break > > print 'the reg list is' > > for j, item in enumerate(reg): > > print j, item > > print 'reg[0]' > > print reg[0] > > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] > > #print reg_reset_val[0] > > if (reg[0] == reg_reset_val[0]): > > print 'test passed' > > else: > > print 'test failed' > > > > > > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. > > Returned from calling driver via IOCTL. > > IOCTL CTL Mem Dump char count > > Control Memory Dump: Address 0xf8812000 > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > 0xdeadfeed > > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But > > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has > > 0xdeadfeed in it. How can I convert the reg[0] to make it normal > 0xdeadfeed. > > > > Thanks, > > David > > > > > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshua.gallagher at gmail.com Wed Aug 27 01:14:07 2008 From: joshua.gallagher at gmail.com (Joshua Gallagher) Date: Tue, 26 Aug 2008 16:14:07 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: <55dc209b0808261326j11bf7457v33373c1e20575b2b@mail.gmail.com> Message-ID: <9bb4e5be0808261614g5b494ef9i2b23c0452c569bc4@mail.gmail.com> Hi David, When you read and write into a file, you read and write at offsets. You can think of the offset as a moving cursor in the file. In other words, if you create a new file and write 10 bytes in, your cursor is 10-bytes into the file. If you perform another write, the write starts at byte 10. By extension, if your cursor is at byte 10 of this new file and you do a read, there's nothing at the end of the file to read. If you've written to a file and want to reread it without closing it you need to seek (http://docs.python.org/lib/bltin-file-objects.html) if you have a file object or lseek (http://docs.python.org/lib/os-fd-ops.html) if you have a file descriptor. Joshua On Tue, Aug 26, 2008 at 3:56 PM, David Elsen wrote: > Alex, > > Thank you for your reply. > > Actually I had modified the text file before posting. It has four words in > one line seperated by space. I was using the split with space to get all > four words from a line. I was appending one word to my list (list of > strings). > > I was wondering once I am using split function whether it converts the > "numbers" from my text file to some particular formats. I was trying to cast > the split output with "map", "long" etc, but it gives the error message > that for it can not accept the non-string input. > > I tried to look around for split reference, but nowhere got its return type > format information. It seems like string ['0xdeadfeed']. But it does not > seem to be. If it is really string type, why cast from "map", "int", or > "long" is giving me error message. > > I apologize for becoming the time sink. I am ready to become the time > source. > > I have one more question though related to my same script. Please forgive me > about this. If I am trying to write my text file in the same script and then > tring to read back. For some reason, read file handle does not have any > data. > > But if I have written to the text file and saved it and then trying to open > it in read mode, I am able to read the data. Is there any delay required > after writing the data to a file? > > Thanks, > David > > Thanks again, > David > > > > > > > On Tue, Aug 26, 2008 at 1:26 PM, Alex Martelli wrote: >> >> You should really study some of the basics of Python -- e.g. via the >> mailing list http://mail.python.org/mailman/listinfo/tutor or any of >> the other resources listed at >> http://wiki.python.org/moin/BeginnersGuide -- this mailing list is for >> the Bay Area Python Interest Group and not particularly suitable for >> your questions. In this case, you're appending to your list reg items >> that are lists of strings (with one item only in each sublist, >> apparently) and you apparently want to convert that list of lists of >> strings to a list of integers -- and give no indication whatsoever >> about what you mean to happen when one of the sublists has more than >> one item (i.e. any of the text lines in file ask_it.txt [apart from >> the first four] has more than one word), or any of the words are not a >> correct representation for an integer, and so forth. If you know the >> "more than one word in a line" can never happen, then it makes no >> sense to have that "datas = line.split()" call -- why are you >> splitting unless >1 word is possible?! >> >> http://www.catb.org/~esr/faqs/smart-questions.html is a document >> really worth studying (quite apart from Python, ANY time you need to >> ask technical questions) and it includes worthy quotes such as "What >> we are, unapologetically, is hostile to people who seem to be >> unwilling to think or to do their own homework before asking >> questions. People like that are time sinks ? they take without giving >> back, and they waste time we could have spent on another question more >> interesting and another person more worthy of an answer." >> >> >> Alex >> >> On Tue, Aug 26, 2008 at 1:02 PM, David Elsen >> wrote: >> > Hi all, >> > >> > I have a test script as follows: >> > >> > import os >> > import string >> > cmd = './testtool dump' >> > res = os.popen(cmd).read() >> > #print res >> > #fout = open("ask_it.txt", "w") >> > #fout.write(res) >> > #fout.close >> > reg_reset_val = [] >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > >> > print 'reg default values' >> > for index, item in enumerate(reg_reset_val): >> > print index, item >> > >> > fin = open ("ask_it.txt", "r") >> > i = 0 >> > reg = [] >> > linelist = fin.readlines() >> > lines = len(linelist) >> > for line in linelist: >> > i = i +1 >> > if (i >= 5): # First four lines are bogus >> > datas = line.split() >> > reg.append(datas) >> > if i == lines: >> > break >> > print 'the reg list is' >> > for j, item in enumerate(reg): >> > print j, item >> > print 'reg[0]' >> > print reg[0] >> > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] >> > #print reg_reset_val[0] >> > if (reg[0] == reg_reset_val[0]): >> > print 'test passed' >> > else: >> > print 'test failed' >> > >> > >> > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. >> > Returned from calling driver via IOCTL. >> > IOCTL CTL Mem Dump char count >> > Control Memory Dump: Address 0xf8812000 >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But >> > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has >> > 0xdeadfeed in it. How can I convert the reg[0] to make it normal >> > 0xdeadfeed. >> > >> > Thanks, >> > David >> > >> > >> > >> > _______________________________________________ >> > Baypiggies mailing list >> > Baypiggies at python.org >> > To change your subscription options or unsubscribe: >> > http://mail.python.org/mailman/listinfo/baypiggies >> > > > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From elsen.david08 at gmail.com Wed Aug 27 01:18:16 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 16:18:16 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: <9bb4e5be0808261614g5b494ef9i2b23c0452c569bc4@mail.gmail.com> References: <55dc209b0808261326j11bf7457v33373c1e20575b2b@mail.gmail.com> <9bb4e5be0808261614g5b494ef9i2b23c0452c569bc4@mail.gmail.com> Message-ID: Hi Joshua, Got it. Thanks. I am misiing the "seek" part. Thanks again, David On Tue, Aug 26, 2008 at 4:14 PM, Joshua Gallagher < joshua.gallagher at gmail.com> wrote: > Hi David, > > When you read and write into a file, you read and write at offsets. > You can think of the offset as a moving cursor in the file. In other > words, if you create a new file and write 10 bytes in, your cursor is > 10-bytes into the file. If you perform another write, the write > starts at byte 10. By extension, if your cursor is at byte 10 of this > new file and you do a read, there's nothing at the end of the file to > read. > > If you've written to a file and want to reread it without closing it > you need to seek (http://docs.python.org/lib/bltin-file-objects.html) > if you have a file object or lseek > (http://docs.python.org/lib/os-fd-ops.html) if you have a file > descriptor. > > Joshua > > > > On Tue, Aug 26, 2008 at 3:56 PM, David Elsen > wrote: > > Alex, > > > > Thank you for your reply. > > > > Actually I had modified the text file before posting. It has four words > in > > one line seperated by space. I was using the split with space to get > all > > four words from a line. I was appending one word to my list (list of > > strings). > > > > I was wondering once I am using split function whether it converts the > > "numbers" from my text file to some particular formats. I was trying to > cast > > the split output with "map", "long" etc, but it gives the error message > > that for it can not accept the non-string input. > > > > I tried to look around for split reference, but nowhere got its return > type > > format information. It seems like string ['0xdeadfeed']. But it does not > > seem to be. If it is really string type, why cast from "map", "int", or > > "long" is giving me error message. > > > > I apologize for becoming the time sink. I am ready to become the time > > source. > > > > I have one more question though related to my same script. Please forgive > me > > about this. If I am trying to write my text file in the same script and > then > > tring to read back. For some reason, read file handle does not have any > > data. > > > > But if I have written to the text file and saved it and then trying to > open > > it in read mode, I am able to read the data. Is there any delay required > > after writing the data to a file? > > > > Thanks, > > David > > > > Thanks again, > > David > > > > > > > > > > > > > > On Tue, Aug 26, 2008 at 1:26 PM, Alex Martelli wrote: > >> > >> You should really study some of the basics of Python -- e.g. via the > >> mailing list http://mail.python.org/mailman/listinfo/tutor or any of > >> the other resources listed at > >> http://wiki.python.org/moin/BeginnersGuide -- this mailing list is for > >> the Bay Area Python Interest Group and not particularly suitable for > >> your questions. In this case, you're appending to your list reg items > >> that are lists of strings (with one item only in each sublist, > >> apparently) and you apparently want to convert that list of lists of > >> strings to a list of integers -- and give no indication whatsoever > >> about what you mean to happen when one of the sublists has more than > >> one item (i.e. any of the text lines in file ask_it.txt [apart from > >> the first four] has more than one word), or any of the words are not a > >> correct representation for an integer, and so forth. If you know the > >> "more than one word in a line" can never happen, then it makes no > >> sense to have that "datas = line.split()" call -- why are you > >> splitting unless >1 word is possible?! > >> > >> http://www.catb.org/~esr/faqs/smart-questions.html is a document > >> really worth studying (quite apart from Python, ANY time you need to > >> ask technical questions) and it includes worthy quotes such as "What > >> we are, unapologetically, is hostile to people who seem to be > >> unwilling to think or to do their own homework before asking > >> questions. People like that are time sinks ? they take without giving > >> back, and they waste time we could have spent on another question more > >> interesting and another person more worthy of an answer." > >> > >> > >> Alex > >> > >> On Tue, Aug 26, 2008 at 1:02 PM, David Elsen > >> wrote: > >> > Hi all, > >> > > >> > I have a test script as follows: > >> > > >> > import os > >> > import string > >> > cmd = './testtool dump' > >> > res = os.popen(cmd).read() > >> > #print res > >> > #fout = open("ask_it.txt", "w") > >> > #fout.write(res) > >> > #fout.close > >> > reg_reset_val = [] > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > reg_reset_val.append(0xdeadfeed) > >> > > >> > print 'reg default values' > >> > for index, item in enumerate(reg_reset_val): > >> > print index, item > >> > > >> > fin = open ("ask_it.txt", "r") > >> > i = 0 > >> > reg = [] > >> > linelist = fin.readlines() > >> > lines = len(linelist) > >> > for line in linelist: > >> > i = i +1 > >> > if (i >= 5): # First four lines are bogus > >> > datas = line.split() > >> > reg.append(datas) > >> > if i == lines: > >> > break > >> > print 'the reg list is' > >> > for j, item in enumerate(reg): > >> > print j, item > >> > print 'reg[0]' > >> > print reg[0] > >> > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] > >> > #print reg_reset_val[0] > >> > if (reg[0] == reg_reset_val[0]): > >> > print 'test passed' > >> > else: > >> > print 'test failed' > >> > > >> > > >> > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. > >> > Returned from calling driver via IOCTL. > >> > IOCTL CTL Mem Dump char count > >> > Control Memory Dump: Address 0xf8812000 > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > 0xdeadfeed > >> > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But > >> > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has > >> > 0xdeadfeed in it. How can I convert the reg[0] to make it normal > >> > 0xdeadfeed. > >> > > >> > Thanks, > >> > David > >> > > >> > > >> > > >> > _______________________________________________ > >> > Baypiggies mailing list > >> > Baypiggies at python.org > >> > To change your subscription options or unsubscribe: > >> > http://mail.python.org/mailman/listinfo/baypiggies > >> > > > > > > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org > > To change your subscription options or unsubscribe: > > http://mail.python.org/mailman/listinfo/baypiggies > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Wed Aug 27 01:21:05 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 16:21:05 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: Message-ID: Hi Sherman. Thanks. It worked for me. My mistake. Sorry for being such a stupid. I am forwarding the Sherman reply to the whole group. Just in case someone need it David > > On Tue, Aug 26, 2008 at 1:30 PM, Shiqi Yang wrote: > >> just saw reg[0] is a list type >> in that case maybe >> int(reg[0][0], 16) would work for you. >> >> >> >> On Tue, Aug 26, 2008 at 1:28 PM, David Elsen >> wrote: >> > Hi Sherman, >> > >> > With int(reg[0],16), I get the error message "TypeError: int() can't >> convert >> > non-string with explicit base." >> > >> > On Tue, Aug 26, 2008 at 1:23 PM, Shiqi Yang >> wrote: >> >> >> >> Hi, David, >> >> >> >> you can give int(reg[0], 16) a try to see if that's what you want. >> >> >> >> >> >> >> >> >> >> On Tue, Aug 26, 2008 at 1:02 PM, David Elsen >> >> wrote: >> >> > Hi all, >> >> > >> >> > I have a test script as follows: >> >> > >> >> > import os >> >> > import string >> >> > cmd = './testtool dump' >> >> > res = os.popen(cmd).read() >> >> > #print res >> >> > #fout = open("ask_it.txt", "w") >> >> > #fout.write(res) >> >> > #fout.close >> >> > reg_reset_val = [] >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > reg_reset_val.append(0xdeadfeed) >> >> > >> >> > print 'reg default values' >> >> > for index, item in enumerate(reg_reset_val): >> >> > print index, item >> >> > >> >> > fin = open ("ask_it.txt", "r") >> >> > i = 0 >> >> > reg = [] >> >> > linelist = fin.readlines() >> >> > lines = len(linelist) >> >> > for line in linelist: >> >> > i = i +1 >> >> > if (i >= 5): # First four lines are bogus >> >> > datas = line.split() >> >> > reg.append(datas) >> >> > if i == lines: >> >> > break >> >> > print 'the reg list is' >> >> > for j, item in enumerate(reg): >> >> > print j, item >> >> > print 'reg[0]' >> >> > print reg[0] >> >> > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] >> >> > #print reg_reset_val[0] >> >> > if (reg[0] == reg_reset_val[0]): >> >> > print 'test passed' >> >> > else: >> >> > print 'test failed' >> >> > >> >> > >> >> > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. >> >> > Returned from calling driver via IOCTL. >> >> > IOCTL CTL Mem Dump char count >> >> > Control Memory Dump: Address 0xf8812000 >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > 0xdeadfeed >> >> > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. >> But >> >> > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has >> >> > 0xdeadfeed in it. How can I convert the reg[0] to make it normal >> >> > 0xdeadfeed. >> >> > >> >> > Thanks, >> >> > David >> >> > >> >> > >> >> > >> >> > _______________________________________________ >> >> > Baypiggies mailing list >> >> > Baypiggies at python.org >> >> > To change your subscription options or unsubscribe: >> >> > http://mail.python.org/mailman/listinfo/baypiggies >> >> > >> >> >> >> >> >> >> >> -- >> >> Sherman Yang >> > >> > >> >> >> >> -- >> Sherman Yang >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elsen.david08 at gmail.com Wed Aug 27 01:25:04 2008 From: elsen.david08 at gmail.com (David Elsen) Date: Tue, 26 Aug 2008 16:25:04 -0700 Subject: [Baypiggies] Is this a conversion problem? Can I get help to resolve this please? In-Reply-To: References: Message-ID: Forgot to include Sherman's answer. It is given below: just saw reg[0] is a list type in that case maybe *int(reg[0][0], 16) would work for you.* - Show quoted text - On Tue, Aug 26, 2008 at 1:28 PM, David Elsen wrote: > Hi Sherman, > > With int(reg[0],16), I get the error message "TypeError: int() can't convert > non-string with explicit base." > > On Tue, Aug 26, 2008 at 1:23 PM, Shiqi Yang wrote: >> >> Hi, David, >> >> you can give int(reg[0], 16) a try to see if that's what you want. >> >> >> >> >> On Tue, Aug 26, 2008 at 1:02 PM, David Elsen >> wrote: >> > Hi all, >> > >> > I have a test script as follows: >> > >> > import os >> > import string >> > cmd = './testtool dump' >> > res = os.popen(cmd).read() >> > #print res >> > #fout = open("ask_it.txt", "w") >> > #fout.write(res) >> > #fout.close >> > reg_reset_val = [] >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > reg_reset_val.append(0xdeadfeed) >> > >> > print 'reg default values' >> > for index, item in enumerate(reg_reset_val): >> > print index, item >> > >> > fin = open ("ask_it.txt", "r") >> > i = 0 >> > reg = [] >> > linelist = fin.readlines() >> > lines = len(linelist) >> > for line in linelist: >> > i = i +1 >> > if (i >= 5): # First four lines are bogus >> > datas = line.split() >> > reg.append(datas) >> > if i == lines: >> > break >> > print 'the reg list is' >> > for j, item in enumerate(reg): >> > print j, item >> > print 'reg[0]' >> > print reg[0] >> > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] >> > #print reg_reset_val[0] >> > if (reg[0] == reg_reset_val[0]): >> > print 'test passed' >> > else: >> > print 'test failed' >> > >> > >> > Calling to driver via IOCTL Control Memory Dump buf addr = 0x804d008. >> > Returned from calling driver via IOCTL. >> > IOCTL CTL Mem Dump char count >> > Control Memory Dump: Address 0xf8812000 >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > 0xdeadfeed >> > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. But >> > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has >> > 0xdeadfeed in it. How can I convert the reg[0] to make it normal >> > 0xdeadfeed. >> > >> > Thanks, >> > David >> > >> > >> > >> > _______________________________________________ >> > Baypiggies mailing list >> > Baypiggies at python.org >> > To change your subscription options or unsubscribe: >> > http://mail.python.org/mailman/listinfo/baypiggies >> > >> >> >> >> -- >> Sherman Yang > > -- Sherman Yang On Tue, Aug 26, 2008 at 4:21 PM, David Elsen wrote: > Hi Sherman. > > Thanks. It worked for me. My mistake. Sorry for being such a stupid. > > I am forwarding the Sherman reply to the whole group. Just in case someone > need it > David > > >> >> On Tue, Aug 26, 2008 at 1:30 PM, Shiqi Yang wrote: >> >>> just saw reg[0] is a list type >>> in that case maybe >>> int(reg[0][0], 16) would work for you. >>> >>> >>> >>> On Tue, Aug 26, 2008 at 1:28 PM, David Elsen >>> wrote: >>> > Hi Sherman, >>> > >>> > With int(reg[0],16), I get the error message "TypeError: int() can't >>> convert >>> > non-string with explicit base." >>> > >>> > On Tue, Aug 26, 2008 at 1:23 PM, Shiqi Yang >>> wrote: >>> >> >>> >> Hi, David, >>> >> >>> >> you can give int(reg[0], 16) a try to see if that's what you want. >>> >> >>> >> >>> >> >>> >> >>> >> On Tue, Aug 26, 2008 at 1:02 PM, David Elsen >> > >>> >> wrote: >>> >> > Hi all, >>> >> > >>> >> > I have a test script as follows: >>> >> > >>> >> > import os >>> >> > import string >>> >> > cmd = './testtool dump' >>> >> > res = os.popen(cmd).read() >>> >> > #print res >>> >> > #fout = open("ask_it.txt", "w") >>> >> > #fout.write(res) >>> >> > #fout.close >>> >> > reg_reset_val = [] >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > reg_reset_val.append(0xdeadfeed) >>> >> > >>> >> > print 'reg default values' >>> >> > for index, item in enumerate(reg_reset_val): >>> >> > print index, item >>> >> > >>> >> > fin = open ("ask_it.txt", "r") >>> >> > i = 0 >>> >> > reg = [] >>> >> > linelist = fin.readlines() >>> >> > lines = len(linelist) >>> >> > for line in linelist: >>> >> > i = i +1 >>> >> > if (i >= 5): # First four lines are bogus >>> >> > datas = line.split() >>> >> > reg.append(datas) >>> >> > if i == lines: >>> >> > break >>> >> > print 'the reg list is' >>> >> > for j, item in enumerate(reg): >>> >> > print j, item >>> >> > print 'reg[0]' >>> >> > print reg[0] >>> >> > print 'reg_reset_val[0]0x%x'%reg_reset_val[0] >>> >> > #print reg_reset_val[0] >>> >> > if (reg[0] == reg_reset_val[0]): >>> >> > print 'test passed' >>> >> > else: >>> >> > print 'test failed' >>> >> > >>> >> > >>> >> > Calling to driver via IOCTL Control Memory Dump buf addr = >>> 0x804d008. >>> >> > Returned from calling driver via IOCTL. >>> >> > IOCTL CTL Mem Dump char count >>> >> > Control Memory Dump: Address 0xf8812000 >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > 0xdeadfeed >>> >> > I am expecting the "reg[0]" and "reg_reset_val[0]" to be the same. >>> But >>> >> > reg[0] is list and has ['0xdeadfeed'] in it and reg_reset_val[0] has >>> >> > 0xdeadfeed in it. How can I convert the reg[0] to make it normal >>> >> > 0xdeadfeed. >>> >> > >>> >> > Thanks, >>> >> > David >>> >> > >>> >> > >>> >> > >>> >> > _______________________________________________ >>> >> > Baypiggies mailing list >>> >> > Baypiggies at python.org >>> >> > To change your subscription options or unsubscribe: >>> >> > http://mail.python.org/mailman/listinfo/baypiggies >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> Sherman Yang >>> > >>> > >>> >>> >>> >>> -- >>> Sherman Yang >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdbaddog at gmail.com Wed Aug 27 02:02:12 2008 From: bdbaddog at gmail.com (William Deegan) Date: Tue, 26 Aug 2008 17:02:12 -0700 Subject: [Baypiggies] os.path.join unexpected behavior on windows Message-ID: <8540148a0808261702v5740b331m729730db47636e41@mail.gmail.com> Greetings, I have the following (simplified) code: import os.path z='/build' x='m:/billdeeg.scons1' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) x='m:/billdeeg.scons1/' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) x='m:/billdeeg.scons1' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) z='build' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) z='/build' x='n:' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) x='n:/' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) x='m:/billdeeg.scons1' print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) When I run it I get the following output: C:\cygwin\home\billdeeg\tmp>python try_ospathjoin.py X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build X=>m:/billdeeg.scons1/ z=>/build Joined path is=>/build X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build X=>m:/billdeeg.scons1 z=>build Joined path is=>m:/billdeeg.scons1\build X=>n: z=>/build Joined path is=>n:/build X=>n:/ z=>/build Joined path is=>n:/build X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build I would expect in all cases that I would get : n:/build or m:/billdeeg.scons1/build But as you can see in some cases that's not what I get. Here's the docs about os.path.join: join( path1[, path2[, ...]]) Join one or more path components intelligently. If any component is an absolute path, all previous components (on Windows, including the previous drive letter, if there was one) are thrown away, and joining continues. The return value is the concatenation of path1, and optionally path2, etc., with exactly one directory separator (os.sep) inserted between components, unless path2 is empty. Note that on Windows, since there is a current directory for each drive, os.path.join("c:", "foo") represents a path relative to the current directory on drive C: (c:foo), not c:\\foo. I'm guessing I get : /build in because of the clause above about "if any component is an absolute path...", is that correct? So to get what I expect, looks like I need to insure that none of the [1:] arguments start with a '/' or '\' ? Thanks, Bill From Chris.Clark at ingres.com Wed Aug 27 02:33:58 2008 From: Chris.Clark at ingres.com (Chris Clark) Date: Tue, 26 Aug 2008 17:33:58 -0700 Subject: [Baypiggies] os.path.join unexpected behavior on windows In-Reply-To: <8540148a0808261702v5740b331m729730db47636e41@mail.gmail.com> References: <8540148a0808261702v5740b331m729730db47636e41@mail.gmail.com> Message-ID: <48B4A0F6.6010408@ingres.com> Please excuse my top post. I've had this issue too, I never worked out why, I just stick an os.path.abspath() around everything I want to display (using it as-is with the Python libs is fine, display is the only place it matters). E.g. >>> import os >>> os.path.abspath('m:/billdeeg.scons1\\build') 'm:\\billdeeg.scons1\\build' >>> and pretend it doesn't happen :-) HTH Chris On 8/26/2008 5:02 PM, William Deegan wrote: > Greetings, > > I have the following (simplified) code: > import os.path > > z='/build' > x='m:/billdeeg.scons1' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > x='m:/billdeeg.scons1/' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > x='m:/billdeeg.scons1' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > z='build' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > z='/build' > x='n:' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > x='n:/' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > x='m:/billdeeg.scons1' > print "X=>%-20s z=>%-10s Joined path is=>%s"%(x,z,os.path.join(x,z)) > > > > When I run it I get the following output: > C:\cygwin\home\billdeeg\tmp>python try_ospathjoin.py > X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build > X=>m:/billdeeg.scons1/ z=>/build Joined path is=>/build > X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build > X=>m:/billdeeg.scons1 z=>build Joined path is=>m:/billdeeg.scons1\build > X=>n: z=>/build Joined path is=>n:/build > X=>n:/ z=>/build Joined path is=>n:/build > X=>m:/billdeeg.scons1 z=>/build Joined path is=>/build > > > I would expect in all cases that I would get : > n:/build or m:/billdeeg.scons1/build > But as you can see in some cases that's not what I get. > > Here's the docs about os.path.join: > join( path1[, path2[, ...]]) > > Join one or more path components intelligently. If any component is an > absolute path, all previous components (on Windows, including the > previous drive letter, if there was one) are thrown away, and joining > continues. The return value is the concatenation of path1, and > optionally path2, etc., with exactly one directory separator (os.sep) > inserted between components, unless path2 is empty. Note that on > Windows, since there is a current directory for each drive, > os.path.join("c:", "foo") represents a path relative to the current > directory on drive C: (c:foo), not c:\\foo. > > I'm guessing I get : /build in because of the clause above about "if > any component is an absolute path...", is that correct? > > So to get what I expect, looks like I need to insure that none of the > [1:] arguments start with a '/' or '\' ? > > Thanks, > Bill > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > From aahz at pythoncraft.com Wed Aug 27 17:07:28 2008 From: aahz at pythoncraft.com (Aahz) Date: Wed, 27 Aug 2008 08:07:28 -0700 Subject: [Baypiggies] os.path.join unexpected behavior on windows In-Reply-To: <8540148a0808261702v5740b331m729730db47636e41@mail.gmail.com> References: <8540148a0808261702v5740b331m729730db47636e41@mail.gmail.com> Message-ID: <20080827150728.GA889@panix.com> On Tue, Aug 26, 2008, William Deegan wrote: > > Here's the docs about os.path.join: > join( path1[, path2[, ...]]) > > Join one or more path components intelligently. If any component is an > absolute path, all previous components (on Windows, including the > previous drive letter, if there was one) are thrown away, and joining > continues. The return value is the concatenation of path1, and > optionally path2, etc., with exactly one directory separator (os.sep) > inserted between components, unless path2 is empty. Note that on > Windows, since there is a current directory for each drive, > os.path.join("c:", "foo") represents a path relative to the current > directory on drive C: (c:foo), not c:\\foo. > > I'm guessing I get : /build in because of the clause above about "if > any component is an absolute path...", is that correct? That seems correct; if you want more discussion I suggest you ask on comp.lang.python -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Adopt A Process -- stop killing all your children! From sherman.yang at gmail.com Wed Aug 27 21:10:07 2008 From: sherman.yang at gmail.com (Shiqi Yang) Date: Wed, 27 Aug 2008 12:10:07 -0700 Subject: [Baypiggies] translating shell environment variables Message-ID: Hi, My python code is reading some xml files that have several shell style environment variables like "$_" or "$$". for example: /tmp/$$.log I need to extract them and translate them into real value when I read the file. Now I can only think of two ways of doing this, 1 is to have a big dictionary in my python code which have all the mappings from shell to python os module(or others as well) another way is to get shell involved and have it pre-process the file, but I'm afraid that way some of the values may not be well translated since the context switch (like the pids, etc). Are there any python module that could help this kind of task? or anyone has done similar work can share your experience? Any help will be highly appreciated. Thanks, -- Sherman Yang From cappy2112 at gmail.com Thu Aug 28 21:53:40 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 28 Aug 2008 12:53:40 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th Message-ID: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> If you want to present a "Newbie Nugget" for Sept 11th, please submit your ideas to the list! Thanks From jjinux at gmail.com Fri Aug 29 00:58:43 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 28 Aug 2008 15:58:43 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: On Thu, Aug 28, 2008 at 12:53 PM, Tony Cappellini wrote: > If you want to present a "Newbie Nugget" for Sept 11th, please submit > your ideas to the list! * The format is that one person covers one topic. * Slides are optional. * Showing some code, perhaps in the Python shell, is required! * Pick something harder than for loops, but easier than metaclasses. * Topics include interesting bits of Python syntax, modules from the standard library, and common third-party packages. In short, pick something interesting that you use an intermediate or advanced Python programmer, and introduce it to a newbie Python programmer. -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From jjinux at gmail.com Fri Aug 29 00:59:12 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 28 Aug 2008 15:59:12 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: On Thu, Aug 28, 2008 at 3:58 PM, Shannon -jj Behrens wrote: > On Thu, Aug 28, 2008 at 12:53 PM, Tony Cappellini wrote: >> If you want to present a "Newbie Nugget" for Sept 11th, please submit >> your ideas to the list! > > * The format is that one person covers one topic. > * Slides are optional. > * Showing some code, perhaps in the Python shell, is required! > * Pick something harder than for loops, but easier than metaclasses. > * Topics include interesting bits of Python syntax, modules from the > standard library, and common third-party packages. > > In short, pick something interesting that you use an intermediate or > advanced Python programmer, and introduce it to a newbie Python > programmer. I forgot to mention, you should limit your talk to 10 minutes. -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From progrium at gmail.com Fri Aug 29 01:14:04 2008 From: progrium at gmail.com (Jeff Lindsay) Date: Thu, 28 Aug 2008 16:14:04 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: I'd be interested in sharing some functional programming stuff like lambdas and higher order functions... On Thu, Aug 28, 2008 at 12:53 PM, Tony Cappellini wrote: > If you want to present a "Newbie Nugget" for Sept 11th, please submit > your ideas to the list! > > Thanks > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > -- Jeff Lindsay http://devjavu.com -- Free Trac and Subversion http://groksystems.com -- Learn about systems theory -------------- next part -------------- An HTML attachment was scrubbed... URL: From cappy2112 at gmail.com Fri Aug 29 01:42:27 2008 From: cappy2112 at gmail.com (Tony Cappellini) Date: Thu, 28 Aug 2008 16:42:27 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: <8249c4ac0808281642h52f43927q1733a545b06fe3f7@mail.gmail.com> On Thu, Aug 28, 2008 at 4:14 PM, Jeff Lindsay wrote: > I'd be interested in sharing some functional programming stuff like lambdas > and higher order functions... +1 From jjinux at gmail.com Fri Aug 29 03:17:15 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Thu, 28 Aug 2008 18:17:15 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: On Thu, Aug 28, 2008 at 4:14 PM, Jeff Lindsay wrote: > I'd be interested in sharing some functional programming stuff like lambdas > and higher order functions... +1 I loves me some closures! -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/ From cvrebert at gmail.com Fri Aug 29 03:30:43 2008 From: cvrebert at gmail.com (Chris Rebert) Date: Thu, 28 Aug 2008 18:30:43 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: <47c890dc0808281830j67023214v21e833ff118bea55@mail.gmail.com> On Thu, Aug 28, 2008 at 6:17 PM, Shannon -jj Behrens wrote: > On Thu, Aug 28, 2008 at 4:14 PM, Jeff Lindsay wrote: >> I'd be interested in sharing some functional programming stuff like lambdas >> and higher order functions... > > +1 > > I loves me some closures! > > -jj > > -- > Don't you wish you had a really clever sig like mine? > http://jjinux.blogspot.com/ > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > http://mail.python.org/mailman/listinfo/baypiggies > Yes, perhaps the new "nonlocal" declaration from PEP 3104 could be worked in too? - Chris From jim at well.com Fri Aug 29 05:20:31 2008 From: jim at well.com (jim) Date: Thu, 28 Aug 2008 20:20:31 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> Message-ID: <1219980031.22670.257.camel@ubuntu> plan on taking about ten minutes, give or take a couple. On Thu, 2008-08-28 at 15:58 -0700, Shannon -jj Behrens wrote: > On Thu, Aug 28, 2008 at 12:53 PM, Tony Cappellini wrote: > > If you want to present a "Newbie Nugget" for Sept 11th, please submit > > your ideas to the list! > > * The format is that one person covers one topic. > * Slides are optional. > * Showing some code, perhaps in the Python shell, is required! > * Pick something harder than for loops, but easier than metaclasses. > * Topics include interesting bits of Python syntax, modules from the > standard library, and common third-party packages. > > In short, pick something interesting that you use an intermediate or > advanced Python programmer, and introduce it to a newbie Python > programmer. > > -jj > From bsergean at gmail.com Fri Aug 29 22:05:38 2008 From: bsergean at gmail.com (Benjamin Sergeant) Date: Fri, 29 Aug 2008 13:05:38 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: <47c890dc0808281830j67023214v21e833ff118bea55@mail.gmail.com> References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> <47c890dc0808281830j67023214v21e833ff118bea55@mail.gmail.com> Message-ID: <1621f9fa0808291305w16770b37u5a2930592d4a25dd@mail.gmail.com> > Yes, perhaps the new "nonlocal" declaration from PEP 3104 could be > worked in too? > - Chris +1 Explaining the difference between nonlocal, global is a good idea. I try to think about confusing stuff for C/C++ programmers. The semantic of the = operator, how do you live without pointers ? >>> A = [0,1] >>> def add(A): A.append(2) ... >>> add(A) >>> A [0, 1, 2] Benjamin. From jjinux at gmail.com Sat Aug 30 01:19:26 2008 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 29 Aug 2008 16:19:26 -0700 Subject: [Baypiggies] Looking for a newbie nugget presenter for Thursday, Sept 11th In-Reply-To: <1621f9fa0808291305w16770b37u5a2930592d4a25dd@mail.gmail.com> References: <8249c4ac0808281253y2d07a003h38cd077e1e14315b@mail.gmail.com> <47c890dc0808281830j67023214v21e833ff118bea55@mail.gmail.com> <1621f9fa0808291305w16770b37u5a2930592d4a25dd@mail.gmail.com> Message-ID: > Explaining the difference between nonlocal, global is a good idea. Agreed. > I > try to think about confusing stuff for C/C++ programmers. The semantic > of the = operator, how do you live without pointers ? > >>>> A = [0,1] >>>> def add(A): A.append(2) > ... >>>> add(A) >>>> A > [0, 1, 2] It's easy--everything's a pointer. Even ints are pointers. It's just that ints are immutable, so they act like values. However, under the covers, they're really just pointers. -jj -- Don't you wish you had a really clever sig like mine? http://jjinux.blogspot.com/