Hi all.
I try to make the python script with the macro.
As you know, the funtion of macro manager can record the every acticvity in python script. But this script work on the macro manager only. I want to make this script work on the run script menu.
The error message was done when I try to run the macro script.
Message says "C:/Temp/abaqusMacros.py:56: SyntaxWarning: import * only allowed at module level
def analzer2():
C:/Temp/abaqusMacros.py:56: SyntaxWarning: import * only allowed at module level
def analzer2():"
Following codes are the macro script what I try to transfer.
Plz help me. -
# Do not delete the following import lines
-
from abaqus import *
-
from abaqusConstants import *
-
import __main__
-
-
def analyzer():
-
import section
-
import regionToolset
-
import displayGroupMdbToolset as dgm
-
import part
-
import material
-
import assembly
-
import step
-
import interaction
-
import load
-
import mesh
-
import job
-
import sketch
-
import visualization
-
import xyPlot
-
import displayGroupOdbToolset as dgo
-
import connectorBehavior
-
o1 = session.openOdb(name='C:/Temp/1.odb')
-
session.viewports['Viewport: 1'].setValues(displayedObject=o1)
-
import sys
-
sys.path.insert(11, r'C:\SIMULIA\Abaqus\6.10-1\abaqus_plugins\reportGenerator')
-
from abaqus import *
-
from abaqusConstants import *
-
import form
-
import reportGenerator
-
report=reportGenerator.ReportGenerator()
-
report.setValues('C:/Temp/1.odb', interactionAdditionalFigure=r"(, , )",
-
logo=r"*.gif", styleSheet=r"*.css", includeXYData=1,
-
outputVariableList=r"(, , , , )", outputVariableView=r"(, , , , )",
-
resultsXYData=r"(, , , , )", resultsAdditionalFigure=r"(, , , , )",
-
userName=r"", includeUsername=1, includeTOC=1, includeLoadData=1,
-
includeResultsData=1, includeStepData=1, imageStyle=r"INLINE",
-
includeInteractionData=1, includePartData=1, includeJobData=1,
-
includeAssemblyData=1, includeMaterialData=1, outputDir=r"C:\Temp",
-
reportTitle=r"Report Generated by 'Abaqus Report Generator'",
-
instanceFigureTop=1, instanceFigureBottom=0, instanceFigureUser2=0,
-
instanceFigureUser1=0, instanceFigureUser3=0, instanceFigureFront=1,
-
instanceThreeDXML=1, imageTogether=r"TOGETHER", instanceFigureIso=1,
-
instanceFigureLeft=0, instanceFigureRight=0,
-
instanceList=r"(ALL, , , , )", instanceFigureUser4=0,
-
includeInstanceTable=1, instanceAdditionalFigure=r"(, , , , )",
-
materialFigureBottom=0, materialFigureFront=1, materialFigureUser1=0,
-
materialFigureUser3=0, materialFigureUser2=0, materialFigureRight=0,
-
materialFigureTop=1, materialFigureUser4=0, materialFigureIso=1,
-
includeMaterialDetails=1, materialThreeDXML=1,
-
materialAdditionalFigure=r"(, , )", includeMaterialTable=1,
-
materialFigureLeft=0, loadAdditionalFigure=r"(, , )", )
-
report.processRequest()
1 5306 bvdet 2,851
Expert Mod 2GB
As the error message indicates, "import *" is only allowed at the module level (outside of the function scope). Better yet, put all your imports at the top of the file just after module comments and doc strings. See Python PEP 8.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andrew Chalk |
last post by:
Is this possible? In my CGI app. I display a web page with a link (anchor).
When the link is clicked I want to exectute a python script rather than go
to an HTML page.
Many thanks.
|
by: Giraud, Sebastien |
last post by:
Ok I was still looking for a 'make like' software and found one : MacMillan
Entreprise
Just work fine even if it's not easy to handle it...
-----Message d'origine-----
De :...
|
by: Arun |
last post by:
Hi,
This is a scripting question, but since I am writing the script in
python I am posting this question here:
I have a python script that runs a simulator (that was written in c++,
so I use...
|
by: Lowell Kirsh |
last post by:
I have a script which I use to find all duplicates of files within a
given directory and all its subdirectories. It seems like it's longer
than it needs to be but I can't figure out how to shorten...
|
by: Harlin Seritt |
last post by:
I have a remote linux server where I can only access it via ssh. I have
a script that I need to have run all the time. I run like so:
python script.py &
It runs fine. When I log off ssh I...
|
by: olaufr |
last post by:
Hi,
I need to call a python script, with command line arguments (it is an
autonomous script with a __main__), from within another python script.
Can I use exec() or execfile() for this? How to...
|
by: hlubenow |
last post by:
Hi,
recently there was a thread about hiding the python-script from the user.
The OP could use
http://freshmeat.net/projects/pyobfuscate/
H.
|
by: michael.buonomo |
last post by:
We have been using the Google recommended python script for about a
year. We recently realized that the script was not crawling our sites
url's, but just our folders which reside on the server. The...
|
by: Jorgen Bodde |
last post by:
Hi all,
This is slightly OT but it drives me nuts. Whenever I create a
shortcut in the start menu (in Windows) of a python script, it will
only execute it when the path where the script resides...
|
by: asdf |
last post by:
I have a python script whose output i want to dynamically display
on a webpage which will be hosted using Apache. How do I do that?
thanks
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |