Skip to content

Tag: python

Ignoring library.zip in py2exe

I need to have an executable file (.exe) which takes some parameters from a file which can be configured by the user depending on his/her need. Since i have created scripts in python, i have used py2exe to create that executable. Though i could place a configurable file called settings.dat as data file and us…

Issue with virtualenv – cannot activate

I created a virtualenv around my project, but when I try to activate it I cannot. It might just be syntax or folder location, but I am stumped right now. You can see below, I create the virtualenv and call it venv. Everything looks good, then I try to activate it by running source venv/bin/activate I’m …

How to access the keys or values of Python GDB Value

I have a struct in GDB and want to run a script which examines this struct. In Python GDB you can easily access the struct via Now I got this variable called mystruct which is a GDB.Value object. And I can access all the members of the struct by simply using this object as a dictionary (likemystruct[‘me…

Python : clear a log file

I develop a client-server application and I have log in the server, so I use the logging module. I would like to create a command in the server to clear the file. I have test with os.remove() but after, the log doesn’t work. Do you have an idea? Thanks. Answer It might be better to truncate the file ins…