@@ -1326,6 +1326,13 @@ def _create_batch_scripts_initial(self):
1326
1326
r"""@echo off
1327
1327
call "%~dp0env.bat"
1328
1328
set WINPYWORKDIR=%~dp0..\Notebooks
1329
+
1330
+ set WINPYWORKDIR1=%~dp1
1331
+ if "%WINPYWORKDIR1%"=="" (
1332
+ if not "%CD%\"=="%~dp0" set WINPYWORKDIR1=%CD%
1333
+ )
1334
+ if "%WINPYWORKDIR1%"=="" set WINPYWORKDIR1=%WINPYWORKDIR%
1335
+
1329
1336
FOR /F "delims=" %%i IN ('cscript /nologo "%~dp0WinpythonIni.vbs"') DO set winpythontoexec=%%i
1330
1337
%winpythontoexec%set winpythontoexec=
1331
1338
@@ -1549,14 +1556,14 @@ def _create_batch_scripts(self):
1549
1556
self .create_batch_script (
1550
1557
'cmd.bat' ,
1551
1558
r"""@echo off
1552
- call "%~dp0env_for_icons.bat"
1559
+ call "%~dp0env_for_icons.bat" %*
1553
1560
cmd.exe /k""" ,
1554
1561
)
1555
1562
1556
1563
self .create_batch_script (
1557
1564
'python.bat' ,
1558
1565
r"""@echo off
1559
- call "%~dp0env_for_icons.bat"
1566
+ call "%~dp0env_for_icons.bat" %*
1560
1567
rem backward compatibility for python command-line users
1561
1568
"%WINPYDIR%\python.exe" %*
1562
1569
""" ,
@@ -1565,8 +1572,8 @@ def _create_batch_scripts(self):
1565
1572
self .create_batch_script (
1566
1573
'winpython.bat' ,
1567
1574
r"""@echo off
1568
- call "%~dp0env_for_icons.bat"
1569
- cd/D "%WINPYWORKDIR %"
1575
+ call "%~dp0env_for_icons.bat" %*
1576
+ cd/D "%WINPYWORKDIR1 %"
1570
1577
rem backward compatibility for non-ptpython users
1571
1578
if exist "%WINPYDIR%\scripts\ptpython.exe" (
1572
1579
"%WINPYDIR%\scripts\ptpython.exe" %*
@@ -1579,7 +1586,7 @@ def _create_batch_scripts(self):
1579
1586
self .create_batch_script (
1580
1587
'idlex.bat' ,
1581
1588
r"""@echo off
1582
- call "%~dp0env_for_icons.bat"
1589
+ call "%~dp0env_for_icons.bat" %*
1583
1590
rem backward compatibility for non-IDLEX users
1584
1591
if exist "%WINPYDIR%\scripts\idlex.pyw" (
1585
1592
"%WINPYDIR%\python.exe" "%WINPYDIR%\scripts\idlex.pyw" %*
@@ -1592,16 +1599,17 @@ def _create_batch_scripts(self):
1592
1599
self .create_batch_script (
1593
1600
'idle.bat' ,
1594
1601
r"""@echo off
1595
- call "%~dp0env_for_icons.bat"
1602
+ call "%~dp0env_for_icons.bat" %*
1596
1603
"%WINPYDIR%\python.exe" "%WINPYDIR%\Lib\idlelib\idle.pyw" %*
1597
1604
1598
1605
""" ,
1599
1606
)
1600
1607
self .create_batch_script (
1601
1608
'winidlex.bat' ,
1602
1609
r"""@echo off
1603
- call "%~dp0env_for_icons.bat"
1604
- cd/D "%WINPYWORKDIR%"
1610
+
1611
+ call "%~dp0env_for_icons.bat" %*
1612
+ cd/D "%WINPYWORKDIR1%"
1605
1613
rem backward compatibility for non-IDLEX users
1606
1614
if exist "%WINPYDIR%\scripts\idlex.pyw" (
1607
1615
"%WINPYDIR%\python.exe" "%WINPYDIR%\scripts\idlex.pyw" %*
@@ -1613,42 +1621,41 @@ def _create_batch_scripts(self):
1613
1621
self .create_batch_script (
1614
1622
'winidle.bat' ,
1615
1623
r"""@echo off
1616
- call "%~dp0env_for_icons.bat"
1617
- cd/D "%WINPYWORKDIR %"
1624
+ call "%~dp0env_for_icons.bat" %*
1625
+ cd/D "%WINPYWORKDIR1 %"
1618
1626
"%WINPYDIR%\python.exe" "%WINPYDIR%\Lib\idlelib\idle.pyw" %*
1619
1627
""" ,
1620
1628
)
1621
1629
1622
1630
self .create_batch_script (
1623
1631
'spyder.bat' ,
1624
1632
r"""@echo off
1625
- call "%~dp0env_for_icons.bat"
1626
- cd/D "%WINPYWORKDIR%"
1633
+ call "%~dp0env_for_icons.bat" %*
1634
+ rem cd/D "%WINPYWORKDIR%"
1627
1635
if exist "%WINPYDIR%\scripts\spyder3.exe" (
1628
- "%WINPYDIR%\scripts\spyder3.exe" %*
1636
+ "%WINPYDIR%\scripts\spyder3.exe" %* -w "%WINPYWORKDIR1%"
1629
1637
) else (
1630
- "%WINPYDIR%\scripts\spyder.exe" %*
1631
- )
1638
+ "%WINPYDIR%\scripts\spyder.exe" %* -w "%WINPYWORKDIR1%"
1639
+ )
1632
1640
""" ,
1633
1641
)
1634
1642
self .create_batch_script (
1635
1643
'winspyder.bat' ,
1636
1644
r"""@echo off
1637
- call "%~dp0env_for_icons.bat"
1638
- cd/D "%WINPYWORKDIR%"
1645
+ call "%~dp0env_for_icons.bat" %*
1646
+ rem cd/D "%WINPYWORKDIR%"
1639
1647
if exist "%WINPYDIR%\scripts\spyder3.exe" (
1640
- "%WINPYDIR%\scripts\spyder3.exe" %*
1648
+ "%WINPYDIR%\scripts\spyder3.exe" %* -w "%WINPYWORKDIR1%"
1641
1649
) else (
1642
- "%WINPYDIR%\scripts\spyder.exe" %*
1643
- )
1650
+ "%WINPYDIR%\scripts\spyder.exe" %* -w "%WINPYWORKDIR1%"
1644
1651
""" ,
1645
1652
)
1646
1653
1647
1654
self .create_batch_script (
1648
1655
'spyder_reset.bat' ,
1649
1656
r"""@echo off
1650
- call "%~dp0env_for_icons.bat"
1651
- cd/D "%WINPYWORKDIR %"
1657
+ call "%~dp0env_for_icons.bat" %*
1658
+ cd/D "%WINPYWORKDIR1 %"
1652
1659
if exist "%WINPYDIR%\scripts\spyder3.exe" (
1653
1660
"%WINPYDIR%\scripts\spyder3.exe" --reset %*
1654
1661
) else (
@@ -1660,53 +1667,53 @@ def _create_batch_scripts(self):
1660
1667
self .create_batch_script (
1661
1668
'ipython_notebook.bat' ,
1662
1669
r"""@echo off
1663
- call "%~dp0env_for_icons.bat"
1664
- cd/D "%WINPYWORKDIR %"
1670
+ call "%~dp0env_for_icons.bat" %*
1671
+ cd/D "%WINPYWORKDIR1 %"
1665
1672
"%WINPYDIR%\scripts\jupyter-notebook.exe" %*
1666
1673
""" ,
1667
1674
)
1668
1675
1669
1676
self .create_batch_script (
1670
1677
'winipython_notebook.bat' ,
1671
1678
r"""@echo off
1672
- call "%~dp0env_for_icons.bat"
1673
- cd/D "%WINPYWORKDIR %"
1679
+ call "%~dp0env_for_icons.bat" %*
1680
+ cd/D "%WINPYWORKDIR1 %"
1674
1681
"%WINPYDIR%\scripts\jupyter-notebook.exe" %*
1675
1682
""" ,
1676
1683
)
1677
1684
1678
1685
self .create_batch_script (
1679
1686
'winjupyter_lab.bat' ,
1680
1687
r"""@echo off
1681
- call "%~dp0env_for_icons.bat"
1682
- cd/D "%WINPYWORKDIR %"
1688
+ call "%~dp0env_for_icons.bat" %*
1689
+ cd/D "%WINPYWORKDIR1 %"
1683
1690
"%WINPYDIR%\scripts\jupyter-lab.exe" %*
1684
1691
""" ,
1685
1692
)
1686
1693
1687
1694
self .create_batch_script (
1688
1695
'qtconsole.bat' ,
1689
1696
r"""@echo off
1690
- call "%~dp0env_for_icons.bat"
1691
- cd/D "%WINPYWORKDIR %"
1697
+ call "%~dp0env_for_icons.bat" %*
1698
+ cd/D "%WINPYWORKDIR1 %"
1692
1699
"%WINPYDIR%\scripts\jupyter-qtconsole.exe" %*
1693
1700
""" ,
1694
1701
)
1695
1702
1696
1703
self .create_batch_script (
1697
1704
'winqtconsole.bat' ,
1698
1705
r"""@echo off
1699
- call "%~dp0env_for_icons.bat"
1700
- cd/D "%WINPYWORKDIR %"
1706
+ call "%~dp0env_for_icons.bat" %*
1707
+ cd/D "%WINPYWORKDIR1 %"
1701
1708
"%WINPYDIR%\scripts\jupyter-qtconsole.exe" %*
1702
1709
""" ,
1703
1710
)
1704
1711
1705
1712
self .create_batch_script (
1706
1713
'qtdemo.bat' ,
1707
1714
r"""@echo off
1708
- call "%~dp0env_for_icons.bat"
1709
- cd/D "%WINPYWORKDIR %"
1715
+ call "%~dp0env_for_icons.bat" %*
1716
+ cd/D "%WINPYWORKDIR1 %"
1710
1717
if exist "%WINPYDIR%\Lib\site-packages\PyQt5\examples\qtdemo\qtdemo.py" (
1711
1718
"%WINPYDIR%\python.exe" "%WINPYDIR%\Lib\site-packages\PyQt5\examples\qtdemo\qtdemo.py"
1712
1719
)
@@ -1719,8 +1726,8 @@ def _create_batch_scripts(self):
1719
1726
self .create_batch_script (
1720
1727
'qtdesigner.bat' ,
1721
1728
r"""@echo off
1722
- call "%~dp0env_for_icons.bat"
1723
- cd/D "%WINPYWORKDIR %"
1729
+ call "%~dp0env_for_icons.bat" %*
1730
+ cd/D "%WINPYWORKDIR1 %"
1724
1731
if "%QT_API%"=="" ( set QT_API=pyqt5 )
1725
1732
if "%QT_API%"=="pyqt5" (
1726
1733
if exist "%WINPYDIR%\Scripts\designer.exe" (
@@ -1743,8 +1750,8 @@ def _create_batch_scripts(self):
1743
1750
self .create_batch_script (
1744
1751
'qtassistant.bat' ,
1745
1752
r"""@echo off
1746
- call "%~dp0env_for_icons.bat"
1747
- cd/D "%WINPYWORKDIR %"
1753
+ call "%~dp0env_for_icons.bat" %*
1754
+ cd/D "%WINPYWORKDIR1 %"
1748
1755
if "%QT_API%"=="" ( set QT_API=pyqt5 )
1749
1756
if "%QT_API%"=="pyqt5" (
1750
1757
if exist "%WINPYDIR%\Scripts\assistant.exe" (
@@ -1767,8 +1774,8 @@ def _create_batch_scripts(self):
1767
1774
self .create_batch_script (
1768
1775
'qtlinguist.bat' ,
1769
1776
r"""@echo off
1770
- call "%~dp0env_for_icons.bat"
1771
- cd/D "%WINPYWORKDIR %"
1777
+ call "%~dp0env_for_icons.bat" %*
1778
+ cd/D "%WINPYWORKDIR1 %"
1772
1779
if "%QT_API%"=="" ( set QT_API=pyqt5 )
1773
1780
if "%QT_API%"=="pyqt5" (
1774
1781
if exist "%WINPYDIR%\Scripts\linguist.exe" (
@@ -1805,8 +1812,8 @@ def _create_batch_scripts(self):
1805
1812
self .create_batch_script (
1806
1813
'wpcp.bat' ,
1807
1814
r"""@echo off
1808
- call "%~dp0env_for_icons.bat"
1809
- cd/D "%WINPYWORKDIR %"
1815
+ call "%~dp0env_for_icons.bat" %*
1816
+ cd/D "%WINPYWORKDIR1 %"
1810
1817
"%WINPYDIR%\python.exe" -m winpython.controlpanel %*
1811
1818
""" ,
1812
1819
)
@@ -1829,7 +1836,7 @@ def _create_batch_scripts(self):
1829
1836
self .create_batch_script (
1830
1837
'winpyzo.bat' ,
1831
1838
r"""@echo off
1832
- call "%~dp0env_for_icons.bat"
1839
+ call "%~dp0env_for_icons.bat" %*
1833
1840
cd/D "%WINPYDIR%"
1834
1841
"%WINPYDIR%\scripts\pyzo.exe" %*
1835
1842
""" ,
@@ -1853,8 +1860,8 @@ def _create_batch_scripts(self):
1853
1860
'winvscode.bat' ,
1854
1861
r"""@echo off
1855
1862
rem launcher for VScode
1856
- call "%~dp0env_for_icons.bat"
1857
- rem cd/D "%WINPYWORKDIR %"
1863
+ call "%~dp0env_for_icons.bat" %*
1864
+ rem cd/D "%WINPYWORKDIR1 %"
1858
1865
if exist "%WINPYDIR%\..\t\vscode\code.exe" (
1859
1866
"%WINPYDIR%\..\t\vscode\code.exe" %*
1860
1867
) else (
0 commit comments