|
by: Jonathan |
last post by:
I'm puzzled by Python's behavior when binding local variables which
are introduced within exec() or execfile() statements. First, consider
this simple Python program:
# main.py
def f() :
x = 1
print "x:", x
f()
|
by: Brian Jones |
last post by:
I'm sure the solution may be obvious, but this problem is driving me
mad. The following is my code:
class a(object):
mastervar =
def __init__(self):
print 'called a'
|
by: bwobbones |
last post by:
Hi,
I'm having trouble making __import__ work with the two classes
attached. The PrintHello() method can't be seen in the BMTest2 class -
what am I doing wrong here?
****************************
class one - BMTest - in BMTest.py:
****************************
import wx
|
by: Brano Zarnovican |
last post by:
Hi !
I have a python script represented by a string.
I need to execute it in a context. 'exec' does
the job, but doesn't display the filename in
tracebacks. 'execfile' is displaying the filename
but it can only exec a script in a filesystem.
I have tried:
- to give exec a filename, like:
|
by: digitalorganics |
last post by:
What's the difference between initializing class variables within the
class definition directly versus initializing them within the class's
__init__ method? Is there a reason, perhaps in certain situations, to
choose one over the other?
Thank you.
|
|
by: Mitko Haralanov |
last post by:
Hi all,
I am going to do my best to describe the issue that I am having and
hopefully someone can shed some light on it:
I have three modules that a comprising the problem:
../core.py
../log.py
../resources/simple/__init__.py
|
by: Dave Westerman |
last post by:
I've got a Jython script where I'm doing an execfile() to pull in a
small script that contains a function, which I then call.
execfile(app_applscript)
optionList = createOptionList(applOptions)
When I do this at the global level in my main script, it works just
fine. However, when I move this code into a function in my main script,
then...
|
by: George Sakkis |
last post by:
I maintain a few configuration files in Python syntax (mainly nested
dicts of ints and strings) and use execfile() to read them back to
Python. This has been working great; it combines the convenience of
pickle with the readability of Python. So far each configuration is
contained in a single standalone file; different configurations are...
|
by: Igor Kaplan |
last post by:
Hello python gurus.
I got quite unusual problem and all my searches to find the answer on my
own were not successful.
Here is the scenario:
I have the python program, let's call it script1.py, this program needs to
execute another python script, let's call it script2.py.
In script1.py I have the statement:
execfile('script2.py')...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|