Skip to content
Advertisement

Tag: python

Porting my PyGtk 3 app to Win32

I recently made my first app with pygtk using Anjuta. It works well under Linux, so it’s time to share it with relatives and friends. I installed Python, pygtk and the Gtk all-in-one bundle (Cairo, pyGobject ect) on windows and tried to run it. I had an error saying self.builder.add_from_file(UI_FILE) Digging a bit in the code I found out that

Python: Print next x lines from text file when hitting string

The situation is as follows: I have a .txt file with results of several nslookups. I want to loop tru the file and everytime it hits the string “Non-authoritative answer:” the scripts has to print the following 8 lines from that position. If it works I shoud get all the positive results in my screen :). First I had the

google-charts not getting displayed on the server

My code: On running my app (created in Django) on the server this chart is not getting displayed, why? This page is “results.html” which is directed from my views.py file. Here “list1” contains the data stored in the table namely “file_name” and “frequency_count”. Why is this happening? I’m new to Django, google-charts and JavaScript. Answer You may have a problem

Basic Python Hello World Program Syntax Error [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 year ago. Improve this question

Can Python select what network adapter when opening a socket?

The target machine running the python application will have three network interfaces available to it. In general all three networks will be vastly different, however there is a possibility that two of the three could be on similar networks. In the example below I do not have control over the destination address on ETH 2 (as it a pre-configured system),

Determine Device of Filesystem in Python

How do you use Python to determine which Linux device/partition contains a given filesystem? e.g. Answer It is not the purdiest, but this will get you started: On OS X: On Ubuntu: To get the device name, chop off the minor number from the partition name. On OS X, also chop the ‘s’ + minor number.

Wait until a certain process (knowing the “pid”) end

I have this: Then i do this: I think this is not the best way to wait for the process to terminate, there must be some function wait or something, but i can’t find it. Disclaimer: The process is not a child process Answer I’m not really a Python programmer, but apparently Python does have os.waitpid(). That should consume less

Advertisement