Re: Printing Unicode strings in a list

2022-04-30 Thread Vlastimil Brom
čt 28. 4. 2022 v 13:33 odesílatel Stephen Tucker napsal: > > Hi PythonList Members, > > Consider the following log from a run of IDLE: > > == > > Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] > on win32 > Type "copyright", "credits" or "license()" for

Re: Confusing textwrap parameters, and request for RE help

2020-03-25 Thread Vlastimil Brom
22. 3. 2020 v 20:02 Chris Angelico : > > When using textwrap.fill() or friends, setting break_long_words=False > without also setting break_on_hyphens=False has the very strange > behaviour that a long hyphenated word will still be wrapped. I > discovered this as a very surprising result when

Re: How to create a RGB color Table

2019-06-17 Thread Vlastimil Brom
po 17. 6. 2019 v 11:30 odesílatel Jorge Conrado Conforte napsal: > > HI, > > Please someone could help me. How can I create a new color table with the > values of r g and b that I have. I use the Mataplolib color tables. However, > I would like to use a new color table with the respective r g b

Re: polar coordinates?

2018-12-09 Thread Vlastimil Brom
2018-12-09 17:30 GMT+01:00, Brian Christiansen : > I have been messing with a program that is inspried by a video on > youtube that is about the vizualization of pi. I might make a post > about that program someday, but I want to talk about something else. > One of the ways of visualizing it is

Re: Number 7 syntax ERROR

2018-11-08 Thread Vlastimil Brom
2018-11-08 2:52 GMT+01:00, NoHaxAllSwagg : > Hello, > I have been experiencing difficulty while trying to run scripts on my IDLE > software, considering that when I run my program, I get an error at the top > of the page in the “Python 3.7.1” area, highlighting the seven telling me > that there is

Re: Format list of list sub elements keeping structure.

2018-07-24 Thread Vlastimil Brom
2018-07-24 3:52 GMT+02:00, Sayth Renshaw : > I have data which is a list of lists of all the full paths in a json > document. > > How can I change the format to be usable when selecting elements? > > data = [['glossary'], > ['glossary', 'title'], > ['glossary', 'GlossDiv'], > ['glossary',

Re: List slicing on Python 2.7

2018-03-15 Thread Vlastimil Brom
2018-03-15 12:54 GMT+01:00 Arkadiusz Bulski : > I have a custom class (a lazy list-like container) that needs to support > slicing. The __getitem__ checks if index is of slice type, and does a list > comprehension over individual integer indexes. The code works fine on >

Re: RegExp - please help me!

2017-12-26 Thread Vlastimil Brom
Hi, I can't comment, whether this is the right approach, as I have no experiences with C++, but for the matching regular expression itself, I believe, e.g. the following might work for your sample data (I am not sure, however, what other details or variants should be taken into account):

Re: matplot plot hangs

2017-11-01 Thread Vlastimil Brom
2017-11-01 13:49 GMT+01:00 Andrew Z : > Wolfgang, > I tried to ran from ide with no rwsults, so now im trying from a terminal > in xwindow. > The .plot is the last line in the script and it does hang trying to execute > it. > > > On Nov 1, 2017 05:44, "Wolfgang Maier" < >

Re: Regular expression query

2017-03-12 Thread Vlastimil Brom
2017-03-12 17:22 GMT+01:00 : > Hi All, > > I have a string which looks like > > a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f > "5546,3434,345,34,34,5,34,543,7" > > It is comma saperated string, but some of the fields have a double quoted >

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Vlastimil Brom
2017-03-12 13:14 GMT+01:00 Chris Green : ... > > This question relates to how one communicates between windows/GUIs. > > When the program starts theres a main GUI, class name abookgui. If > you want to add new entries or modify existing entries an edit GUI is > started in a

Re: an other issue when installing python under Windows OS

2016-10-12 Thread Vlastimil Brom
2016-10-12 14:24 GMT+02:00 Karlheinz Hoening : >Hello all, > >on my iMac I have installed Windows (7) and I am now trying to install >Python 3.5.2 (32-bit) under Windows OS. >Every time after having 'repaired' with the installation procedere I >receive the

Re: generator no iter - how do I call it from another function

2016-10-01 Thread Vlastimil Brom
2016-10-01 12:09 GMT+02:00 Sayth Renshaw : > My main issue is that usually its just x in ,,, for a generator. > > But if I change the code > for meet in roots.iter("meeting"): > > to > for meet in roots("meeting"): > > Well its invalid but I need to be able to reference the

Re: pyinstaller

2016-07-27 Thread Vlastimil Brom
2016-07-27 3:15 GMT+02:00 Larry Martell : > On Tue, Jul 26, 2016 at 8:49 PM, Tom Brown wrote: >> I used pyinstaller quite a bit 3 years ago. I could brush off the cobwebs >> and see if I can help if you have not solved it already. >> >> What is the

Re: math.frexp

2016-07-16 Thread Vlastimil Brom
2016-07-15 13:39 GMT+02:00 Steven D'Aprano : > I'm experimenting with various implementations of product(values). Here's a > naive version that easily suffers from overflow: > > from functools import reduce > from operator import mul > > def product_naive(values): > return

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread Vlastimil Brom
2016-06-15 5:28 GMT+02:00 Yubin Ruan : > Hi everyone, > I am struggling writing a right regex that match what I want: > > Problem Description: > > Given a string like this: > > >>>string = "false_head aaa bbb false_tail \ > true_head some_text_here ccc ddd

Re: Detecting repeated subsequences of identical items

2016-04-21 Thread Vlastimil Brom
2016-04-21 5:07 GMT+02:00 Steven D'Aprano : > I want to group repeated items in a sequence. For example, I can group > repeated sequences of a single item at a time using groupby: > > > from itertools import groupby > for key, group in groupby("BBCDDEEE"): > group

Re: What's the best/neatest way to get Unicode data from a database into a grid cell?

2016-02-08 Thread Vlastimil Brom
2016-02-08 11:42 GMT+01:00 <c...@isbd.net>: > Vlastimil Brom <vlastimil.b...@gmail.com> wrote: >> >> Hi, >> your code in >> http://www.salstat.com/news/linking-wxgrid-to-sqlite-database-in-python-an-example >> >> seems to work for me after smal

Re: What's the best/neatest way to get Unicode data from a database into a grid cell?

2016-02-07 Thread Vlastimil Brom
2016-02-07 12:19 GMT+01:00 : > I'm using this as a starting point for creating a grid to view and > edit some sqlite data:- > > http://www.salstat.com/news/linking-wxgrid-to-sqlite-database-in-python-an-example > > I can actually understand most of it which is a good start. >

Re: import locale and print range on same line

2016-01-23 Thread Vlastimil Brom
2016-01-23 11:36 GMT+01:00 Marko Rauhamaa : > rai...@gmail.com: > >> Can someone tell me why next code doesn't work? >> >> import locale; locale.setlocale(locale.LC_ALL, ""); for i in >> range(1,20,4): print(locale.format("%2f", i, 1)) >> >> It gives an error: SyntaxError:

Re: one more question on regex

2016-01-23 Thread Vlastimil Brom
2016-01-22 23:47 GMT+01:00 mg <no...@nowhere.com>: > Il Fri, 22 Jan 2016 21:10:44 +0100, Vlastimil Brom ha scritto: > >> [...] > > You explanation of re.findall() results is correct. My point is that the > documentation states: > > re.findall(pattern, stri

Re: one more question on regex

2016-01-22 Thread Vlastimil Brom
2016-01-22 16:50 GMT+01:00 mg : > Il Fri, 22 Jan 2016 15:32:57 +, mg ha scritto: > >> python 3.4.3 >> >> import re re.search('(ab){2}','abzzabab') >> <_sre.SRE_Match object; span=(4, 8), match='abab'> >> > re.findall('(ab){2}','abzzabab') >> ['ab'] >> >> Why for search()

Re: Trailing zeros of 100!

2016-01-02 Thread Vlastimil Brom
2016-01-02 12:49 GMT+01:00 : > Hi, newbie here! > I'm trying to write a python program to find how many trailing zeros are in > 100! (factorial of 100). > I used factorial from the math module, but my efforts to continue failed. > Please help. > > Thank you, > Yehuda > -- >

Re: Trailing zeros of 100!

2016-01-02 Thread Vlastimil Brom
2016-01-02 18:34 GMT+01:00 yehudak . <katye2...@gmail.com>: [partly edited for bottom posting] > On Sat, Jan 2, 2016 at 5:24 PM, Vlastimil Brom <vlastimil.b...@gmail.com> > wrote: >> >> 2016-01-02 14:14 GMT+01:00 yehudak . <katye2...@gmail.com>: >>

Re: Trailing zeros of 100!

2016-01-02 Thread Vlastimil Brom
2016-01-02 14:14 GMT+01:00 yehudak . <katye2...@gmail.com>: > Vlastimil, > Thank you so much, but... > All that is Chinese for me. > Can you show a 'normal' Python code for me? > > Yehuda > > On Sat, Jan 2, 2016 at 2:44 PM, Vlastimil Brom <vlastimil.b...@gmail.com

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Vlastimil Brom
2015-12-21 4:01 GMT+01:00 Steven D'Aprano : > I have a large number of strings (originally file names) which tend to fall > into two groups. Some are human-meaningful, but not necessarily dictionary > words e.g.: > > > baby lions at play > saturday_morning12 > Fukushima >

Re: textfile: copy between 2 keywords

2015-09-10 Thread Vlastimil Brom
2015-09-10 13:18 GMT+02:00 Gerald : > Hey, > > is there a easy way to copy the content between 2 unique keywords in a .txt > file? > > example.txt > > 1, 2, 3, 4 > #keyword1 > 3, 4, 5, 6 > 2, 3, 4, 5 > #keyword2 > 4, 5, 6 ,7 > > > Thank you very much Hi, just to add

conditional sys.excepthook (outside of the interactive interpreter)?

2015-03-09 Thread Vlastimil Brom
Hi all, I'd like to as for advise about posibilities of redirecting error traceback via sys.excepthook in a gui (wxpython in my case) with a requirement, that the errors from the code typed in the interactive interpreter (as part of my app) are printed there directly and are not catched from the

Re: Tkinter frame reset

2014-08-09 Thread Vlastimil Brom
2014-08-09 2:38 GMT+02:00 Nicholas Cannon nicholascann...@gmail.com: Ok so I am working on a little project and I cant seem to solve something with it. I have a label and then a clear button and I want all the numbers in the label to clear when I push the button. This button is on a separate

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

2014-07-24 Thread Vlastimil Brom
2014-07-24 14:53 GMT+02:00 fl rxjw...@gmail.com: Hi, I have read a lot about Python, but it still has a problem now on a simple exercise. For example, I want to generate a sine curve. First, I get a time sequence: index=range(100) I import math module, try to calculate sine with

Re: Python's re module and genealogy problem

2014-06-11 Thread Vlastimil Brom
2014-06-11 14:23 GMT+02:00 BrJohan brjo...@gmail.com: For some genealogical purposes I consider using Python's re module. ... Now, my problem: Is there a way to decide whether any two - or more - of those regular expressions will match the same string? Or, stated a little differently: Can

Re: Regular Expression for the special character | pipe

2014-05-27 Thread Vlastimil Brom
2014-05-27 12:59 GMT+02:00 Aman Kashyap amankashyap1...@gmail.com: I would like to create a regular expression in which i can match the | special character too. e.g. start=|ID=ter54rt543d|SID=ter54rt543d|end=| I want to only |ID=ter54rt543d| from the above string but i am unable to

Re: Off-topic circumnavigating the earth in a mile or less [was Re: Significant digits in a float?]

2014-05-01 Thread Vlastimil Brom
2014-05-01 3:57 GMT+02:00 Chris Angelico ros...@gmail.com: On Thu, May 1, 2014 at 9:46 AM, Ian Kelly ian.g.ke...@gmail.com wrote: It also works if your starting point is (precisely) the north pole. I believe that's the canonical answer to the riddle, since there are no bears in Antarctica.

Re: Significant digits in a float?

2014-04-29 Thread Vlastimil Brom
2014-04-28 18:00 GMT+02:00 Roy Smith r...@panix.com: I'm using Python 2.7 I have a bunch of floating point values. For example, here's a few (printed as reprs): 38.0 41.2586 40.752801 49.25 33.7951994 36.8371996 34.1489 45.5 Fundamentally, these numbers

Re: How to properly get the microseconds from the timestamps?

2014-04-22 Thread Vlastimil Brom
2014-04-22 4:38 GMT+02:00 Igor Korot ikoro...@gmail.com: ... datetime.datetime.fromtimestamp(1092787200/1000.0) datetime.datetime(1970, 1, 13, 7, 33, 7, 20) Is there a way to know if the timestamp has a microseconds? Thank you. -- Hi, I believe, in these cases, you can just test,

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Vlastimil Brom
2014-03-26 10:40 GMT+01:00 Martin Landa landa.mar...@gmail.com: Hi all, I am trying to fix a bug in the project which I am working for. The program starts on Windows via bat file which calls a Python script to set up the environment including GUI and allow to launch program-specific tools.

Re: Get a datetime with nanoseconds

2014-02-11 Thread Vlastimil Brom
2014-02-11 6:42 GMT+01:00 Igor Korot ikoro...@gmail.com: Hi, ALL, I am woking on an application for digital forensic. In this application I am getting this 2 pieces of information: atime - long representing the time stamp atime_nano - long representing the nanoseconds. What I'd like to do

Re: On a scrollbar for tkinter

2014-01-03 Thread Vlastimil Brom
2014/1/3 eneskri...@gmail.com: @Rick I found some solutions for python 2.x, but still, as I am with the future, I need a futuristic solution or 2, so if anyone else could help me, I'd be grateful! -- Hi, I usually don't use tkinter myself, hence others may have more idiomatic suggestions,

Re: Count each unique element in list of lists

2013-11-08 Thread Vlastimil Brom
2013/11/8 Yaşar Arabacı yasar11...@gmail.com: Hi, I have a function that returns something like this; [[[1, 5, 9], [2, 6, 7], [3, 4, 8]], [[1, 6, 8], [2, 4, 9], [3, 5, 7]]] It is a list of list of lists. Each uppermost list is called a result. I want to write a code that shows that each

Re: extraction tool using CRF++

2013-10-01 Thread Vlastimil Brom
2013/10/1 cerr ron.egg...@gmail.com: Hi, I want to write an extraction tool using CRF++ (http://crfpp.googlecode.com/svn/trunk/doc/index.html). I have written a trainings file and a template: training: banana FOODB-NP bread FOODI-NP template: U01:%x[0,1] U02:%x[1,1] and

Re: Antispam measures circumventing

2013-09-20 Thread Vlastimil Brom
2013/9/20 Jugurtha Hadjar jugurtha.had...@gmail.com: Hello, # I posted this on the tutor list, but my message wasn't displayed I shared some assembly code (microcontrollers) and I had a comment wit my e-mail address for contact purposes. Supposing my name is John Doe and the e-mail is

Re: Iterate through a list of tuples for processing

2013-09-20 Thread Vlastimil Brom
2013/9/20 Shyam Parimal Katti spk...@nyu.edu: I have a list of tuples where the number of rows in the list and the number of columns in tuples of the list will not be constant. i.e. ... i.e. list_value = [(‘name1’, 1234, ‘address1’ ), (‘name2’, 5678, ‘address2’), (‘name3’, 1011,

Re: Remove \n, from tuple.

2013-09-18 Thread Vlastimil Brom
2013/9/18 Venkat Addala venkat.bof...@gmail.com Hi all, I have a tuple in this format, which is retrived using MySQLdb, now i want to remove \n and extra spaces in this. 13L, 'ssDsC', 'CEs5s1, DsC', 'srylscetsmight\nghtscetylsse', '3', '3q25.1', 151531861L, 151546276L, '+', '1

Re: how does not work nested comment in python?

2013-09-04 Thread Vlastimil Brom
2013/9/4 vnkumbh...@gmail.com: example: print hello # print comment +world= single line comment print hello '''print comment''' +world = multiple line comment -- https://mail.python.org/mailman/listinfo/python-list Hi, python only has single line comments, which apply from a # to the

Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread Vlastimil Brom
2013/9/2 Anthony Papillion papill...@gmail.com: Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove the first line. Basically, I want to toss the

Re: can't get utf8 / unicode strings from embedded python

2013-08-25 Thread Vlastimil Brom
2013/8/25 David M. Cotter m...@davecotter.com: i'm sorry this is so confusing, let me try to re-state the problem in as clear a way as i can. I have a C++ program, with very well tested unicode support. All logging is done in utf8. I have conversion routines that work flawlessly, so i can

Re: Python variable as a string

2013-08-23 Thread Vlastimil Brom
2013/8/23 Jake Angulo jake.ang...@gmail.com: Sorry this is a very basic question. I have a list var which after some evaluation I need to refer to var as a string. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string', anothervar='anotherstring') anotherdict = dict() if

Re: [GUI] Good frameworks for Windows/Mac?

2013-08-06 Thread Vlastimil Brom
2013/8/6 Gilles nos...@nospam.com: Hello I need to write a small GUI application that should run on Windows and Mac. What open-source framework would you recommend? I just need basic widgets (button, listbox, etc.) and would rather a solution that can get me up and running fast. I know

Re: Numeric coercions

2013-07-07 Thread Vlastimil Brom
2013/7/7 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: I sometimes find myself needing to promote[1] arbitrary numbers (Decimals, Fractions, ints) to floats. E.g. I might say: numbers = [float(num) for num in numbers] or if you prefer: numbers = map(float, numbers) The problem

Re: looking for a linguistical/semiotic quote

2013-06-27 Thread Vlastimil Brom
2013/6/27 rusi rustompm...@gmail.com: I am looking for a quote (from Whorf/Sapir/Wittgenstein/Humboldt dunno... that 'school') It goes something like this: What characterizes a language is not what we can say in it but what we must -- like it or not -- say. [...] Hi, I belive, the author

Re: Libroffice PMT equivalent in python

2013-04-25 Thread Vlastimil Brom
2013/4/25 ஆமாச்சு ama...@amachu.me Hi, Are there equivalent in any Python libraries that could match function like PMT in libreoffice? Refer: https://help.libreoffice.org/Calc/Financial_Functions_Part_Two#PMT -- Amachu -- http://mail.python.org/mailman/listinfo/python-list Hi, you

Re: A string and an integer to appear in tuple (python 2.7)

2013-03-12 Thread Vlastimil Brom
2013/3/13 Jiewei Huang jiewe...@gmail.com: Hi all, I'm currently stuck at this question on Writing a function len_str that takes a string as an argument and returns a pair consisting of the length of the string and the string itself. Example: len_str('Meaning of life') should return the

Re: simple GUI environment

2013-03-05 Thread Vlastimil Brom
2013/3/5 Eric Johansson e...@harvee.org: I need a simple GUI toolkits like easygui pythoncard. The main reason I discount both of those is that they are effectively dead as I can see. Last updates in the 2010/2011 range. Has there been some toolkit to replace them? And no, the existing

Re: Recursive function

2013-03-05 Thread Vlastimil Brom
2013/3/5 Ana Dionísio anadionisio...@gmail.com: Hello! I have to make a script that calculates temperature, but one of the parameters is the temperature in the iteration before, for example: temp = (temp_-1)+1 it = 0 temp = 3 it = 1 temp = 3+1 it = 2 temp = 4+1 How can I do this in

Re: Encoding problem in python

2013-03-04 Thread Vlastimil Brom
2013/3/4 yomnasala...@gmail.com: I have a problem with encoding in python 27 shell. when i write this in the python shell: w=u'العربى' It gives me the following error: Unsupported characters in input any help? -- http://mail.python.org/mailman/listinfo/python-list Hi, I guess, you

Re: Best way to convert number of minutes to hh:mm AM/PM?

2013-03-01 Thread Vlastimil Brom
2013/3/2 andydtay...@gmail.com: Hi, I need to create a list of equally spaced times (as in hh:mm AM/PM) within a day to loop through. Having selected 30 minute intervals I figured I could: * Create a list from 1 to 48 * Multiply each value by 30 * Convert minutes to a time.

Re: Correct handling of case in unicode and regexps

2013-02-23 Thread Vlastimil Brom
2013/2/23 Devin Jeanpierre jeanpierr...@gmail.com: Hi folks, I'm pretty unsure of myself when it comes to unicode. As I understand it, you're generally supposed to compare things in a case insensitive manner by case folding, right? So instead of a.lower() == b.lower() (the ASCII way), you do

Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple?

2013-01-02 Thread Vlastimil Brom
2013/1/2 Victor Hooi victorh...@gmail.com: Hi, I'm using pysvn to checkout a specific revision based on date - pysvn will only accept a date in terms of seconds since the epoch. I'm attempting to use time.mktime() to convert a date (e.g. 2012-02-01) to seconds since epoch. According to

Re: ignore case only for a part of the regex?

2013-01-01 Thread Vlastimil Brom
2013/1/1 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: On Sun, 30 Dec 2012 10:20:19 -0500, Roy Smith wrote: The way I would typically do something like this is build my regexes in all lower case and .lower() the text I was matching against them. I'm curious what you're doing where

Re: numpy has got newtonsmethod?

2013-01-01 Thread Vlastimil Brom
2013/1/2 Usama Khan usamazo...@gmail.com: my question is can we import newtonsmethod from nympy or sciPy? -- http://mail.python.org/mailman/listinfo/python-list Hi, After successfully installing SciPy http://www.scipy.org/Download you should be able to import the respective modules and use

Re: numpy has got newtonsmethod?

2013-01-01 Thread Vlastimil Brom
2013/1/2 Usama Khan usamazo...@gmail.com: thanks. . but how to instal scipy. because its in .rar form. .i have extracted the files to the place where python2.7 is installed. . but everytime i write import sciPy. .it give me error. . nd regarding ur question. . its a long story telling u

Re: Considering taking a hammer to the computer...

2012-12-31 Thread Vlastimil Brom
2013/1/1 worldsbiggestsabres...@gmail.com: Hey :) I'm trying to help my son with an assignment and spending hours making an inch of progress. I know nothing about programming and I'm trying to learn, on my own, at a rate faster than possible. I would love a little help! My son is taking

Re: ignore case only for a part of the regex?

2012-12-30 Thread Vlastimil Brom
2012/12/30 Helmut Jarausch jarau...@skynet.be: Hi, is there a means to specify that 'ignore-case' should only apply to a part of a regex? E.g. the regex should match Msg-id:, Msg-Id, ... but not msg-id: and so on. I've tried the pattern r'^Msg-(?:(?i)id):' but (?i) makes the whole

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Vlastimil Brom
2012/12/30 Alvaro Lacerda alacerda...@gmail.com: The code I wrote is supposed to ask the user to enter a number; Then tell the user what's going to happen to that number (x / 2 + 5) ; Then give the user an answer; I succeeded getting results from even numbers, but when I try diving an

Re: calculation on lists

2012-12-19 Thread Vlastimil Brom
2012/12/19 loïc Lauréote laureote-l...@hotmail.fr: hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx == Hi, for such simpler cases, you may try list comprehensions and probably the zip(...) function

Re: calculation on lists

2012-12-19 Thread Vlastimil Brom
2012/12/19 loïc Lauréote laureote-l...@hotmail.fr: hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx -- http://mail.python.org/mailman/listinfo/python-list Hi, I guess, if you are interested in

Re: py2exe is on Sourceforge list of top growth projects

2012-12-18 Thread Vlastimil Brom
2012/12/18 Colin J. Williams c...@ncf.ca: ... Yes, but py2exe appears limited to Python 2.6. PyInstaller is another option with similar functionality. Colin W. -- http://mail.python.org/mailman/listinfo/python-list There are versions for python 2.3 - 2.7:

Re: Unicode

2012-12-17 Thread Vlastimil Brom
2012/12/17 Anatoli Hristov toli...@gmail.com: if you only see encoding problems on printing results to your terminal, its settings or unicode capability might be the cause, however, if you also get badly encoding items in the database, you are likely using an inappropriate encoding in some

Re: How to exactly set style in tkinter.ttk

2012-12-17 Thread Vlastimil Brom
2012/12/17 Netrick netr...@o2.pl: So, we have now in python 3 the tile module http://tktable.sourceforge.net/tile/screenshots/unix.html integrated as tkinter.ttk. However, in the python and tk docs there is a lot about that tkk, but only how to set your own style for specific widgets. There is

Re: String manipulation in python..NEED HELP!!!!

2012-12-10 Thread Vlastimil Brom
2012/12/10 qbai...@ihets.org: I need help with a program i am doing. it is a cryptography program. i am given a regular alphabet and a key. i need to use the user input and use the regular alphabet and use the corresponding letter in the key and that becomes the new letter. i have the

Re: Good use for itertools.dropwhile and itertools.takewhile

2012-12-06 Thread Vlastimil Brom
2012/12/5 Nick Mellor thebalance...@gmail.com: Neil, Further down the data, found another edge case: Spring ONION from QLD Following the spec, the whole line should be description (description starts at first word that is not all caps.) This case breaks the latest groupby. N --

Re: Good use for itertools.dropwhile and itertools.takewhile

2012-12-06 Thread Vlastimil Brom
2012/12/6 Neil Cerutti ne...@norwich.edu: On 2012-12-05, Vlastimil Brom vlastimil.b...@gmail.com wrote: ... PARSNIP, certified organic I'm not sure on this one. ('PARSNIP', ', certified organic') -- Neil Cerutti -- Well, I wasn't either, when I noticed this item, but given

Re: Good use for itertools.dropwhile and itertools.takewhile

2012-12-04 Thread Vlastimil Brom
2012/12/4 Nick Mellor thebalance...@gmail.com: I love the way you guys can write a line of code that does the same as 20 of mine :) I can turn up the heat on your regex by feeding it a null description or multiple white space (both in the original file.) I'm sure you'd adjust, but at the

Re: regex function driving me nuts

2012-10-23 Thread Vlastimil Brom
2012/10/23 MartinD. cyberdi...@gmail.com: Hi, I'm new to Python. Does someone has an idea what's wrong. I tried everything. The only regex that is tested is the last one in a whole list of regex in keywords.txt Thanks! Martin def checkKeywords( str, lstKeywords ):

Re: get each pair from a string.

2012-10-21 Thread Vlastimil Brom
2012/10/21 Vincent Davis vinc...@vincentdavis.net: I am looking for a good way to get every pair from a string. For example, input: x = 'apple' output 'ap' 'pp' 'pl' 'le' I am not seeing a obvious way to do this without multiple for loops, but maybe there is not :-) In the end I am

Re: why do this program not fullscreen?

2012-09-25 Thread Vlastimil Brom
2012/9/25 Levi Nie levinie...@gmail.com: the code: import wx app=wx.App() win=wx.Frame(None) win.ShowFullScreen() app.MainLoop() -- http://mail.python.org/mailman/listinfo/python-list Hi, win.ShowFullScreen(True) should work, the boolean parameter appears to be required. hth, vbr --

Re: [SOLVED] Least-lossy string.encode to us-ascii?

2012-09-14 Thread Vlastimil Brom
2012/9/14 Tim Chase python.l...@tim.thechases.com: On 09/13/12 16:44, Vlastimil Brom wrote: import unicodedata unicodedata.normalize(NFD, userviço móvil).encode(ascii, ignore).decode(ascii) u'servico movil' Works well for all the test-cases I threw at it. Thanks! -tkc Hi, I am

Re: Least-lossy string.encode to us-ascii?

2012-09-13 Thread Vlastimil Brom
2012/9/13 Tim Chase python.l...@tim.thechases.com: I've got a bunch of text in Portuguese and to transmit them, need to have them in us-ascii (7-bit). I'd like to keep as much information as possible, just stripping accents, cedillas, tildes, etc. So serviço móvil becomes servico movil. Is

Re: get the matched regular expression position in string.

2012-09-03 Thread Vlastimil Brom
2012/9/3 contro opinion contropin...@gmail.com: Here is a string : str1=ha,hihi,a,ok I want to get the position of , in the str1,Which can count 3,8,14. how can I get it in python ? -- http://mail.python.org/mailman/listinfo/python-list Hi, you can use re.finditer to match all , and

Re: Regex Question

2012-08-18 Thread Vlastimil Brom
2012/8/18 Frank Koshti frank.kos...@gmail.com: Hey Steven, Thank you for the detailed (and well-written) tutorial on this very issue. I actually learned a few things! Though, I still have unresolved questions. The reason I don't want to use an XML parser is because the tokens are not

Re: Intermediate Python user needed help

2012-08-05 Thread Vlastimil Brom
2012/8/5 John Mordecai Dildy jdild...@gmail.com: Current Problem at the moment Traceback (most recent call last): File ex26.py, line 66, in module beans, jars, crates = secret_formula(start-point) NameError: name 'start' is not defined anyone know how to make start defined --

Re: simpler increment of time values?

2012-07-06 Thread Vlastimil Brom
Thanks to all for further comments! Just for completeness and in case somebody would like to provide some suggestions or corrections; the following trivial class should be able to deal with the initial requirement of adding or subtracting dateless time values (hour:minute). regards, vbr # # # #

Re: simpler increment of time values?

2012-07-05 Thread Vlastimil Brom
Many thanks to all for your suggestions! @ChrisA Yes, the calculations with seconds since the Unix epoch is very convenient for real times, but trying to make it dateless seemed to make it more complicated for me. The expected output for the increments asked by Jason was already correctly stated

simpler increment of time values?

2012-07-04 Thread Vlastimil Brom
, Vlastimil Brom -- http://mail.python.org/mailman/listinfo/python-list

Re: Plot a function with matplotlib?

2012-05-19 Thread Vlastimil Brom
2012/5/19 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: I have matplotlib and iPython, and want to plot a function over an equally-spaced range of points. That is to say, I want to say something like this: plot(func, start, end) rather than generating the X and Y values by hand,

Re: Invalid syntax error

2012-03-10 Thread Vlastimil Brom
2012/3/10 sl33k ahsanbag...@gmail.com: I'm trying project euler problem 3 and I've hit the wall with this error. What could be the problem here?  l=[] num=600851475143 i=1 while i=num: ...     if num%i==0: ...         l.append(i) ...     i+=1 ... print max(l)  File stdin, line 5    

[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-06 Thread Vlastimil Brom
Vlastimil Brom vlastimil.b...@gmail.com added the comment: Sorry for mixing the different problems, these were somehow things I noticed at once in the new python version, but I should have noticed the different domains myself. I still might not understand the term crash properly - I just meant

[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-05 Thread Vlastimil Brom
New submission from Vlastimil Brom vlastimil.b...@gmail.com: Hi, while testing python 3.3a1 a bit, especially the new string handling of non-BMP characters, I noticed a problem in Idle in this regard: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32

[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-05 Thread Vlastimil Brom
Vlastimil Brom vlastimil.b...@gmail.com added the comment: Hi, thanks for the pointer, after invoking idle using python.exe, I don't see the crash mentioned in the report: Python 3.3.0a1 (default, Mar 4 2012, 17:27:59) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license

[issue14200] Idle shell crash on printing non-BMP unicode character

2012-03-05 Thread Vlastimil Brom
Vlastimil Brom vlastimil.b...@gmail.com added the comment: I'd like to add some further observations to the mentioned issue; it seems, that the crash is indeed not specific to idle. In a sample tkinter app, where I just display e.g. chr(66352) in an Entry widget, I also get the same immediate

Re: re module: Nothing to repeat, but no sre_constants.error: nothing to repeat ?

2012-02-14 Thread Vlastimil Brom
2012/2/14 Devin Jeanpierre jeanpierr...@gmail.com: Hey Pythonistas, Consider the regular expression $*. Compilation fails with the exception, sre_constants.error: nothing to repeat. Consider the regular expression (?=$)*. As far as I know it is equivalent. It does not fail to compile. Why

Re: Regexp : repeated group identification

2011-12-14 Thread Vlastimil Brom
2011/12/14 candide candide@free.invalid: Consider the following code # import re z=re.match('(Spam\d)+', 'Spam4Spam2Spam7Spam8') print z.group(0) print z.group(1) # outputting :

Re: Regexp : repeated group identification

2011-12-14 Thread Vlastimil Brom
2011/12/14 candide candide@free.invalid: ... Thanks for the reference and the example. I didn't know of this reimplementation, hoping it offers the Aho-Corasick algorithm allowing multiple keys search. -- http://mail.python.org/mailman/listinfo/python-list Hi, I am not sure about the

Re: Question: Optional Regular Expression Grouping

2011-10-10 Thread Vlastimil Brom
2011/10/10 galyle gal...@gmail.com: HI, I've looked through this forum, but I haven't been able to find a resolution to the problem I'm having (maybe I didn't look hard enough -- I have to believe this has come up before).  The problem is this: I have a file which has 0, 2, or 3 groups that

Re: regexp compilation error

2011-09-30 Thread Vlastimil Brom
2011/9/30 Ovidiu Deac ovidiud...@gmail.com: This is only part of a regex taken from an old perl application which we are trying to understand/port to our new Python implementation. The original regex was considerably more complex and it didn't compile in python so I removed all the parts I

Re: Generating equally-spaced floats with least rounding error

2011-09-24 Thread Vlastimil Brom
2011/9/24 Chris Angelico ros...@gmail.com: On Sat, Sep 24, 2011 at 11:53 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: #1 add multiples of the width to the starting value, 0. #2 subtract multiples of width from the ending value, 2.1. #3, go half and half - generate the

Re: how to make a nested list

2011-09-15 Thread Vlastimil Brom
2011/9/15 Stef Mientki stef.mien...@gmail.com: hello, I need a nested list, like this A= [ [None,None], [None,None], [None, None] ] A[2][0] =77 A [[None, None], [None, None], [77, None]] ... thanks, Stef -- http://mail.python.org/mailman/listinfo/python-list Besides the above

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Vlastimil Brom
2011/9/13 ron vacor...@gmail.com: Depending on the load, you can do something like: .join([x for x in string if ord(x) 128]) It's worked great for me in cleaning input on webapps where there's a lot of copy/paste from varied sources. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread Vlastimil Brom
declared; see http://www.python.org/peps/pep-0263.html for details Exit Code: 1 Line 1: a=u'''≤'''.encode(ascii, ignore).decode(ascii) On Tue, Sep 13, 2011 at 11:33 PM, Vlastimil Brom vlastimil.b...@gmail.com wrote: 2011/9/13 ron vacor...@gmail.com: Depending on the load, you can do something

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-12 Thread Vlastimil Brom
2011/9/12 Alec Taylor alec.tayl...@gmail.com: Good evening, I have converted ODT to HTML using LibreOffice Writer, because I want to convert from HTML to Creole using python-creole. Unfortunately I get this error: File Convert to Creole.py, line 17 SyntaxError: Non-ASCII character '\xe2' in

  1   2   3   4   >