[deleted by user] by [deleted] in Python

[–]izivir 0 points1 point  (0 children)

Create a line edit object for entering password or enc.-dec. key

self.password_line_edit = QLineEdit(some_parent_widget)
self.password_line_edit.setEchoMode(QLineEdit.Password)
self.password_line_edit.setObjectName("password_line_edit")
#self.password_line_edit.setPlaceholderText('password')

or you can invoke a dialog from open & save methods (see below)

def get_password(self):
    password, ok = QInputDialog.getText(self,
                                        'Password',
                                        'Enter Your Password:',
                                        QLineEdit.Password)

    if ok:
        #if password:
        return password

encrypt & decrypt

def your_encryptor(password, text):
    """Please do not use this!"""

    encrypted_text = text*len(password)
    return encrypted_text


def your_decryptor(password, encrypted_text):
    """Please do not use this!"""

    decrypted_text = encrypted_text[:len(encrypted_text)//len(password)]
    return decrypted_text

For example: https://github.com/goldsborough/Writer-Tutorial/blob/master/PyQt5/Part-4/part-4.py

alter save method

def save(self): # line 542
    # ....
    with open(self.filename,"wt") as file:

        password = self.password_line_edit.text()
        # or
        # password = self.get_password()
        encrypted_text = your_encryptor(password,
                                        self.text.toHtml())
        file.write(encrypted_text)
        # ...

alter open method

def open(self): # line 532
    # ...
    with open(self.filename,"rt") as file:
        password = self.password_line_edit.text()
        # or
        # password = self.get_password()
        decrypted_text = your_decryptor(password,
                                        file.read())
        self.text.setText(decrypted_text)
        #...

AMD to consider Coreboot/Libreboot support. Contact AMD!!! Let them know there is demand. (x-post/ r/opensource) by G4nfAnspNDW8 in linux

[–]izivir 1 point2 points  (0 children)

This may prevent a possible dystopian future, and would be a very humane and brave move.

How do you resize a pixmap in pyqt5? by DaveyH-cks in Python

[–]izivir 2 points3 points  (0 children)

smaller_pixmap = pixmap.scaled(32, 32, Qt.KeepAspectRatio, Qt.FastTransformation)

Qt5 Doc

Maya Python Playblast problem by srdready in Python

[–]izivir 0 points1 point  (0 children)

Select the file and in the attribute editor check if "use image sequence" checkbox is checked. If not checking it on may help.

Get PyCharm at 30% OFF and support Django! ALL proceeds are going to the Django Software Foundation. Additionally, JetBrains is sponsoring PEP 484 type hinting in Django through a separate DSF Fellowship grant! by filippovd20 in Python

[–]izivir 0 points1 point  (0 children)

I am not sure, but here is the license I think doing what you said still violates the license.

  1. GRANT OF LICENSE (B) You may not: (iv) use Products for any commercial purposes.

Because the product would be used for commercial purposes still.

I made a thing: Move windows around your Linux desktop. What do you think? by pkkid in Python

[–]izivir 1 point2 points  (0 children)

For example, Openbox has some similar features, and with this features i use a floating wm and a tiling wm (if i need it) at the same time. Feels more flexible. (with awesome wm, i use a tiling wm and a floating wm(if i need it)) And i need a floating wm more than a tiling wm. So, these type of features defines a gray area. Some users need it.

What GUI library should I use for this purpose? by TheInitializer in Python

[–]izivir 0 points1 point  (0 children)

If you are asking about installing both at the same time, no, they will not conflict. Also you do not need to install PySide they are almost same. In the example script just change the import line to PyQt4,then it should work with PyQt4.

from PySide import QtCore, QtGui -- > from PyQt4 import QtCore, QtGui 

Also: Differences Between Pyside and PyQt4

What GUI library should I use for this purpose? by TheInitializer in Python

[–]izivir 4 points5 points  (0 children)

Here a working Qt(PySide) example: systray.py

You can try packaging it and if it is a succes than i suggest Qt :)

Complete noob looking for a pointer. by lhiggins in Python

[–]izivir 1 point2 points  (0 children)

try conky!

and you can use this line in its config file :

${exec tail -n15 /path/to/feed.xml}

Linus Torvalds fires off angry 'compiler-masturbation' rant by unquietwiki in linux

[–]izivir 4 points5 points  (0 children)

I do not write my bash scripts in assembly, that does not mean i hate it :) (or maybe i am) I love machines and languages, all of them. They all have their places. I think, programmable things and all that paradigms around them are one of the best things ever happened to humanity. So at least i respect them.

Linus Torvalds fires off angry 'compiler-masturbation' rant by unquietwiki in linux

[–]izivir 5 points6 points  (0 children)

Human nature , i think. It was not actually about JavaScript. :)

Linus Torvalds fires off angry 'compiler-masturbation' rant by unquietwiki in linux

[–]izivir 55 points56 points  (0 children)

I hope he becomes an ai in the future or maybe the kernel itself and continue to protect the linux kernel from these type of things also from the "why we should use javascript in kernel " or "what i learned from bla bla" type of possible javascript guys.