I try to run selenium with firefox on RasberyPi3 ARM7 , any idea if it possible?

2018-09-09 Thread alon . najman
I try to run selenium with firefox on RasberyPi3 ARM7 , any idea if it possible?

what should I do?
I don't mind to change to another driver
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: "glob.glob('weirdness')" Any thoughts?

2018-09-09 Thread Thomas Jollans

On 09/09/2018 02:20 PM, Gilmeh Serda wrote:


# Python 3.6.1/Linux
(acts the same in Python 2.7.3 also, by the way)


from glob import glob



glob('./Testfile *')

['./Testfile [comment] some text.txt']


glob('./Testfile [comment]*')

[]


glob('./Testfile [comment? some text.*')

['./Testfile [comment] some text.txt']


glob('./Testfile [comment[]*')

['./Testfile [comment] some text.txt']


glob('./Testfile [comment[] some text.*')

[]

Testing:


fnmatch.translate('./Testfile [comment] some text.*')

'(?s:\\.\\/Testfile\\ [comment]\\ some\\ text\\..*)\\Z'


fnmatch.translate('./Testfile [comment? some text.*')

'(?s:\\.\\/Testfile\\ \\[comment.\\ some\\ text\\..*)\\Z'

It seems it translates [comments] as a set of valid characters to look
for and doesn't care about the [] characters, which is what breaks it, I
assume.

? translates into RegEx .
* translates into RegEx .*

And escaping doesn't work either, because:


https://docs.python.org/3/library/glob.html#glob.escape demonstrates a 
way of escaping that works:


glob('./Testfile [[]comment]*')




fnmatch.translate('./Testfile [comment\] some text.*')

'(?s:\\.\\/Testfile\\ [comment]\\ some\\ text\\..*)\\Z'

...the \ is replaced with \\ which breaks the pattern since it is no
longer a real escape character but an escaped escape character, if that
makes sense.

When the file name has a non working RegEx set, e.g., './Testfile
comment]*' it works.

Yes, easy to say "don't write that into file names," but I don't make the
rules.

I guess I have to write my own.

Oh, well...



--
https://mail.python.org/mailman/listinfo/python-list


Re: Object-oriented philosophy

2018-09-09 Thread Gene Heskett
On Sunday 09 September 2018 08:19:52 Gilmeh Serda wrote:

> On Thu, 06 Sep 2018 18:07:55 +0200, Thomas Jollans wrote:
> >> Also, get someone, preferrable a python engineer to review your
> >> code.
> >
> > Does anyone here know anyone who would refer to themselves as a
> > "Python engineer" with a straight face? I merely ask...
>
> We're all tinker bells.
>
> --
> Gilmeh

And some of us are just senior citizen tinkerers, like me :) I lurk here, 
hoping some of it will rub into me.


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Object-oriented philosophy

2018-09-09 Thread Amirouche Boubekki
Le jeu. 6 sept. 2018 à 16:05, Michael F. Stemper
 a écrit :
>
> How does one judge when it's worthwhile to do this and when it's
> not? What criteria would somebody seasoned in OO and python use
> to say "good idea" vs "don't waste your time"?
>

I may qualify as experienced with Python, that being said, "to class
or not to class?" is still an open question.
I have been working on some stuff using Scheme and no OO machinery and
it worked well. Also, mocked
some stuff in the frontend using a purely functional approach. It works.

So, I am wondering what's the purpose of OOP?

Class-based error handling with exception and inheritance is very
handy maybe perfect.

I have been burned by Django class everywhere (ORM, REST, admin UI,
data validation, etc?).

Another place where class shines is when you have the same interface
for different objects.
Like others have said, it's more "duck typing" than OOP. Again
following the "common interface"
an abstract class is helpful and in this case, inheritance makes
sense. But that doesn't require
more that one or two level deep inheritance.

So, in the end, I think that except for error handling and the
subject.verb(**complements) syntax. OOP is dubious.

Multiple inheritances outside mixin anyone? Metaclass outside ORM / ODM?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Object-oriented philosophy

2018-09-09 Thread Abdur-Rahmaan Janhangeer
 just see who a company employ as a py eng, ask him.

Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
Mauritius


>
> Does anyone here know anyone who would refer to themselves as a "Python
> engineer" with a straight face? I merely ask...
>
> -- Thomas
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: perplexing error

2018-09-09 Thread Sharan Basappa
On Sunday, 9 September 2018 00:02:49 UTC+5:30, Peter Otten  wrote:
> Sharan Basappa wrote:
> 
> > I am running a small python code. The main module calls another data
> > loader module. I keep this getting this error.
> > 
> > AttributeError: 'str' object has no attribute 'raw_data'
> > 
> > I tried few things in the code and finally realized that no matter the
> > line number is 68 of data loader module. Of course, this was after a few
> > iterations. I then commented this line itself but I still get this error.
> > 
> > Below is a little longer code snippet.
> > 
> > AttributeErrorTraceback (most recent call last)
> > D:\Projects\Initiatives\machine learning\Log analyzer\log_analyzer.py in
> > ()
> >  32 model = para['models']
> >  33 assert model in ['DT', 'LR', 'SVM']
> > ---> 34 raw_data, event_mapping_data =
> > data_loader.bgl_data_loader(para)
> >  35
> >  36 logger.debug("raw data %s \n", raw_data)
> > D:\Projects\Initiatives\machine
> > learning\loglizer-master\loglizer-master\utils\data_loader.py in
> > bgl_data_loader(para)
> >  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")
> >  70 raw_data = data_df[['label','seconds_since']].as_matrix()
> > AttributeError: 'str' object has no attribute 'raw_data'
> > 
> > If you notice, line 68 is commented.
> > I am not sure what I am doing wrong.
> > 
> > Need some inputs ...
> 
> The source code in the traceback is read from the file when the exception is 
> raised. If 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
> >>> import tmp
> >>> with open("tmp.py", "w") as f: f.write("def f():\n return 1/2\n")
> ... 
> 21
> >>> tmp.f()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/peter/tmp.py", line 2, in f
> return 1/2
> ZeroDivisionError: division by zero
> 
> Therefore you must ensure that the interpreter is restarted after changing 
> the source code. This may include restarting a server or an editor.

Understood. Now I know why the error is stuck on that line.
This gives me a clue.
-- 
https://mail.python.org/mailman/listinfo/python-list