On Mon, 23 Jul 2018 23:24:18 +0100, John Pote wrote:
> I recently wrote a command line app to take a stream of numbers, do some
> signal processing on them and display the results on the console. There
> may be several output columns of data so a title line is printed first.
> But the stream of
Robin Becker wrote:
> On 31/07/2018 09:16, Paul Moore wrote:
>> On 31 July 2018 at 08:40, Robin Becker wrote:
>>> A bitbucket user complains that python 3.6.6 with -Wall -b prints
>>> warnings for some reportlab code; the
>>> example boils down to the following
>>>
>>> ##
>>> C:\code\hg-r
Uri Even-Chen wrote:
> Hi,
>
> We are using unittest.TestCase.assertRaisesRegex in our Django project
> (Speedy Net / Speedy Match - https://github.com/urievenchen/speedy-net),
> and I always prefer calling Python function parameters by name. So we call
> self.assertRaisesRegex with parameters (k
Uri Even-Chen wrote:
> Do you know what is the problem and why I receive these deprecation
> warnings?
I poked around a bit and found
https://bugs.python.org/issue24134
Perhaps you can make sense of it (I can't).
--
https://mail.python.org/mailman/listinfo/python-list
Robin Becker wrote:
> On 01/08/2018 09:52, Chris Angelico wrote:
>> On Wed, Aug 1, 2018 at 6:36 PM, Robin Becker wrote:
>>> On 31/07/2018 16:52, Chris Angelico wrote:
>>..
>>>
>>> it says explicitly that numeric keys will use numeric comparison, but no
> .
>>>
>>
>> Technically,
Sayth Renshaw wrote:
> Hi.
>
> I want to use a function argument as an argument to a bs4 search for
> attributes.
>
> I had this working not as a function
># noms = soup.findAll('nomination')
> # nom_attrs = []
> # for attr in soup.nomination.attrs:
> # nom_attrs.append(attr)
Paul Moore wrote:
> On Wed, 1 Aug 2018 at 16:10, Robin Becker wrote:
>>
>> On 01/08/2018 14:38, Chris Angelico wrote:
>> > t's a warning designed to help people port code from Py2 to Py3. It's
>> > not meant to catch every possible comparison. Unless you are actually
>> > porting Py2 code and are
giannis.dafnomi...@gmail.com wrote:
> Hello guys. I'm having an issue with a Python PulP MILP problem. You can
> find the simplified code that reproduces the problem here:
>
> from pulp import *
> machines = 2
> I = range(machines)
> positions = 2
> J = range(positions)
> years = 10
> T = range(y
giannis.dafnomi...@gmail.com wrote:
> Hey Peter.
>
> This worked like a charm! I can't believe I did not think of that, after
> wasting so many hours on it.
>
> Thank you so much for the help!
You can make these things easier to debug by breaking your code into small
f
cseber...@gmail.com wrote:
> Why this regex for string literals
> can't handle escaped quotes? '"(\\.|[^"])*"'
>
> See this...
>
string_re = '"(\\.|[^"])*"'
>
re.match(string_re, '""')
> <_sre.SRE_Match object; span=(0, 6), match='""'>
>
re.match(string_re, '"aa\"aa"
Venkatesh Adiga wrote:
> Hi All,
>
> I am facing issue with python package import.
> In my project, I have many directories with different python classes
> defined within them. I am trying to import those classes in another python
> program, but not able to import them.
> Here are my directories
inhahe wrote:
> I need to make a list of instances of a Structure, then I need to make an
> instance of another Structure, one of the fields of which needs to be an
> arbitrary-length array of pointers to the instances in the list. How do I
> do that?
>
> Just in case it helps, I'll include what
Venkatesh Adiga wrote:
> Thanks Peter... What are the ways to update outside of the python program
> without defining environment variable for source code path Otherwise
> can I do it once in during initialization of sys.path update?
I don't understand the question. Yo
wfgazd...@gmail.com wrote:
> I have a main window open. Then I open a tk.TopLevel dialog window giving
> the user multiple choices. He selects one, the corresponding event is
> executed. Then in the underlining main window, just by chance there is
> another button exactly under the mouse click
Steven D'Aprano wrote:
> On Wed, 15 Aug 2018 05:34:06 -0700, tomusatov wrote:
>
>> I am not terribly familiar with Python, but am currently authoring an
>> integer sequence for www.oeis.org and was wondering if anyone in the
>> community could help me with authoring a Python program that outputs,
tomusa...@gmail.com wrote:
> Thank you very much! Do you also know how I might slightly alter to
> composite numbers that are one less than twice a composite number?
>
> 15 would be the first number
> Since 8 is composite then
>
> 2*8=16
> 16 - 1=15 Is composite
Like
>>> def is_composite(n):
.
Chris Angelico wrote:
> On Fri, Aug 17, 2018 at 9:49 PM, Jon Ribbens
> wrote:
>>> "Code running directly under the class" describes every use of the class
>>> keyword (except those with an empty body). If you write:
>>>
>>> class Spam:
>>> x = 1
>>>
>>> you are running code under the
Frank Millman wrote:
> I find that using a separate method per subclass does exactly what I want,
> and that part of my project has been working stably for some time.
I think that approach is fine. Do not let a tool have you bend over
backwards. Do not give in to pylint's nagging when you are co
shradha...@gmail.com wrote:
> I am using for my logger
>
> handler.setFormatter(SimpleJsonFormatter(json.dumps))
Where does SimpleJsonFormatter come from?
If it uses the json.dumps argument to serialize a dict you may pass a
modified version instead:
# untested
KEYS_TO_IGNORE = {"fields", "yo
zljubi...@gmail.com wrote:
> 1. saving json will result in unordered ini file. It could be solved by
> using OrderedDict that will than with json.dumps be saved to file in the
> same order as options are added to the ordered dict.
dict-s are guaranteed to keep insertion order in Python 3.7, see
On Wed, 22 Aug 2018 13:12:59 +0200, jacob m wrote:
[snip]
> That's my error:
> "import zipfile
> File "/home/lib/python3.7/lib/python3.7/zipfile.py", line 19, in
> crc32 = zlib.crc32
> AttributeError: module 'zlib' has no attribute 'crc32' "
>
> I have no idea what to do with that :/ I
Sharan Basappa wrote:
> I am running a program that I got as reference from GitHub.
> I am running on windows OS.
>
> Here is a snippet of the code (initial few lines).
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> __author__ = 'Shilin He'
>
> import sys
> sys.path.insert(0, 'D:\Project
har...@moonshots.co.in wrote:
> On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote:
>> The top-level object you are showing is a list [], not a dictionary {}.
>> It has dictionaries inside of it though. Do you want to sort the list?
>>
>> Python's sorted() function return
har...@moonshots.co.in wrote:
> sort = sorted(results, key=lambda res:itemgetter('date'))
> print(sort)
>
>
> I have tried the above code peter but it was showing error like
> TypeError: '<' not supported between instances of 'operator.itemg
On Fri, 31 Aug 2018 08:36:52 -0600, Malcolm Greene wrote:
> I have use case where I need to distribute binary files to customers and
> want to provide a way for our customers to verify the
> "integrity/lineage" (I know there's a better description, but can't
> think of it) of these files, eg. to g
On Fri, 31 Aug 2018 12:51:58 -0600, Malcolm Greene wrote:
> Thanks for the replies! I'm going to investigate the use of
> python-gnupg which is a Python wrapper for the GPG command line
> utility. This library is based on gpg.py written by Andrew Kuchling.
> I'm all ears if f anyone has any altern
On Sat, 1 Sep 2018 10:11:59 -0700 (PDT), moha...@gmail.com wrote:
> All,
>
> I m trying to run this small script to find the lowest of the given
> array of numbers. The script works fine for various combination of
> inputs but fails in a weird way for a particular set of inputs, can
> anyone point
alon.naj...@gmail.com wrote:
> how to get a value from CSV specific cell (A7) thanks
$ cat csv_sheet.py
#!/usr/bin/python3
import re
import csv
import string
LOOKUP = {c: i for i, c in enumerate(string.ascii_uppercase, 1)}
def a2i(s):
"""
>>> a2i("A")
0
>>> a2i("Z
On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote:
> how can i be able to store a list of values to drop-down menu and then
> grab the value that the user selects?
>
> **
> name = month = year = ''
>
> # populate names, months, years
> names.ad
On Tue, 4 Sep 2018 10:13:07 -0700 (PDT), Nick Berg wrote:
[snip]
>
> May i ask how you managed to send an email with a domain
> nowhere.invalid ? I would like to do the same.
I don't post by sending email, I post by using a news client (slrn),
which interacts with the Usenet system
(en.wikipedia.o
On Sun, 2 Sep 2018 13:40:18 -0700 (PDT), Nick Berg wrote:
> how can i be able to store a list of values to drop-down menu and then
> grab the value that the user selects?
>
> **
> name = month = year = ''
>
> # populate names, months, years
> names.ad
alon.naj...@gmail.com wrote:
> hi,
>
> I try to edit a text file with python 2.7:
>
> * AAPL *
> Date: September 07 2018
> Time: 14:10:52
> Price: ,068,407
> Ask: None
> High: None
> Low: None
> Previous Close: ,068,407
> Volume: $ 227.35 / $ 221.30
> Market Cap: 20.23
It looks like the
you edit a module after importing it the traceback may pick lines
that caused the code raising the exception, but now contain something
completely different. A little demo:
>>> with open("tmp.py", "w") as f: f.write("def f():\n return 1/0\n")
...
21
>>&
On 8 Sep 2018 17:25:52 GMT, Stefan Ram wrote:
> Sharan Basappa writes:
>> 66 # get the label for each log
>> 67 data_df['label'] = (data_df['label'] != '-').astype(int)
>>---> 68 #logger.debug("data frame %s \n", data_df)
>> 69 logger.debug("\n")
>>
Max Zettlmeißl via Python-list wrote:
>> glob('./Testfile [[]comment]*')
>>
>
> That is about the least correct working solution one could conceive.
> Of course your suggested "glob('./Testfile [[]comment]*')" works in
> the positive case, but pretty much comes down to a glob('./Testfile
> [[]*')
On 8 Sep 2018 19:10:09 GMT, Stefan Ram wrote:
> Peter Pearson writes:
>>On 8 Sep 2018 17:25:52 GMT, Stefan Ram wrote:
>>>In such cases, I do:
>>>print( 'at position 1' )
>>This approach is especially valuable when it turns out that
>>the f
Malcolm Greene wrote:
> I'm using the Python logging module and looking for a way to include a
> method's class name when using %(funcName). Is this possible? When you
> have several related classes, just getting the function (method) name is
> not enough information to provide context on the code
On Tue, 11 Sep 2018 20:54:23 +0200 (CEST), Bat erdene endzis wrote:
[snip]
> def dice():
> attacker_dice=[random.randint(1,6) for _ in range(3)]
> defender_dice=[random.randint(1,6) for _ in range(2)]
> a=max(attacker_dice)
> b=max(defender_dice)
> for i in range(1000):
>
On Tue, 11 Sep 2018 19:51:01 -0700 (PDT), alon.naj...@gmail.com wrote:
> hi,
>
> on python 2.7 how do I build a loop with a button + textbox?
>
> for example:
>
> I want the user to enter is name and then press "ok" button, I want
> his name to be printed 5 times.
Tested on Python 3.5.3:
import b
Steven D'Aprano wrote:
> I'm originally posted this on the Python-Ideas list, but this is probably
> more appropriate.
>
>
> import time
> from threading import Thread, local
>
> def func():
> pass
>
> def attach(value):
# no new local() here
> func.__params__.value = value
>
>
Antoon Pardon wrote:
> On 12-09-18 22:14, Peter Otten wrote:
>> As I understand it you need one local() instance that is shared by all
>> workers. Every thead will then see thread-specific values.
>
> It has always puzzled me how this is useful. The times I work with
> th
Chris Angelico wrote:
> On Thu, Sep 13, 2018 at 10:22 PM, Peter Otten <__pete...@web.de> wrote:
>> Antoon Pardon wrote:
>>
>>> On 12-09-18 22:14, Peter Otten wrote:
>>>> As I understand it you need one local() instance that is shared by all
>>>&
YnIk wrote:
> Dear Python,
> Hello. This is an email concerning about my Python program(3.7.0). It
> keeps printing out stuff that’s too fast to read. If I try to write code,
> it just keeps on going. I have tried Ctrl+C, but even that’s not working.
> I searched through all my flies and can’t fin
Francis Esmonde-White wrote:
> Hello,
>
> I came to report one bug (in the Python 3 tutorial documentation), and ran
> into another (functional in bugs.python.org bug tracker registration
> system). I have included details for both bugs below.
>
> Thanks in advance for your assistance, I am lovi
Victor via Python-list wrote:
> Let me use a different input args and display them below. Basically, I am
> hoping to add up all elements of each nested list. So at first it should
> start with [1,11,111] ==> 1+11+111 = 123. But instead, it appears to take
> the 1st element from each nested lis
Brian Oney via Python-list wrote:
> That's one thing that confused me. Generators are supposed to be one-off
> iterators. Iterators, *I understood* as reusable iterables.
The way I think about it, informally: iterables need and __iter__ method,
iterators need a __next__ method.
In practice all
Victor via Python-list wrote:
> On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote:
>> Victor via Python-list wrote:
>>
>> > Let me use a different input args and display them below. Basically, I
>> > am
>> > hoping to add up all ele
Victor Porton wrote:
> What is the recommended format for --log-level (or --loglevel?) command
> line option?
>
> Is it a number or NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL?
Not really a recommendation, but I use
choices=["DEBUG", ..., "CRITICAL"],
type=str.upper
It's not clear to me what it m
vito.detul...@gmail.com wrote:
> Hi
> Today I've added a couple of lines in my source code, and I'm very ashamed
> of it. it "runs", and I know what it does (for now), but it's "too
> clever". I have "abused" the "else" clause of the loops to makes a break
> "broke" more loops
>
>
> for i in
On Fri, 28 Sep 2018 15:01:41 +0100, Chris Green wrote:
> Chris Green wrote:
>> Brian Oney wrote:
>> > Could you please try another tool like `convert'? E.g.
>> >
>> > $ convert 102_PANA/P1020466.JPG test.png
>> >
>> >
>> > What does that say?
>>
>> Well, after having returned home with the l
jlada...@itu.edu wrote:
> On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote:
>> I have a list created by:-
>>
>> fld = shlex.split(ln)
>>
>> It may contain 3, 4 or 5 entries according to data read into ln.
>> What's the neatest way of setting the fourth and fifth entries
Ben Finney wrote:
> Ben Finney writes:
>
>> You can use a comprehension, iterating over the full range of index you
>> want::
>>
>> words = shlex.split(line)
>> padding_length = 5
>> words_padded = [
>> (words[index] if index < len(words))
>> for index in range(paddin
Glen D souza wrote:
> fld = [ ]
> data = shlex.split(ln)
> for item in data:
>fld.append(item)
> fld = fld + [0] * (5 - len(data))
There's no need to make a copy of data, one item at the time.
It's a tedious way to build a new list, and you are throwing it away in the
next line anyway, a
Vinodhini Balusamy wrote:
> Hi,
>
> I tried using namedtuples and just found a behaviour which I am not able
> to conclude as correct behaviour.
>
> from collections import namedtuple
>
> (n, categories) = (int(input()), input().split())
> Grade = namedtuple('Grade', categories)
> Grade.ID = 1
Siva Sukumar Reddy wrote:
> I am really new to Python contribution community want to propose below
> methods for List object. Forgive me if this is not the format to send an
> email.
>
> 1. *list.replace( item_to_be_replaced, new_item )*: which replaces all the
> occurrences of an element in the
f...@lutix.org wrote:
> Hello everyone,
>
> I have 2 functions whose aim is to read a pdf file, the first one manages
> an uploaded file, the another one fecth a remote one (via an url). They
> are quite the same:
>
> def handle_uploaded_file(path,file):
> #if os.path
Stone Zhong wrote:
> Hi There,
>
> Now I want to make sure my code calls a function foo with an object t,
> however, foo.assert_called_once_with(t) does not work, since t is a model
> object and the code may load a different copy of t, so what I really want
> to test is "It calls foo with t where
Tobiah wrote:
> My IDE (pycharm) suggests that I mark my class methods
> with @staticmethod when they don't use 'self'. Sounds
> good. I did that then it suggested I had the option
> to make a regular function instead, at the file level.
> That's a possibility. I was thinking that I'd leave
> t
songbird wrote:
> MRAB wrote:
>> On 2018-11-02 19:58, songbird wrote:
>>>
>>>hello, :)
>>>
>> [snip]
>> In __init__ you initialise self.animation_initial_turn_it_off to True.
>>
>> Nowhere in your code do you change it, so it remains True.
>
> i wish it were that easy...
>
> see my_s
lampahome wrote:
> Above is I thought to make code clear, and this pattern is called simple
> factory?
This is a factory function:
> def get_class(obj):
> if obj == 'A1' or obj == 'A2':
> return A(obj)
> else:
> return B(obj)
The rest is just cruft ;)
>
> *Is there bet
NoHaxAllSwagg wrote:
> 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 a syntax error, in th
Grant Edwards wrote:
> On 2018-11-07, Peter Otten <__pete...@web.de> wrote:
>> lampahome wrote:
>>
>>> Above is I thought to make code clear, and this pattern is called simple
>>> factory?
>
> [...]
>
>>> *Is there better design pattern f
Cameron Simpson wrote:
> In Python 3 the loop is much cleaner:
>
> with open('namelist.txt', encoding='utf-8') as f:
> for line in f:
> line = line.strip()
> print("line =", line)
In Python 2.7 you can use io.open():
import io
with io.open('namelist.txt', encoding='utf-8') a
Sharan Basappa wrote:
> are there any requirements about the format of the CSV file when using
> read_csv from pandas? For example, is it necessary that the csv file has
> to have same number of columns in every line etc.
> ParserError: Error tokenizing data. C error: Expected 1 fields in line 8,
On Mon, 28 Mar 2016 14:10:28 -0700 (PDT), jenswaelk...@gmail.com wrote:
> I'm using the tkFileDialog-module in Python 2.7, it works fine except
> for one thing: when I add a title, the title isn't shown.
>
> e.g. I have this line of code:
> inputfilename=tkFileDialog.askopenfilename(defaultextensio
Steven D'Aprano wrote:
> http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/
I was about to post that in a few years' time C# will acquire enough
features to make code that follows the functional paradigm feasible in that
language.
Then I noted that this
Rustom Mody wrote:
> [How BTW did you folks go about unearth that groupindex?? Dont see it in
> [docs]
While it's there
https://docs.python.org/dev/library/re.html#re.regex.groupindex
my personal search algorithm for this category of questions is mostly "I saw
something like that before", then
Sven R. Kunze wrote:
> On 29.03.2016 12:18, Sven R. Kunze wrote:
>> On 29.03.2016 11:39, Peter Otten wrote:
>>> My question to those who know a bit of C#: what is the state-of-the-art
>>> equivalent to
>>>
>>> "\n".join(foo.descripti
Michael Selik wrote:
> I prefer itertools.chain.from_iterable to the sum trick.
>
from itertools import chain
lst = list('abc')
list(chain.from_iterable([s]*3 for s in lst))
> ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c']
If you want to make this completely lazy:
>>> from functoo
Poul Riis wrote:
> Den onsdag den 30. marts 2016 kl. 17.59.49 UTC+2 skrev Steven D'Aprano:
>> On Thu, 31 Mar 2016 02:23 am, Poul Riis wrote:
>>
>> > What I intend to do is to let sympy find the derivative of some
>> > welldefined function and next define the foundation derivative as a
>> > normal
Steven D'Aprano wrote:
> Sometimes people look for a method which is equivalent to dict.get, where
> they can set a default value for when the key isn't found:
>
>
> py> d = {1: 'a', 2: 'b'}
> py> d.get(999, '?')
> '?'
>
>
> The equivalent for sequences such as lists and tuples is a slice. If
Chris Angelico wrote:
> On Fri, Apr 1, 2016 at 1:55 AM, Peter Otten <__pete...@web.de> wrote:
>> Hm, the two functions fmsympy() and fm() do not return the same value:
>>
>> $ python -i sympy_diff.py
>> 1 evaluations with sympy : dt1 = 0.7178411483764648
&g
Vito De Tullio wrote:
> Michael Selik wrote:
>
>>> > I need to scan a list of strings. If one of the elements matches the
>>> > beginning of a search keyword, that element needs to snap to the front
>>> > of the list.
>>>
>>> I know this post regards the function passing, but, on you specific
>>>
On Sun, 3 Apr 2016 16:06:58 +0100, anthony uwaifo wrote:
[snip]
>
> class BankAccount(object):
> def __init__(self, balance):
> self.balance = balance
>
>
> def deposit(self, amount):
> self.amount=amount
> self.balance += amount
> return self.balance
>
>
> def withdraw(self,
DFS wrote:
> cntText = 60
> cntBool = 20
> cntNbrs = 30
> cntDate = 20
> cntBins = 20
>
> strText = " text: "
> strBool = " boolean: "
> strNbrs = " numeric: "
> strDate = " date-time:"
> strBins = " binary: "
>
> colCounts = [(cntText,strText) , (cntBool,strBool), (cntNbrs,strNbrs)
DFS wrote:
> On 4/3/2016 3:31 PM, Peter Otten wrote:
>>>>> from operator import itemgetter as get
>>>>> print "\n".join("{1} {0}".format(*p) for p in sorted(
>> ... sorted(colCounts, key=get(1)), key=get(0), reverse=True))
>
> K
Nagy László Zsolt wrote:
> If anyone is interested, a module was born:
>
> https://bitbucket.org/nagylzs/intervalset
> https://pypi.python.org/pypi/intervalset/0.1.1
>
> I have some unit tests, but testers and comments are welcome.
Why do you limit the intervals to datetime? Are there any assum
Robin Becker wrote:
> A user points out that this code in reportlab uses the now deprecated imp
> module
>
> def _fake_import(fn,name):
> if os.path.isfile(fn):
> import imp
> with open(fn,'rb') as f:
> imp.load_source(name,fn,f)
>
> and suggests I use importl
Random832 wrote:
> On Mon, Apr 4, 2016, at 02:56, Peter Otten wrote:
>> > That works well. Why is it 'cheating'?
>>
>> On second thought it isn't ;)
>
> It does require a numeric type, though. There are lots of types that are
> orderable but do
Gordon( Hotmail ) wrote:
Welcome!
> I am struggling to understand the basic principles of Python having spent
> many years as a pure Amateur tinkering with a variety of BASIC as you can
> see on my site at http://www.sigord.co.uk/ I think you will agree all
> such versions of Basic I have used
George Trojan - NOAA Federal wrote:
> Here is my test program:
>
> ''' generic test '''
>
> import functools
> import inspect
>
> def f():
> '''I am f'''
> pass
>
> g = functools.partial(f)
> g.__doc__ = '''I am g'''
> g.__name__ = 'g'
>
> def partial(func, *args, **keywords):
> d
Antoon Pardon wrote:
> Second tryal, I hope the formatting doesn't get messed up now
>
> Playing around with the collections and collections.abc modules in
> python3.4 I stumbled upon the following:
>
from collections.abc import Sequence
from collections import deque
isinstance(li
Antoon Pardon wrote:
> Op 07-04-16 om 11:12 schreef Peter Otten:
>>
>>>>> from collections import deque
>>>>> from collections.abc import Sequence
>>>>> [name for name in set(dir(Sequence)) - set(dir(deque)) if not
>> name.startswith(&qu
Daiyue Weng wrote:
> Hi, when I read a file, the file string contains Mojibake chars at the
> beginning, the code is like,
>
> file_str = open(file_path, 'r', encoding='utf-8').read()
> print(repr(open(file_path, 'r', encoding='utf-8').read())
>
> part of the string (been printing) containing Mo
On Thu, 07 Apr 2016 11:37:50 +1000, Steven D'Aprano wrote:
> On Thu, 7 Apr 2016 05:56 am, Thomas 'PointedEars' Lahn wrote:
>> Rustom Mody wrote:
>
>>> So here are some examples to illustrate what I am saying:
>>>
>>> Example 1 -- Ligatures:
>>>
>>> Python3 gets it right
>> flag = 1
>> flag
Joaquin Alzola wrote:
> Hi People
>
> I need to covert this string:
>
> hello there
> this is a test
>
> (also \n important)
>
> To this Unicode:
>
00680065006c006c006f0020002000740068006500720065000a00740068006900730020006900730020006100200074006500730074000a
> Without the \u and space.
>
On Fri, 08 Apr 2016 16:00:10 +1000, Steven D'Aprano wrote:
> On Fri, 8 Apr 2016 02:51 am, Peter Pearson wrote:
>>
>> The Unicode consortium was certifiably insane when it went into the
>> typesetting business.
>
> They are not, and never have been, in t
On Sat, 9 Apr 2016 03:50:16 +1000, Chris Angelico wrote:
> On Sat, Apr 9, 2016 at 3:44 AM, Marko Rauhamaa wrote:
[snip]
>> (As for ligatures, I understand that there might be quite a bit of
>> legacy software that dedicated code points and code pages for ligatures.
>> Translating that legacy soft
gvim wrote:
> Given that this work in a Python 3 repl:
>
import re
txt = "Some random text"
if re.search(r"\b\w{4}\b", txt): txt
'Some random text'
>
> and this works on the command line, printing all lines in logs.txt:
>
> $ python3 -m oneliner -ne 'line' logs.txt
>
>
gesh...@gmail.com wrote:
> how to write a function taking a string parameter, which returns it after
> you delete the spaces, punctuation marks, accented characters in python ?
Looks like you want to remove more characters than you want to keep. In this
case I'd decide what characters too keep f
Diego Lelis wrote:
> Hi guys, im having a little problem to make the StringVar Linked to my
> OnScreen Keyboard Change when the user click in one Entry.
>
> Here's my code:
> from tkinter import *
>
> Begin
> Code___
>
> def frame(
Thomas 'PointedEars' Lahn wrote:
> Peter Otten wrote:
>
>> gesh...@gmail.com wrote:
>>> how to write a function taking a string parameter, which returns it
>>> after you delete the spaces, punctuation marks, accented characters in
>>> python ?
>
Daiyue Weng wrote:
> Hi, I need to compare the years in a Series. The values in the Series is
> like '1996', '2015', '2006-01-02' or '20130101' etc. The code I created
> is,
>
> col_value_series = pd.to_datetime(col_value_series,
> infer_datetime_format=True) min_year = col_value_series.min().yea
martin.spic...@gmail.com wrote:
> Hi,
>
> there may be a serious error in python's int() function:
>
> print int(float(2.8/0.1))
>
> yields
>
> 27
>
> instead of 28!!
>
> I am using Python Python 2.7.6, GCC 4.8.2 on Linux Ubuntu.
>
> Is that known?
Yes. C has the same error as has every ot
alister wrote:
> On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote:
>
>> I have a doubt regarding a problem.
>>
> No, you have a question doubt means you don't believe something
> (sorry I know this is not an English language lesson)
"doubt" is commonly used that way in Indian English, see
Robin Becker wrote:
> Does anyone know if sum does anything special to try and improve accuracy?
> My simple tests seem to show it is exactly equivalent to a for loop
> summation.
If you are worried about accuracy and your values are floating point numbers
use math.fsum():
"""
fsum(...)
fsu
Paulo da Silva wrote:
> Às 21:10 de 13-04-2016, Paulo da Silva escreveu:
>> Hi all.
> ...
>
>> [6 rows x 4 columns]
>>
>>> dft=pd.DataFrame([[1,2,3,4]],
>> index=[datetime.date(2016,1,12)],columns=df.columns)
>>
>>> dft
>> A B C D
>> 2016-01-12 1 2 3 4
>>
>> [1 rows x 4 colu
ast wrote:
>
> a écrit dans le message de
> news:52f7516c-8601-4252-ab16-bc30c59c8...@googlegroups.com...
>> Hi,
>>
>> there may be a serious error in python's int() function:
>>
>> print int(float(2.8/0.1))
>>
>> yields
>>
>> 27
>>
>> instead of 28!!
>>
>> I am using Python Python 2.7.6, GCC 4.
durgadevi1 wrote:
>
>>
>> This looks clearer:
>>
>>>>> code = b'a0\xed\xf0Z\x15]g^\xce3x'
>>>>> key = b')U\x81\x9c55*\x08,\xa2WY'
>>>>> bytes(c ^ k for c, k in zip(code, key)).decode()
>>'Hello world!'
>>
>>
>> Marko
>
> Hi, I have gotten another error message when working wi
Rustom Mody wrote:
> I have a doubt:
> Is it incorrect to correct someone when they are incorrect?
No doubt about it. Everyone's a winner...
> [Sprinkle a "politically" on the above to taste ]
Ah, contradictio in adiecto. That shifts it to definitely maybe.
--
https://mail.python.org/mailman
1401 - 1500 of 9252 matches
Mail list logo