Re: did anybody play with python and window mobile broadband?
On 18 мар, 11:20, News123 wrote: > I'd like to use a mobile broadband device with a windows python app. > Did anybody play already with python and the window mobile broadband > interface? > There was a discussion on this subject in some local forum recently. I assume you're using PythonCE, right? The best solution proposed there was to use ctypes and WinAPI. You can find a relatively high level APIs to set up a connection (without need to go too low level with AT commands) and make your own wrapper. A good starting point can be found here: http://msdn.microsoft.com/en-us/library/bb416346.aspx (it's not the only way to to things, btw). -- regards, eGlyph -- http://mail.python.org/mailman/listinfo/python-list
Re: url2lib (windows 7) does not notice when network reconnects (getaddrinfo problem)
On 18 мар, 00:47, News123 wrote: > Hi, > > I'd like to write a function, that knows when the 'internet' is reachable. > > My setup is a windows7 host with a wireless USB modem. The modem might > connect / disconnect any time. > > I thought I write a small function just checking whether I can fetch a url. > # script starts > import time,urllib2 > > myurl = "http://www.mysite.com"; # or "www.google.com" or whatever you like > > while True: > connected = False > try: > urllib2.urlopen(myurl) > connected = True > except urllib2.URLError as e: > print "urlerr %s" % e > print "connected",connected > time.sleep(1) > ## end of script > > if the network is connected when I start the script the first time after > reboot, then I receive> connected True > > As expected > > If the network is disconnected when I start the script the first time > after reboot, then I receive> urlerr getaddrinfo failed> > > connected False > > as expected > > Things are getting weired, when my USB wireless modem connects after > I started my script: > > It happens, that I just continue to receive: > > > urlerr > > connected False > > however when I use a windows cmd window and I start > "pingwww.mysite.com", then my python script recovers and reports > > > connected True > > My perhaps false conclusion is, that getaddrinfo() is not retrying to > resolve an IP address, when it failed once. > > Is this behaviour known? Can this really be possible? > I can reproduce this issue. not every time, but rather often. > > If yes, is there any way to force a new host name lookup under windows? > > What else could I be doing wrong? > > Thanks a lot in advance for any ideas > > N Actually this should be expected behavior. Windows establishes connection automatically when you start pinging something, your script doesn't. Just check the connection state with winapi (ctypes? pywin32?) and establish it if it isn't already. -- regards, eGlyph -- http://mail.python.org/mailman/listinfo/python-list
Re: Install 2.6.4 as non-admin on Windows
On 18 мар, 16:45, Mark Carter wrote: > How do I install python 2.6.4 on Windows without admin privileges? > > Can I install it on a machine I control, zip up the contents, copy it > across to an admin-restricted machine, and set up a couple of > environemtn variables? Does python install files to system > directories, making this impossible? The only file written to a system folder is python2x.dll (I think it's not true for python2.6 any longer), so your approach is perfectly valid if you can put this dll into a folder where it can be found by the system. PortablePython does this almost the same. -- regards, eGlyph -- http://mail.python.org/mailman/listinfo/python-list
Re: Python + OpenOffice Calc
On Apr 1, 6:53 am, rantingrick wrote: > > 3 fields: quantity - description of the piece bought - price > > So what is your plan...? > * Pop up a dialog with three entrys, > * have him fill out the three entrys, > * then have python insert the data into the spreadsheet? > ...Why bother messing with OO, too much trouble for me? Totally agree with you. No need for a heavy machinery in this case. > Then just save all the data as csv and you > can always load it into a spreadsheet later if the IRS comes knocking, > or you need to print a professional looking spreadsheet ;-). Simple, > 100% python solution! Actually, a spreadsheet based solution isn't best fit for such a task. I'd recommend to store the data in sqlite3 (also 100% pure python as the module is in the stdlib). CSV is good for making invoices or something like that. -- http://mail.python.org/mailman/listinfo/python-list
Re: plotting in python 3
On Apr 6, 11:52 pm, Rolf Camps wrote: > Op dinsdag 06-04-2010 om 14:55 uur [tijdzone -0500], schreef Christopher > Choi: > It was after the homework I asked my question. All plot solutions i > found where for python2.x. gnuplot_py states on its homepage you need a > 'working copy of numpy'. I don't think numpy is ported to python 3.x. Or > is it? Google charts could be quick and dirty solution -- http://pygooglechart.slowchop.com/ -- http://mail.python.org/mailman/listinfo/python-list
