Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

python

How to execute a Python script from the Django shell?

August 19, 2022 by Magenaut

I need to execute a Python script from the Django shell. I tried:

Categories Python, Q&A Tags django, django-shell, python Leave a comment

Python find elements in one list that are not in the other

August 19, 2022 by Magenaut

I need to compare two lists in order to create a new list of specific elements found in one list but not in the other. For example: main_list=[] list_1=["a", "b", "c", "d", "e"] list_2=["a", "f", "c", "m"] I want to loop through list_1 and append to main_list all the elements from list_2 that are not … Read more

Categories Python, Q&A Tags list, python Leave a comment

SQLAlchemy: print the actual query

August 19, 2022 by Magenaut

I’d really like to be able to print out valid SQL for my application, including values, rather than bind parameters, but it’s not obvious how to do this in SQLAlchemy (by design, I’m fairly sure).

Categories Python, Q&A Tags python, sqlalchemy Leave a comment

What is the perfect counterpart in Python for “while not EOF”

August 19, 2022 by Magenaut

To read some text file, in C or Pascal, I always use the following snippets to read the data until EOF:

Categories Python, Q&A Tags eof, file, iteration, python Leave a comment

Common xlabel/ylabel for matplotlib subplots

August 19, 2022 by Magenaut

I have the following plot:

Categories Python, Q&A Tags matplotlib, python Leave a comment

Implement touch using Python?

August 19, 2022 by Magenaut

touch is a Unix utility that sets the modification and access times of files to the current time of day. If the file doesn’t exist, it is created with default permissions.

Categories Python, Q&A Tags python, utility Leave a comment

What makes sets faster than lists?

August 19, 2022 by Magenaut

The python wiki says: “Membership testing with sets and dictionaries is much faster, O(1), than searching sequences, O(n). When testing “a in b”, b should be a set or dictionary instead of a list or tuple.”

Categories Python, Q&A Tags list, python, set Leave a comment

Possible to share in-memory data between 2 separate processes?

August 19, 2022 by Magenaut

I have an xmlrpc server using Twisted. The server has a huge amount of data stored in-memory. Is it possible to have a secondary, separate xmlrpc server running which can access the object in-memory in the first server?

Categories Python, Q&A Tags python Leave a comment

Can’t import my own modules in Python

August 19, 2022 by Magenaut

I’m having a hard time understanding how module importing works in Python (I’ve never done it in any other language before either).

Categories Python, Q&A Tags import, module, package, python Leave a comment

Regex matching 5-digit substrings not enclosed with digits

August 19, 2022 by Magenaut

I want to extract 5 continuous digits from the string

Categories Python, Q&A Tags python, regex Leave a comment
Older posts
Newer posts
← Previous Page1 … Page287 Page288 Page289 … Page830 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress