[issue22870] urlopen timeout failed with SSL socket

2014-11-15 Thread Dave Tian
Dave Tian added the comment: Hi David, Thanks for your quick response. I have tried Python 3.4.2 using urllib.request.urlopen() - still not working. Below is the backtrace. I am not sure if this is a bug of PySSL_SSLread, which returns nothing yet without timeout. If you want me to dig

Re:python on android: where to start

2014-11-14 Thread Dave Angel
maurog qualsivog...@dovetipare.nz Wrote in message: I looked at the newsgroup, but I didn't find recent infos on this topic. On the other side I went lost by looking for this topic with google. So I'm asking you my question, if I want to develop or run some code with python on android, what

[issue22870] urlopen timeout failed with SSL socket

2014-11-14 Thread Dave Tian
New submission from Dave Tian: Hi there, Recent urlopen with timeout did not work. Below is the back trace. After digging into the Python lib, the root cause is found - within the socket.py, self._sock.recv(), under a 'while True' loop, tried to retrieve sth from the under-layer SSL socket

Re: Synchronizing a sound with a widget change

2014-11-13 Thread Dave Angel
ast nom...@invalid.com Wrote in message: ast nom...@invalid.com a écrit dans le message de news:54648e75$0$12771$426a7...@news.free.fr... ast nom...@invalid.com a écrit dans le message de news:54648d03$0$1981$426a7...@news.free.fr... I have the idea to run an other thread to emit the

Re: Synchronizing a sound with a widget change

2014-11-13 Thread Dave Angel
Yimr Zero yim...@gmail.com Wrote in message: body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Segoe UI'; color: rgb(0, 0, 0); line-height: 1.5; } Hi, You may try to add the sleep(5) after the color

Re: __missing__ for the top-level Python script

2014-11-12 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Mon, Nov 10, 2014 at 10:31 AM, Chris Angelico ros...@gmail.com wrote: So the semantics should be: If NameError would be raised (not including UnboundLocalError, which still represents an error), attempt to import the absent name. If

Re:What is \1 here?

2014-11-11 Thread Dave Angel
satishmlm...@gmail.com Wrote in message: What does \1 do in the following piece of code(fourth line)? import re print(re.sub('[ABC]', '*', 'XAXAXBXBXCXC')) print(re.sub('[ABC]_', '*', 'XA-XA_XB-XB_XC-XC_')) print(re.sub('(.) spam', 'spam\\1', 'x spam, y spam')) def mapper(matchobj):

Re: Combining lists to dictionary

2014-11-11 Thread Dave Angel
Ben Finney ben+pyt...@benfinney.id.au Wrote in message: Denis McMahon denismfmcma...@gmail.com writes: Hi Given x,y are a lists of keys and value that I wish to combine to a dictionary, such that x[n] is the key for value y[n], which is preferred: z = {a:b for (a,b) in zip(x,y)} This

Re:dictionary issue for formatted print

2014-11-09 Thread Dave Angel
Yusuf Can Bayrak yusufcanbay...@gmail.com Wrote in message: when dictionary has one value for each key it's okey. I'm just type '% greek_letters' and it's working. But how can i assign dict's values to formatted print, if it has more values than one. # -*- coding: utf-8 -*-greek_letters =

Re: Understanding help command description syntax - explanation needed

2014-11-07 Thread Dave Angel
Bob Martin bob.mar...@excite.com Wrote in message: in 730867 20141107 093651 c...@isbd.net wrote: Darren Chen ccylily1...@gmail.com wrote: 在 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道: On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev

Re:generating 2D bit array variants with specific algorythm

2014-11-07 Thread Dave Angel
Robert Voigtländer r.voigtlaen...@gmail.com Wrote in message: Hi, I need to generate all variants of a 2D array with variable dimension sizes which fit a specific rule. (up to 200*1000) The rules are: - Values are only 0 or 1 - the sum of each line bust be 1 - only valid results must

Re:[OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Dave Angel
françai s romaper...@gmail.com Wrote in message: I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? What is the lowest level of programming computers

Re: Understanding help command description syntax - explanation needed

2014-11-05 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell larry.mart...@gmail.com wrote: And I don't think Larry was actually offended; it's just that some questions don't really have easy answers - imagine someone asking a great mathematician But how do

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Dave Angel
Skip Montanaro skip.montan...@gmail.com Wrote in message: On Wed, Nov 5, 2014 at 10:44 AM, Skip Montanaro skip.montan...@gmail.com wrote: I figured everything would be flushed to the respective .stdout and .stderr files at the end of every request, but that appears not to be the case. I

Re: what can i do to improve my skill after finished python course on codecademy

2014-11-02 Thread Dave Angel
On 11/02/2014 04:03 PM, Seymore4Head wrote: On Sun, 02 Nov 2014 19:42:49 +, Mark Lawrence breamore...@yahoo.co.uk wrote: On 02/11/2014 19:10, Seymore4Head wrote: On Sun, 2 Nov 2014 12:16:11 -0500, Joel Goldstick joel.goldst...@gmail.com wrote: On Sun, Nov 2, 2014 at 10:08 AM, Peter

Re: set environmental variable from python

2014-10-31 Thread Dave Angel
On 10/30/2014 10:40 PM, Artur Bercik wrote: On Fri, Oct 31, 2014 at 11:30 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thursday, October 30, 2014, Artur Bercik vbubbl...@gmail.com wrote: Dear Dave Angel Thanks for your answer. I am using Python 2.7 I want to set

Re: Implementing pdfkit and wkhtmltopdf on windows fails

2014-10-31 Thread Dave Angel
On 10/31/2014 12:46 PM, robert brook wrote: I am able to install both of these packages on my mac at home and it works well. I am trying to install on windows 7 at work and it fails. PDFKit is trying to find the wkh package and it cannot. I have entered the full path to the exe for the

Re: Classes

2014-10-31 Thread Dave Angel
On 10/31/2014 12:31 PM, Seymore4Head wrote: In this class, we will follow the practice of accessing the contents of objects using methods known as getters and setters. While not required by Python, this practice encourages the user of the class to manipulates class objects solely via class

Re: set environmental variable from python

2014-10-30 Thread Dave Angel
On 10/30/2014 09:22 PM, Artur Bercik wrote: I have to set environmental variable in my windows PC as follows: variable name: GISBASE value: C:\GRASS-64 Is it possible to set it from python? Which Python? I'll have to assume 3.x import sys sys.path.append(C:\\GRASS-64) But how to give

Re:% symbol in python

2014-10-28 Thread Dave Angel
satishmlm...@gmail.com Wrote in message: trthkeytdinput type=text name=key value=%(key)s rowhtml = 'trth%stdinput type=text name=%s value%%(%s)s\n what does % mean in first line of code and what does %%(%s)s mean in second line of code kindly explain Please post Python code, and we can

Re: Anyone know the solution

2014-10-28 Thread Dave Angel
Cameron Simpson c...@zip.com.au Wrote in message: On 28Oct2014 09:07, ngangsia akumbo ngang...@gmail.com wrote: This is a sample code on how to read data from a file files1 {} result = open(file1.txt) for line in result: file1 = linesplit() files1.append(file1) result.close() file1.sort()

Re: (-1)**1000

2014-10-24 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 10/22/2014 4:27 AM, ast wrote: Hello If i am writing (-1)**1000 on a python program, will the interpreter do (-1)*(-1)*...*(-1) or something clever ? The answer depends on the implementation. In fact i have (-1)**N with N an integer

Re: I am out of trial and error again Lists

2014-10-24 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: On Fri, 24 Oct 2014 09:54:23 -0700 (PDT), Rustom Mody rustompm...@gmail.com wrote: Totally befuddled myself! Are you deliberately misspelling list to lst and hoping the error will go away. And Puh LEESE dont post screen shots of

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Dave Angel
Anurag Patibandla anuragpatiband...@gmail.com Wrote in message: Thanks for the response. Here is the code that I have tried. from operator import itemgetter keys = json.keys() order = list(keys) q1 = int(round(len(keys)*0.2)) q2 = int(round(len(keys)*0.3)) q3 = int(round(len(keys)*0.5))

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Dave Angel
Anurag Patibandla anuragpatiband...@gmail.com Wrote in message: On Wednesday, October 15, 2014 1:10:41 PM UTC-4, Rustom Mody wrote: On Wednesday, October 15, 2014 10:30:49 PM UTC+5:30, Anurag Patibandla wrote: keys = json.keys() order = list(keys) q1 = int(round(len(keys)*0.2))

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Dave Angel
Anurag Patibandla anuragpatiband...@gmail.com Wrote in message: dicts = dict(lists) print dicts print dict[0] Print dicts works as expected giving me the combine dictionary values. But when I say dict[0]. I see the error: TypeError: 'type' object has no attribute

Re:[ANN] pdb-clone 1.9 - a fast clone of pdb with the remote debugging and attach features

2014-10-15 Thread Dave Angel
Xavier de Gaye xdeg...@gmail.com Wrote in message: pdb-clone 1.9 has been released at Pypi: https://pypi.python.org/pypi/pdb-clone Features: * Improve significantly pdb performance. With breakpoints, pdb-clone runs just above the speed of the interpreter while pdb runs at 10 to 100

Re: Parsing Python dictionary with multiple objects

2014-10-15 Thread Dave Angel
Anurag Patibandla anuragpatiband...@gmail.com Wrote in message: On Wednesday, October 15, 2014 1:35:43 PM UTC-4, Rustom Mody wrote: On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote: Here is my sample dict if that helps: json = {1: {Status:

Re:Code Review for Paper, Rock, Scissors

2014-10-14 Thread Dave Angel
Revenant faceofoblivionoffic...@gmail.com Wrote in message: One thing I want to try to add is a Press any key to continue function that occurs at the end of the program when the user decides to quit. I looked at some options online, but haven't quite figured it out yet. Use the

Re: How to install and run a script?

2014-10-14 Thread Dave Angel
Michael Torrie torr...@gmail.com Wrote in message: On 10/12/2014 08:05 PM, ryguy7272 wrote: Ah!!! I didn't know I needed to run it from the command prompt! Ok, not it makes sense, and everything works. Thanks to all! You don't have to run python apps from the command line. Apps

Re:Parsing Python dictionary with multiple objects

2014-10-14 Thread Dave Angel
anuragpatiband...@gmail.com Wrote in message: I have a dictionary that looks like this: {1:{Key1:Value1, Key2:Value2, Key3:Value3}, 2:{Key1:Value1, Key2:Value2, Key3:Value3}, 3:{Key1:Value1, Key2:Value2, Key3:Value3}, 4:{Key1:Value1, Key2:Value2, Key3:Value3}} Now if I have 100 objects

Re:downloading from links within a webpage

2014-10-14 Thread Dave Angel
Shiva shivaji...@yahoo.com.dmarc.invalid Wrote in message: Hi, Here is a small code that I wrote that downloads images from a webpage url specified (you can limit to how many downloads you want). However, I am looking at adding functionality and searching external links from this page and

Re:Parsing Python dictionary with multiple objects

2014-10-14 Thread Dave Angel
anuragpatiband...@gmail.com Wrote in message: I have a dictionary that looks like this: {1:{Key1:Value1, Key2:Value2, Key3:Value3}, 2:{Key1:Value1, Key2:Value2, Key3:Value3}, 3:{Key1:Value1, Key2:Value2, Key3:Value3}, 4:{Key1:Value1, Key2:Value2, Key3:Value3}} Now if I have 100 objects

Re: TypeError: 'kwarg' is an invalid keyword argument for this function

2014-10-13 Thread Dave Angel
Ian Kelly ian.g.ke...@gmail.com Wrote in message: On Sun, Oct 12, 2014 at 6:55 AM, roro codeath rorocode...@gmail.com wrote: How to implement it in my class? class Str(str): def __init__(self, *args, **kwargs): pass Str('smth', kwarg='a') The error is coming from the __new__

Re:Toggle

2014-10-08 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: I want to toggle between color=Red and color=Blue Here is one: if color == Red: color = Blue else: color = Red Here is two: if x = True color = Red else: color=Blue x= not x Others? One looks like

Re:Representing mathematical equations

2014-10-06 Thread Dave Angel
varun...@gmail.com Wrote in message: Hello, I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out? The equation looks like this b(i,x) = [Σ(l∈L) [bd(l) * dist(l) * hc(l)]] / Σ(l∈L) l I have a

Re: Representing mathematical equations

2014-10-06 Thread Dave Angel
varun...@gmail.com Wrote in message: On Monday, 6 October 2014 15:03:44 UTC+2, varu...@gmail.com wrote: (Deleted all the 8-space quoting. Either use a better email client or remove the extra 7 lines between every line you quote.) Okay, I forgot to explain them. L is a set of links, dist

Re:re search through a text Vs line

2014-10-05 Thread Dave Angel
Shiva shivaji...@yahoo.com.dmarc.invalid Wrote in message: Hi, I am doing a regular expression search for a year through a file. I think you are being confused in part by your choice of names. Let's go through and describe the variable contents. fileextract = open(fullfilename,'r')

Re: re search through a text Vs line

2014-10-05 Thread Dave Angel
Shiva shivaji...@yahoo.com.dmarc.invalid Wrote in message: OK, Hi Dave, I modified it as below and it works(If there is a way to make this more efficient please let me know) Deends on what you mean by efficiency. The big memory efficiency gain was when you got rid of either

Re:Python Basics

2014-10-03 Thread Dave Angel
diarmuid.higg...@mycit.ie Wrote in message: Hi I have just started an introductory course on Python. I have never even seen a programming language before so I am struggling a bit. Our lecturer has given us a number of excercises to complete and I am stuck on the one I have listed below.

Re: Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-10-02 Thread Dave Angel
On 09/30/2014 10:55 AM, c...@isbd.net wrote: Dave Angel da...@davea.name wrote: name. And presumably you never remove an old name from the config. The only things really likely to change (and may change regularly) are the conversion factors, drifting voltage references etc

Re:Keepin constants, configuration values, etc. in Python - dedicated module or what?

2014-09-30 Thread Dave Angel
c...@isbd.net Wrote in message: I am developing some code which runs on a (remote from me most of the time) Beaglebone Black single board computer. It reads various items of data (voltages, currents, temperatures, etc.) using both a 1-wire bus system and the Beaglebone's ADC inputs. The

Re:Leap year

2014-09-27 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: Still practicing. Since this is listed as a Pseudocode, I assume this is a good way to explain something. That means I can also assume my logic is fading with age. http://en.wikipedia.org/wiki/Leap_year#Algorithm cut I didn't

Re:Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Dave Angel
Mark Lawrence breamore...@yahoo.co.uk Wrote in message: I thought that Windows users who don't follow Python-dev might be interested in this announcement https://mail.python.org/pipermail/python-dev/2014-September/136499.html, the rest of you can look away now :) -- My fellow

Re: String representations of numbers and approximate equality

2014-09-25 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Thu, Sep 25, 2014 at 5:56 AM, Dave Angel da...@davea.name wrote: Your definition is not nearly as concrete as you think. Is the first number considered to be exact, and we'll only check the second? Will the factor always be an int

Re:import reloading

2014-09-24 Thread Dave Angel
Robin Becker ro...@reportlab.com Wrote in message: I'm tryng to bring some outdated ihooks code into the modern world. I notice that module loaders are supposed to re-use an existing module if it is already in sys.modules. No, the loader is required to reuse the existing module. Is

Re: import reloading

2014-09-24 Thread Dave Angel
Robin Becker ro...@reportlab.com Wrote in message: On 24/09/2014 12:54, Dave Angel wrote: Robin Becker ro...@reportlab.com Wrote in message: ... Is a loader supposed to reset all the reused module's attributes and reset the __dict__ or does it just run the code from the module in hte

Re:String representations of numbers and approximate equality

2014-09-24 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: Yes, it's another how can I see if two numbers are approximately equal thread, but this time I have a concrete definition of approximately equal... and they're Decimals, not floats. I have a number of files (this is an ongoing thing) in which

Re:Python advice

2014-09-22 Thread Dave Angel
ngangsia akumbo ngang...@gmail.com Wrote in message: I have learned python for some time now. I am developing apps using django. I need some advice. I want to be able to write big programs using python. I have not been able to do that as of now. Define'big'. I could write a 25 line

Re:Lists

2014-09-15 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: import random nums=range(1,11) print (nums) samp=random.sample(nums,10) top=nums newlist=nums[::-1] tail=newlist for x in range(10): print (Top {:2d}Tail {:2.0f} Sample {:2d} .format(top[x],tail[x],samp[x])) I

Re:protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Dave Angel
Josh English joshua.r.engl...@gmail.com Wrote in message: I do not know what these three filesare doing, but suddenly they have caught in a loop every time I try to run some code. I grabbed the trace decorator from the python library and this is the last bit of the output:

Re:CSV methodology

2014-09-15 Thread Dave Angel
je...@newsguy.com Wrote in message: Hello. Back in the '80s, I wrote a fractal generator, which, over the years, I've modified/etc to run under Windows. I've been an Assembly Language programmer for decades. Recently, I decided to learn a new language, and decided on Python, and I just

Re:protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Dave Angel
Dave Angel da...@davea.name Wrote in message: Josh English joshua.r.engl...@gmail.com Wrote in message: I do not know what these three filesare doing, but suddenly they have caught in a loop every time I try to run some code. I grabbed the trace decorator from the python library

Re: Shuffle

2014-09-15 Thread Dave Angel
Michael Torrie torr...@gmail.com Wrote in message: On 09/13/2014 05:47 PM, Seymore4Head wrote: Here is a screenshot of me trying Dave Briccetti's quiz program from the shell and it (the shuffle command) works. https://www.youtube.com/watch?v=VR-yNEpGk3g http://i.imgur.com/vlpVa5i.jpg Two

Re:find the error

2014-09-13 Thread Dave Angel
daoudi...@gmail.com Wrote in message: Dear friends when i used import urllib, re, sys symbol = sys.argv[1] this function is show -- symbol = sys.argv[1] IndexError: list index out of range kindly find the solution of this sys.argv is filled in from the command line arguments.

Re:My backwards logic

2014-09-05 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: I'm still doing practice problems. I haven't heard from the library on any of the books I have requested. http://www.practicepython.org/exercise/2014/04/16/11-check-primality-functions.html This is not a hard problem, but it got

Re: My backwards logic

2014-09-05 Thread Dave Angel
Seymore4Head Seymore4Head@Hotmail.invalid Wrote in message: On Fri, 05 Sep 2014 12:48:56 -0400, Seymore4Head Seymore4Head@Hotmail.invalid wrote: If you start with the list [3,5,7] and step through the list of all remaining odd numbers (step 2), and start appending numbers that won't

Re:error while writing program to send mail.

2014-09-01 Thread Dave Angel
Om Prakash torque.in...@gmail.com Wrote in message: Hi, I am writing this program from https://docs.python.org/2/library/email-examples.html but getting the error as singhom@debian:~/pythons$ python send_email.py Traceback (most recent call last): File send_email.py, line 18, in

PEP440 and pre-releases

2014-08-29 Thread Dave Shawley
. Has anyone else run into similar difficulties? I'm guessing that I am over-thinking things again and no one really worries about such details. Any advice (even opinions) very much appreciated. - dave -- State and behavior. State and behavior. If it doesn't bundle state and behavior

Re:why i can't get the sourcecode with inspect module?

2014-08-20 Thread Dave Angel
luofeiyu elearn2...@gmail.com Wrote in message: import inspect def changer(x,y): ... return(x+y) ... dir() ['__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__ 'changer', 'inspect'] inspect.getsource(changer) Traceback (most recent call last): File

Re:Log base 2 of large integers

2014-08-13 Thread Dave Angel
Mok-Kong Shen mok-kong.s...@t-online.de Wrote in message: I like to compute log base 2 of a fairly large integer n but with math.log(n,2) I got: OverflowError: long int too large to convert to float. Is there any feasible work-around for that? Thanks in advance. M. K. Shen

Re:get the min date from a list

2014-08-10 Thread Dave Angel
luofeiyu elearn2...@gmail.com Wrote in message: date ['Sat, 09 Aug 2014 07:36:46 -0700', 'Fri, 8 Aug 2014 22:25:40 -0400', 'Sat, 9 Au g 2014 12:46:43 +1000', 'Sat, 9 Aug 2014 12:50:52 +1000', 'Sat, 9 Aug . 2014 03:4 4:56 +0200', 'Sun, 10 Aug 2014 01:55:24 + (UTC)', 'Sun, 10

Re: how to write file into my android phone?

2014-08-09 Thread Dave Angel
Chris “Kwpolska” Warrick kwpol...@gmail.com Wrote in message: On Sat, Aug 9, 2014 at 7:56 PM, luofeiyu elearn2...@gmail.com wrote: When i input usb line with my android phone into the pc , there are two disks j: and k: (type :removable disk) displayed in win7. i can get my android phone

Re:how to call back a method ?

2014-08-04 Thread Dave Angel
elearn elearn2...@gmail.com Wrote in message: I want to call back a function which is the method of a class . def callback(self.do,x): return(self.do(x)) That is what i want to write,when i input def callback(self.do,x): error message: File stdin, line

Re:Python crashing when script is running against live system

2014-08-03 Thread Dave Angel
Igor Korot ikoro...@gmail.com Wrote in message: Hi, ALL, I'm working on the script that should starting from the given directory enumerate all directories and files underneath and calculates the hash value of such file. It works fine when I start it from some particular directory, but when I

Re:What's the difference between gevent.sleep and time.sleep?

2014-07-27 Thread Dave Angel
Xiadong Zhu mailto1...@gmail.com Wrote in message: Hi, I'm learning gevent, but I didn't found the difference with gevent.sleep and time.sleep, does anybody could give me a sample code to show their difference? Thanks! gevent is a cooperative analog to the threading module. When using it

Re: What is the simplest method to get a vector result?

2014-07-24 Thread Dave Angel
fl rxjw...@gmail.com Wrote in message: I am puzzled about the last part of your code and want to learn from it ( * + * ). 6 * + x will produce a string of 6 blanks followed by an x. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list

Re:initializing parameters class in Python only once?

2014-07-14 Thread Dave Angel
Catherine M Moroney catherine.m.moro...@jpl.nasa.gov Wrote in message: Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of parameters (whose

Re:base64 convert to binary by binascii is that right?

2014-07-11 Thread Dave Angel
Frank Liou fk2654159...@gmail.com Wrote in message: conn = engine.connect() encoded = base64.b64encode(getbody) binary_string = binascii.a2b_base64(encoded) puresql = sqla.text(INSERT INTO friends(name) VALUES(:binary_string)) conn.execute(puresql,binary_string =

Re:Hello. I'm new here...

2014-07-11 Thread Dave Angel
Antonio Dalvit antonio.dal...@gmail.com Wrote in message: Hello! Im Antonio, from Italy. I'm new here and i'd like to introduce myself: i'm learning python language after years working in ICT sector. I decided to study python after fortran basic, c++, java and php for fun and because i'm

Re:Writing Python File at Specific Interval

2014-07-09 Thread Dave Angel
subhabangal...@gmail.com Wrote in message: In the next part, I am trying to store the daily results to a new file. As I researched I found some tips around time module, logging module, pythoncom etc. But not getting any important lead. What exactly is the problem? Perhaps you want

Re: open() and EOFError

2014-07-07 Thread Dave Angel
Steven D'Aprano st...@pearwood.info Wrote in message: On Mon, 07 Jul 2014 17:04:12 +1200, Gregory Ewing wrote: Steven D'Aprano wrote: Are there any circumstances where merely *opening* a file (before reading it) can raise EOFError? I don't think so. As far as I know, the only built-in

Re: python33, windows, UnicodeEncodeError: 'charmap' codec can't encode characters in position, to print out the file contents to stdout,

2014-07-06 Thread Dave Angel
gintare g.statk...@gmail.com Wrote in message: The answer is on page:https://docs.python.org/3.3/howto/unicode.html#reading-and-writing-unicode-data The correct code: f=open('C:\Python33\Scripts\lang\langu\svtxt.txt','r', encoding='utf-8') linef=f.readlines() print(repr(linef)) But

Re:Writing files at run time

2014-06-30 Thread Dave Angel
subhabangal...@gmail.com Wrote in message: Dear Group, In my previous post[https://groups.google.com/forum/#!topic/comp.lang.python/ZYjsskV5MgE;] I was trying to discuss some issue on file writing. I got an associated issue. I am trying to crawl a link, through urllib and trying to

Re:Writing Multiple files at a times

2014-06-29 Thread Dave Angel
subhabangal...@gmail.com Wrote in message: Dear Group, I am trying to crawl multiple URLs. As they are coming I want to write them as string, as they are coming, preferably in a queue. If any one of the esteemed members of the group may kindly help. From your subject line, it appears

Re:how to build web based database performance monitoring application

2014-06-27 Thread Dave Angel
sandhyaranimangip...@gmail.com Wrote in message: Hi Gurus, Can you pls suggest to build a web based application to monitor sybase database with the help of python, I am new to this. You'll probably get better answers if you're more specific. What part of the assignment has you puzzled?

Re: Single underscore in interactive mode

2014-06-25 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 6/25/2014 11:20 AM, candide wrote: According to the official documentation (The Python Language Reference, Release 3.2): --- The special identifier _ is used in the interactive interpreter to store the

Re:About python while statement and pop()

2014-06-11 Thread Dave Angel
hito koto hitokoto2...@gmail.com Wrote in message: Hello,all I'm first time, I want to make a while statement which can function the same x.pop () and without the use of pop、how can i to do? No idea what the question means. Are you just trying to rewrite the loop in a python

Re:How to use imported function to get current globals

2014-06-07 Thread Dave Angel
1989lzhh 1989l...@gmail.com Wrote in message: Here is the code m1.py def f(): print globals() m2.py from m1 import f f()# how to get current module's globals? As others have said, it's probably a bad idea. I can think of 3 reasons to try: teacher said so, writing a debugger,

Re:try/except/finally

2014-06-07 Thread Dave Angel
Frank B fbick...@gmail.com Wrote in message: Ok; this is a bit esoteric. So finally is executed regardless of whether an exception occurs, so states the docs. But, I thought, if I return from my function first, that should take precedence. au contraire Turns out that if you do

Re: How to use SQLite (sqlite3) more efficiently

2014-06-06 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Sat, Jun 7, 2014 at 4:15 AM, R Johnson ps16thypresenceisfullnessof...@gmail.com wrote: The subject line isn't as important as a header, carried invisibly through, that says that you were replying to an existing post. :) Sorry for my

Re:How to use SQLite (sqlite3) more efficiently

2014-06-05 Thread Dave Angel
R Johnson ps16thypresenceisfullnessof...@gmail.com Wrote in message: I've attached some new sample code in which I've attempted to correct various things that you mentioned. Attachments don't work well for many people using this list. I for one can't even see them. -- DaveA --

Re: Unicode and Python - how often do you index strings?

2014-06-04 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Wed, Jun 4, 2014 at 8:10 PM, Peter Otten __pete...@web.de wrote: The indices used for slicing typically don't come out of nowhere. A simple example would be def strip_prefix(text, prefix): if text.startswith(prefix): text =

Re:Command prompt not shown when running Python script with subprocess on Windows

2014-05-27 Thread Dave Angel
ps16thypresenceisfullnessof...@gmail.com Wrote in message: I have written a Python script with a wxPython GUI that uses subprocess.Popen to open a list of files that the user provides. One of my users would like to be able to run a Python script with my application. The Python script he is

Re: Check to see if the script has been previously used?

2014-05-27 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: On Tue, May 27, 2014 at 5:45 PM, KC Sparks kcrspa...@gmail.com wrote: I was wondering if there was an extension or way that would allow me to print instructions if it is the first the the user has used the script. The trickiest part is

[issue21590] Systemtap and DTrace support

2014-05-27 Thread Dave Malcolm
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21590 ___ ___ Python-bugs-list

Re: Loop thru the dictionary with tuples

2014-05-25 Thread Dave Angel
Ned Batchelder n...@nedbatchelder.com Wrote in message: On 5/25/14 8:55 AM, Igor Korot wrote: Hi, ALL, I have a following data structure: my_dict[(var1,var2,var3)] = None my_dict[(var4,var5,var6)] = 'abc' What I'm trying to do is this: for (key,value) in my_dict: #Do some stuff

Re:Windows rebooting due to faulty code

2014-05-23 Thread Dave Angel
Ronak Dhakan ronaksoni...@gmail.com Wrote in message: I am learning python, and sometimes when I run a file with a faulty code, windows gives a message that the system is rebooting and gives me 1 minute to save my work. Does anyone know how can I fix this? Most of the time a faulty code

Re:All-numeric script names and import

2014-05-21 Thread Dave Angel
Chris Angelico ros...@gmail.com Wrote in message: If I have a file called 1.py, is there a way to import it? Obviously I can't import it as itself, but in theory, it should be possible to import something from it. I can manage it with __import__ (this is Python 2.7 I'm working on, at least for

[issue14776] Add SystemTap static markers

2014-05-19 Thread Dave Malcolm
Dave Malcolm added the comment: On Mon, 2014-05-19 at 11:10 +, Bohuslav Slavek Kabrda wrote: Bohuslav Slavek Kabrda added the comment: Hi, I'd like to take this over after Dave Malcolm. I don't see any issues that haven't been resolved, so my question is: What else can I do to make

[issue14776] Add SystemTap static markers

2014-05-19 Thread Dave Malcolm
Dave Malcolm added the comment: On Mon, 2014-05-19 at 14:15 +, Dave Malcolm wrote: Dave Malcolm added the comment: On Mon, 2014-05-19 at 11:10 +, Bohuslav Slavek Kabrda wrote: Bohuslav Slavek Kabrda added the comment: Hi, I'd like to take this over after Dave Malcolm. I

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Dave Angel
On 05/16/2014 04:49 AM, Enlong Liu wrote: Dear All, I have a question about the integration with Python. The equation is as below: and I want to get values of I with respect of V. E_F is known. But for T(E), I don't have explicit equation, but a .dat file containing two columns, the first is E,

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

2014-05-15 Thread Dave Angel
On 05/15/2014 07:30 AM, Simon Evans wrote: Dear Programmers, I noticed a couple of typos in my previous message, so have now altered them thus :- Dear Programmers, As anticipated, it has not been to long before I have encountered further difficulty. Your first thread was about getting

Re: PEP 8 : Maximum line Length :

2014-05-15 Thread Dave Angel
On 05/14/2014 10:12 PM, Roy Smith wrote: In article mailman.10026.1400116640.18130.python-l...@python.org, Mark Lawrence breamore...@yahoo.co.uk wrote: I still remember the cry of anguish when the guy in the computer building at (the then) Portsmouth Polytechnic dropped his cardboard box of

Re: struct.unpack: why 's' fmt char convert to bytestring

2014-05-15 Thread Dave Angel
On 05/15/2014 08:34 AM, GuoChao wrote: The Python documentation gives this same example: record = b'raymond \x32\x12\x08\x01\x08' name, serialnum, school, gradelevel = unpack('10sHHb', record) but get different results as to 's', don't know why this change in Python 3? need extra work to

Re: Everything you did not want to know about Unicode in Python 3

2014-05-14 Thread Dave Angel
On 05/13/2014 09:39 AM, Steven D'Aprano wrote: On Tue, 13 May 2014 07:20:34 -0400, Roy Smith wrote: ASCII *is* all I need. You've never needed to copyright something? Copyright © Roy Smith 2014... I know some people use (c) instead, but that actually has no legal standing. (Not that any

Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-14 Thread Dave Angel
On 05/14/2014 02:49 AM, varun...@gmail.com wrote: I try to add an edge with the source id and destination id over a loop but this is the error I am getting. And the range for the for addEdge is something I have no clue about. python export.py --output topology.xml --xml germany50.xml

Re: Why isn't my re.sub replacing the contents of my MS Word file?

2014-05-13 Thread Dave Angel
On 05/12/2014 01:35 PM, scottca...@gmail.com wrote: On Friday, May 9, 2014 8:12:57 PM UTC-4, Steven D'Aprano wrote: Good: # Untested fStr = re.sub(b'#x(201[2-5])|(2E3[AB])|(00[2A]D)', b'-', fStr) Still doesn't work. Guess whatever the code is for endash and mdash are not

Re: Need help to write data onto an XML file after reading data from another xml file

2014-05-13 Thread Dave Angel
On 05/13/2014 10:31 AM, varun...@gmail.com wrote: Hello Users, I am in dire need of your help. I have been working on this code for quite some time and it is making me restless. All I am trying to do is, 1. Read data from an xml file. Source:

Re: Fortran

2014-05-11 Thread Dave Angel
On 05/11/2014 09:11 PM, Steven D'Aprano wrote: On Mon, 12 May 2014 00:51:01 +0100, MRAB wrote: Certainly not. However they may be different where *you* are :-P I'm using an IBM keyboard, model SK-8820. Mine have an little ridge on the keytop of those keys. I've seen keyboards with

<    1   2   3   4   5   6   7   8   9   10   >