Re: simple GUI question

2004-12-07 Thread vincent wehren
to disable this, or is there an alternate way of doing things? OK call me anal, but it bothers me. You want somthing like: root = Tkinter.Tk() root.withdraw() msg = tkMessageBox.showwarning("Ooops", "Some warning") -- Vincent Wehren Another thing I would *like* but is not strictl

Re: after embedding and extending python (using swig) problem importing (non-core) modules

2004-12-07 Thread vincent wehren
bug mode? If so, make sure you have the debug versions of those dll's in your path (i.e. _sre_d.pyd etc.)... HTH -- Vincent Wehren It does not look like a path-problem to me, so I'm clueless right now. I could work around this extending some functions to python and use them, but then I lo

Re: Problem while trying to extract a directory from a zipfile.

2004-12-08 Thread vincent wehren
when i try to extract an zipfile with a directory in it the code returns me an IOErro exception: "It is a directory" Please how can i solve it ? You need to create any directories yourself. Maybe the recipe at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252508 gives you

Re: Distutils vs. Extension header files

2004-12-09 Thread vincent wehren
ude setup.py include setup.cfg recursive-include src *.c *.h recursive-include docs *.html *.css *.gif *.jpg *.txt prune someolddir HTH, -- Vincent Wehren If I do a bdist_rpm, the source files get copied into the build directory and the build starts, but the header files aren't copied with the s

Re: Help need with converting Hex string to IEEE format float

2004-12-17 Thread Ian Vincent
Max M <[EMAIL PROTECTED]> wrote in news:41bf121e$0$280 [EMAIL PROTECTED]: > > ## > st = '80 00 00 00' > > import binascii > import struct > > s = ''.join([binascii.a2b_hex(s) for s in st.split()]) > v = struct.unpack("f", s)[0] > print v > ## This one worked great for what I was trying to do.

problem to compile a win32 module with Python2.4

2004-12-18 Thread vincent delft
I've a module written in C and the associated setup.py. Work fine (and compile fine with mvc) with Python 2.3.x Now I've installed Python 2.4 (all the rest unchanged) When I try to compile it, I've got a message saying that .NET SDK must be installed. Am I the only one having this problem (n

Re: Easy "here documents" ??

2004-12-18 Thread vincent wehren
some {$foo->bar[1]}. This should print a capital 'A': \x41 EOT; AFAIK, there is no direct Python equivalent for this kind of syntax. Using a mapping like you suggested or the string.Template class in Python 2.4 still maybe improvements over what OP calls that "wacky" business. -

Re: sql server support from linux

2004-12-20 Thread vincent wehren
DB-API 2.0 compiant. Does anyone in this list ever connect to SQL Server from Linux, using Python? If so, what is your solution? Using mx.ODBC? -- Vincent Wehren I'm going nuts over here! Sw. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode entries on sys.path

2004-12-24 Thread vincent wehren
Just wrote: In article <[EMAIL PROTECTED]>, "Martin v. Lowis" <[EMAIL PROTECTED]> wrote: Hm, maybe more a windows question than a python question... The real question here is: why does Python not support arbitrary Unicode strings on sys.path? It could, in principle, atleast on Windows NT+ (and al

Re: Unicode entries on sys.path

2004-12-30 Thread vincent wehren
ful of unicode APIs. FindFirstFile does not seem to be one of them - unless the list on htpp://msdn.microsoft.com/library/default.asp?url=/library/en-us/mslu/winprog/other_existing_unicode_support.asp) is bogus (?). -- Vincent Wehren Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: ClassA instance has no attribute '__len__'

2005-03-30 Thread vincent wehren
digit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] If you want len(self.y) to work, self.y must be an object that implements a __len__ method. In other words, your "ClassA" needs a __len__ method. A trivial example: class ClassA: def __init__(self, text): self.text = text def __len__(self): #return something useful return len(self.text) y = ClassA("Hello") print len(y) # prints 5 Regards, -- Vincent Wehren | | Thanks in advance | | Mack | -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance issue

2005-04-02 Thread vincent wehren
ted(word.lower())) if sorted_word == sorted_anagram: found.append(word) if found: print "Anagrams of %s:" % anagram for w in found: print w else: print "No anagrams for %s" % anagram -- Vincent Wehren -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect windows shutdown

2005-04-07 Thread vincent wehren
you got, | > and the answer could well point directly to a cause that | > is different than you think it is.) | > | > -Peter Does this problem also occur when you "manually" exit the program (provided you have a function to do so)? If so, make sure you do something lik

Re: help with wxPython and wxGrid

2005-04-10 Thread vincent wehren
not the best, but that how I got started | ;) -- any help owuld be appreciated | | Try: from wxPython.wx import * from wxPython.grid import * or import wx import wx.grid -- Vincent Wehren -- http://mail.python.org/mailman/listinfo/python-list

Re: How to minimize the window

2005-04-12 Thread vincent wehren
m tray. You can take look at "Main.py" in the wx Demo. Look for "class DemoTaskBarIcon(wx.TaskBarIcon)" and how it is used in the "wxPythonDemo" class. | Is there any way to let the window have 4 attributes? | "." "_" "O " "x&qu

Re: Doubt regarding sorting of a list specific field

2005-04-12 Thread vincent wehren
#x27;], [2234, 'name2']] # Or to sort by the name index print sortSeqOfSeqs(seq, 1) # prints [[1234, 'name1'], [2234, 'name2'], [1432, 'name3']] Is this what you we're looking for? -- Vincent Wehren | | with regards | Prabahar | | | | | |

Re: String manipulation

2005-04-13 Thread vincent wehren
ions ord() and chr() -- Chapter 2.1 of the manual. >> s = 'x' >> c = ord(s) >> c 120 >> c+=1 >> s2 = chr(c) >> s2 'y' -- Vincent Wehren | | NG | -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding Questions

2005-04-19 Thread vincent wehren
in any languages in | this way and return them when requested using utf-8 encoding? | | 3. Does python 2.4 support all encodings? See http://docs.python.org/lib/standard-encodings.html for an overview. | | By the way, I have set my default encoding in Python to utf8. | Why would you want to do t

Re: using locales

2005-04-20 Thread vincent wehren
wrap the appropriate functions living in winnls.h (or the version of winnls.h contained in the platform SDK) - some of which may have already found there way into the Python for Win32 Extensions (GetDateFormat for example). Regards, -- Vincent Wehren | | Anyway, I'd love to have a

Using pythons smtp server

2013-12-12 Thread Vincent Davis
initiate a SMTP server, send the attachment and shutdown the SMTP after. Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: Using pythons smtp server

2013-12-13 Thread Vincent Davis
ython have the ability to send emails without installing additional software or using an external server/service? Maybe I am wrong, I thought examples like s = smtplib.SMTP('localhost') ​​ are using a local(outside of python) smtp server, like postfix. Vincent Davis 720-301-3003 On Fri

Re: Using pythons smtp server

2013-12-13 Thread Vincent Davis
o send the email too. Then submit the email to that address using smtplib.SMTP ​Do I have that right? ​ Vincent Davis 720-301-3003 On Fri, Dec 13, 2013 at 10:24 AM, Dennis Lee Bieber wrote: > On Thu, 12 Dec 2013 18:01:58 -0700, Vincent Davis > declaimed the following: > > >I have

Re: Using pythons smtp server

2013-12-13 Thread Vincent Davis
Grant, Chris Thanks !!! I guess in the end this is a bad idea, (for my purposes) I should just use my gmail account smtp server. Vincent Davis 720-301-3003 On Fri, Dec 13, 2013 at 11:15 AM, Chris Angelico wrote: > On Sat, Dec 14, 2013 at 4:13 AM, Vincent Davis > wrote: > > Let me

Getting updates and restarting a long running url request.

2013-12-22 Thread Vincent Davis
7;-G 4 -E 1' blast_result = NCBIWWW.qblast("blastn", "nt", queryseq, megablast=True, entrez_query=e_query, word_size='11', other_advanced='-G 5 -E 2') return NCBIXML.read(blast_result) Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting updates and restarting a long running url request.

2013-12-26 Thread Vincent Davis
aiting on results. It will either give a result or possibly produce and error I suppose if the for example I lost the connection to the internet but I am not really sure about that. That said after some more research I found this tread. http://lists.open-bio.org/pipermail/biopython/2013-Apr

lookup xpath (other?) to value in html

2013-12-31 Thread Vincent Davis
. Any suggestions? Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: lookup xpath (other?) to value in html

2013-12-31 Thread Vincent Davis
efer to, given xpath what is the value (the opposite of what I want) Vincent Davis On Tue, Dec 31, 2013 at 6:45 PM, Jason Friedman wrote: > > I have a about 255 data fields that I am trying to verify on thousands of > > webpages. > > For example: > > value: 255,000 >

Re: lookup xpath (other?) to value in html

2013-12-31 Thread Vincent Davis
r some of the pages, I got this from the county on a cd, I thought defining the xpath would be easier using bs4 or http://lxml.de/ Vincent Davis 720-301-3003 On Tue, Dec 31, 2013 at 10:30 PM, Jason Friedman wrote: > > For example this URL; > > http://jeffco.us/ats/displaygeneral.

Re: Flip a graph

2014-01-04 Thread Vincent Davis
You might think about using an array to represent the canvas. Starting with it filled with "" and then for each point change it to "X". The print the rows of the array. You can make the array/canvas arbitrarily large and then plot multiple different paths onto the same array.

Re: Flip a graph

2014-01-04 Thread Vincent Davis
When printing the rows of the array/canvas you might add \n to the end of each row and print the canvas all at once rather than a print statement for each row. Vincent Davis 720-301-3003 On Sat, Jan 4, 2014 at 3:10 PM, Vincent Davis wrote: > You might think about using an array to repres

generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
0: for j in range(1, p + 1): sequence = sequence + a[j] else: a = a[:t] + a[t - p] + a[t+1:] db(t + 1, p) for j in range(int(a[t - p]) + 1, k): a = a[:t] + str(j) + a[t+1:] db(t + 1, t)

Re: generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
de_brujin(k, n) and the ordering the same ordering as found in ​de_brujin(k, n). I am not really sure how to modify the algorithm to do that. Any ideas? I won't have time to think hard about that until later. Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
ence generated by itertools.permutations. Vincent Davis On Thu, Jan 23, 2014 at 10:18 AM, Dave Angel wrote: > > Vincent Davis Wrote in message: > > > (something about your message seems to make it unquotable) > > 64gig is 4^18, so you can forget about holding a string of size 4^50

Re: generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
gt; db(t + 1, t) > db(1, 1) > return sequence.translate(_mapping) I am not really sure what _mapping should be. The code above does not run because NameError: global name '_mapping' is not defined I tried to get the bytearray ​ ​ sequence to convert to ascii but don

Re: generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
te > type." > ​Thanks for pointing this out Mark, ​I will soon be running this on 3.3+ Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: generate De Bruijn sequence memory and string vs lists

2014-01-23 Thread Vincent Davis
100 loops, best of 3: 10.2 msec per loop This took ~4 secs (stop watch) which is much more that 10*.0102 Why is this? $ python3 -m timeit -s 'from debruijn_compat import debruijn_bytes as d' 'd(4, 11)' 10 loops, best of 3: 480 msec per loop​ This took ~20 secs vs .480*10 d(4, 14) takes about 24 seconds (one run) Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: generate De Bruijn sequence memory and string vs lists

2014-01-24 Thread Vincent Davis
tually plan to plot frequency (the number of times an observed sub sequence overlaps a value in the De Bruijn sequence) The way the sub sequences overlap is important to me and I don't see a way go from base-k (or any other base) to the index location in the De Bruijn sequence. i.e. a

Re: generate De Bruijn sequence memory and string vs lists

2014-01-24 Thread Vincent Davis
0 times -- until there's a run that takes > 0.2 secs or more. The total expected minimum time without startup overhead > is then > ​Ah, I did not know about the calibration. That and I did not notice the 100 on my machine vs 10 on yours.​ Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

manually build a unittest/doctest object.

2015-12-07 Thread Vincent Davis
t.Example(source="print('hello world')/n", want="hello world\n") t = doctest.DocTestRunner() t.run(e) Thanks Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
is into a test. doctest seemed the simplest but maybe there is a better way. I also tried something like: assert exec("""print('hello word')""") == 'hello word' Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
int('world') Exception raised: Traceback (most recent call last): File "/Users/vincentdavis/anaconda/envs/py35/lib/python3.5/doctest.py", line 1320, in __run compileflags, 1), test.globs) File "", line 1 print('hello') ^ SyntaxError: multiple statements found while compiling a single statement Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: manually build a unittest/doctest object.

2015-12-08 Thread Vincent Davis
urce code from a jupyter notebook. Reading closer this seems like it will work. Not that I mind learning more about how doctests work ;-) Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Try: rather than if :

2015-12-14 Thread Vincent Davis
except AttributeError: pass handle.write("\n") The specific use case I noticed this was https://github.com/biopython/biopython/blob/master/Bio/AlignIO/EmbossIO.py#L38 Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: Try: rather than if :

2015-12-14 Thread Vincent Davis
ributeError: raise try: name = handel.name write("# Report_file: %s\n" % name) except AttributeError: pass write("\n") Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: Try: rather than if :

2015-12-14 Thread Vincent Davis
On Mon, Dec 14, 2015 at 4:53 PM, Ian Kelly wrote: > > Except that catching an exception just to immediately re-raise it is > silly. This would be better: > > try: > name = handle.name > except AttributeError: > pass > else: > handle.write("# Report_file: %s\n" % name) ​Ya that would

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Vincent Davis
e is one result as of now, ​which is an archive of this tread. If you search for any given word or even the phrase ​, for example​ "baby lions at play ​ " you get a much larger set of results ​ ~500​ . I assue there are many was to search google with python, this looks like one. https://pypi.python.org/pypi/google Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

unicodedata with chr() not the same between python 3.4 and 3.5

2015-12-22 Thread Vincent Davis
'Lu', 'Ll')))[945:965] >>> u 'ԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵ' Python 3.4 >>> import unicodedata >>> u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i)) in ('Lu', 'Ll')))[945:965] >>> u '

Re: x=something, y=somethinelse and z=crud all likely to fail - how do i wrap them up

2016-02-01 Thread Vincent Davis
se a dict was better. See the example here. https://github.com/vincentdavis/USAC_data/blob/master/tools.py#L24 Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

suggestions for VIN parsing

2014-12-25 Thread Vincent Davis
oach this. http://www.britishspares.com/41.php Thanks Vincent -- https://mail.python.org/mailman/listinfo/python-list

Re: suggestions for VIN parsing

2014-12-25 Thread Vincent Davis
These are vintage motorcycles so the "VIN's" are not like modern VIN's these are frame numbers and engine number. I don't want to parse the page, I what a function that given a VIN (frame or engine number) returns the year the bike was made. Vincent Davis 720-301-3003

Re: suggestions for VIN parsing

2014-12-25 Thread Vincent Davis
Tim and Ben, Thanks for your input, I am working on it now and will come back when I have questions. Any comment on using pyparsing VS regex Vincent Davis 720-301-3003 On Thu, Dec 25, 2014 at 7:18 PM, Ben Finney wrote: > Vincent Davis writes: > > > I don't want to parse t

Re: suggestions for VIN parsing

2014-12-28 Thread Vincent Davis
#x27;t1956' elif 100 <= int(g[0]) <= 944 and g[0][0]=='0': # t1956: 0100 - 0944 return 't1956' elif g[0][0] == '0' and 945 <= int(g[0]) <= 5: # tp1957: 0945 - 05 return 'tp1957' elif g[0][0] == '0' and 6 <= int(g[0]) <= 20075: # tp1958: 06 - 020075 return 'tp1958' elif g[0][0] == '0' and 20076 <= int(g[0]) <= 29363: # tp1959: 020076 - 029363 return 'tp1959' elif g[0][0] == '0' and 29364 <= int(g[0]) <= 30424: # tp1960: 029364 - 030424 return 'tp1960' else: return None else: return None vin_test_list = ['101n', '500n', '234na', '15809NA', '25000', '32303', '44135', '56700', '70930', '0100', 'H11512', 'D15789', 'DU101'] for vin in vin_test_list: print(vin_to_year2(vin)) Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: suggestions for VIN parsing

2014-12-29 Thread Vincent Davis
e 1982 model year. > ​Ah , I had not looked close at that yet. I found a different more extensive site. http://www.britishonly.com/tech/joust/techtiptriumphmf.htm​ Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: suggestions for VIN parsing

2014-12-29 Thread Vincent Davis
, it would act as a kinda test, If I only expect one match and I get more than I likely have a problem, 2, I found a more extensive (maybe better) list of frame numbers <http://www.britishonly.com/tech/joust/techtiptriumphmf.htm>, I could see some overlapping although I have not looked real close yet. Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Merge/append CSV files with different headers

2014-03-24 Thread Vincent Davis
csv.DictReader(csvfilesin, delimiter=',') for r in rows: print(allHeaders.issuperset(r.keys())) outfile.writerow(r) Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: Merge/append CSV files with different headers

2014-03-24 Thread Vincent Davis
Thanks for the feedback. Vincent Davis 720-301-3003 On Mon, Mar 24, 2014 at 1:44 PM, Chris Angelico wrote: > On Tue, Mar 25, 2014 at 4:50 AM, Vincent Davis > wrote: > > I have several csv file I need to append (vertically). They have > different > > but overlapping

bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
Bio.Affy import CelFile from bz2 import decompress, with open('Tests/Affy/affy_v3_ex.CEL.bz2', 'rb') as handle: cel_data = decompress(handle.read()) c = CelFile.read(cel_data) ​​ ​Thanks​ Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
ead()).decode('ascii')) Vincent Davis 720-301-3003 On Sun, May 18, 2014 at 8:32 PM, Tim Chase wrote: > On 2014-05-18 19:53, Vincent Davis wrote: > > I have a file compressed with bz2 and a function that expects a > > file handle. When I decompress the bz2 file I get a string (

Re: bz2.decompress as file handle

2014-05-18 Thread Vincent Davis
On Sun, May 18, 2014 at 9:44 PM, Ian Kelly wrote: > You can just use bz2.open: > > >>> with bz2.open('test.txt.bz2', 'rt', encoding='ascii') as f: > ... print(f.read()) > ​Thanks I like that better then my solution. ​ Vincent Davis 720

Re: Python regex exercise

2015-04-04 Thread Vincent Davis
On Sat, Apr 4, 2015 at 5:51 PM, Thomas 'PointedEars' Lahn < [email protected]> wrote: > > Do anyone have good links to python regex or other python problems for > > beginners but with solution. > > > > Please mail me. > ​I recently found​ this https

using DictReader() with .decode('utf-8', 'ignore')

2015-04-14 Thread Vincent Davis
I had been reading in a file like so. (python 3) with open(dfile, 'rb') as f: for line in f: ​line = line.decode('utf-8', 'ignore').split(',') ​How can I ​do accomplish decode('utf-8', 'ignore') when reading with DictReader() Vi

Re: using DictReader() with .decode('utf-8', 'ignore')

2015-04-14 Thread Vincent Davis
: > print(row['fieldname']) > What you have seems to work, now I need to go find my strange symbols that are not ​'utf-8' and see what happens I was thought, that I had to open with 'rb' to use ​encoding? Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: using DictReader() with .decode('utf-8', 'ignore')

2015-04-14 Thread Vincent Davis
" "LEASE GREGPRU D ETERSPM " "LEASE GREGPRU D ¬ETERSPM " "979643" {'encoding': 'windows-1252', 'confidence': 0.5} "¦ " " " " " "¦ " "986979" {'encoding': 'windows-1252', 'confidence': 0.5} "WELLS FARGO &¢ COMPANY " "WELLS FARGO & COMPANY " "WELLS FARGO & COMPANY " "WELLS FARGO &¢ COMPANY " "994946" {'encoding': 'windows-1252', 'confidence': 0.5} OSSOSSO¬¬O " OSSOSSOO " OSSOSSOO " OSSOSSO¬¬O " "996535" Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

date from day (count) of year

2015-04-24 Thread Vincent Davis
How does one get the date given the day of a year. >>> dt.datetime.now().timetuple().tm_yday 114 How would I get the Date of the 114 day of 2014? Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: date from day (count) of year

2015-04-24 Thread Vincent Davis
On Fri, Apr 24, 2015 at 8:01 AM, Ian Kelly wrote: > >>> dt.date(2014, 1, 1) + dt.timedelta(114 - 1) > datetime.date(2014, 4, 24) > ​Thanks!​ Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

getting fieldnames from Dictreader before reading lines

2015-05-09 Thread Vincent Davis
) 97 except StopIteration: 98 pass ValueError: I/O operation on closed file. Thanks Vincent ​ Davis​ -- https://mail.python.org/mailman/listinfo/python-list

Re: getting fieldnames from Dictreader before reading lines

2015-05-09 Thread Vincent Davis
Not sure what I was doing wrong, it seems to work now. Vincent Davis 720-301-3003 On Sat, May 9, 2015 at 4:46 PM, Vincent Davis wrote: > I am reading a file with Dictreader and writing a new file. I want use the > fieldnames in the Dictwriter from the reader. See below How should I be &

Re: getting fieldnames from Dictreader before reading lines

2015-05-09 Thread Vincent Davis
hly messed up parts of your error messages. I am posting from google mail (not google groups). Kindly let me know if this email is also html. Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

assertRaises() help

2015-05-27 Thread Vincent Davis
ile "/Users/vmd/GitHub/pandas_vmd/pandas/util/testing.py", line 1640, in __exit__ raise AssertionError("{0} not raised.".format(name)) AssertionError: ValueError not raised. >From the docs maybe I should be using a "with" statement​. Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: assertRaises() help

2015-05-27 Thread Vincent Davis
On Wed, May 27, 2015 at 4:55 PM, Cameron Simpson wrote: > First, test your test by hand running: > > to_datetime('2015-02-29', coerce=False) > > _Does_ it raise ValueError? > ​Well that was not expected.​ Thanks Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

write csv to object and read into pandas

2015-10-14 Thread Vincent Davis
. with open(infile,"r") as fin: with open(outfile,"w") as fout: writer=csv.writer(fout) for row in csv.reader(fin): #do stuff to the row writer.writerow(row) df = pandas.csv_reader(outfile) Vincent Davis 72

Re: write csv to object and read into pandas

2015-10-15 Thread Vincent Davis
That worked, Thanks! Vincent Davis 720-301-3003 On Thu, Oct 15, 2015 at 6:11 AM, Peter Otten <[email protected]> wrote: > Oscar Benjamin wrote: > > > On 15 October 2015 at 09:16, Peter Otten <[email protected]> wrote: > >> > >> def preprocess(fi

Public key encryption example.

2015-11-18 Thread Vincent Davis
reading the message from a local file. Possibly using cryptography library elliptic-curve https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#elliptic-curve-signature-algorithms Surly there is an example out there? Vincent Davis -- https://mail.python.org/mailman/listinfo/python-list

Re: Public key encryption example.

2015-11-18 Thread Vincent Davis
Found an example, needs a little updating but then it works (appears to) in python 3.5. http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto) Vincent Davis 720-301-3003 On Wed, Nov 18, 2015 at 5:04 PM, Chris Angelico wrote: > On Thu, Nov 19, 2015 at 10:56

shorten "compress" long integer to short ascii.

2015-11-19 Thread Vincent Davis
My goal is to shorten a long integer into a shorter set of characters. Below is what I have which gets me about a 45-50% reduction. Any suggestion on how to improve upon this? I not limited to ascii but I didn't see how going to utf8 would help. The resulting string needs to be something I could ty

Re: shorten "compress" long integer to short ascii.

2015-11-20 Thread Vincent Davis
gt; backagain = decoder(short) > nlen = len(str(n)) > print (nlen, len(short), float(len(short))/nlen) > assert n==backagain, (n,short,b) > > test() > Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

speed up pandas calculation

2014-07-30 Thread Vincent Davis
x27;VDAY', 'VMONTH', 'VYEAR', 'MED1', 'MED2', 'MED3', 'MED4', 'MED5'] for col in col_init: if col not in keep_col: del df[col] if f[-3:] == 'csv' and f[-6:-4] in ('93', '94', '95', '96', '97', '98', '99', '00', '91', '02', '03', '04', '05'): drugs = drugs_98_05 elif f[-3:] == 'csv' and f[-6:-4] in ('06', '08', '09', '10'): drugs = drugs_current for n in drugs: df[n] = df[['MED1','MED2','MED3','MED4','MED5']].isin([drugs[n]]).any(1) Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: speed up pandas calculation

2014-07-30 Thread Vincent Davis
On Wed, Jul 30, 2014 at 6:28 PM, Vincent Davis wrote: > The real slow part seems to be > for n in drugs: > df[n] = > df[['MED1','MED2','MED3','MED4','MED5']].isin([drugs[n]]).any(1) > ​I was wrong, this is fast, it was selecti

Re: speed up pandas calculation

2014-07-30 Thread Vincent Davis
= df[keep_col] is not fast but it is not that slow. You made me think of a solution to that part. just slice and copy. The only gotya is that the keep_col have to actually exist keep_col = ['PATCODE', 'PATWT', 'VDAYR', 'VMONTH', 'MED1', 'MED2', 'MED3', 'MED4', 'MED5'] df = df[keep_col] The real slow part seems to be for n in drugs: df[n] = df[['MED1','MED2','MED3','MED4','MED5']].isin([drugs[n]]).any(1) Vincent Davis 720-301-3003 -- https://mail.python.org/mailman/listinfo/python-list

Re: Guido working on Pypy?

2005-12-30 Thread Vincent Wehren
the same applies to Google. In addition, PyPy is not being developed "on behalf of the EU" but is subsidized by the EU. See http://codespeak.net/pypy/dist/pypy/doc/news.html for more info on PyPy." Regards, Vincent Wehren -- http://mail.python.org/mailman/listinfo/python-list

Re: python encoding bug?

2005-12-31 Thread Vincent Wehren
k the current UnicodeData.txt (on http://www.unicode.org/Public/UNIDATA/) you'll find: 009D;;Cc;0;BN;N;OPERATING SYSTEM COMMAND Regards, Vincent Wehren | | The same happens if I use 'latin-1' instead of 'iso8859_1'. | | This caught me by surprise, since I

War chest for writing web apps in Python?

2006-07-27 Thread Vincent Delporte
Hello I'm thinking of using Python to build the prototype for a business web appplication. The development and test machine is XP, while ultimate deployment will be on a shared Unix web host. What would you recommend I get, besides the Python engine itself? Good IDE (Kodomo?) ? Some kind of GUI d

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 08:06:10 +0200, Vincent Delporte <[EMAIL PROTECTED]> wrote: (snip) Thanks everyone for the input! For the IDE: Ideally, I'd like something modern that uses language wordlists (to show syntax, variables, etc. in different colors), a window that lists all the proc

Re: Need a compelling argument to use Django instead of Rails

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:58:24 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Ben Sizer wrote: >(snip) >> Pretty much every Python web offering revolves around you having your >> own server with the luxury of running your own long-running processes >> on it. BTW, what is the advantage of ru

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:31:47 -0400, Dan Sommers <[EMAIL PROTECTED]> wrote: >You win that bet. (We actually tested on both platforms.) *Not* >testing on the deployment platform is *definitely* asking for trouble. I did intend to validate it on the deployment platform. It's just that I prefer to w

Re: War chest for writing web apps in Python?

2006-07-28 Thread Vincent Delporte
On Fri, 28 Jul 2006 17:33:00 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >Well, syntax color coding, and block folding are supported by >PythonWin (comes with the ActiveState Windows install) and SciTE. > > The structural browser isn't as easy... Thanks for the input. -- http://mail.p

Re: Need a compelling argument to use Django instead of Rails

2006-07-29 Thread Vincent Delporte
On Sat, 29 Jul 2006 04:07:12 GMT, Tim Roberts <[EMAIL PROTECTED]> wrote: >Exactly. The Python interpreter can take a significant fraction of a >second to start. For the typical short web request, the overhead can add >up. > >On the other hand, unless you're handling dozens of requests per minute,

Re: Need a compelling argument to use Django instead of Rails

2006-07-31 Thread Vincent Delporte
On 31 Jul 2006 07:05:27 -0700, "Ben Sizer" <[EMAIL PROTECTED]> wrote: >Typically you run PHP as a module in your webserver, so there should be >no process startup overhead. mod_python provides the same sort of >functionality for Python, but is not as popular or widely installed as >the PHP Apache m

[Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Vincent Delporte
Hello I'd like to use Python under Linux to write a business application, and I'll need a good grid/spreadsheet editable widget, maybe not on par with eg. ComponentOne's excellent VSFlexGrid (http://www.componentone.com/newimages/flexgrid_02_lg.gif), but somewhat professional-grade. Any recomme

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Vincent Delporte
On Thu, 3 Aug 2006 22:07:04 +0100, Phil Thompson <[EMAIL PROTECTED]> wrote: >PyQt4 has QTableWidget... Thx for the two pointers. Are those widgets more than just tables, ie. can I edit the contents, including displaying a combo box, can items be grouped or hierarchized, or are they just basic, rea

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-04 Thread Vincent Delporte
On Fri, 04 Aug 2006 10:58:42 GMT, Dave Cook <[EMAIL PROTECTED]> wrote: >But both pyqt and wxpython also offer that. Try running the demos for each. Thx everyone! -- http://mail.python.org/mailman/listinfo/python-list

Compiling wxPython app for Windows; Single EXE

2006-08-13 Thread Vincent Delporte
Hi I browsed the archives, but since some messages date back a bit, I wanted to make sure that - py2exe is still the best tool in town to compile Python scripts to run on a Windows host that doesn't have Python installed, including wxWidgets/wxPython - there's no way to build a single EXE, to ma

Re: Compiling wxPython app for Windows; Single EXE

2006-08-13 Thread Vincent Delporte
On 13 Aug 2006 13:46:14 -0700, "Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote: >I have a wxPython app, which I compile into one EXE file. Then there's >just 1 support file needed: a MS DLL (which, once distributed, you will >not need to update). OK. So you compile the Python app into an EXE usin

Re: Compiling wxPython app for Windows; Single EXE

2006-08-14 Thread Vincent Delporte
On 14 Aug 2006 09:39:02 -0700, "ajaksu" <[EMAIL PROTECTED]> wrote: >I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to >"compile" a wxPython-based program. So I'm curious about what makes >py2exe "the best tool...", because I'm about to miss that due to my >ignorance. I didn't k

Re: Compiling wxPython app for Windows; Single EXE

2006-08-15 Thread Vincent Delporte
On Mon, 14 Aug 2006 17:46:11 -0500, Philippe Martin <[EMAIL PROTECTED]> wrote: >Yes there is a way to make one .exe/.msi for everything ... but it does >require purchasing a tool such as VC++. > >I have python + wxWindows + my stuff + many other libraries in one installer >(takes 120 Megs (sigh))

Jython Sounds Examples

2006-10-10 Thread Ian Vincent
I have been hunting around Google hits for any source code examples of using sound (preferably WAV) under Jython with no success (minus several using other toolkits such as JNRI and JES). Does anybody know if any such examples exist and if so, I would be grateful for a pointer in their directio

unittest behaving oddly

2006-06-20 Thread David Vincent
ply > assertEquals((0 * 10), 0) > NameError: global name 'assertEquals' is not defined > > -- > Ran 2 tests in 0.045s > > FAILED (errors=2) > Mina:~/Documents/source/unittest-debug dvincent$ p

Re: unittest behaving oddly

2006-06-20 Thread David Vincent
-BEGIN PGP SIGNED MESSAGE- On 20/06/2006, at 23:15, Mike Kent wrote: > David Vincent wrote: > >>> import unittest >>> >>> class IntegerArithmenticTestCase(unittest.TestCase): >>> def testAdd(self): ## test method names begin &

Jythonc Problem

2006-07-04 Thread Ian Vincent
I cannot find a Jython newsgroup, so apologies in advance if this question has been posted to the wrong group. Just written my first Jython program (previously written Python ones) and it is working fine in 'interpreted mode'. I now want to compile it into Java classes but I get the following e

Re: reading id3 tags with python

2006-11-25 Thread Rabin Vincent
On 24 Nov 2006 08:42:02 -0800, jeff <[EMAIL PROTECTED]> wrote: > File "/home/jeffrey/Documents/Music/.rename/id3reader.py", line 341, > in _interpretFlags > self._readExtHeader = _readExtHeader_rev3 > NameError: global name '_readExtHeader_rev3' is not defined Add a "self." in front of _read

<    1   2   3   4   5   6   >